diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 20e55e25..00000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 12ec170c..96659eb5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,7 @@ -v4-client-cpp/ @asnefedovv @dydxprotocol/eng -v4-client-py/ @kaloureyes3 @dydxprotocol/eng -v4-client-py-v2/ @samtin0x @therustmonk @piwonskp @dydxprotocol/eng +# Order is important. The last matching pattern has the most precedence. -* @dydxprotocol/eng +* @dydxprotocol/engineering + +/v4-client-py-deprecated/ @dydxprotocol/engineering @dydxprotocol/foundation @dydxprotocol/nethermind +/v4-client-py-v2/ @dydxprotocol/engineering @dydxprotocol/foundation @dydxprotocol/nethermind +/v4-client-rs/ @dydxprotocol/engineering @dydxprotocol/foundation @dydxprotocol/nethermind diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 00000000..0c6f8d40 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,35 @@ +name: "Conventional PR Title" +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + paths: + - 'v4-client-js/**' + - 'v4-client-rs/**' +jobs: + conventional-pr-title: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./v4-client-js + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use Node.js 20.8.1 + uses: actions/setup-node@v3 + with: + node-version: 20.8.1 + registry-url: https://registry.npmjs.org + cache: "npm" + cache-dependency-path: '**/package-lock.json' + + - name: Install dependencies + run: | + npm install @commitlint/config-conventional + + - name: Lint PR Title + run: | + echo "${PR_TITLE}" | npx commitlint --config commitlint.config.js + env: + PR_TITLE: '${{ github.event.pull_request.title }}' + diff --git a/.github/workflows/js-lint-build-test.yml b/.github/workflows/js-lint-build-test.yml index 46799b83..20d39751 100644 --- a/.github/workflows/js-lint-build-test.yml +++ b/.github/workflows/js-lint-build-test.yml @@ -20,10 +20,10 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 - - name: Use Node.js 16 + - name: Use Node.js 20.8.1 uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20.8.1 registry-url: https://registry.npmjs.org cache: "npm" cache-dependency-path: '**/package-lock.json' diff --git a/.github/workflows/js-publish.yml b/.github/workflows/js-publish.yml index 15fa45ef..9b4c3780 100644 --- a/.github/workflows/js-publish.yml +++ b/.github/workflows/js-publish.yml @@ -28,7 +28,7 @@ jobs: - name: Npm uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20.8.1 registry-url: https://registry.npmjs.org cache: "npm" cache-dependency-path: '**/package-lock.json' @@ -38,7 +38,10 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_READ }} - - name: Publish - run: ./scripts/publish-if-not-exists.sh + # Run semantic-release to automatically bump the version based on PR title + - name: Run semantic-release + run: npm run release env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_WRITE }} + + diff --git a/.github/workflows/rs-build-fmt-clippy-audit-test.yml b/.github/workflows/rs-build-fmt-clippy-audit-test.yml new file mode 100644 index 00000000..3d5fe006 --- /dev/null +++ b/.github/workflows/rs-build-fmt-clippy-audit-test.yml @@ -0,0 +1,49 @@ +name: "[v4-client-rs] Build, Fmt, Clippy, Audit, & Test" + +on: + pull_request: + paths: + - 'v4-client-rs/**' + push: + paths: + - 'v4-client-rs/**' + branches: + - main + - "release/*" + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./v4-client-rs + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Install protoc # for dev dependencies only + run: sudo apt install -y protobuf-compiler + + - name: Build + run: cargo build + + - name: Check formatting + run: cargo fmt -- --check + + - name: Linter + shell: bash + run: cargo clippy -- -D warnings + + - name: Install audit + shell: bash + run: cargo install cargo-deny + + - name: Security audit, licenses + shell: bash + run: cargo deny check licenses advisories sources + + - name: Test + run: cargo test diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..33e33f1f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +**/.DS_Store diff --git a/.gitmodules b/.gitmodules index ed3678b2..dad43a24 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,12 @@ [submodule "v4-client-cpp"] path = v4-client-cpp url = https://github.com/asnefedovv/dydx-v4-client-cpp +[submodule "dydxprotocol"] + path = dydxjs/packages/dydxjs/proto/dydxprotocol-src + url = git@github.com:dydxprotocol/v4-chain.git +[submodule "noble-cctp"] + path = dydxjs/packages/dydxjs/proto/noble-cctp-src + url = git@github.com:circlefin/noble-cctp.git +[submodule "slinky"] + path = dydxjs/packages/dydxjs/proto/slinky-src + url = git@github.com:skip-mev/slinky.git diff --git a/README.md b/README.md index 788991e6..a2680c02 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,57 @@ Python client for dYdX Chain. Developed and maintained by the Nethermind team. - [Saul M.](https://github.com/samtin0x) - [Piotr P.](https://github.com/piwonskp) +## v4-client-rs +Rust client for dYdX Chain. Developed and maintained by the Nethermind team. +- [Emanuel V.](https://github.com/v0-e) +- [Denis K.](https://github.com/therustmonk) +- [Maksim R.](https://github.com/maksimryndin) + ## v4-client-cpp (Third Party Client) To pull the latest C++ client, run `git submodule update --init --recursive` +Please note the C++ client only works on Linux. + This client was originally developed and open-sourced through a grant by the dYdX Grants Trust — an unaffiliated and independent third-party from dYdX Trading Inc. The original client can be found [here](https://github.com/asnefedovv/dydx-v4-client-cpp). +## dydxjs +dydxjs is a Typescript library for interacting with dYdX chain and other Cosmos blockchains. It makes it easy to compose and broadcast dYdX and Cosmos messages, with all of the proto and amino encoding handled for you.
+Note: This library provides the low-level interfaces to compose and send transactions. It is recommended to install `v4-client-js` for a simpler developer experience. + # Third-party Clients -By clicking the above links to third-party clients, you will leave the dYdX Trading Inc. (“dYdX”) GitHub repository and join repositories made available by third parties, which are independent from and unaffiliated with dYdX. dYdX is not responsible for any action taken or content on third-party repositories. \ No newline at end of file +By clicking the above links to third-party clients, you will leave the dYdX Trading Inc. (“dYdX”) GitHub repository and join repositories made available by third parties, which are independent from and unaffiliated with dYdX. dYdX is not responsible for any action taken or content on third-party repositories. + +# Contributing + +## We use [Conventional Commits](https://github.com/conventional-changelog/commitlint) +We use a commit-msg hook to check if your commit messages meet the conventional commit format. + +In general the pattern looks like this: + +`type(scope?): subject` #scope is optional; multiple scopes are supported (current delimiter options: "/", "\" and ",") + +### Real world examples can look like this: +`chore: run tests on travis ci` +`fix(server): send cors headers` +`feat(blog): add comment section` + +Common types according to commitlint-config-conventional can be: + +build +chore +ci +docs +feat +fix +perf +refactor +revert +style +test + +## Any contributions you make will be under the same License +When you submit code changes, your submissions are understood to be under the same [License](https://github.com/dydxprotocol/v4-web/blob/master/LICENSE) that covers the project. diff --git a/dydxjs/.editorconfig b/dydxjs/.editorconfig new file mode 100644 index 00000000..4a7ea303 --- /dev/null +++ b/dydxjs/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/dydxjs/.eslintignore b/dydxjs/.eslintignore new file mode 100644 index 00000000..38ba4849 --- /dev/null +++ b/dydxjs/.eslintignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +main/ +module/ +coverage/ \ No newline at end of file diff --git a/dydxjs/.eslintrc.js b/dydxjs/.eslintrc.js new file mode 100644 index 00000000..bb88e34d --- /dev/null +++ b/dydxjs/.eslintrc.js @@ -0,0 +1,70 @@ +module.exports = { + plugins: ['prettier'], + extends: ['eslint:recommended', 'prettier'], + parserOptions: { + ecmaVersion: 11, + requireConfigFile: false, + sourceType: 'module', + ecmaFeatures: { + jsx: true + } + }, + env: { + es6: true, + browser: true, + node: true, + jest: true + }, + rules: { + 'no-debugger': 2, + 'no-alert': 2, + 'no-await-in-loop': 0, + 'no-prototype-builtins': 0, + 'no-return-assign': ['error', 'except-parens'], + 'no-restricted-syntax': [ + 2, + 'ForInStatement', + 'LabeledStatement', + 'WithStatement' + ], + 'no-unused-vars': [ + 0, + { + ignoreSiblings: true, + argsIgnorePattern: 'React|res|next|^_' + } + ], + 'prefer-const': [ + 'error', + { + destructuring: 'all' + } + ], + 'no-unused-expressions': [ + 2, + { + allowTaggedTemplates: true + } + ], + 'no-console': 1, + 'comma-dangle': 2, + 'jsx-quotes': [2, 'prefer-double'], + 'linebreak-style': ['error', 'unix'], + quotes: [ + 2, + 'single', + { + avoidEscape: true, + allowTemplateLiterals: true + } + ], + 'prettier/prettier': [ + 'error', + { + trailingComma: 'none', + singleQuote: true, + printWidth: 80 + } + ] + } +}; diff --git a/dydxjs/.gitignore b/dydxjs/.gitignore new file mode 100644 index 00000000..7bba65cc --- /dev/null +++ b/dydxjs/.gitignore @@ -0,0 +1,50 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# out +dist +mjs +main +module + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + +# Editors +.idea + +# Lib +lib + +# npm package lock +package-lock.json +yarn.lock + +# others +.DS_Store \ No newline at end of file diff --git a/dydxjs/.npmignore b/dydxjs/.npmignore new file mode 100644 index 00000000..cc2605fa --- /dev/null +++ b/dydxjs/.npmignore @@ -0,0 +1,32 @@ +*.log +npm-debug.log* + +# Coverage directory used by tools like istanbul +coverage +.nyc_output + +# Dependency directories +node_modules + +# npm package lock +package-lock.json +yarn.lock + +# project files +__fixtures__ +__tests__ +.babelrc +.babelrc.js +.editorconfig +.eslintignore +.eslintrc +.eslintrc.js +.gitignore +.travis.yml +.vscode +CHANGELOG.md +examples +jest.config.js +package.json +src +test \ No newline at end of file diff --git a/dydxjs/.npmrc b/dydxjs/.npmrc new file mode 100644 index 00000000..a21347f1 --- /dev/null +++ b/dydxjs/.npmrc @@ -0,0 +1 @@ +scripts-prepend-node-path=true \ No newline at end of file diff --git a/dydxjs/LICENSE b/dydxjs/LICENSE new file mode 100644 index 00000000..e39bff25 --- /dev/null +++ b/dydxjs/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 jared vu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dydxjs/README.md b/dydxjs/README.md new file mode 100644 index 00000000..e18b121c --- /dev/null +++ b/dydxjs/README.md @@ -0,0 +1,323 @@ +# dydxjs + +

+
+ dydx client library +

+ +

+ + + + +

+ + +## install + +```sh +npm install dydxjs +``` +## Table of contents + +- [dydxjs](#dydxjs) + - [Install](#install) + - [Table of contents](#table-of-contents) +- [Usage](#usage) + - [RPC Clients](#rpc-clients) + - [Composing Messages](#composing-messages) + - Cosmos, CosmWasm, and IBC + - [CosmWasm](#cosmwasm-messages) + - [IBC](#ibc-messages) + - [Cosmos](#cosmos-messages) +- [Wallets and Signers](#connecting-with-wallets-and-signing-messages) + - [Stargate Client](#initializing-the-stargate-client) + - [Creating Signers](#creating-signers) + - [Broadcasting Messages](#broadcasting-messages) +- [Advanced Usage](#advanced-usage) +- [Developing](#developing) +- [Codegen](#codegen) +- [Publishing](#publishing) +- [Related](#related) +- [Credits](#credits) + +## Usage +### RPC Clients + +```js +import { dydx } from 'dydxjs'; + +const { createRPCQueryClient } = dydx.ClientFactory; +const client = await createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); + +// now you can query the cosmos modules +const balance = await client.cosmos.bank.v1beta1 + .allBalances({ address: 'dydx1addresshere' }); + +// you can also query the dydx modules +const balances = await client.dydx.exchange.v1beta1 + .exchangeBalances() +``` + +### Composing Messages + +Import the `dydx` object from `dydxjs`. + +```js +import { dydx } from 'dydxjs'; + +const { + createSpotLimitOrder, + createSpotMarketOrder, + deposit +} = dydx.exchange.v1beta1.MessageComposer.withTypeUrl; +``` + +#### CosmWasm Messages + +```js +import { cosmwasm } from "dydxjs"; + +const { + clearAdmin, + executeContract, + instantiateContract, + migrateContract, + storeCode, + updateAdmin +} = cosmwasm.wasm.v1.MessageComposer.withTypeUrl; +``` + +#### IBC Messages + +```js +import { ibc } from 'dydxjs'; + +const { + transfer +} = ibc.applications.transfer.v1.MessageComposer.withTypeUrl +``` + +#### Cosmos Messages + +```js +import { cosmos } from 'dydxjs'; + +const { + fundCommunityPool, + setWithdrawAddress, + withdrawDelegatorReward, + withdrawValidatorCommission +} = cosmos.distribution.v1beta1.MessageComposer.fromPartial; + +const { + multiSend, + send +} = cosmos.bank.v1beta1.MessageComposer.fromPartial; + +const { + beginRedelegate, + createValidator, + delegate, + editValidator, + undelegate +} = cosmos.staking.v1beta1.MessageComposer.fromPartial; + +const { + deposit, + submitProposal, + vote, + voteWeighted +} = cosmos.gov.v1beta1.MessageComposer.fromPartial; +``` + +## Connecting with Wallets and Signing Messages + +⚡️ For web interfaces, we recommend using [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit). Continue below to see how to manually construct signers and clients. + +Here are the docs on [creating signers](https://docs.cosmology.zone/cosmos-kit) in cosmos-kit that can be used with Keplr and other wallets. + +### Initializing the Stargate Client + +Use `getSigningdYdXClient` to get your `SigningStargateClient`, with the proto/amino messages full-loaded. No need to manually add amino types, just require and initialize the client: + +```js +import { getSigningdYdXClient } from 'dydxjs'; + +const stargateClient = await getSigningdYdXClient({ + rpcEndpoint, + signer // OfflineSigner +}); +``` +### Creating Signers + +To broadcast messages, you can create signers with a variety of options: + +* [cosmos-kit](https://docs.cosmology.zone/cosmos-kit) (recommended) +* [keplr](https://docs.keplr.app/api/cosmjs.html) +* [cosmjs](https://gist.github.com/webmaster128/8444d42a7eceeda2544c8a59fbd7e1d9) +### Amino Signer + +Likely you'll want to use the Amino, so unless you need proto, you should use this one: + +```js +import { getOfflineSignerAmino as getOfflineSigner } from 'cosmjs-utils'; +``` +### Proto Signer + +```js +import { getOfflineSignerProto as getOfflineSigner } from 'cosmjs-utils'; +``` + +WARNING: NOT RECOMMENDED TO USE PLAIN-TEXT MNEMONICS. Please take care of your security and use best practices such as AES encryption and/or methods from 12factor applications. + +```js +import { chains } from 'chain-registry'; + +const mnemonic = + 'unfold client turtle either pilot stock floor glow toward bullet car science'; + const chain = chains.find(({ chain_name }) => chain_name === 'dydx'); + const signer = await getOfflineSigner({ + mnemonic, + chain + }); +``` +### Broadcasting Messages + +Now that you have your `stargateClient`, you can broadcast messages: + +```js +const { send } = cosmos.bank.v1beta1.MessageComposer.withTypeUrl; + +const msg = send({ + amount: [ + { + denom: 'coin', + amount: '1000' + } + ], + toAddress: address, + fromAddress: address +}); + +const fee: StdFee = { + amount: [ + { + denom: 'coin', + amount: '864' + } + ], + gas: '86364' +}; +const response = await stargateClient.signAndBroadcast(address, [msg], fee); +``` + +## Advanced Usage + + +If you want to manually construct a stargate client + +```js +import { OfflineSigner, GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; + +import { + cosmosAminoConverters, + cosmosProtoRegistry, + cosmwasmAminoConverters, + cosmwasmProtoRegistry, + ibcProtoRegistry, + ibcAminoConverters, + dydxAminoConverters, + dydxProtoRegistry +} from 'dydxjs'; + +const signer: OfflineSigner = /* create your signer (see above) */ +const rpcEndpint = 'https://rpc.cosmos.directory/dydx'; // or another URL + +const protoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...cosmosProtoRegistry, + ...cosmwasmProtoRegistry, + ...ibcProtoRegistry, + ...dydxProtoRegistry +]; + +const aminoConverters = { + ...cosmosAminoConverters, + ...cosmwasmAminoConverters, + ...ibcAminoConverters, + ...dydxAminoConverters +}; + +const registry = new Registry(protoRegistry); +const aminoTypes = new AminoTypes(aminoConverters); + +const stargateClient = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry, + aminoTypes +}); +``` + +## Developing + +When first cloning the repo: + +``` +yarn +yarn build +``` + +### Codegen + +Look inside of `scripts/codegen.ts` and configure the settings for bundling your SDK and contracts into `dydxjs`: + +``` +yarn codegen +``` + +### Publishing + +To publish, use `lerna`: + +``` +lerna publish +``` + +You can publish patch, minor, or major versions: + +``` +lerna publish minor +``` + +If you absolutely need to publish manually using npm, ensure to do it this way, and publish from the `dist/` directory for proper tree-shaking module paths: + +``` +cd ./packages/ +yarn build +cd dist +npm publish +``` + + +## Related + +Checkout these related projects: + +* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. +* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. +* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. +* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command. +* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. +* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain. + +## Credits + +🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator) + + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/dydxjs/lerna.json b/dydxjs/lerna.json new file mode 100644 index 00000000..a34a6aac --- /dev/null +++ b/dydxjs/lerna.json @@ -0,0 +1,24 @@ +{ + "lerna": "6", + "conventionalCommits": true, + "npmClient": "yarn", + "npmClientArgs": [ + "--no-lockfile" + ], + "packages": [ + "packages/*" + ], + "version": "independent", + "registry": "https://registry.npmjs.org", + "command": { + "create": { + "homepage": "https://github.com/jaredvu/dydxjs", + "license": "SEE LICENSE IN LICENSE", + "access": "restricted" + }, + "publish": { + "allowBranch": "main", + "message": "chore(release): publish" + } + } +} \ No newline at end of file diff --git a/dydxjs/package.json b/dydxjs/package.json new file mode 100644 index 00000000..77f6f58a --- /dev/null +++ b/dydxjs/package.json @@ -0,0 +1,52 @@ +{ + "name": "dydxjs", + "version": "0.0.1", + "author": "dYdX Trading Inc.", + "private": true, + "repository": { + "type": "git", + "url": "git+https://github.com/dydxprotocol/v4-clients.git" + }, + "license": "SEE LICENSE IN LICENSE", + "bugs": { + "url": "https://github.com/dydxprotocol/v4-clients/issues" + }, + "publishConfig": { + "access": "restricted" + }, + "workspaces": [ + "packages/*" + ], + "scripts": { + "clean": "lerna run clean", + "build": "lerna run build --stream", + "lint": "lerna run lint --parallel", + "test": "lerna run test --stream --scope dydxjs", + "codegen": "lerna run codegen --stream --scope dydxjs", + "symlink": "symlink-workspace --logLevel error", + "postinstall": "yarn symlink", + "client": "yarn workspace ts-client", + "dydxjs": "yarn workspace dydxjs", + "precodegen": "./packages/dydxjs/scripts/export_protos.sh" + }, + "devDependencies": { + "@types/jest": "^29.5.11", + "@types/node": "^20.12.7", + "@typescript-eslint/eslint-plugin": "^7.10.0", + "@typescript-eslint/parser": "^7.10.0", + "copyfiles": "^2.4.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-unused-imports": "^4.0.0", + "eslint": "^8.56.0", + "jest": "^29.6.2", + "lerna": "^6", + "prettier": "^3.0.2", + "rimraf": "4.4.1", + "strip-ansi": "^5", + "symlink-workspace": "^1.1.0", + "ts-jest": "^29.1.1", + "ts-node": "^10.9.2", + "typescript": "^5.1.6" + } +} diff --git a/dydxjs/packages/dydxjs/__tests__/messages.test.ts b/dydxjs/packages/dydxjs/__tests__/messages.test.ts new file mode 100644 index 00000000..4b349d8d --- /dev/null +++ b/dydxjs/packages/dydxjs/__tests__/messages.test.ts @@ -0,0 +1,16 @@ +import { cosmos } from '../src'; +import { it, expect } from '@jest/globals'; + +it('cosmos', () => { + const message = cosmos.bank.v1beta1.MessageComposer.fromPartial.send({ + amount: [ + { + amount: '1', + denom: 'uatom' + } + ], + fromAddress: 'myaddress', + toAddress: 'youraddress' + }); + expect(message).toMatchSnapshot(); +}) diff --git a/dydxjs/packages/dydxjs/jest.config.js b/dydxjs/packages/dydxjs/jest.config.js new file mode 100644 index 00000000..0aa3aaa4 --- /dev/null +++ b/dydxjs/packages/dydxjs/jest.config.js @@ -0,0 +1,18 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + transform: { + "^.+\\.tsx?$": [ + "ts-jest", + { + babelConfig: false, + tsconfig: "tsconfig.json", + }, + ], + }, + transformIgnorePatterns: [`/node_modules/*`], + testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", + moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], + modulePathIgnorePatterns: ["dist/*"] +}; diff --git a/dydxjs/packages/dydxjs/package.json b/dydxjs/packages/dydxjs/package.json new file mode 100644 index 00000000..1261b73c --- /dev/null +++ b/dydxjs/packages/dydxjs/package.json @@ -0,0 +1,44 @@ +{ + "name": "dydxjs", + "version": "0.0.1", + "author": "jared vu ", + "description": "dydx client library", + "main": "index.js", + "module": "esm/index.js", + "types": "index.d.ts", + "homepage": "https://github.com/jaredvu/dydxjs", + "license": "SEE LICENSE IN LICENSE", + "publishConfig": { + "access": "public", + "directory": "dist" + }, + "repository": { + "type": "git", + "url": "https://github.com/jaredvu/dydxjs" + }, + "bugs": { + "url": "https://github.com/jaredvu/dydxjs/issues" + }, + "scripts": { + "copy": "copyfiles -f ../../LICENSE README.md package.json dist", + "clean": "rimraf dist/**", + "prepare": "npm run build", + "codegen": "ts-node scripts/codegen.ts", + "build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy", + "lint": "eslint . --fix", + "test": "jest", + "test:watch": "jest --watch" + }, + "devDependencies": { + "@cosmology/telescope": "^1.0.1", + "@types/jest": "^29.5.12" + }, + "dependencies": { + "@cosmjs/amino": "0.32.3", + "@cosmjs/encoding": "0.32.3", + "@cosmjs/math": "0.32.3", + "@cosmjs/proto-signing": "0.32.3", + "@cosmjs/stargate": "0.32.3" + }, + "keywords": [] +} diff --git a/dydxjs/packages/dydxjs/proto/amino/LICENSE b/dydxjs/packages/dydxjs/proto/amino/LICENSE new file mode 100644 index 00000000..063e03fc --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/amino/LICENSE @@ -0,0 +1,204 @@ +Cosmos SDK +License: Apache2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 All in Bits, Inc + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/amino/README.md b/dydxjs/packages/dydxjs/proto/amino/README.md new file mode 100644 index 00000000..b0d34bbf --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/amino/README.md @@ -0,0 +1 @@ +# amino \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/amino/amino.proto b/dydxjs/packages/dydxjs/proto/amino/amino.proto new file mode 100644 index 00000000..d01f1752 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/amino/amino.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package amino; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; + +extend google.protobuf.MessageOptions { + // name is the string used when registering a concrete + // type into the Amino type registry, via the Amino codec's + // `RegisterConcrete()` method. This string MUST be at most 39 + // characters long, or else the message will be rejected by the + // Ledger hardware device. + string name = 11110001; + + // encoding describes the encoding format used by Amino for the given + // message. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the `encoding` + // one which operates on the field level. + string message_encoding = 11110002; +} + +extend google.protobuf.FieldOptions { + // encoding describes the encoding format used by Amino for + // the given field. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the + // `message_encoding` one which operates on the message level. + string encoding = 11110003; + + // field_name sets a different field name (i.e. key name) in + // the amino JSON object for the given field. + // + // Example: + // + // message Foo { + // string bar = 1 [(amino.field_name) = "baz"]; + // } + // + // Then the Amino encoding of Foo will be: + // `{"baz":"some value"}` + string field_name = 11110004; + + // dont_omitempty sets the field in the JSON object even if + // its value is empty, i.e. equal to the Golang zero value. To learn what + // the zero values are, see https://go.dev/ref/spec#The_zero_value. + // + // Fields default to `omitempty`, which is the default behavior when this + // annotation is unset. When set to true, then the field value in the + // JSON object will be set, i.e. not `undefined`. + // + // Example: + // + // message Foo { + // string bar = 1; + // string baz = 2 [(amino.dont_omitempty) = true]; + // } + // + // f := Foo{}; + // out := AminoJSONEncoder(&f); + // out == {"baz":""} + bool dont_omitempty = 11110005; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/confio/LICENSE b/dydxjs/packages/dydxjs/proto/confio/LICENSE new file mode 100644 index 00000000..deaad1f5 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/confio/LICENSE @@ -0,0 +1,204 @@ +Confio/ICS23 +License: Apache2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Confio UO + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/confio/README.md b/dydxjs/packages/dydxjs/proto/confio/README.md new file mode 100644 index 00000000..af52fb63 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/confio/README.md @@ -0,0 +1 @@ +# confio \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/confio/proofs.proto b/dydxjs/packages/dydxjs/proto/confio/proofs.proto new file mode 100644 index 00000000..da43503e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/confio/proofs.proto @@ -0,0 +1,234 @@ +syntax = "proto3"; + +package ics23; +option go_package = "github.com/confio/ics23/go"; + +enum HashOp { + // NO_HASH is the default if no data passed. Note this is an illegal argument some places. + NO_HASH = 0; + SHA256 = 1; + SHA512 = 2; + KECCAK = 3; + RIPEMD160 = 4; + BITCOIN = 5; // ripemd160(sha256(x)) +} + +/** +LengthOp defines how to process the key and value of the LeafOp +to include length information. After encoding the length with the given +algorithm, the length will be prepended to the key and value bytes. +(Each one with it's own encoded length) +*/ +enum LengthOp { + // NO_PREFIX don't include any length info + NO_PREFIX = 0; + // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length + VAR_PROTO = 1; + // VAR_RLP uses rlp int encoding of the length + VAR_RLP = 2; + // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer + FIXED32_BIG = 3; + // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer + FIXED32_LITTLE = 4; + // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer + FIXED64_BIG = 5; + // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer + FIXED64_LITTLE = 6; + // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) + REQUIRE_32_BYTES = 7; + // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) + REQUIRE_64_BYTES = 8; +} + +/** +ExistenceProof takes a key and a value and a set of steps to perform on it. +The result of peforming all these steps will provide a "root hash", which can +be compared to the value in a header. + +Since it is computationally infeasible to produce a hash collission for any of the used +cryptographic hash functions, if someone can provide a series of operations to transform +a given key and value into a root hash that matches some trusted root, these key and values +must be in the referenced merkle tree. + +The only possible issue is maliablity in LeafOp, such as providing extra prefix data, +which should be controlled by a spec. Eg. with lengthOp as NONE, + prefix = FOO, key = BAR, value = CHOICE +and + prefix = F, key = OOBAR, value = CHOICE +would produce the same value. + +With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field +in the ProofSpec is valuable to prevent this mutability. And why all trees should +length-prefix the data before hashing it. +*/ +message ExistenceProof { + bytes key = 1; + bytes value = 2; + LeafOp leaf = 3; + repeated InnerOp path = 4; +} + +/* +NonExistenceProof takes a proof of two neighbors, one left of the desired key, +one right of the desired key. If both proofs are valid AND they are neighbors, +then there is no valid proof for the given key. +*/ +message NonExistenceProof { + bytes key = 1; // TODO: remove this as unnecessary??? we prove a range + ExistenceProof left = 2; + ExistenceProof right = 3; +} + +/* +CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages +*/ +message CommitmentProof { + oneof proof { + ExistenceProof exist = 1; + NonExistenceProof nonexist = 2; + BatchProof batch = 3; + CompressedBatchProof compressed = 4; + } +} + +/** +LeafOp represents the raw key-value data we wish to prove, and +must be flexible to represent the internal transformation from +the original key-value pairs into the basis hash, for many existing +merkle trees. + +key and value are passed in. So that the signature of this operation is: + leafOp(key, value) -> output + +To process this, first prehash the keys and values if needed (ANY means no hash in this case): + hkey = prehashKey(key) + hvalue = prehashValue(value) + +Then combine the bytes, and hash it + output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) +*/ +message LeafOp { + HashOp hash = 1; + HashOp prehash_key = 2; + HashOp prehash_value = 3; + LengthOp length = 4; + // prefix is a fixed bytes that may optionally be included at the beginning to differentiate + // a leaf node from an inner node. + bytes prefix = 5; +} + +/** +InnerOp represents a merkle-proof step that is not a leaf. +It represents concatenating two children and hashing them to provide the next result. + +The result of the previous step is passed in, so the signature of this op is: + innerOp(child) -> output + +The result of applying InnerOp should be: + output = op.hash(op.prefix || child || op.suffix) + + where the || operator is concatenation of binary data, +and child is the result of hashing all the tree below this step. + +Any special data, like prepending child with the length, or prepending the entire operation with +some value to differentiate from leaf nodes, should be included in prefix and suffix. +If either of prefix or suffix is empty, we just treat it as an empty string +*/ +message InnerOp { + HashOp hash = 1; + bytes prefix = 2; + bytes suffix = 3; +} + + +/** +ProofSpec defines what the expected parameters are for a given proof type. +This can be stored in the client and used to validate any incoming proofs. + + verify(ProofSpec, Proof) -> Proof | Error + +As demonstrated in tests, if we don't fix the algorithm used to calculate the +LeafHash for a given tree, there are many possible key-value pairs that can +generate a given hash (by interpretting the preimage differently). +We need this for proper security, requires client knows a priori what +tree format server uses. But not in code, rather a configuration object. +*/ +message ProofSpec { + // any field in the ExistenceProof must be the same as in this spec. + // except Prefix, which is just the first bytes of prefix (spec can be longer) + LeafOp leaf_spec = 1; + InnerSpec inner_spec = 2; + // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) + int32 max_depth = 3; + // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) + int32 min_depth = 4; +} + +/* +InnerSpec contains all store-specific structure info to determine if two proofs from a +given store are neighbors. + +This enables: + + isLeftMost(spec: InnerSpec, op: InnerOp) + isRightMost(spec: InnerSpec, op: InnerOp) + isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) +*/ +message InnerSpec { + // Child order is the ordering of the children node, must count from 0 + // iavl tree is [0, 1] (left then right) + // merk is [0, 2, 1] (left, right, here) + repeated int32 child_order = 1; + int32 child_size = 2; + int32 min_prefix_length = 3; + int32 max_prefix_length = 4; + // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) + bytes empty_child = 5; + // hash is the algorithm that must be used for each InnerOp + HashOp hash = 6; +} + +/* +BatchProof is a group of multiple proof types than can be compressed +*/ +message BatchProof { + repeated BatchEntry entries = 1; +} + +// Use BatchEntry not CommitmentProof, to avoid recursion +message BatchEntry { + oneof proof { + ExistenceProof exist = 1; + NonExistenceProof nonexist = 2; + } +} + + +/****** all items here are compressed forms *******/ + +message CompressedBatchProof { + repeated CompressedBatchEntry entries = 1; + repeated InnerOp lookup_inners = 2; +} + +// Use BatchEntry not CommitmentProof, to avoid recursion +message CompressedBatchEntry { + oneof proof { + CompressedExistenceProof exist = 1; + CompressedNonExistenceProof nonexist = 2; + } +} + +message CompressedExistenceProof { + bytes key = 1; + bytes value = 2; + LeafOp leaf = 3; + // these are indexes into the lookup_inners table in CompressedBatchProof + repeated int32 path = 4; +} + +message CompressedNonExistenceProof { + bytes key = 1; // TODO: remove this as unnecessary??? we prove a range + CompressedExistenceProof left = 2; + CompressedExistenceProof right = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/LICENSE b/dydxjs/packages/dydxjs/proto/cosmos/LICENSE new file mode 100644 index 00000000..063e03fc --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/LICENSE @@ -0,0 +1,204 @@ +Cosmos SDK +License: Apache2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 All in Bits, Inc + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/README.md b/dydxjs/packages/dydxjs/proto/cosmos/README.md new file mode 100644 index 00000000..98a49c6b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/README.md @@ -0,0 +1 @@ +# cosmos \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/config.proto b/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/config.proto new file mode 100644 index 00000000..ed775006 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/config.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/any.proto"; + +// Config represents the configuration for a Cosmos SDK ABCI app. +// It is intended that all state machine logic including the version of +// baseapp and tx handlers (and possibly even Tendermint) that an app needs +// can be described in a config object. For compatibility, the framework should +// allow a mixture of declarative and imperative app wiring, however, apps +// that strive for the maximum ease of maintainability should be able to describe +// their state machine with a config object alone. +message Config { + // modules are the module configurations for the app. + repeated ModuleConfig modules = 1; +} + +// ModuleConfig is a module configuration for an app. +message ModuleConfig { + // name is the unique name of the module within the app. It should be a name + // that persists between different versions of a module so that modules + // can be smoothly upgraded to new versions. + // + // For example, for the module cosmos.bank.module.v1.Module, we may chose + // to simply name the module "bank" in the app. When we upgrade to + // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + // and the framework knows that the v2 module should receive all the same state + // that the v1 module had. Note: modules should provide info on which versions + // they can migrate from in the ModuleDescriptor.can_migration_from field. + string name = 1; + + // config is the config object for the module. Module config messages should + // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + google.protobuf.Any config = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/module.proto b/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/module.proto new file mode 100644 index 00000000..599078d7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/module.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module indicates that this proto type is a config object for an app module + // and optionally provides other descriptive information about the module. + // It is recommended that a new module config object and go module is versioned + // for every state machine breaking version of a module. The recommended + // pattern for doing this is to put module config objects in a separate proto + // package from the API they expose. Ex: the cosmos.group.v1 API would be + // exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc. + ModuleDescriptor module = 57193479; +} + +// ModuleDescriptor describes an app module. +message ModuleDescriptor { + // go_import names the package that should be imported by an app to load the + // module in the runtime module registry. Either go_import must be defined here + // or the go_package option must be defined at the file level to indicate + // to users where to location the module implementation. go_import takes + // precedence over go_package when both are defined. + string go_import = 1; + + // use_package refers to a protobuf package that this module + // uses and exposes to the world. In an app, only one module should "use" + // or own a single protobuf package. It is assumed that the module uses + // all of the .proto files in a single package. + repeated PackageReference use_package = 2; + + // can_migrate_from defines which module versions this module can migrate + // state from. The framework will check that one module version is able to + // migrate from a previous module version before attempting to update its + // config. It is assumed that modules can transitively migrate from earlier + // versions. For instance if v3 declares it can migrate from v2, and v2 + // declares it can migrate from v1, the framework knows how to migrate + // from v1 to v3, assuming all 3 module versions are registered at runtime. + repeated MigrateFromInfo can_migrate_from = 3; +} + +// PackageReference is a reference to a protobuf package used by a module. +message PackageReference { + // name is the fully-qualified name of the package. + string name = 1; + + // revision is the optional revision of the package that is being used. + // Protobuf packages used in Cosmos should generally have a major version + // as the last part of the package name, ex. foo.bar.baz.v1. + // The revision of a package can be thought of as the minor version of a + // package which has additional backwards compatible definitions that weren't + // present in a previous version. + // + // A package should indicate its revision with a source code comment + // above the package declaration in one of its fields containing the + // test "Revision N" where N is an integer revision. All packages start + // at revision 0 the first time they are released in a module. + // + // When a new version of a module is released and items are added to existing + // .proto files, these definitions should contain comments of the form + // "Since Revision N" where N is an integer revision. + // + // When the module runtime starts up, it will check the pinned proto + // image and panic if there are runtime protobuf definitions that are not + // in the pinned descriptor which do not have + // a "Since Revision N" comment or have a "Since Revision N" comment where + // N is <= to the revision specified here. This indicates that the protobuf + // files have been updated, but the pinned file descriptor hasn't. + // + // If there are items in the pinned file descriptor with a revision + // greater than the value indicated here, this will also cause a panic + // as it may mean that the pinned descriptor for a legacy module has been + // improperly updated or that there is some other versioning discrepancy. + // Runtime protobuf definitions will also be checked for compatibility + // with pinned file descriptors to make sure there are no incompatible changes. + // + // This behavior ensures that: + // * pinned proto images are up-to-date + // * protobuf files are carefully annotated with revision comments which + // are important good client UX + // * protobuf files are changed in backwards and forwards compatible ways + uint32 revision = 2; +} + +// MigrateFromInfo is information on a module version that a newer module +// can migrate from. +message MigrateFromInfo { + + // module is the fully-qualified protobuf name of the module config object + // for the previous module version, ex: "cosmos.group.module.v1.Module". + string module = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/query.proto new file mode 100644 index 00000000..efec9c81 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/app/v1alpha1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "cosmos/app/v1alpha1/config.proto"; + +// Query is the app module query service. +service Query { + + // Config returns the current app config. + rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} +} + +// QueryConfigRequest is the Query/Config request type. +message QueryConfigRequest {} + +// QueryConfigRequest is the Query/Config response type. +message QueryConfigResponse { + + // config is the current app config. + Config config = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/auth.proto b/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/auth.proto new file mode 100644 index 00000000..486d507f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/auth.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// BaseAccount defines a base account type. It contains all the necessary fields +// for basic account functionality. Any custom account type should extend this +// type for additional functionality (e.g. vesting). +message BaseAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + option (cosmos_proto.implements_interface) = "cosmos.auth.AccountI"; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"]; + uint64 account_number = 3; + uint64 sequence = 4; +} + +// ModuleAccount defines an account for modules that holds coins on a pool. +message ModuleAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.auth.ModuleAccountI"; + + BaseAccount base_account = 1 [(gogoproto.embed) = true]; + string name = 2; + repeated string permissions = 3; +} + +// Params defines the parameters for the auth module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + uint64 max_memo_characters = 1; + uint64 tx_sig_limit = 2; + uint64 tx_size_cost_per_byte = 3; + uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"]; + uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/genesis.proto new file mode 100644 index 00000000..c88b94ee --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// GenesisState defines the auth module's genesis state. +message GenesisState { + // params defines all the paramaters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // accounts are the accounts present at genesis. + repeated google.protobuf.Any accounts = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/query.proto new file mode 100644 index 00000000..8de4d09d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/auth/v1beta1/query.proto @@ -0,0 +1,130 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Query defines the gRPC querier service. +service Query { + // Accounts returns all the existing accounts + // + // Since: cosmos-sdk 0.43 + rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; + } + + // Account returns account details based on address. + rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + } + + // Params queries all parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + } + + // ModuleAccounts returns all the existing module accounts. + rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; + } + + // Bech32 queries bech32Prefix + rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32"; + } + + // AddressBytesToString converts Account Address bytes to string + rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}"; + } + + // AddressStringToBytes converts Address string to bytes + rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}"; + } +} + +// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsResponse { + // accounts are the existing accounts + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.AccountI"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address defines the address to query for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. +message QueryModuleAccountsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryAccountResponse is the response type for the Query/Account RPC method. +message QueryAccountResponse { + // account defines the account of the corresponding address. + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.AccountI"]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. +message QueryModuleAccountsResponse { + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.ModuleAccountI"]; +} + +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method +message Bech32PrefixRequest {} + +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method +message Bech32PrefixResponse { + string bech32_prefix = 1; +} + +// AddressBytesToStringRequest is the request type for AddressString rpc method +message AddressBytesToStringRequest { + bytes address_bytes = 1; +} + +// AddressBytesToStringResponse is the response type for AddressString rpc method +message AddressBytesToStringResponse { + string address_string = 1; +} + +// AddressStringToBytesRequest is the request type for AccountBytes rpc method +message AddressStringToBytesRequest { + string address_string = 1; +} + +// AddressStringToBytesResponse is the response type for AddressBytes rpc method +message AddressStringToBytesResponse { + bytes address_bytes = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/authz.proto b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/authz.proto new file mode 100644 index 00000000..2dce1ce0 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/authz.proto @@ -0,0 +1,46 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +option (gogoproto.goproto_getters_all) = false; + +// GenericAuthorization gives the grantee unrestricted permissions to execute +// the provided method on behalf of the granter's account. +message GenericAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + + // Msg, identified by it's type URL, to grant unrestricted permissions to execute + string msg = 1; +} + +// Grant gives permissions to execute +// the provide method with expiration time. +message Grant { + google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "cosmos.authz.Authorization"]; + // time when the grant will expire and will be pruned. If null, then the grant + // doesn't have a time expiration (other conditions in `authorization` + // may apply to invalidate the grant) + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; +} + +// GrantAuthorization extends a grant with both the addresses of the grantee and granter. +// It is used in genesis.proto and query.proto +message GrantAuthorization { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "cosmos.authz.Authorization"]; + google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true]; +} + +// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +message GrantQueueItem { + // msg_type_urls contains the list of TypeURL of a sdk.Msg. + repeated string msg_type_urls = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/event.proto b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/event.proto new file mode 100644 index 00000000..0476649a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/event.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// EventGrant is emitted on Msg/Grant +message EventGrant { + // Msg type URL for which an autorization is granted + string msg_type_url = 2; + // Granter account address + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Grantee account address + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventRevoke is emitted on Msg/Revoke +message EventRevoke { + // Msg type URL for which an autorization is revoked + string msg_type_url = 2; + // Granter account address + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Grantee account address + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/genesis.proto new file mode 100644 index 00000000..310f6265 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/genesis.proto @@ -0,0 +1,13 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/authz/v1beta1/authz.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// GenesisState defines the authz module's genesis state. +message GenesisState { + repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/query.proto new file mode 100644 index 00000000..62154ac1 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/query.proto @@ -0,0 +1,82 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// Query defines the gRPC querier service. +service Query { + // Returns list of `Authorization`, granted to the grantee by the granter. + rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants"; + } + + // GranterGrants returns list of `GrantAuthorization`, granted by granter. + // + // Since: cosmos-sdk 0.46 + rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}"; + } + + // GranteeGrants returns a list of `GrantAuthorization` by grantee. + // + // Since: cosmos-sdk 0.46 + rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}"; + } +} + +// QueryGrantsRequest is the request type for the Query/Grants RPC method. +message QueryGrantsRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Optional, msg_type_url, when set, will query only grants matching given msg type. + string msg_type_url = 3; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +message QueryGrantsResponse { + // authorizations is a list of grants granted for grantee by granter. + repeated Grant grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. +message QueryGranterGrantsRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. +message QueryGranterGrantsResponse { + // grants is a list of grants granted by the granter. + repeated GrantAuthorization grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +message QueryGranteeGrantsRequest { + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. +message QueryGranteeGrantsResponse { + // grants is a list of grants granted to the grantee. + repeated GrantAuthorization grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/tx.proto new file mode 100644 index 00000000..9c8ae160 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/authz/v1beta1/tx.proto @@ -0,0 +1,75 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the authz Msg service. +service Msg { + // Grant grants the provided authorization to the grantee on the granter's + // account with the provided expiration time. If there is already a grant + // for the given (granter, grantee, Authorization) triple, then the grant + // will be overwritten. + rpc Grant(MsgGrant) returns (MsgGrantResponse); + + // Exec attempts to execute the provided messages using + // authorizations granted to the grantee. Each message should have only + // one signer corresponding to the granter of the authorization. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // Revoke revokes any authorization corresponding to the provided method name on the + // granter's account that has been granted to the grantee. + rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); +} + +// MsgGrant is a request type for Grant method. It declares authorization to the grantee +// on behalf of the granter with the provided expiration time. +message MsgGrant { + option (cosmos.msg.v1.signer) = "granter"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false]; +} + +// MsgExecResponse defines the Msg/MsgExecResponse response type. +message MsgExecResponse { + repeated bytes results = 1; +} + +// MsgExec attempts to execute the provided messages using +// authorizations granted to the grantee. Each message should have only +// one signer corresponding to the granter of the authorization. +message MsgExec { + option (cosmos.msg.v1.signer) = "grantee"; + + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Authorization Msg requests to execute. Each msg must implement Authorization interface + // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + // triple and validate it. + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, cosmos.authz.Authorization"]; +} + +// MsgGrantResponse defines the Msg/MsgGrant response type. +message MsgGrantResponse {} + +// MsgRevoke revokes any authorization with the provided sdk.Msg type on the +// granter's account with that has been granted to the grantee. +message MsgRevoke { + option (cosmos.msg.v1.signer) = "granter"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string msg_type_url = 3; +} + +// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +message MsgRevokeResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/authz.proto b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/authz.proto new file mode 100644 index 00000000..e3e600b4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/authz.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// SendAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account. +// +// Since: cosmos-sdk 0.43 +message SendAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + + repeated cosmos.base.v1beta1.Coin spend_limit = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/bank.proto b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/bank.proto new file mode 100644 index 00000000..f70c24ab --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/bank.proto @@ -0,0 +1,108 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Params defines the parameters for the bank module. +message Params { + option (gogoproto.goproto_stringer) = false; + repeated SendEnabled send_enabled = 1; + bool default_send_enabled = 2; +} + +// SendEnabled maps coin denom to a send_enabled status (whether a denom is +// sendable). +message SendEnabled { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + string denom = 1; + bool enabled = 2; +} + +// Input models transaction input. +message Input { + option (cosmos.msg.v1.signer) = "address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// Output models transaction outputs. +message Output { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// Supply represents a struct that passively keeps track of the total supply +// amounts in the network. +// This message is deprecated now that supply is indexed by denom. +message Supply { + option deprecated = true; + + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "SupplyI"; + + repeated cosmos.base.v1beta1.Coin total = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// DenomUnit represents a struct that describes a given +// denomination unit of the basic token. +message DenomUnit { + // denom represents the string name of the given denom unit (e.g uatom). + string denom = 1; + // exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 10^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + uint32 exponent = 2; + // aliases is a list of string aliases for the given denom + repeated string aliases = 3; +} + +// Metadata represents a struct that describes +// a basic token. +message Metadata { + string description = 1; + // denom_units represents the list of DenomUnit's for a given coin + repeated DenomUnit denom_units = 2; + // base represents the base denom (should be the DenomUnit with exponent = 0). + string base = 3; + // display indicates the suggested denom that should be + // displayed in clients. + string display = 4; + // name defines the name of the token (eg: Cosmos Atom) + // + // Since: cosmos-sdk 0.43 + string name = 5; + // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + // + // Since: cosmos-sdk 0.43 + string symbol = 6; + // URI to a document (on or off-chain) that contains additional information. Optional. + // + // Since: cosmos-sdk 0.46 + string uri = 7 [(gogoproto.customname) = "URI"]; + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + // + // Since: cosmos-sdk 0.46 + string uri_hash = 8 [(gogoproto.customname) = "URIHash"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/genesis.proto new file mode 100644 index 00000000..aa35790b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/genesis.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// GenesisState defines the bank module's genesis state. +message GenesisState { + // params defines all the paramaters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // balances is an array containing the balances of all the accounts. + repeated Balance balances = 2 [(gogoproto.nullable) = false]; + + // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + repeated cosmos.base.v1beta1.Coin supply = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + // denom_metadata defines the metadata of the differents coins. + repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false]; +} + +// Balance defines an account address and balance pair used in the bank module's +// genesis state. +message Balance { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the balance holder. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // coins defines the different coins this balance holds. + repeated cosmos.base.v1beta1.Coin coins = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/query.proto new file mode 100644 index 00000000..cbe7f38a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/query.proto @@ -0,0 +1,231 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the balance of a single coin for a single account. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; + } + + // AllBalances queries the balance of all coins for a single account. + rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; + } + + // SpendableBalances queries the spenable balance of all coins for a single + // account. + rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; + } + + // TotalSupply queries the total supply of all coins. + rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; + } + + // SupplyOf queries the supply of a single coin. + rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom"; + } + + // Params queries the parameters of x/bank module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + } + + // DenomsMetadata queries the client metadata of a given coin denomination. + rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; + } + + // DenomsMetadata queries the client metadata for all registered coin + // denominations. + rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; + } + + // DenomOwners queries for all account addresses that own a particular token + // denomination. + rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +message QueryBalanceRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +message QueryBalanceResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + +// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +message QueryAllBalancesRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC +// method. +message QueryAllBalancesResponse { + // balances is the balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySpendableBalancesRequest defines the gRPC request structure for querying +// an account's spendable balances. +message QuerySpendableBalancesRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query spendable balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QuerySpendableBalancesResponse defines the gRPC response structure for querying +// an account's spendable balances. +message QuerySpendableBalancesResponse { + // balances is the spendable balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC +// method. +message QueryTotalSupplyRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // pagination defines an optional pagination for the request. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC +// method +message QueryTotalSupplyResponse { + // supply is the supply of the coins + repeated cosmos.base.v1beta1.Coin supply = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // pagination defines the pagination in the response. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +message QuerySupplyOfRequest { + // denom is the coin denom to query balances for. + string denom = 1; +} + +// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +message QuerySupplyOfResponse { + // amount is the supply of the coin. + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest defines the request type for querying x/bank parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/bank parameters. +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +message QueryDenomsMetadataRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC +// method. +message QueryDenomsMetadataResponse { + // metadata provides the client information for all the registered tokens. + repeated Metadata metadatas = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +message QueryDenomMetadataRequest { + // denom is the coin denom to query the metadata for. + string denom = 1; +} + +// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +// method. +message QueryDenomMetadataResponse { + // metadata describes and provides all the client information for the requested token. + Metadata metadata = 1 [(gogoproto.nullable) = false]; +} + +// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +message QueryDenomOwnersRequest { + // denom defines the coin denomination to query all account holders for. + string denom = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +message DenomOwner { + // address defines the address that owns a particular denomination. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // balance is the balance of the denominated coin for an account. + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; +} + +// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +message QueryDenomOwnersResponse { + repeated DenomOwner denom_owners = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/tx.proto new file mode 100644 index 00000000..22e62cbf --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/bank/v1beta1/tx.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Msg defines the bank Msg service. +service Msg { + // Send defines a method for sending coins from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); + + // MultiSend defines a method for sending coins from some accounts to other accounts. + rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); +} + +// MsgSend represents a message to send coins from one account to another. +message MsgSend { + option (cosmos.msg.v1.signer) = "from_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} + +// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +message MsgMultiSend { + option (cosmos.msg.v1.signer) = "inputs"; + + option (gogoproto.equal) = false; + + repeated Input inputs = 1 [(gogoproto.nullable) = false]; + repeated Output outputs = 2 [(gogoproto.nullable) = false]; +} + +// MsgMultiSendResponse defines the Msg/MultiSend response type. +message MsgMultiSendResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/abci/v1beta1/abci.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/abci/v1beta1/abci.proto new file mode 100644 index 00000000..09a2fcc4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/abci/v1beta1/abci.proto @@ -0,0 +1,158 @@ +syntax = "proto3"; +package cosmos.base.abci.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; + +// TxResponse defines a structure containing relevant tx data and metadata. The +// tags are stringified and the log is JSON decoded. +message TxResponse { + option (gogoproto.goproto_getters) = false; + // The block height + int64 height = 1; + // The transaction hash. + string txhash = 2 [(gogoproto.customname) = "TxHash"]; + // Namespace for the Code + string codespace = 3; + // Response code. + uint32 code = 4; + // Result bytes, if any. + string data = 5; + // The output of the application's logger (raw string). May be + // non-deterministic. + string raw_log = 6; + // The output of the application's logger (typed). May be non-deterministic. + repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; + // Additional information. May be non-deterministic. + string info = 8; + // Amount of gas requested for transaction. + int64 gas_wanted = 9; + // Amount of gas consumed by transaction. + int64 gas_used = 10; + // The request transaction bytes. + google.protobuf.Any tx = 11; + // Time of the previous block. For heights > 1, it's the weighted median of + // the timestamps of the valid votes in the block.LastCommit. For height == 1, + // it's genesis time. + string timestamp = 12; + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante handler. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; +} + +// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +message ABCIMessageLog { + option (gogoproto.stringer) = true; + + uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"]; + string log = 2; + + // Events contains a slice of Event objects that were emitted during some + // execution. + repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; +} + +// StringEvent defines en Event object wrapper where all the attributes +// contain key/value pairs that are strings instead of raw bytes. +message StringEvent { + option (gogoproto.stringer) = true; + + string type = 1; + repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; +} + +// Attribute defines an attribute wrapper where the key and value are +// strings instead of raw bytes. +message Attribute { + string key = 1; + string value = 2; +} + +// GasInfo defines tx execution gas context. +message GasInfo { + // GasWanted is the maximum units of work we allow this tx to perform. + uint64 gas_wanted = 1; + + // GasUsed is the amount of gas actually consumed. + uint64 gas_used = 2; +} + +// Result is the union of ResponseFormat and ResponseCheckTx. +message Result { + option (gogoproto.goproto_getters) = false; + + // Data is any data returned from message or handler execution. It MUST be + // length prefixed in order to separate data from multiple message executions. + // Deprecated. This field is still populated, but prefer msg_response instead + // because it also contains the Msg response typeURL. + bytes data = 1 [deprecated = true]; + + // Log contains the log information from message or handler execution. + string log = 2; + + // Events contains a slice of Event objects that were emitted during message + // or handler execution. + repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; + + // msg_responses contains the Msg handler responses type packed in Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 4; +} + +// SimulationResponse defines the response generated when a transaction is +// successfully simulated. +message SimulationResponse { + GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Result result = 2; +} + +// MsgData defines the data returned in a Result object during message +// execution. +message MsgData { + option deprecated = true; + option (gogoproto.stringer) = true; + + string msg_type = 1; + bytes data = 2; +} + +// TxMsgData defines a list of MsgData. A transaction will have a MsgData object +// for each message. +message TxMsgData { + option (gogoproto.stringer) = true; + + // data field is deprecated and not populated. + repeated MsgData data = 1 [deprecated = true]; + + // msg_responses contains the Msg handler responses packed into Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 2; +} + +// SearchTxsResult defines a structure for querying txs pageable +message SearchTxsResult { + option (gogoproto.stringer) = true; + + // Count of all txs + uint64 total_count = 1; + // Count of txs in current page + uint64 count = 2; + // Index of current page, start from 1 + uint64 page_number = 3; + // Count of total pages + uint64 page_total = 4; + // Max count txs per page + uint64 limit = 5; + // List of txs in current page + repeated TxResponse txs = 6; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/kv/v1beta1/kv.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/kv/v1beta1/kv.proto new file mode 100644 index 00000000..4e9b8d28 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/kv/v1beta1/kv.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.base.kv.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/kv"; + +// Pairs defines a repeated slice of Pair objects. +message Pairs { + repeated Pair pairs = 1 [(gogoproto.nullable) = false]; +} + +// Pair defines a key/value bytes tuple. +message Pair { + bytes key = 1; + bytes value = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/query/v1beta1/pagination.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/query/v1beta1/pagination.proto new file mode 100644 index 00000000..0a368144 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/query/v1beta1/pagination.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package cosmos.base.query.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +// PageRequest is to be embedded in gRPC request messages for efficient +// pagination. Ex: +// +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } +message PageRequest { + // key is a value returned in PageResponse.next_key to begin + // querying the next page most efficiently. Only one of offset or key + // should be set. + bytes key = 1; + + // offset is a numeric offset that can be used when key is unavailable. + // It is less efficient than using key. Only one of offset or key should + // be set. + uint64 offset = 2; + + // limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + uint64 limit = 3; + + // count_total is set to true to indicate that the result set should include + // a count of the total number of items available for pagination in UIs. + // count_total is only respected when offset is used. It is ignored when key + // is set. + bool count_total = 4; + + // reverse is set to true if results are to be returned in the descending order. + // + // Since: cosmos-sdk 0.43 + bool reverse = 5; +} + +// PageResponse is to be embedded in gRPC response messages where the +// corresponding request message has used PageRequest. +// +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } +message PageResponse { + // next_key is the key to be passed to PageRequest.key to + // query the next page most efficiently. It will be empty if + // there are no more results. + bytes next_key = 1; + + // total is total number of results available if PageRequest.count_total + // was set, its value is undefined otherwise + uint64 total = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/reflection/v1beta1/reflection.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/reflection/v1beta1/reflection.proto new file mode 100644 index 00000000..22670e72 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/reflection/v1beta1/reflection.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package cosmos.base.reflection.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection"; + +// ReflectionService defines a service for interface reflection. +service ReflectionService { + // ListAllInterfaces lists all the interfaces registered in the interface + // registry. + rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces"; + }; + + // ListImplementations list all the concrete types that implement a given + // interface. + rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/" + "{interface_name}/implementations"; + }; +} + +// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. +message ListAllInterfacesRequest {} + +// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +message ListAllInterfacesResponse { + // interface_names is an array of all the registered interfaces. + repeated string interface_names = 1; +} + +// ListImplementationsRequest is the request type of the ListImplementations +// RPC. +message ListImplementationsRequest { + // interface_name defines the interface to query the implementations for. + string interface_name = 1; +} + +// ListImplementationsResponse is the response type of the ListImplementations +// RPC. +message ListImplementationsResponse { + repeated string implementation_message_names = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/reflection/v2alpha1/reflection.proto new file mode 100644 index 00000000..d5b04855 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/reflection/v2alpha1/reflection.proto @@ -0,0 +1,218 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.base.reflection.v2alpha1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"; + +// AppDescriptor describes a cosmos-sdk based application +message AppDescriptor { + // AuthnDescriptor provides information on how to authenticate transactions on the application + // NOTE: experimental and subject to change in future releases. + AuthnDescriptor authn = 1; + // chain provides the chain descriptor + ChainDescriptor chain = 2; + // codec provides metadata information regarding codec related types + CodecDescriptor codec = 3; + // configuration provides metadata information regarding the sdk.Config type + ConfigurationDescriptor configuration = 4; + // query_services provides metadata information regarding the available queriable endpoints + QueryServicesDescriptor query_services = 5; + // tx provides metadata information regarding how to send transactions to the given application + TxDescriptor tx = 6; +} + +// TxDescriptor describes the accepted transaction type +message TxDescriptor { + // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + // it is not meant to support polymorphism of transaction types, it is supposed to be used by + // reflection clients to understand if they can handle a specific transaction type in an application. + string fullname = 1; + // msgs lists the accepted application messages (sdk.Msg) + repeated MsgDescriptor msgs = 2; +} + +// AuthnDescriptor provides information on how to sign transactions without relying +// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures +message AuthnDescriptor { + // sign_modes defines the supported signature algorithm + repeated SigningModeDescriptor sign_modes = 1; +} + +// SigningModeDescriptor provides information on a signing flow of the application +// NOTE(fdymylja): here we could go as far as providing an entire flow on how +// to sign a message given a SigningModeDescriptor, but it's better to think about +// this another time +message SigningModeDescriptor { + // name defines the unique name of the signing mode + string name = 1; + // number is the unique int32 identifier for the sign_mode enum + int32 number = 2; + // authn_info_provider_method_fullname defines the fullname of the method to call to get + // the metadata required to authenticate using the provided sign_modes + string authn_info_provider_method_fullname = 3; +} + +// ChainDescriptor describes chain information of the application +message ChainDescriptor { + // id is the chain id + string id = 1; +} + +// CodecDescriptor describes the registered interfaces and provides metadata information on the types +message CodecDescriptor { + // interfaces is a list of the registerted interfaces descriptors + repeated InterfaceDescriptor interfaces = 1; +} + +// InterfaceDescriptor describes the implementation of an interface +message InterfaceDescriptor { + // fullname is the name of the interface + string fullname = 1; + // interface_accepting_messages contains information regarding the proto messages which contain the interface as + // google.protobuf.Any field + repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2; + // interface_implementers is a list of the descriptors of the interface implementers + repeated InterfaceImplementerDescriptor interface_implementers = 3; +} + +// InterfaceImplementerDescriptor describes an interface implementer +message InterfaceImplementerDescriptor { + // fullname is the protobuf queryable name of the interface implementer + string fullname = 1; + // type_url defines the type URL used when marshalling the type as any + // this is required so we can provide type safe google.protobuf.Any marshalling and + // unmarshalling, making sure that we don't accept just 'any' type + // in our interface fields + string type_url = 2; +} + +// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains +// an interface represented as a google.protobuf.Any +message InterfaceAcceptingMessageDescriptor { + // fullname is the protobuf fullname of the type containing the interface + string fullname = 1; + // field_descriptor_names is a list of the protobuf name (not fullname) of the field + // which contains the interface as google.protobuf.Any (the interface is the same, but + // it can be in multiple fields of the same proto message) + repeated string field_descriptor_names = 2; +} + +// ConfigurationDescriptor contains metadata information on the sdk.Config +message ConfigurationDescriptor { + // bech32_account_address_prefix is the account address prefix + string bech32_account_address_prefix = 1; +} + +// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction +message MsgDescriptor { + // msg_type_url contains the TypeURL of a sdk.Msg. + string msg_type_url = 1; +} + +// ReflectionService defines a service for application reflection. +service ReflectionService { + // GetAuthnDescriptor returns information on how to authenticate transactions in the application + // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in + // future releases of the cosmos-sdk. + rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn"; + } + // GetChainDescriptor returns the description of the chain + rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain"; + }; + // GetCodecDescriptor returns the descriptor of the codec of the application + rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec"; + } + // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application + rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration"; + } + // GetQueryServicesDescriptor returns the available gRPC queryable services of the application + rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services"; + } + // GetTxDescriptor returns information on the used transaction object and available msgs that can be used + rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor"; + } +} + +// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC +message GetAuthnDescriptorRequest {} +// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC +message GetAuthnDescriptorResponse { + // authn describes how to authenticate to the application when sending transactions + AuthnDescriptor authn = 1; +} + +// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC +message GetChainDescriptorRequest {} +// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC +message GetChainDescriptorResponse { + // chain describes application chain information + ChainDescriptor chain = 1; +} + +// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC +message GetCodecDescriptorRequest {} +// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC +message GetCodecDescriptorResponse { + // codec describes the application codec such as registered interfaces and implementations + CodecDescriptor codec = 1; +} + +// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorRequest {} +// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorResponse { + // config describes the application's sdk.Config + ConfigurationDescriptor config = 1; +} + +// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorRequest {} +// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorResponse { + // queries provides information on the available queryable services + QueryServicesDescriptor queries = 1; +} + +// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC +message GetTxDescriptorRequest {} +// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC +message GetTxDescriptorResponse { + // tx provides information on msgs that can be forwarded to the application + // alongside the accepted transaction protobuf type + TxDescriptor tx = 1; +} + +// QueryServicesDescriptor contains the list of cosmos-sdk queriable services +message QueryServicesDescriptor { + // query_services is a list of cosmos-sdk QueryServiceDescriptor + repeated QueryServiceDescriptor query_services = 1; +} + +// QueryServiceDescriptor describes a cosmos-sdk queryable service +message QueryServiceDescriptor { + // fullname is the protobuf fullname of the service descriptor + string fullname = 1; + // is_module describes if this service is actually exposed by an application's module + bool is_module = 2; + // methods provides a list of query service methods + repeated QueryMethodDescriptor methods = 3; +} + +// QueryMethodDescriptor describes a queryable method of a query service +// no other info is provided beside method name and tendermint queryable path +// because it would be redundant with the grpc reflection service +message QueryMethodDescriptor { + // name is the protobuf name (not fullname) of the method + string name = 1; + // full_query_path is the path that can be used to query + // this method via tendermint abci.Query + string full_query_path = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/snapshots/v1beta1/snapshot.proto new file mode 100644 index 00000000..a89e0b4c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/snapshots/v1beta1/snapshot.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; +package cosmos.base.snapshots.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types"; + +// Snapshot contains Tendermint state sync snapshot info. +message Snapshot { + uint64 height = 1; + uint32 format = 2; + uint32 chunks = 3; + bytes hash = 4; + Metadata metadata = 5 [(gogoproto.nullable) = false]; +} + +// Metadata contains SDK-specific snapshot metadata. +message Metadata { + repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes +} + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +message SnapshotItem { + // item is the specific type of snapshot item. + oneof item { + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + SnapshotExtensionMeta extension = 3; + SnapshotExtensionPayload extension_payload = 4; + SnapshotKVItem kv = 5 [(gogoproto.customname) = "KV"]; + SnapshotSchema schema = 6; + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +message SnapshotStoreItem { + string name = 1; +} + +// SnapshotIAVLItem is an exported IAVL node. +message SnapshotIAVLItem { + bytes key = 1; + bytes value = 2; + // version is block height + int64 version = 3; + // height is depth of the tree. + int32 height = 4; +} + +// SnapshotExtensionMeta contains metadata about an external snapshotter. +message SnapshotExtensionMeta { + string name = 1; + uint32 format = 2; +} + +// SnapshotExtensionPayload contains payloads of an external snapshotter. +message SnapshotExtensionPayload { + bytes payload = 1; +} + +// SnapshotKVItem is an exported Key/Value Pair +message SnapshotKVItem { + bytes key = 1; + bytes value = 2; +} + +// SnapshotSchema is an exported schema of smt store +message SnapshotSchema{ + repeated bytes keys = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/store/v1beta1/commit_info.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/store/v1beta1/commit_info.proto new file mode 100644 index 00000000..98a33d30 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/store/v1beta1/commit_info.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// CommitInfo defines commit information used by the multi-store when committing +// a version/height. +message CommitInfo { + int64 version = 1; + repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; +} + +// StoreInfo defines store-specific commit information. It contains a reference +// between a store name and the commit ID. +message StoreInfo { + string name = 1; + CommitID commit_id = 2 [(gogoproto.nullable) = false]; +} + +// CommitID defines the committment information when a specific store is +// committed. +message CommitID { + option (gogoproto.goproto_stringer) = false; + + int64 version = 1; + bytes hash = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/store/v1beta1/listening.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/store/v1beta1/listening.proto new file mode 100644 index 00000000..35999710 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/store/v1beta1/listening.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +// Deletes +// +// Since: cosmos-sdk 0.43 +message StoreKVPair { + string store_key = 1; // the store key for the KVStore this pair originates from + bool delete = 2; // true indicates a delete operation, false indicates a set operation + bytes key = 3; + bytes value = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/tendermint/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/tendermint/v1beta1/query.proto new file mode 100644 index 00000000..96a46e53 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "tendermint/p2p/types.proto"; +import "tendermint/types/block.proto"; +import "tendermint/types/types.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; + +// Service defines the gRPC querier service for tendermint queries. +service Service { + // GetNodeInfo queries the current node info. + rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; + } + // GetSyncing queries node syncing. + rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; + } + // GetLatestBlock returns the latest block. + rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; + } + // GetBlockByHeight queries block for given height. + rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; + } + + // GetLatestValidatorSet queries latest validator-set. + rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; + } + // GetValidatorSetByHeight queries validator-set at a given height. + rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; + } +} + +// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +message GetValidatorSetByHeightRequest { + int64 height = 1; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +message GetValidatorSetByHeightResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +message GetLatestValidatorSetRequest { + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +message GetLatestValidatorSetResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// Validator is the type for the validator-set. +message Validator { + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +message GetBlockByHeightRequest { + int64 height = 1; +} + +// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +message GetBlockByHeightResponse { + .tendermint.types.BlockID block_id = 1; + .tendermint.types.Block block = 2; +} + +// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +message GetLatestBlockRequest {} + +// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +message GetLatestBlockResponse { + .tendermint.types.BlockID block_id = 1; + .tendermint.types.Block block = 2; +} + +// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +message GetSyncingRequest {} + +// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +message GetSyncingResponse { + bool syncing = 1; +} + +// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +message GetNodeInfoRequest {} + +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. +message GetNodeInfoResponse { + .tendermint.p2p.NodeInfo node_info = 1; + VersionInfo application_version = 2; +} + +// VersionInfo is the type for the GetNodeInfoResponse message. +message VersionInfo { + string name = 1; + string app_name = 2; + string version = 3; + string git_commit = 4; + string build_tags = 5; + string go_version = 6; + repeated Module build_deps = 7; + // Since: cosmos-sdk 0.43 + string cosmos_sdk_version = 8; +} + +// Module is the type for VersionInfo +message Module { + // module path + string path = 1; + // module version + string version = 2; + // checksum + string sum = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/base/v1beta1/coin.proto b/dydxjs/packages/dydxjs/proto/cosmos/base/v1beta1/coin.proto new file mode 100644 index 00000000..69e67e09 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/base/v1beta1/coin.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.base.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; + +// Coin defines a token with a denomination and an amount. +// +// NOTE: The amount field is an Int which implements the custom method +// signatures required by gogoproto. +message Coin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecCoin defines a token with a denomination and a decimal amount. +// +// NOTE: The amount field is an Dec which implements the custom method +// signatures required by gogoproto. +message DecCoin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} + +// IntProto defines a Protobuf wrapper around an Int object. +message IntProto { + string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecProto defines a Protobuf wrapper around a Dec object. +message DecProto { + string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/capability/v1beta1/capability.proto b/dydxjs/packages/dydxjs/proto/cosmos/capability/v1beta1/capability.proto new file mode 100644 index 00000000..c433566d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/capability/v1beta1/capability.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +import "gogoproto/gogo.proto"; + +// Capability defines an implementation of an object capability. The index +// provided to a Capability must be globally unique. +message Capability { + option (gogoproto.goproto_stringer) = false; + + uint64 index = 1; +} + +// Owner defines a single capability owner. An owner is defined by the name of +// capability and the module name. +message Owner { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + string module = 1; + string name = 2; +} + +// CapabilityOwners defines a set of owners of a single Capability. The set of +// owners must be unique. +message CapabilityOwners { + repeated Owner owners = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/capability/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/capability/v1beta1/genesis.proto new file mode 100644 index 00000000..b5482439 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/capability/v1beta1/genesis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/capability/v1beta1/capability.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +// GenesisOwners defines the capability owners with their corresponding index. +message GenesisOwners { + // index is the index of the capability owner. + uint64 index = 1; + + // index_owners are the owners at the given index. + CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false]; +} + +// GenesisState defines the capability module's genesis state. +message GenesisState { + // index is the capability global index. + uint64 index = 1; + + // owners represents a map from index to owners of the capability index + // index key is string to allow amino marshalling. + repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crisis/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/crisis/v1beta1/genesis.proto new file mode 100644 index 00000000..5c291604 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crisis/v1beta1/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// GenesisState defines the crisis module's genesis state. +message GenesisState { + // constant_fee is the fee used to verify the invariant in the crisis + // module. + cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crisis/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/crisis/v1beta1/tx.proto new file mode 100644 index 00000000..fea9059f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crisis/v1beta1/tx.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the bank Msg service. +service Msg { + // VerifyInvariant defines a method to verify a particular invariance. + rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); +} + +// MsgVerifyInvariant represents a message to verify a particular invariance. +message MsgVerifyInvariant { + option (cosmos.msg.v1.signer) = "sender"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string invariant_module_name = 2; + string invariant_route = 3; +} + +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +message MsgVerifyInvariantResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crypto/ed25519/keys.proto b/dydxjs/packages/dydxjs/proto/cosmos/crypto/ed25519/keys.proto new file mode 100644 index 00000000..6ffec344 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crypto/ed25519/keys.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package cosmos.crypto.ed25519; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; + +// PubKey is an ed25519 public key for handling Tendermint keys in SDK. +// It's needed for Any serialization and SDK compatibility. +// It must not be used in a non Tendermint key context because it doesn't implement +// ADR-28. Nevertheless, you will like to use ed25519 in app user level +// then you must create a new proto message and follow ADR-28 for Address construction. +message PubKey { + option (gogoproto.goproto_stringer) = false; + + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; +} + +// Deprecated: PrivKey defines a ed25519 private key. +// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. +message PrivKey { + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crypto/hd/v1/hd.proto b/dydxjs/packages/dydxjs/proto/cosmos/crypto/hd/v1/hd.proto new file mode 100644 index 00000000..e4a95afc --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crypto/hd/v1/hd.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package cosmos.crypto.hd.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; +option (gogoproto.goproto_getters_all) = false; + +// BIP44Params is used as path field in ledger item in Record. +message BIP44Params { + option (gogoproto.goproto_stringer) = false; + // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + uint32 purpose = 1; + // coin_type is a constant that improves privacy + uint32 coin_type = 2; + // account splits the key space into independent user identities + uint32 account = 3; + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + // chain. + bool change = 4; + // address_index is used as child index in BIP32 derivation + uint32 address_index = 5; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crypto/keyring/v1/record.proto b/dydxjs/packages/dydxjs/proto/cosmos/crypto/keyring/v1/record.proto new file mode 100644 index 00000000..9b2d3c96 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crypto/keyring/v1/record.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package cosmos.crypto.keyring.v1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/crypto/hd/v1/hd.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; +option (gogoproto.goproto_getters_all) = false; + +// Record is used for representing a key in the keyring. +message Record { + // name represents a name of Record + string name = 1; + // pub_key represents a public key in any format + google.protobuf.Any pub_key = 2; + + // Record contains one of the following items + oneof item { + // local stores the public information about a locally stored key + Local local = 3; + // ledger stores the public information about a Ledger key + Ledger ledger = 4; + // Multi does not store any information. + Multi multi = 5; + // Offline does not store any information. + Offline offline = 6; + } + + // Item is a keyring item stored in a keyring backend. + // Local item + message Local { + google.protobuf.Any priv_key = 1; + string priv_key_type = 2; + } + + // Ledger item + message Ledger { + hd.v1.BIP44Params path = 1; + } + + // Multi item + message Multi {} + + // Offline item + message Offline {} +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crypto/multisig/keys.proto b/dydxjs/packages/dydxjs/proto/cosmos/crypto/multisig/keys.proto new file mode 100644 index 00000000..7a11fe33 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crypto/multisig/keys.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.crypto.multisig; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; + +// LegacyAminoPubKey specifies a public key type +// which nests multiple public keys and a threshold, +// it uses legacy amino address rules. +message LegacyAminoPubKey { + option (gogoproto.goproto_getters) = false; + + uint32 threshold = 1; + repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/dydxjs/packages/dydxjs/proto/cosmos/crypto/multisig/v1beta1/multisig.proto new file mode 100644 index 00000000..bf671f17 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crypto/multisig/v1beta1/multisig.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.crypto.multisig.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; + +// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. +// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers +// signed and with which modes. +message MultiSignature { + option (gogoproto.goproto_unrecognized) = true; + repeated bytes signatures = 1; +} + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after proto encoding. +// This is not thread safe, and is not intended for concurrent usage. +message CompactBitArray { + option (gogoproto.goproto_stringer) = false; + + uint32 extra_bits_stored = 1; + bytes elems = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crypto/secp256k1/keys.proto b/dydxjs/packages/dydxjs/proto/cosmos/crypto/secp256k1/keys.proto new file mode 100644 index 00000000..a2272571 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crypto/secp256k1/keys.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.crypto.secp256k1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; + +// PubKey defines a secp256k1 public key +// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte +// if the y-coordinate is the lexicographically largest of the two associated with +// the x-coordinate. Otherwise the first byte is a 0x03. +// This prefix is followed with the x-coordinate. +message PubKey { + option (gogoproto.goproto_stringer) = false; + + bytes key = 1; +} + +// PrivKey defines a secp256k1 private key. +message PrivKey { + bytes key = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/crypto/secp256r1/keys.proto b/dydxjs/packages/dydxjs/proto/cosmos/crypto/secp256r1/keys.proto new file mode 100644 index 00000000..2e96c6e3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/crypto/secp256r1/keys.proto @@ -0,0 +1,23 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.crypto.secp256r1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; +option (gogoproto.messagename_all) = true; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// PubKey defines a secp256r1 ECDSA public key. +message PubKey { + // Point on secp256r1 curve in a compressed representation as specified in section + // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; +} + +// PrivKey defines a secp256r1 ECDSA private key. +message PrivKey { + // secret number serialized using big-endian encoding + bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/distribution.proto b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/distribution.proto new file mode 100644 index 00000000..1afe25ae --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/distribution.proto @@ -0,0 +1,154 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; + +// Params defines the set of params for the distribution module. +message Params { + option (gogoproto.goproto_stringer) = false; + string community_tax = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string base_proposer_reward = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string bonus_proposer_reward = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + bool withdraw_addr_enabled = 4; +} + +// ValidatorHistoricalRewards represents historical rewards for a validator. +// Height is implicit within the store key. +// Cumulative reward ratio is the sum from the zeroeth period +// until this period of rewards / tokens, per the spec. +// The reference count indicates the number of objects +// which might need to reference this historical entry at any point. +// ReferenceCount = +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization +message ValidatorHistoricalRewards { + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + uint32 reference_count = 2; +} + +// ValidatorCurrentRewards represents current rewards and current +// period for a validator kept as a running counter and incremented +// each block as long as the validator's tokens remain constant. +message ValidatorCurrentRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + uint64 period = 2; +} + +// ValidatorAccumulatedCommission represents accumulated commission +// for a validator kept as a running counter, can be withdrawn at any time. +message ValidatorAccumulatedCommission { + repeated cosmos.base.v1beta1.DecCoin commission = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +// for a validator inexpensive to track, allows simple sanity checks. +message ValidatorOutstandingRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// ValidatorSlashEvent represents a validator slash event. +// Height is implicit within the store key. +// This is needed to calculate appropriate amount of staking tokens +// for delegations which are withdrawn after a slash has occurred. +message ValidatorSlashEvent { + uint64 validator_period = 1; + string fraction = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +message ValidatorSlashEvents { + option (gogoproto.goproto_stringer) = false; + repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false]; +} + +// FeePool is the global fee pool for distribution. +message FeePool { + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; +} + +// CommunityPoolSpendProposal details a proposal for use of community funds, +// together with how many coins are proposed to be spent, and to which +// recipient account. +message CommunityPoolSpendProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string recipient = 3; + repeated cosmos.base.v1beta1.Coin amount = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// DelegatorStartingInfo represents the starting info for a delegator reward +// period. It tracks the previous validator period, the delegation's amount of +// staking token, and the creation height (to check later on if any slashes have +// occurred). NOTE: Even though validators are slashed to whole staking tokens, +// the delegators within the validator may be left with less than a full token, +// thus sdk.Dec is used. +message DelegatorStartingInfo { + uint64 previous_period = 1; + string stake = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 height = 3 [(gogoproto.jsontag) = "creation_height"]; +} + +// DelegationDelegatorReward represents the properties +// of a delegator's delegation reward. +message DelegationDelegatorReward { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + repeated cosmos.base.v1beta1.DecCoin reward = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +// with a deposit +message CommunityPoolSpendProposalWithDeposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string recipient = 3; + string amount = 4; + string deposit = 5; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/genesis.proto new file mode 100644 index 00000000..4662e8df --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/genesis.proto @@ -0,0 +1,144 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; + +// DelegatorWithdrawInfo is the address for where distributions rewards are +// withdrawn to by default this struct is only used at genesis to feed in +// default withdraw addresses. +message DelegatorWithdrawInfo { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // withdraw_address is the address to withdraw the delegation rewards to. + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +message ValidatorOutstandingRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // outstanding_rewards represents the oustanding rewards of a validator. + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// ValidatorAccumulatedCommissionRecord is used for import / export via genesis +// json. +message ValidatorAccumulatedCommissionRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // accumulated is the accumulated commission of a validator. + ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false]; +} + +// ValidatorHistoricalRewardsRecord is used for import / export via genesis +// json. +message ValidatorHistoricalRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // period defines the period the historical rewards apply to. + uint64 period = 2; + + // rewards defines the historical rewards of a validator. + ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false]; +} + +// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +message ValidatorCurrentRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // rewards defines the current rewards of a validator. + ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false]; +} + +// DelegatorStartingInfoRecord used for import / export via genesis json. +message DelegatorStartingInfoRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_address is the address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // starting_info defines the starting info of a delegator. + DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false]; +} + +// ValidatorSlashEventRecord is used for import / export via genesis json. +message ValidatorSlashEventRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // height defines the block height at which the slash event occured. + uint64 height = 2; + // period is the period of the slash event. + uint64 period = 3; + // validator_slash_event describes the slash event. + ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false]; +} + +// GenesisState defines the distribution module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the paramaters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // fee_pool defines the fee pool at genesis. + FeePool fee_pool = 2 [(gogoproto.nullable) = false]; + + // fee_pool defines the delegator withdraw infos at genesis. + repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 [(gogoproto.nullable) = false]; + + // fee_pool defines the previous proposer at genesis. + string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // fee_pool defines the outstanding rewards of all validators at genesis. + repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 [(gogoproto.nullable) = false]; + + // fee_pool defines the accumulated commisions of all validators at genesis. + repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 [(gogoproto.nullable) = false]; + + // fee_pool defines the historical rewards of all validators at genesis. + repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 [(gogoproto.nullable) = false]; + + // fee_pool defines the current rewards of all validators at genesis. + repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 [(gogoproto.nullable) = false]; + + // fee_pool defines the delegator starting infos at genesis. + repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 [(gogoproto.nullable) = false]; + + // fee_pool defines the validator slash events at genesis. + repeated ValidatorSlashEventRecord validator_slash_events = 10 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/query.proto new file mode 100644 index 00000000..a09413fc --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/query.proto @@ -0,0 +1,219 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; + +// Query defines the gRPC querier service for distribution module. +service Query { + // Params queries params of the distribution module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; + } + + // ValidatorOutstandingRewards queries rewards of a validator address. + rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) + returns (QueryValidatorOutstandingRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/outstanding_rewards"; + } + + // ValidatorCommission queries accumulated commission for a validator. + rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/commission"; + } + + // ValidatorSlashes queries slash events of a validator. + rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes"; + } + + // DelegationRewards queries the total rewards accrued by a delegation. + rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/" + "{validator_address}"; + } + + // DelegationTotalRewards queries the total rewards accrued by a each + // validator. + rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; + } + + // DelegatorValidators queries the validators of a delegator. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/validators"; + } + + // DelegatorWithdrawAddress queries withdraw address of a delegator. + rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/withdraw_address"; + } + + // CommunityPool queries the community pool coins. + rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorOutstandingRewardsRequest is the request type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorOutstandingRewardsResponse is the response type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsResponse { + ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorCommissionRequest is the request type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorCommissionResponse is the response type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionResponse { + // commission defines the commision the validator received. + ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorSlashesRequest is the request type for the +// Query/ValidatorSlashes RPC method +message QueryValidatorSlashesRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // starting_height defines the optional starting height to query the slashes. + uint64 starting_height = 2; + // starting_height defines the optional ending height to query the slashes. + uint64 ending_height = 3; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryValidatorSlashesResponse is the response type for the +// Query/ValidatorSlashes RPC method. +message QueryValidatorSlashesResponse { + // slashes defines the slashes the validator received. + repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRewardsRequest is the request type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address defines the validator address to query for. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationRewardsResponse is the response type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsResponse { + // rewards defines the rewards accrued by a delegation. + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; +} + +// QueryDelegationTotalRewardsRequest is the request type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationTotalRewardsResponse is the response type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsResponse { + // rewards defines all the rewards accrued by a delegator. + repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false]; + // total defines the sum of all the rewards. + repeated cosmos.base.v1beta1.DecCoin total = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; +} + +// QueryDelegatorValidatorsRequest is the request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorValidatorsResponse is the response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validators defines the validators a delegator is delegating for. + repeated string validators = 1; +} + +// QueryDelegatorWithdrawAddressRequest is the request type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorWithdrawAddressResponse is the response type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // withdraw_address defines the delegator address to query for. + string withdraw_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +message QueryCommunityPoolRequest {} + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +message QueryCommunityPoolResponse { + // pool defines community pool's coins. + repeated cosmos.base.v1beta1.DecCoin pool = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/tx.proto new file mode 100644 index 00000000..7f22dce9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/distribution/v1beta1/tx.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the distribution Msg service. +service Msg { + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); + + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); + + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); + + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); +} + +// MsgSetWithdrawAddress sets the withdraw address for +// a delegator (or validator self-delegation). +message MsgSetWithdrawAddress { + option (cosmos.msg.v1.signer) = "delegator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +message MsgSetWithdrawAddressResponse {} + +// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator +// from a single validator. +message MsgWithdrawDelegatorReward { + option (cosmos.msg.v1.signer) = "delegator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +message MsgWithdrawDelegatorRewardResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgWithdrawValidatorCommission withdraws the full commission to the validator +// address. +message MsgWithdrawValidatorCommission { + option (cosmos.msg.v1.signer) = "validator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +message MsgWithdrawValidatorCommissionResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +message MsgFundCommunityPool { + option (cosmos.msg.v1.signer) = "depositor"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +message MsgFundCommunityPoolResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/evidence.proto b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/evidence.proto new file mode 100644 index 00000000..83f9ec3d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/evidence.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +// Equivocation implements the Evidence interface and defines evidence of double +// signing misbehavior. +message Equivocation { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + int64 height = 1; + google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + int64 power = 3; + string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/genesis.proto new file mode 100644 index 00000000..199f446f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +import "google/protobuf/any.proto"; + +// GenesisState defines the evidence module's genesis state. +message GenesisState { + // evidence defines all the evidence at genesis. + repeated google.protobuf.Any evidence = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/query.proto new file mode 100644 index 00000000..eda00544 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/query.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +// Query defines the gRPC querier service. +service Query { + // Evidence queries evidence based on evidence hash. + rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{evidence_hash}"; + } + + // AllEvidence queries all evidence. + rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence"; + } +} + +// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +message QueryEvidenceRequest { + // evidence_hash defines the hash of the requested evidence. + bytes evidence_hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; +} + +// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +message QueryEvidenceResponse { + // evidence returns the requested evidence. + google.protobuf.Any evidence = 1; +} + +// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceResponse { + // evidence returns all evidences. + repeated google.protobuf.Any evidence = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/tx.proto new file mode 100644 index 00000000..90f62964 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/evidence/v1beta1/tx.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the evidence Msg service. +service Msg { + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); +} + +// MsgSubmitEvidence represents a message that supports submitting arbitrary +// Evidence of misbehavior such as equivocation or counterfactual signing. +message MsgSubmitEvidence { + option (cosmos.msg.v1.signer) = "submitter"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.Evidence"]; +} + +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +message MsgSubmitEvidenceResponse { + // hash defines the hash of the evidence. + bytes hash = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/feegrant.proto b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/feegrant.proto new file mode 100644 index 00000000..25fec10b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -0,0 +1,78 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// BasicAllowance implements Allowance with a one-time grant of tokens +// that optionally expires. The grantee can use up to SpendLimit to cover fees. +message BasicAllowance { + option (cosmos_proto.implements_interface) = "cosmos.feegrant.FeeAllowanceI"; + + // spend_limit specifies the maximum amount of tokens that can be spent + // by this allowance and will be updated as tokens are spent. If it is + // empty, there is no spend limit and any amount of coins can be spent. + repeated cosmos.base.v1beta1.Coin spend_limit = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // expiration specifies an optional time when this allowance expires + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; +} + +// PeriodicAllowance extends Allowance to allow for both a maximum cap, +// as well as a limit per time period. +message PeriodicAllowance { + option (cosmos_proto.implements_interface) = "cosmos.feegrant.FeeAllowanceI"; + + // basic specifies a struct of `BasicAllowance` + BasicAllowance basic = 1 [(gogoproto.nullable) = false]; + + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + // period_spend_limit specifies the maximum number of coins that can be spent + // in the period + repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // period_can_spend is the number of coins left to be spent before the period_reset time + repeated cosmos.base.v1beta1.Coin period_can_spend = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // period_reset is the time at which this period resets and a new one begins, + // it is calculated from the start time of the first transaction after the + // last period ended + google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +// AllowedMsgAllowance creates allowance only for specified message types. +message AllowedMsgAllowance { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.FeeAllowanceI"; + + // allowance can be any of basic and periodic fee allowance. + google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.FeeAllowanceI"]; + + // allowed_messages are the messages for which the grantee has the access. + repeated string allowed_messages = 2; +} + +// Grant is stored in the KVStore to record a grant with full context +message Grant { + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.FeeAllowanceI"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/genesis.proto new file mode 100644 index 00000000..5b1ac4ca --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/genesis.proto @@ -0,0 +1,13 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/feegrant/v1beta1/feegrant.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// GenesisState contains a set of fee allowances, persisted from the store +message GenesisState { + repeated Grant allowances = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/query.proto new file mode 100644 index 00000000..59c992c9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/query.proto @@ -0,0 +1,79 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Query defines the gRPC querier service. +service Query { + + // Allowance returns fee granted to the grantee by the granter. + rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; + } + + // Allowances returns all the grants for address. + rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; + } + + // AllowancesByGranter returns all the grants given by an address + // Since v0.46 + rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; + } +} + +// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +message QueryAllowanceRequest { + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. +message QueryAllowanceResponse { + // allowance is a allowance granted for grantee by granter. + cosmos.feegrant.v1beta1.Grant allowance = 1; +} + +// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +message QueryAllowancesRequest { + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +message QueryAllowancesResponse { + // allowances are allowance's granted for grantee by granter. + repeated cosmos.feegrant.v1beta1.Grant allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. +message QueryAllowancesByGranterRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. +message QueryAllowancesByGranterResponse { + // allowances that have been issued by the granter. + repeated cosmos.feegrant.v1beta1.Grant allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/tx.proto new file mode 100644 index 00000000..5cef0557 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/feegrant/v1beta1/tx.proto @@ -0,0 +1,53 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Msg defines the feegrant msg service. +service Msg { + + // GrantAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); + + // RevokeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); +} + +// MsgGrantAllowance adds permission for Grantee to spend up to Allowance +// of fees from the account of Granter. +message MsgGrantAllowance { + option (cosmos.msg.v1.signer) = "granter"; + + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.FeeAllowanceI"]; +} + +// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. +message MsgGrantAllowanceResponse {} + +// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +message MsgRevokeAllowance { + option (cosmos.msg.v1.signer) = "granter"; + + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +message MsgRevokeAllowanceResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/genutil/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/genutil/v1beta1/genesis.proto new file mode 100644 index 00000000..958d15fe --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/genutil/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package cosmos.genutil.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; + +// GenesisState defines the raw genesis transaction in JSON. +message GenesisState { + // gen_txs defines the genesis transactions. + repeated bytes gen_txs = 1 [(gogoproto.casttype) = "encoding/json.RawMessage", (gogoproto.jsontag) = "gentxs"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/genesis.proto new file mode 100644 index 00000000..cb44a7f3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/genesis.proto @@ -0,0 +1,26 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.gov.v1; + +import "cosmos/gov/v1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2; + // votes defines all the votes present at genesis. + repeated Vote votes = 3; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4; + // params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5; + // params defines all the paramaters of related to voting. + VotingParams voting_params = 6; + // params defines all the paramaters of related to tally. + TallyParams tally_params = 7; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/gov.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/gov.proto new file mode 100644 index 00000000..fb014d65 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/gov.proto @@ -0,0 +1,132 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// WeightedVoteOption defines a unit of vote for vote split. +message WeightedVoteOption { + VoteOption option = 1; + string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + uint64 proposal_id = 1; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + uint64 id = 1; + repeated google.protobuf.Any messages = 2; + ProposalStatus status = 3; + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4; + google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true]; + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 10; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + PROPOSAL_STATUS_UNSPECIFIED = 0; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; + string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; + string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; + string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + uint64 proposal_id = 1; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + reserved 3; + repeated WeightedVoteOption options = 4; + + // metadata is any arbitrary metadata to attached to the vote. + string metadata = 5; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "min_deposit,omitempty"]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.jsontag) = "max_deposit_period,omitempty"]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Length of the voting period. + google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "quorum,omitempty"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "threshold,omitempty"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "veto_threshold,omitempty"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/query.proto new file mode 100644 index 00000000..ea46472a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/query.proto @@ -0,0 +1,183 @@ + +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1/gov.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + Proposal proposal = 1; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the oter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defined the queried vote. + Vote vote = 1; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defined the queried votes. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1; + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2; + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + repeated Deposit deposits = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/tx.proto new file mode 100644 index 00000000..7aee9991 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1/tx.proto @@ -0,0 +1,100 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1/gov.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Msg defines the gov Msg service. +service Msg { + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + rpc ExecLegacyContent(MsgExecLegacyContent) returns (MsgExecLegacyContentResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposer"; + + repeated google.protobuf.Any messages = 1; + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false]; + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 4; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1; +} + +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +message MsgExecLegacyContent { + option (cosmos.msg.v1.signer) = "authority"; + + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // authority must be the gov module address. + string authority = 2; +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +message MsgExecLegacyContentResponse {} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + VoteOption option = 3; + string metadata = 4; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +message MsgVoteWeighted { + option (cosmos.msg.v1.signer) = "voter"; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated WeightedVoteOption options = 3; + string metadata = 4; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (cosmos.msg.v1.signer) = "depositor"; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/genesis.proto new file mode 100644 index 00000000..be9b07e4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/genesis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package cosmos.gov.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/gov/v1beta1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; + // votes defines all the votes present at genesis. + repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; + // params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5 [(gogoproto.nullable) = false]; + // params defines all the paramaters of related to voting. + VotingParams voting_params = 6 [(gogoproto.nullable) = false]; + // params defines all the paramaters of related to tally. + TallyParams tally_params = 7 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/gov.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/gov.proto new file mode 100644 index 00000000..c23dd925 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/gov.proto @@ -0,0 +1,201 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; +} + +// WeightedVoteOption defines a unit of vote for vote split. +// +// Since: cosmos-sdk 0.43 +message WeightedVoteOption { + VoteOption option = 1; + string weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval. +message TextProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + option (gogoproto.equal) = true; + + string title = 1; + string description = 2; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + uint64 proposal_id = 1; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + option (gogoproto.equal) = true; + + uint64 proposal_id = 1; + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + ProposalStatus status = 3; + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin total_deposit = 7 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + option (gogoproto.equal) = true; + + string yes = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string abstain = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string no = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string no_with_veto = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id"]; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if and only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + VoteOption option = 3 [deprecated = true]; + // Since: cosmos-sdk 0.43 + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.jsontag) = "min_deposit,omitempty" + ]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "max_deposit_period,omitempty" + ]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Length of the voting period. + google.protobuf.Duration voting_period = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + bytes quorum = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "quorum,omitempty" + ]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "threshold,omitempty" + ]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + bytes veto_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto_threshold,omitempty" + ]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/query.proto new file mode 100644 index 00000000..e8837fd2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/query.proto @@ -0,0 +1,191 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + Proposal proposal = 1 [(gogoproto.nullable) = false]; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the oter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defined the queried vote. + Vote vote = 1 [(gogoproto.nullable) = false]; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defined the queried votes. + repeated Vote votes = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [(gogoproto.nullable) = false]; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1 [(gogoproto.nullable) = false]; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/tx.proto new file mode 100644 index 00000000..6b2f1689 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/gov/v1beta1/tx.proto @@ -0,0 +1,106 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Msg defines the bank Msg service. +service Msg { + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + // + // Since: cosmos-sdk 0.43 + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposer"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; +} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + VoteOption option = 3; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeighted { + option (cosmos.msg.v1.signer) = "voter"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (cosmos.msg.v1.signer) = "depositor"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/group/v1/events.proto b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/events.proto new file mode 100644 index 00000000..e8907243 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/events.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; + +package cosmos.group.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/group/v1/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// EventCreateGroup is an event emitted when a group is created. +message EventCreateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventUpdateGroup is an event emitted when a group is updated. +message EventUpdateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventCreateGroupPolicy is an event emitted when a group policy is created. +message EventCreateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +message EventUpdateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventSubmitProposal is an event emitted when a proposal is created. +message EventSubmitProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +message EventWithdrawProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventVote is an event emitted when a voter votes on a proposal. +message EventVote { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventExec is an event emitted when a proposal is executed. +message EventExec { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // result is the proposal execution result. + ProposalExecutorResult result = 2; +} + +// EventLeaveGroup is an event emitted when group member leaves the group. +message EventLeaveGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // address is the account address of the group member. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/group/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/genesis.proto new file mode 100644 index 00000000..49655ad2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/genesis.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "cosmos/group/v1/types.proto"; + +// GenesisState defines the group module's genesis state. +message GenesisState { + + // group_seq is the group table orm.Sequence, + // it is used to get the next group ID. + uint64 group_seq = 1; + + // groups is the list of groups info. + repeated GroupInfo groups = 2; + + // group_members is the list of groups members. + repeated GroupMember group_members = 3; + + // group_policy_seq is the group policy table orm.Sequence, + // it is used to generate the next group policy account address. + uint64 group_policy_seq = 4; + + // group_policies is the list of group policies info. + repeated GroupPolicyInfo group_policies = 5; + + // proposal_seq is the proposal table orm.Sequence, + // it is used to get the next proposal ID. + uint64 proposal_seq = 6; + + // proposals is the list of proposals. + repeated Proposal proposals = 7; + + // votes is the list of votes. + repeated Vote votes = 8; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/group/v1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/query.proto new file mode 100644 index 00000000..1690d5b7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/query.proto @@ -0,0 +1,308 @@ +syntax = "proto3"; + +package cosmos.group.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/group/v1/types.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// Query is the cosmos.group.v1 Query service. +service Query { + + // GroupInfo queries group info based on group id. + rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_info/{group_id}"; + }; + + // GroupPolicyInfo queries group policy info based on account address of group policy. + rpc GroupPolicyInfo(QueryGroupPolicyInfoRequest) returns (QueryGroupPolicyInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}"; + }; + + // GroupMembers queries members of a group + rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}"; + }; + + // GroupsByAdmin queries groups by admin address. + rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_admin/{admin}"; + }; + + // GroupPoliciesByGroup queries group policies by group id. + rpc GroupPoliciesByGroup(QueryGroupPoliciesByGroupRequest) returns (QueryGroupPoliciesByGroupResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}"; + }; + + // GroupsByAdmin queries group policies by admin address. + rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}"; + }; + + // Proposal queries a proposal based on proposal id. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposal/{proposal_id}"; + }; + + // ProposalsByGroupPolicy queries proposals based on account address of group policy. + rpc ProposalsByGroupPolicy(QueryProposalsByGroupPolicyRequest) returns (QueryProposalsByGroupPolicyResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals_by_group_policy/{address}"; + }; + + // VoteByProposalVoter queries a vote by proposal id and voter. + rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}"; + }; + + // VotesByProposal queries a vote by proposal. + rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}"; + }; + + // VotesByVoter queries a vote by voter. + rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_voter/{voter}"; + }; + + // GroupsByMember queries groups by member address. + rpc GroupsByMember(QueryGroupsByMemberRequest) returns (QueryGroupsByMemberResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}"; + }; + + // TallyResult queries the tally of a proposal votes. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; + }; +} + +// QueryGroupInfoRequest is the Query/GroupInfo request type. +message QueryGroupInfoRequest { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// QueryGroupInfoResponse is the Query/GroupInfo response type. +message QueryGroupInfoResponse { + + // info is the GroupInfo for the group. + GroupInfo info = 1; +} + +// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. +message QueryGroupPolicyInfoRequest { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. +message QueryGroupPolicyInfoResponse { + + // info is the GroupPolicyInfo for the group policy. + GroupPolicyInfo info = 1; +} + +// QueryGroupMembersRequest is the Query/GroupMembers request type. +message QueryGroupMembersRequest { + + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. +message QueryGroupMembersResponse { + + // members are the members of the group with given group_id. + repeated GroupMember members = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. +message QueryGroupsByAdminRequest { + + // admin is the account address of a group's admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. +message QueryGroupsByAdminResponse { + + // groups are the groups info with the provided admin. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. +message QueryGroupPoliciesByGroupRequest { + + // group_id is the unique ID of the group policy's group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. +message QueryGroupPoliciesByGroupResponse { + + // group_policies are the group policies info associated with the provided group. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. +message QueryGroupPoliciesByAdminRequest { + + // admin is the admin address of the group policy. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. +message QueryGroupPoliciesByAdminResponse { + + // group_policies are the group policies info with provided admin. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryProposalRequest is the Query/Proposal request type. +message QueryProposalRequest { + + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the Query/Proposal response type. +message QueryProposalResponse { + + // proposal is the proposal info. + Proposal proposal = 1; +} + +// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. +message QueryProposalsByGroupPolicyRequest { + + // address is the account address of the group policy related to proposals. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. +message QueryProposalsByGroupPolicyResponse { + + // proposals are the proposals with given group policy. + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. +message QueryVoteByProposalVoterRequest { + + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // voter is a proposal voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. +message QueryVoteByProposalVoterResponse { + + // vote is the vote with given proposal_id and voter. + Vote vote = 1; +} + +// QueryVotesByProposalRequest is the Query/VotesByProposal request type. +message QueryVotesByProposalRequest { + + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByProposalResponse is the Query/VotesByProposal response type. +message QueryVotesByProposalResponse { + + // votes are the list of votes for given proposal_id. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVotesByVoterRequest is the Query/VotesByVoter request type. +message QueryVotesByVoterRequest { + // voter is a proposal voter account address. + string voter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByVoterResponse is the Query/VotesByVoter response type. +message QueryVotesByVoterResponse { + + // votes are the list of votes by given voter. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. +message QueryGroupsByMemberRequest { + // address is the group member address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. +message QueryGroupsByMemberResponse { + // groups are the groups info with the provided group member. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the Query/TallyResult request type. +message QueryTallyResultRequest { + // proposal_id is the unique id of a proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the Query/TallyResult response type. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/group/v1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/tx.proto new file mode 100644 index 00000000..9fb0caa1 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/tx.proto @@ -0,0 +1,364 @@ +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/group/v1/types.proto"; + +import "cosmos/msg/v1/msg.proto"; + +// Msg is the cosmos.group.v1 Msg service. +service Msg { + + // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. + rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse); + + // UpdateGroupMembers updates the group members with given group id and admin address. + rpc UpdateGroupMembers(MsgUpdateGroupMembers) returns (MsgUpdateGroupMembersResponse); + + // UpdateGroupAdmin updates the group admin with given group id and previous admin address. + rpc UpdateGroupAdmin(MsgUpdateGroupAdmin) returns (MsgUpdateGroupAdminResponse); + + // UpdateGroupMetadata updates the group metadata with given group id and admin address. + rpc UpdateGroupMetadata(MsgUpdateGroupMetadata) returns (MsgUpdateGroupMetadataResponse); + + // CreateGroupPolicy creates a new group policy using given DecisionPolicy. + rpc CreateGroupPolicy(MsgCreateGroupPolicy) returns (MsgCreateGroupPolicyResponse); + + // CreateGroupWithPolicy creates a new group with policy. + rpc CreateGroupWithPolicy(MsgCreateGroupWithPolicy) returns (MsgCreateGroupWithPolicyResponse); + + // UpdateGroupPolicyAdmin updates a group policy admin. + rpc UpdateGroupPolicyAdmin(MsgUpdateGroupPolicyAdmin) returns (MsgUpdateGroupPolicyAdminResponse); + + // UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. + rpc UpdateGroupPolicyDecisionPolicy(MsgUpdateGroupPolicyDecisionPolicy) + returns (MsgUpdateGroupPolicyDecisionPolicyResponse); + + // UpdateGroupPolicyMetadata updates a group policy metadata. + rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse); + + // SubmitProposal submits a new proposal. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // WithdrawProposal aborts a proposal. + rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse); + + // Vote allows a voter to vote on a proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // Exec executes a proposal. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // LeaveGroup allows a group member to leave the group. + rpc LeaveGroup(MsgLeaveGroup) returns (MsgLeaveGroupResponse); +} + +// +// Groups +// + +// MsgCreateGroup is the Msg/CreateGroup request type. +message MsgCreateGroup { + option (cosmos.msg.v1.signer) = "admin"; + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated Member members = 2 [(gogoproto.nullable) = false]; + + // metadata is any arbitrary metadata to attached to the group. + string metadata = 3; +} + +// MsgCreateGroupResponse is the Msg/CreateGroup response type. +message MsgCreateGroupResponse { + + // group_id is the unique ID of the newly created group. + uint64 group_id = 1; +} + +// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. +message MsgUpdateGroupMembers { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // member_updates is the list of members to update, + // set weight to 0 to remove a member. + repeated Member member_updates = 3 [(gogoproto.nullable) = false]; +} + +// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. +message MsgUpdateGroupMembersResponse {} + +// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. +message MsgUpdateGroupAdmin { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the current account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // new_admin is the group new admin account address. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. +message MsgUpdateGroupAdminResponse {} + +// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. +message MsgUpdateGroupMetadata { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is the updated group's metadata. + string metadata = 3; +} + +// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. +message MsgUpdateGroupMetadataResponse {} + +// +// Group Policies +// + +// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. +message MsgCreateGroupPolicy { + option (cosmos.msg.v1.signer) = "admin"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is any arbitrary metadata attached to the group policy. + string metadata = 3; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; +} + +// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. +message MsgCreateGroupPolicyResponse { + + // address is the account address of the newly created group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. +message MsgUpdateGroupPolicyAdmin { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // address is the account address of the group policy. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // new_admin is the new group policy admin. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. +message MsgCreateGroupWithPolicy { + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group and group policy admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated Member members = 2 [(gogoproto.nullable) = false]; + + // group_metadata is any arbitrary metadata attached to the group. + string group_metadata = 3; + + // group_policy_metadata is any arbitrary metadata attached to the group policy. + string group_policy_metadata = 4; + + // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. + bool group_policy_as_admin = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; +} + +// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. +message MsgCreateGroupWithPolicyResponse { + + // group_id is the unique ID of the newly created group with policy. + uint64 group_id = 1; + + // group_policy_address is the account address of the newly created group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +message MsgUpdateGroupPolicyAdminResponse {} + +// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. +message MsgUpdateGroupPolicyDecisionPolicy { + option (cosmos.msg.v1.signer) = "admin"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // address is the account address of group policy. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // decision_policy is the updated group policy's decision policy. + google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; +} + +// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. +message MsgUpdateGroupPolicyDecisionPolicyResponse {} + +// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. +message MsgUpdateGroupPolicyMetadata { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // address is the account address of group policy. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is the updated group policy metadata. + string metadata = 3; +} + +// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. +message MsgUpdateGroupPolicyMetadataResponse {} + +// +// Proposals and Voting +// + +// Exec defines modes of execution of a proposal on creation or on new vote. +enum Exec { + + // An empty value means that there should be a separate + // MsgExec request for the proposal to execute. + EXEC_UNSPECIFIED = 0; + + // Try to execute the proposal immediately. + // If the proposal is not allowed per the DecisionPolicy, + // the proposal will still be open and could + // be executed at a later point. + EXEC_TRY = 1; +} + +// MsgSubmitProposal is the Msg/SubmitProposal request type. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposers"; + + option (gogoproto.goproto_getters) = false; + + // address is the account address of group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // proposers are the account addresses of the proposers. + // Proposers signatures will be counted as yes votes. + repeated string proposers = 2; + + // metadata is any arbitrary metadata to attached to the proposal. + string metadata = 3; + + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 4; + + // exec defines the mode of execution of the proposal, + // whether it should be executed immediately on creation or not. + // If so, proposers signatures are considered as Yes votes. + Exec exec = 5; +} + +// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// MsgWithdrawProposal is the Msg/WithdrawProposal request type. +message MsgWithdrawProposal { + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // address is the admin of the group policy or one of the proposer of the proposal. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. +message MsgWithdrawProposalResponse {} + +// MsgVote is the Msg/Vote request type. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + // voter is the voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata to attached to the vote. + string metadata = 4; + + // exec defines whether the proposal should be executed + // immediately after voting or not. + Exec exec = 5; +} + +// MsgVoteResponse is the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgExec is the Msg/Exec request type. +message MsgExec { + option (cosmos.msg.v1.signer) = "signer"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // signer is the account address used to execute the proposal. + string signer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgExecResponse is the Msg/Exec request type. +message MsgExecResponse {} + +// MsgLeaveGroup is the Msg/LeaveGroup request type. +message MsgLeaveGroup { + option (cosmos.msg.v1.signer) = "address"; + + // address is the account address of the group member. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; +} + +// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. +message MsgLeaveGroupResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/group/v1/types.proto b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/types.proto new file mode 100644 index 00000000..604fe0ae --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/group/v1/types.proto @@ -0,0 +1,308 @@ +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; + +// Member represents a group member with an account address, +// non-zero weight and metadata. +message Member { + + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata to attached to the member. + string metadata = 3; + + // added_at is a timestamp specifying when a member was added. + google.protobuf.Timestamp added_at = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// Members defines a repeated slice of Member objects. +message Members { + + // members is the list of members. + repeated Member members = 1 [(gogoproto.nullable) = false]; +} + +// ThresholdDecisionPolicy implements the DecisionPolicy interface +message ThresholdDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.DecisionPolicy"; + + // threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. + string threshold = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// PercentageDecisionPolicy implements the DecisionPolicy interface +message PercentageDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.DecisionPolicy"; + + // percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. + string percentage = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// DecisionPolicyWindows defines the different windows for voting and execution. +message DecisionPolicyWindows { + // voting_period is the duration from submission of a proposal to the end of voting period + // Within this times votes can be submitted with MsgVote. + google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + // min_execution_period is the minimum duration after the proposal submission + // where members can start sending MsgExec. This means that the window for + // sending a MsgExec transaction is: + // `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + // where max_execution_period is a app-specific config, defined in the keeper. + // If not set, min_execution_period will default to 0. + // + // Please make sure to set a `min_execution_period` that is smaller than + // `voting_period + max_execution_period`, or else the above execution window + // is empty, meaning that all proposals created with this decision policy + // won't be able to be executed. + google.protobuf.Duration min_execution_period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; +} + +// VoteOption enumerates the valid vote options for a given proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// +// State +// + +// GroupInfo represents the high-level on-chain information for a group. +message GroupInfo { + + // id is the unique ID of the group. + uint64 id = 1; + + // admin is the account address of the group's admin. + string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata to attached to the group. + string metadata = 3; + + // version is used to track changes to a group's membership structure that + // would break existing proposals. Whenever any members weight is changed, + // or any member is added or removed this version is incremented and will + // cause proposals based on older versions of this group to fail + uint64 version = 4; + + // total_weight is the sum of the group members' weights. + string total_weight = 5; + + // created_at is a timestamp specifying when a group was created. + google.protobuf.Timestamp created_at = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// GroupMember represents the relationship between a group and a member. +message GroupMember { + + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // member is the member data. + Member member = 2; +} + +// GroupPolicyInfo represents the high-level on-chain information for a group policy. +message GroupPolicyInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + // address is the account address of group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // admin is the account address of the group admin. + string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata to attached to the group policy. + string metadata = 4; + + // version is used to track changes to a group's GroupPolicyInfo structure that + // would create a different result on a running proposal. + uint64 version = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; + + // created_at is a timestamp specifying when a group policy was created. + google.protobuf.Timestamp created_at = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// Proposal defines a group proposal. Any member of a group can submit a proposal +// for a group policy to decide upon. +// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal +// passes as well as some optional metadata associated with the proposal. +message Proposal { + option (gogoproto.goproto_getters) = false; + + // id is the unique id of the proposal. + uint64 id = 1; + + // address is the account address of group policy. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata to attached to the proposal. + string metadata = 3; + + // proposers are the account addresses of the proposers. + repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // submit_time is a timestamp specifying when a proposal was submitted. + google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // group_version tracks the version of the group that this proposal corresponds to. + // When group membership is changed, existing proposals from previous group versions will become invalid. + uint64 group_version = 6; + + // group_policy_version tracks the version of the group policy that this proposal corresponds to. + // When a decision policy is changed, existing proposals from previous policy versions will become invalid. + uint64 group_policy_version = 7; + + // status represents the high level position in the life cycle of the proposal. Initial value is Submitted. + ProposalStatus status = 8; + + // result is the final result based on the votes and election rule. Initial value is unfinalized. + // The result is persisted so that clients can always rely on this state and not have to replicate the logic. + ProposalResult result = 9; + + // final_tally_result contains the sums of all weighted votes for this + // proposal for each vote option, after tallying. When querying a proposal + // via gRPC, this field is not populated until the proposal's voting period + // has ended. + TallyResult final_tally_result = 10 [(gogoproto.nullable) = false]; + + // voting_period_end is the timestamp before which voting must be done. + // Unless a successfull MsgExec is called before (to execute a proposal whose + // tally is successful before the voting period ends), tallying will be done + // at this point, and the `final_tally_result`, as well + // as `status` and `result` fields will be accordingly updated. + google.protobuf.Timestamp voting_period_end = 11 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // executor_result is the final result based on the votes and election rule. Initial value is NotRun. + ProposalExecutorResult executor_result = 12; + + // messages is a list of Msgs that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 13; +} + +// ProposalStatus defines proposal statuses. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is invalid and not allowed. + PROPOSAL_STATUS_UNSPECIFIED = 0; + + // Initial status of a proposal when persisted. + PROPOSAL_STATUS_SUBMITTED = 1; + + // Final status of a proposal when the final tally was executed. + PROPOSAL_STATUS_CLOSED = 2; + + // Final status of a proposal when the group was modified before the final tally. + PROPOSAL_STATUS_ABORTED = 3; + + // A proposal can be deleted before the voting start time by the owner. When this happens the final status + // is Withdrawn. + PROPOSAL_STATUS_WITHDRAWN = 4; +} + +// ProposalResult defines types of proposal results. +enum ProposalResult { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is invalid and not allowed + PROPOSAL_RESULT_UNSPECIFIED = 0; + + // Until a final tally has happened the status is unfinalized + PROPOSAL_RESULT_UNFINALIZED = 1; + + // Final result of the tally + PROPOSAL_RESULT_ACCEPTED = 2; + + // Final result of the tally + PROPOSAL_RESULT_REJECTED = 3; +} + +// ProposalExecutorResult defines types of proposal executor results. +enum ProposalExecutorResult { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is not allowed. + PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0; + + // We have not yet run the executor. + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1; + + // The executor was successful and proposed action updated state. + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2; + + // The executor returned an error and proposed action didn't update state. + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3; +} + +// TallyResult represents the sum of weighted votes for each vote option. +message TallyResult { + option (gogoproto.goproto_getters) = false; + + // yes_count is the weighted sum of yes votes. + string yes_count = 1; + + // abstain_count is the weighted sum of abstainers. + string abstain_count = 2; + + // no is the weighted sum of no votes. + string no_count = 3; + + // no_with_veto_count is the weighted sum of veto. + string no_with_veto_count = 4; +} + +// Vote represents a vote for a proposal. +message Vote { + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // voter is the account address of the voter. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata to attached to the vote. + string metadata = 4; + + // submit_time is the timestamp when the vote was submitted. + google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/genesis.proto new file mode 100644 index 00000000..4e783fb5 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/mint/v1beta1/mint.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// GenesisState defines the mint module's genesis state. +message GenesisState { + // minter is a space for holding current inflation information. + Minter minter = 1 [(gogoproto.nullable) = false]; + + // params defines all the paramaters of the module. + Params params = 2 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/mint.proto b/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/mint.proto new file mode 100644 index 00000000..9cfe2b76 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/mint.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +// Minter represents the minting state. +message Minter { + // current annual inflation rate + string inflation = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // current annual expected provisions + string annual_provisions = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Params holds parameters for the mint module. +message Params { + option (gogoproto.goproto_stringer) = false; + + // type of coin to mint + string mint_denom = 1; + // maximum annual change in inflation rate + string inflation_rate_change = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // maximum inflation rate + string inflation_max = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // minimum inflation rate + string inflation_min = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // goal of percent bonded atoms + string goal_bonded = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // expected blocks per year + uint64 blocks_per_year = 6; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/query.proto new file mode 100644 index 00000000..acd341d7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/mint/v1beta1/query.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/mint/v1beta1/mint.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/params"; + } + + // Inflation returns the current minting inflation value. + rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; + } + + // AnnualProvisions current minting annual provisions value. + rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryInflationRequest is the request type for the Query/Inflation RPC method. +message QueryInflationRequest {} + +// QueryInflationResponse is the response type for the Query/Inflation RPC +// method. +message QueryInflationResponse { + // inflation is the current minting inflation value. + bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// QueryAnnualProvisionsRequest is the request type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsRequest {} + +// QueryAnnualProvisionsResponse is the response type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsResponse { + // annual_provisions is the current minting annual provisions value. + bytes annual_provisions = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/msg/v1/msg.proto b/dydxjs/packages/dydxjs/proto/cosmos/msg/v1/msg.proto new file mode 100644 index 00000000..89bdf312 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/msg/v1/msg.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package cosmos.msg.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice"; + +extend google.protobuf.MessageOptions { + // signer must be used in cosmos messages in order + // to signal to external clients which fields in a + // given cosmos message must be filled with signer + // information (address). + // The field must be the protobuf name of the message + // field extended with this MessageOption. + // The field must either be of string kind, or of message + // kind in case the signer information is contained within + // a message inside the cosmos message. + repeated string signer = 11110000; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/event.proto b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/event.proto new file mode 100644 index 00000000..96964f08 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/event.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// EventSend is emitted on Msg/Send +message EventSend { + string class_id = 1; + string id = 2; + string sender = 3; + string receiver = 4; +} + +// EventMint is emitted on Mint +message EventMint { + string class_id = 1; + string id = 2; + string owner = 3; +} + +// EventBurn is emitted on Burn +message EventBurn { + string class_id = 1; + string id = 2; + string owner = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/genesis.proto new file mode 100644 index 00000000..6f36ed34 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/genesis.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// GenesisState defines the nft module's genesis state. +message GenesisState { + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + repeated Entry entries = 2; +} + +// Entry Defines all nft owned by a person +message Entry { + // owner is the owner address of the following nft + string owner = 1; + + // nfts is a group of nfts of the same owner + repeated cosmos.nft.v1beta1.NFT nfts = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/nft.proto b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/nft.proto new file mode 100644 index 00000000..b1241260 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/nft.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// Class defines the class of the nft type. +message Class { + // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + string id = 1; + + // name defines the human-readable name of the NFT classification. Optional + string name = 2; + + // symbol is an abbreviated name for nft classification. Optional + string symbol = 3; + + // description is a brief description of nft classification. Optional + string description = 4; + + // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + string uri = 5; + + // uri_hash is a hash of the document pointed by uri. Optional + string uri_hash = 6; + + // data is the app specific metadata of the NFT class. Optional + google.protobuf.Any data = 7; +} + +// NFT defines the NFT. +message NFT { + // class_id associated with the NFT, similar to the contract address of ERC721 + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; + + // uri for the NFT metadata stored off chain + string uri = 3; + + // uri_hash is a hash of the document pointed by uri + string uri_hash = 4; + + // data is an app specific data of the NFT. Optional + google.protobuf.Any data = 10; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/query.proto new file mode 100644 index 00000000..c1d8070f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/query.proto @@ -0,0 +1,125 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/balance/{owner}/{class_id}"; + } + + // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + rpc Owner(QueryOwnerRequest) returns (QueryOwnerResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/owner/{class_id}/{id}"; + } + + // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/supply/{class_id}"; + } + + // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in + // ERC721Enumerable + rpc NFTs(QueryNFTsRequest) returns (QueryNFTsResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts"; + } + + // NFT queries an NFT based on its class and id. + rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts/{class_id}/{id}"; + } + + // Class queries an NFT class based on its id + rpc Class(QueryClassRequest) returns (QueryClassResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes/{class_id}"; + } + + // Classes queries all NFT classes + rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method +message QueryBalanceRequest { + string class_id = 1; + string owner = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method +message QueryBalanceResponse { + uint64 amount = 1; +} + +// QueryOwnerRequest is the request type for the Query/Owner RPC method +message QueryOwnerRequest { + string class_id = 1; + string id = 2; +} + +// QueryOwnerResponse is the response type for the Query/Owner RPC method +message QueryOwnerResponse { + string owner = 1; +} + +// QuerySupplyRequest is the request type for the Query/Supply RPC method +message QuerySupplyRequest { + string class_id = 1; +} + +// QuerySupplyResponse is the response type for the Query/Supply RPC method +message QuerySupplyResponse { + uint64 amount = 1; +} + +// QueryNFTstRequest is the request type for the Query/NFTs RPC method +message QueryNFTsRequest { + string class_id = 1; + string owner = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +message QueryNFTsResponse { + repeated cosmos.nft.v1beta1.NFT nfts = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryNFTRequest is the request type for the Query/NFT RPC method +message QueryNFTRequest { + string class_id = 1; + string id = 2; +} + +// QueryNFTResponse is the response type for the Query/NFT RPC method +message QueryNFTResponse { + cosmos.nft.v1beta1.NFT nft = 1; +} + +// QueryClassRequest is the request type for the Query/Class RPC method +message QueryClassRequest { + string class_id = 1; +} + +// QueryClassResponse is the response type for the Query/Class RPC method +message QueryClassResponse { + cosmos.nft.v1beta1.Class class = 1; +} + +// QueryClassesRequest is the request type for the Query/Classes RPC method +message QueryClassesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClassesResponse is the response type for the Query/Classes RPC method +message QueryClassesResponse { + repeated cosmos.nft.v1beta1.Class classes = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/tx.proto new file mode 100644 index 00000000..95b402ce --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/nft/v1beta1/tx.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the nft Msg service. +service Msg { + // Send defines a method to send a nft from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); +} +// MsgSend represents a message to send a nft from one account to another account. +message MsgSend { + option (cosmos.msg.v1.signer) = "sender"; + + // class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + string class_id = 1; + + // id defines the unique identification of nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3; + + // receiver is the receiver address of nft + string receiver = 4; +} +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/orm/v1/orm.proto b/dydxjs/packages/dydxjs/proto/cosmos/orm/v1/orm.proto new file mode 100644 index 00000000..abfbbd4f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/orm/v1/orm.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package cosmos.orm.v1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + + // table specifies that this message will be used as an ORM table. It cannot + // be used together with the singleton option. + TableDescriptor table = 104503790; + + // singleton specifies that this message will be used as an ORM singleton. It cannot + // be used together with the table option. + SingletonDescriptor singleton = 104503791; +} + +// TableDescriptor describes an ORM table. +message TableDescriptor { + + // primary_key defines the primary key for the table. + PrimaryKeyDescriptor primary_key = 1; + + // index defines one or more secondary indexes. + repeated SecondaryIndexDescriptor index = 2; + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 3; +} + +// PrimaryKeyDescriptor describes a table primary key. +message PrimaryKeyDescriptor { + + // fields is a comma-separated list of fields in the primary key. Spaces are + // not allowed. Supported field types, their encodings, and any applicable constraints + // are described below. + // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers. + // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers such as auto-incrementing sequences. + // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + // sorted iteration. These types are well-suited for encoding fixed with + // decimals as integers. + // - string's are encoded as raw bytes in terminal key segments and null-terminated + // in non-terminal segments. Null characters are thus forbidden in strings. + // string fields support sorted iteration. + // - bytes are encoded as raw bytes in terminal segments and length-prefixed + // with a 32-bit unsigned varint in non-terminal segments. + // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + // an encoding that enables sorted iteration. + // - google.protobuf.Timestamp and google.protobuf.Duration are encoded + // as 12 bytes using an encoding that enables sorted iteration. + // - enum fields are encoded using varint encoding and do not support sorted + // iteration. + // - bool fields are encoded as a single byte 0 or 1. + // + // All other fields types are unsupported in keys including repeated and + // oneof fields. + // + // Primary keys are prefixed by the varint encoded table id and the byte 0x0 + // plus any additional prefix specified by the schema. + string fields = 1; + + // auto_increment specifies that the primary key is generated by an + // auto-incrementing integer. If this is set to true fields must only + // contain one field of that is of type uint64. + bool auto_increment = 2; +} + +// PrimaryKeyDescriptor describes a table secondary index. +message SecondaryIndexDescriptor { + + // fields is a comma-separated list of fields in the index. The supported + // field types are the same as those for PrimaryKeyDescriptor.fields. + // Index keys are prefixed by the varint encoded table id and the varint + // encoded index id plus any additional prefix specified by the schema. + // + // In addition the the field segments, non-unique index keys are suffixed with + // any additional primary key fields not present in the index fields so that the + // primary key can be reconstructed. Unique indexes instead of being suffixed + // store the remaining primary key fields in the value.. + string fields = 1; + + // id is a non-zero integer ID that must be unique within the indexes for this + // table and less than 32768. It may be deprecated in the future when this can + // be auto-generated. + uint32 id = 2; + + // unique specifies that this an unique index. + bool unique = 3; +} + +// TableDescriptor describes an ORM singleton table which has at most one instance. +message SingletonDescriptor { + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 1; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/orm/v1alpha1/schema.proto b/dydxjs/packages/dydxjs/proto/cosmos/orm/v1alpha1/schema.proto new file mode 100644 index 00000000..ab713340 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/orm/v1alpha1/schema.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package cosmos.orm.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module_schema is used to define the ORM schema for an app module. + // All module config messages that use module_schema must also declare + // themselves as app module config messages using the cosmos.app.v1.is_module + // option. + ModuleSchemaDescriptor module_schema = 104503792; +} + +// ModuleSchemaDescriptor describe's a module's ORM schema. +message ModuleSchemaDescriptor { + repeated FileEntry schema_file = 1; + + // FileEntry describes an ORM file used in a module. + message FileEntry { + // id is a prefix that will be varint encoded and prepended to all the + // table keys specified in the file's tables. + uint32 id = 1; + + // proto_file_name is the name of a file .proto in that contains + // table definitions. The .proto file must be in a package that the + // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + string proto_file_name = 2; + + // storage_type optionally indicates the type of storage this file's + // tables should used. If it is left unspecified, the default KV-storage + // of the app will be used. + StorageType storage_type = 3; + } + + // prefix is an optional prefix that precedes all keys in this module's + // store. + bytes prefix = 2; +} + +// StorageType +enum StorageType { + // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent + // KV-storage where primary key entries are stored in merkle-tree + // backed commitment storage and indexes and seqs are stored in + // fast index storage. Note that the Cosmos SDK before store/v2alpha1 + // does not support this. + STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; + + // STORAGE_TYPE_MEMORY indicates in-memory storage that will be + // reloaded every time an app restarts. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_MEMORY = 1; + + // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + // at the end of every block. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_TRANSIENT = 2; + + // STORAGE_TYPE_INDEX indicates persistent storage which is not backed + // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK + // before store/v2alpha1 does not support this. + STORAGE_TYPE_INDEX = 3; + + // STORAGE_TYPE_INDEX indicates persistent storage which is backed by + // a merkle-tree. With this type of storage, both primary and index keys + // will affect the app hash and this is generally less efficient + // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index + // keys into index storage. Note that modules built with the + // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT + // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX + // because this is the only type of persistent storage available. + STORAGE_TYPE_COMMITMENT = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/params/v1beta1/params.proto b/dydxjs/packages/dydxjs/proto/cosmos/params/v1beta1/params.proto new file mode 100644 index 00000000..e5aabfec --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/params/v1beta1/params.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +// ParameterChangeProposal defines a proposal to change one or more parameters. +message ParameterChangeProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + repeated ParamChange changes = 3 [(gogoproto.nullable) = false]; +} + +// ParamChange defines an individual parameter change, for use in +// ParameterChangeProposal. +message ParamChange { + option (gogoproto.goproto_stringer) = false; + + string subspace = 1; + string key = 2; + string value = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/params/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/params/v1beta1/query.proto new file mode 100644 index 00000000..3b1c9a76 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/params/v1beta1/query.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/params/v1beta1/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; + +// Query defines the gRPC querier service. +service Query { + // Params queries a specific parameter of a module, given its subspace and + // key. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/params"; + } + + // Subspaces queries for all registered subspaces and all keys for a subspace. + rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/subspaces"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest { + // subspace defines the module to query the parameter for. + string subspace = 1; + + // key defines the key of the parameter in the subspace. + string key = 2; +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // param defines the queried parameter. + ParamChange param = 1 [(gogoproto.nullable) = false]; +} + +// QuerySubspacesRequest defines a request type for querying for all registered +// subspaces and all keys for a subspace. +message QuerySubspacesRequest {} + +// QuerySubspacesResponse defines the response types for querying for all +// registered subspaces and all keys for a subspace. +message QuerySubspacesResponse { + repeated Subspace subspaces = 1; +} + +// Subspace defines a parameter subspace name and all the keys that exist for +// the subspace. +message Subspace { + string subspace = 1; + repeated string keys = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/genesis.proto new file mode 100644 index 00000000..312d56aa --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/genesis.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; + +// GenesisState defines the slashing module's genesis state. +message GenesisState { + // params defines all the paramaters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false]; + + // signing_infos represents a map between validator addresses and their + // signing infos. + repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false]; + + // missed_blocks represents a map between validator addresses and their + // missed blocks. + repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false]; +} + +// SigningInfo stores validator signing info of corresponding address. +message SigningInfo { + // address is the validator address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_signing_info represents the signing info of this validator. + ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false]; +} + +// ValidatorMissedBlocks contains array of missed blocks of corresponding +// address. +message ValidatorMissedBlocks { + // address is the validator address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // missed_blocks is an array of missed blocks by the validator. + repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false]; +} + +// MissedBlock contains height and missed status as boolean. +message MissedBlock { + // index is the height at which the block was missed. + int64 index = 1; + // missed is the missed status. + bool missed = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/query.proto new file mode 100644 index 00000000..f742c1f8 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/query.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +// Query provides defines the gRPC querier service +service Query { + // Params queries the parameters of slashing module + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; + } + + // SigningInfo queries the signing info of given cons address + rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; + } + + // SigningInfos queries signing info of all validators + rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC +// method +message QuerySigningInfoRequest { + // cons_address is the address to query signing info of + string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC +// method +message QuerySigningInfoResponse { + // val_signing_info is the signing info of requested val cons address + ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false]; +} + +// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC +// method +message QuerySigningInfosRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC +// method +message QuerySigningInfosResponse { + // info is the signing info of all validators + repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/slashing.proto b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/slashing.proto new file mode 100644 index 00000000..0aa9f61f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/slashing.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +// ValidatorSigningInfo defines a validator's signing info for monitoring their +// liveness activity. +message ValidatorSigningInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Height at which validator was first a candidate OR was unjailed + int64 start_height = 2; + // Index which is incremented each time the validator was a bonded + // in a block and may have signed a precommit or not. This in conjunction with the + // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + int64 index_offset = 3; + // Timestamp until which the validator is jailed due to liveness downtime. + google.protobuf.Timestamp jailed_until = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // Whether or not a validator has been tombstoned (killed out of validator set). It is set + // once the validator commits an equivocation or for any other configured misbehiavor. + bool tombstoned = 5; + // A counter kept to avoid unnecessary array reads. + // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + int64 missed_blocks_counter = 6; +} + +// Params represents the parameters used for by the slashing module. +message Params { + int64 signed_blocks_window = 1; + bytes min_signed_per_window = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration downtime_jail_duration = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + bytes slash_fraction_double_sign = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes slash_fraction_downtime = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/tx.proto new file mode 100644 index 00000000..7c90304b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/slashing/v1beta1/tx.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the slashing Msg service. +service Msg { + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); +} + +// MsgUnjail defines the Msg/Unjail request type +message MsgUnjail { + option (cosmos.msg.v1.signer) = "validator_addr"; + + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "address"]; +} + +// MsgUnjailResponse defines the Msg/Unjail response type +message MsgUnjailResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/authz.proto b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/authz.proto new file mode 100644 index 00000000..981da1db --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/authz.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// StakeAuthorization defines authorization for delegate/undelegate/redelegate. +// +// Since: cosmos-sdk 0.43 +message StakeAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + + // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + // empty, there is no spend limit and any amount of coins can be delegated. + cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + // validators is the oneof that represents either allow_list or deny_list + oneof validators { + // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + // account. + Validators allow_list = 2; + // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. + Validators deny_list = 3; + } + // Validators defines list of validator addresses. + message Validators { + repeated string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + } + // authorization_type defines one of AuthorizationType. + AuthorizationType authorization_type = 4; +} + +// AuthorizationType defines the type of staking module authorization type +// +// Since: cosmos-sdk 0.43 +enum AuthorizationType { + // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type + AUTHORIZATION_TYPE_UNSPECIFIED = 0; + // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate + AUTHORIZATION_TYPE_DELEGATE = 1; + // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + AUTHORIZATION_TYPE_UNDELEGATE = 2; + // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate + AUTHORIZATION_TYPE_REDELEGATE = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/genesis.proto new file mode 100644 index 00000000..bf3c298e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/genesis.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; + +// GenesisState defines the staking module's genesis state. +message GenesisState { + // params defines all the paramaters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false]; + + // last_total_power tracks the total amounts of bonded tokens recorded during + // the previous end block. + bytes last_total_power = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + + // last_validator_powers is a special index that provides a historical list + // of the last-block's bonded validators. + repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false]; + + // delegations defines the validator set at genesis. + repeated Validator validators = 4 [(gogoproto.nullable) = false]; + + // delegations defines the delegations active at genesis. + repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; + + // unbonding_delegations defines the unbonding delegations active at genesis. + repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false]; + + // redelegations defines the redelegations active at genesis. + repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; + + bool exported = 8; +} + +// LastValidatorPower required for validator set update logic. +message LastValidatorPower { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the validator. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // power defines the power of the validator. + int64 power = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/query.proto new file mode 100644 index 00000000..02469232 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/query.proto @@ -0,0 +1,349 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Query defines the gRPC querier service. +service Query { + // Validators queries all validators that match the given status. + rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; + } + + // Validator queries validator info for given validator address. + rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; + } + + // ValidatorDelegations queries delegate info for given validator. + rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; + } + + // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) + returns (QueryValidatorUnbondingDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" + "{validator_addr}/unbonding_delegations"; + } + + // Delegation queries delegate info for given validator delegator pair. + rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}"; + } + + // UnbondingDelegation queries unbonding info for given validator delegator + // pair. + rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}/unbonding_delegation"; + } + + // DelegatorDelegations queries all delegations of a given delegator address. + rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; + } + + // DelegatorUnbondingDelegations queries all unbonding delegations of a given + // delegator address. + rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) + returns (QueryDelegatorUnbondingDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" + "{delegator_addr}/unbonding_delegations"; + } + + // Redelegations queries redelegations of given address. + rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; + } + + // DelegatorValidators queries all validators info for given delegator + // address. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; + } + + // DelegatorValidator queries validator info for given delegator validator + // pair. + rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" + "{validator_addr}"; + } + + // HistoricalInfo queries the historical info for given height. + rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; + } + + // Pool queries the pool info. + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; + } + + // Parameters queries the staking parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + } +} + +// QueryValidatorsRequest is request type for Query/Validators RPC method. +message QueryValidatorsRequest { + // status enables to query for validators matching a given status. + string status = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorsResponse is response type for the Query/Validators RPC method +message QueryValidatorsResponse { + // validators contains all the queried validators. + repeated Validator validators = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorRequest is response type for the Query/Validator RPC method +message QueryValidatorRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorResponse is response type for the Query/Validator RPC method +message QueryValidatorResponse { + // validator defines the the validator info. + Validator validator = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorDelegationsRequest is request type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorDelegationsResponse is response type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsResponse { + repeated DelegationResponse delegation_responses = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorUnbondingDelegationsRequest is required type for the +// Query/ValidatorUnbondingDelegations RPC method +message QueryValidatorUnbondingDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorUnbondingDelegationsResponse is response type for the +// Query/ValidatorUnbondingDelegations RPC method. +message QueryValidatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRequest is request type for the Query/Delegation RPC method. +message QueryDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationResponse is response type for the Query/Delegation RPC method. +message QueryDelegationResponse { + // delegation_responses defines the delegation info of a delegation. + DelegationResponse delegation_response = 1; +} + +// QueryUnbondingDelegationRequest is request type for the +// Query/UnbondingDelegation RPC method. +message QueryUnbondingDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationResponse is response type for the Query/UnbondingDelegation +// RPC method. +message QueryUnbondingDelegationResponse { + // unbond defines the unbonding information of a delegation. + UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false]; +} + +// QueryDelegatorDelegationsRequest is request type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorDelegationsResponse is response type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsResponse { + // delegation_responses defines all the delegations' info of a delegator. + repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorUnbondingDelegationsRequest is request type for the +// Query/DelegatorUnbondingDelegations RPC method. +message QueryDelegatorUnbondingDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryUnbondingDelegatorDelegationsResponse is response type for the +// Query/UnbondingDelegatorDelegations RPC method. +message QueryDelegatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRedelegationsRequest is request type for the Query/Redelegations RPC +// method. +message QueryRedelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // src_validator_addr defines the validator address to redelegate from. + string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // dst_validator_addr defines the validator address to redelegate to. + string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryRedelegationsResponse is response type for the Query/Redelegations RPC +// method. +message QueryRedelegationsResponse { + repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorsRequest is request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorValidatorsResponse is response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + // validators defines the the validators' info of a delegator. + repeated Validator validators = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorRequest is request type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorValidatorResponse response type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorResponse { + // validator defines the the validator info. + Validator validator = 1 [(gogoproto.nullable) = false]; +} + +// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoRequest { + // height defines at which height to query the historical info. + int64 height = 1; +} + +// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoResponse { + // hist defines the historical info at the given height. + HistoricalInfo hist = 1; +} + +// QueryPoolRequest is request type for the Query/Pool RPC method. +message QueryPoolRequest {} + +// QueryPoolResponse is response type for the Query/Pool RPC method. +message QueryPoolResponse { + // pool defines the pool info. + Pool pool = 1 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/staking.proto b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/staking.proto new file mode 100644 index 00000000..dcf2645f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/staking.proto @@ -0,0 +1,358 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "tendermint/types/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// HistoricalInfo contains header and validator information for a given block. +// It is stored as part of staking module's state, which persists the `n` most +// recent HistoricalInfo +// (`n` is set by the staking module's `historical_entries` parameter). +message HistoricalInfo { + tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; + repeated Validator valset = 2 [(gogoproto.nullable) = false]; +} + +// CommissionRates defines the initial commission rates to be used for creating +// a validator. +message CommissionRates { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // rate is the commission rate charged to delegators, as a fraction. + string rate = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. + string max_rate = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. + string max_change_rate = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Commission defines commission parameters for a given validator. +message Commission { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // commission_rates defines the initial commission rates to be used for creating a validator. + CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // update_time is the last time the commission rate was changed. + google.protobuf.Timestamp update_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// Description defines a validator description. +message Description { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // moniker defines a human-readable name for the validator. + string moniker = 1; + // identity defines an optional identity signature (ex. UPort or Keybase). + string identity = 2; + // website defines an optional website link. + string website = 3; + // security_contact defines an optional email for security contact. + string security_contact = 4; + // details define other optional details. + string details = 5; +} + +// Validator defines a validator, together with the total amount of the +// Validator's bond shares and their exchange rate to coins. Slashing results in +// a decrease in the exchange rate, allowing correct calculation of future +// undelegations without iterating over delegators. When coins are delegated to +// this validator, the validator is credited with a delegation whose number of +// bond shares is based on the amount of coins delegated divided by the current +// exchange rate. Voting power can be calculated as total bonded shares +// multiplied by exchange rate. +message Validator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech encoded in JSON. + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. + google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + // jailed defined whether the validator has been jailed from bonded status or not. + bool jailed = 3; + // status is the validator status (bonded/unbonding/unbonded). + BondStatus status = 4; + // tokens define the delegated tokens (incl. self-delegation). + string tokens = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // delegator_shares defines total shares issued to a validator's delegators. + string delegator_shares = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // description defines the description terms for the validator. + Description description = 7 [(gogoproto.nullable) = false]; + // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. + int64 unbonding_height = 8; + // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. + google.protobuf.Timestamp unbonding_time = 9 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // commission defines the commission parameters. + Commission commission = 10 [(gogoproto.nullable) = false]; + // min_self_delegation is the validator's self declared minimum self delegation. + string min_self_delegation = 11 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// BondStatus is the status of a validator. +enum BondStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an invalid validator status. + BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + // UNBONDED defines a validator that is not bonded. + BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; + // UNBONDING defines a validator that is unbonding. + BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; + // BONDED defines a validator that is bonded. + BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; +} + +// ValAddresses defines a repeated set of validator addresses. +message ValAddresses { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = true; + + repeated string addresses = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVPair is struct that just has a delegator-validator pair with no other data. +// It is intended to be used as a marshalable pointer. For example, a DVPair can +// be used to construct the key to getting an UnbondingDelegation from state. +message DVPair { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVPairs defines an array of DVPair objects. +message DVPairs { + repeated DVPair pairs = 1 [(gogoproto.nullable) = false]; +} + +// DVVTriplet is struct that just has a delegator-validator-validator triplet +// with no other data. It is intended to be used as a marshalable pointer. For +// example, a DVVTriplet can be used to construct the key to getting a +// Redelegation from state. +message DVVTriplet { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVVTriplets defines an array of DVVTriplet objects. +message DVVTriplets { + repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false]; +} + +// Delegation represents the bond with tokens held by an account. It is +// owned by one delegator, and is associated with the voting power of one +// validator. +message Delegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // shares define the delegation shares received. + string shares = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// UnbondingDelegation stores all of a single delegator's unbonding bonds +// for a single validator in an time-ordered list. +message UnbondingDelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // entries are the unbonding delegation entries. + repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries +} + +// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +message UnbondingDelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height is the height which the unbonding took place. + int64 creation_height = 1; + // completion_time is the unix time for unbonding completion. + google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // initial_balance defines the tokens initially scheduled to receive at completion. + string initial_balance = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // balance defines the tokens to receive at completion. + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// RedelegationEntry defines a redelegation object with relevant metadata. +message RedelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height defines the height which the redelegation took place. + int64 creation_height = 1; + // completion_time defines the unix time for redelegation completion. + google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // initial_balance defines the initial balance when redelegation started. + string initial_balance = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // shares_dst is the amount of destination-validator shares created by redelegation. + string shares_dst = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Redelegation contains the list of a particular delegator's redelegating bonds +// from a particular source validator to a particular destination validator. +message Redelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_src_address is the validator redelegation source operator address. + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_dst_address is the validator redelegation destination operator address. + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // entries are the redelegation entries. + repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries +} + +// Params defines the parameters for the staking module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // unbonding_time is the time duration of unbonding. + google.protobuf.Duration unbonding_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + // max_validators is the maximum number of validators. + uint32 max_validators = 2; + // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + uint32 max_entries = 3; + // historical_entries is the number of historical entries to persist. + uint32 historical_entries = 4; + // bond_denom defines the bondable coin denomination. + string bond_denom = 5; + // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators + string min_commission_rate = 6 [ + (gogoproto.moretags) = "yaml:\"min_commission_rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// DelegationResponse is equivalent to Delegation except that it contains a +// balance in addition to shares which is more suitable for client responses. +message DelegationResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + + Delegation delegation = 1 [(gogoproto.nullable) = false]; + + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; +} + +// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +// contains a balance in addition to shares which is more suitable for client +// responses. +message RedelegationEntryResponse { + option (gogoproto.equal) = true; + + RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// RedelegationResponse is equivalent to a Redelegation except that its entries +// contain a balance in addition to shares which is more suitable for client +// responses. +message RedelegationResponse { + option (gogoproto.equal) = false; + + Redelegation redelegation = 1 [(gogoproto.nullable) = false]; + repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false]; +} + +// Pool is used for tracking bonded and not-bonded token supply of the bond +// denomination. +message Pool { + option (gogoproto.description) = true; + option (gogoproto.equal) = true; + string not_bonded_tokens = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "not_bonded_tokens" + ]; + string bonded_tokens = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "bonded_tokens" + ]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/tx.proto new file mode 100644 index 00000000..6c8d40a7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/staking/v1beta1/tx.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Msg defines the staking Msg service. +service Msg { + // CreateValidator defines a method for creating a new validator. + rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); + + // EditValidator defines a method for editing an existing validator. + rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); + + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); + + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); +} + +// MsgCreateValidator defines a SDK message for creating a new validator. +message MsgCreateValidator { + // NOTE(fdymylja): this is a particular case in which + // if validator_address == delegator_address then only one + // is expected to sign, otherwise both are. + option (cosmos.msg.v1.signer) = "delegator_address"; + option (cosmos.msg.v1.signer) = "validator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false]; + CommissionRates commission = 2 [(gogoproto.nullable) = false]; + string min_self_delegation = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; +} + +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +message MsgCreateValidatorResponse {} + +// MsgEditValidator defines a SDK message for editing an existing validator. +message MsgEditValidator { + option (cosmos.msg.v1.signer) = "validator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // We pass a reference to the new commission rate and min self delegation as + // it's not mandatory to update. If not updated, the deserialized rate will be + // zero with no way to distinguish if an update was intended. + // REF: #2373 + string commission_rate = 3 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + string min_self_delegation = 4 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; +} + +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +message MsgEditValidatorResponse {} + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message MsgDelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; +} + +// MsgDelegateResponse defines the Msg/Delegate response type. +message MsgDelegateResponse {} + +// MsgBeginRedelegate defines a SDK message for performing a redelegation +// of coins from a delegator and source validator to a destination validator. +message MsgBeginRedelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; +} + +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +message MsgBeginRedelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a +// delegate and a validator. +message MsgUndelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; +} + +// MsgUndelegateResponse defines the Msg/Undelegate response type. +message MsgUndelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/tx/signing/v1beta1/signing.proto b/dydxjs/packages/dydxjs/proto/cosmos/tx/signing/v1beta1/signing.proto new file mode 100644 index 00000000..5a22616f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; +package cosmos.tx.signing.v1beta1; + +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; + +// SignMode represents a signing mode with its own security guarantees. +// +// This enum should be considered a registry of all known sign modes +// in the Cosmos ecosystem. Apps are not expected to support all known +// sign modes. Apps that would like to support custom sign modes are +// encouraged to open a small PR against this file to add a new case +// to this SignMode enum describing their sign mode so that different +// apps have a consistent version of this enum. +enum SignMode { + // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + // rejected. + SIGN_MODE_UNSPECIFIED = 0; + + // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + // verified with raw bytes from Tx. + SIGN_MODE_DIRECT = 1; + + // SIGN_MODE_TEXTUAL is a future signing mode that will verify some + // human-readable textual representation on top of the binary representation + // from SIGN_MODE_DIRECT. It is currently not supported. + SIGN_MODE_TEXTUAL = 2; + + // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + // require signers signing over other signers' `signer_info`. It also allows + // for adding Tips in transactions. + // + // Since: cosmos-sdk 0.46 + SIGN_MODE_DIRECT_AUX = 3; + + // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + // Amino JSON and will be removed in the future. + SIGN_MODE_LEGACY_AMINO_JSON = 127; +} + +// SignatureDescriptors wraps multiple SignatureDescriptor's. +message SignatureDescriptors { + // signatures are the signature descriptors + repeated SignatureDescriptor signatures = 1; +} + +// SignatureDescriptor is a convenience type which represents the full data for +// a signature including the public key of the signer, signing modes and the +// signature itself. It is primarily used for coordinating signatures between +// clients. +message SignatureDescriptor { + // public_key is the public key of the signer + google.protobuf.Any public_key = 1; + + Data data = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to prevent + // replay attacks. + uint64 sequence = 3; + + // Data represents signature data + message Data { + // sum is the oneof that specifies whether this represents single or multi-signature data + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a multisig signer + Multi multi = 2; + } + + // Single is the signature data for a single signer + message Single { + // mode is the signing mode of the single signer + SignMode mode = 1; + + // signature is the raw signature bytes + bytes signature = 2; + } + + // Multi is the signature data for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // signatures is the signatures of the multi-signature + repeated Data signatures = 2; + } + } +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/tx/v1beta1/service.proto b/dydxjs/packages/dydxjs/proto/cosmos/tx/v1beta1/service.proto new file mode 100644 index 00000000..e7af1526 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/tx/v1beta1/service.proto @@ -0,0 +1,163 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/abci/v1beta1/abci.proto"; +import "cosmos/tx/v1beta1/tx.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "tendermint/types/block.proto"; +import "tendermint/types/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Service defines a gRPC service for interacting with transactions. +service Service { + // Simulate simulates executing a transaction for estimating gas usage. + rpc Simulate(SimulateRequest) returns (SimulateResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/simulate" + body: "*" + }; + } + // GetTx fetches a tx by hash. + rpc GetTx(GetTxRequest) returns (GetTxResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; + } + // BroadcastTx broadcast transaction. + rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/txs" + body: "*" + }; + } + // GetTxsEvent fetches txs by event. + rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; + } + // GetBlockWithTxs fetches a block with decoded txs. + // + // Since: cosmos-sdk 0.45.2 + rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; + } +} + +// GetTxsEventRequest is the request type for the Service.TxsByEvents +// RPC method. +message GetTxsEventRequest { + // events is the list of transaction event type. + repeated string events = 1; + // pagination defines a pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; + OrderBy order_by = 3; +} + +// OrderBy defines the sorting order +enum OrderBy { + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + ORDER_BY_UNSPECIFIED = 0; + // ORDER_BY_ASC defines ascending order + ORDER_BY_ASC = 1; + // ORDER_BY_DESC defines descending order + ORDER_BY_DESC = 2; +} + +// GetTxsEventResponse is the response type for the Service.TxsByEvents +// RPC method. +message GetTxsEventResponse { + // txs is the list of queried transactions. + repeated cosmos.tx.v1beta1.Tx txs = 1; + // tx_responses is the list of queried TxResponses. + repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; + // pagination defines a pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +// RPC method. +message BroadcastTxRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; + BroadcastMode mode = 2; +} + +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +enum BroadcastMode { + // zero-value for mode ordering + BROADCAST_MODE_UNSPECIFIED = 0; + // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + // the tx to be committed in a block. + BROADCAST_MODE_BLOCK = 1; + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + // a CheckTx execution response only. + BROADCAST_MODE_SYNC = 2; + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + // immediately. + BROADCAST_MODE_ASYNC = 3; +} + +// BroadcastTxResponse is the response type for the +// Service.BroadcastTx method. +message BroadcastTxResponse { + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 1; +} + +// SimulateRequest is the request type for the Service.Simulate +// RPC method. +message SimulateRequest { + // tx is the transaction to simulate. + // Deprecated. Send raw tx bytes instead. + cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; + // tx_bytes is the raw transaction. + // + // Since: cosmos-sdk 0.43 + bytes tx_bytes = 2; +} + +// SimulateResponse is the response type for the +// Service.SimulateRPC method. +message SimulateResponse { + // gas_info is the information about gas used in the simulation. + cosmos.base.abci.v1beta1.GasInfo gas_info = 1; + // result is the result of the simulation. + cosmos.base.abci.v1beta1.Result result = 2; +} + +// GetTxRequest is the request type for the Service.GetTx +// RPC method. +message GetTxRequest { + // hash is the tx hash to query, encoded as a hex string. + string hash = 1; +} + +// GetTxResponse is the response type for the Service.GetTx method. +message GetTxResponse { + // tx is the queried transaction. + cosmos.tx.v1beta1.Tx tx = 1; + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 2; +} + +// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs +// RPC method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsRequest { + // height is the height of the block to query. + int64 height = 1; + // pagination defines a pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsResponse { + // txs are the transactions in the block. + repeated cosmos.tx.v1beta1.Tx txs = 1; + .tendermint.types.BlockID block_id = 2; + .tendermint.types.Block block = 3; + // pagination defines a pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 4; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/tx/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/tx/v1beta1/tx.proto new file mode 100644 index 00000000..ac7b690f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/tx/v1beta1/tx.proto @@ -0,0 +1,249 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/tx/signing/v1beta1/signing.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Tx is the standard type used for broadcasting transactions. +message Tx { + // body is the processable content of the transaction + TxBody body = 1; + + // auth_info is the authorization related content of the transaction, + // specifically signers, signer modes and fee + AuthInfo auth_info = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// TxRaw is a variant of Tx that pins the signer's exact binary representation +// of body and auth_info. This is used for signing, broadcasting and +// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and +// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used +// as the transaction ID. +message TxRaw { + // body_bytes is a protobuf serialization of a TxBody that matches the + // representation in SignDoc. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in SignDoc. + bytes auth_info_bytes = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +message SignDoc { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in TxRaw. + bytes auth_info_bytes = 2; + + // chain_id is the unique identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker + string chain_id = 3; + + // account_number is the account number of the account in state + uint64 account_number = 4; +} + +// SignDocDirectAux is the type used for generating sign bytes for +// SIGN_MODE_DIRECT_AUX. +// +// Since: cosmos-sdk 0.46 +message SignDocDirectAux { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // public_key is the public key of the signing account. + google.protobuf.Any public_key = 2; + + // chain_id is the identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker. + string chain_id = 3; + + // account_number is the account number of the account in state. + uint64 account_number = 4; + + // sequence is the sequence number of the signing account. + uint64 sequence = 5; + + // Tip is the optional tip used for meta-transactions. It should be left + // empty if the signer is not the tipper for this transaction. + Tip tip = 6; +} + +// TxBody is the body of a transaction that all signers sign over. +message TxBody { + // messages is a list of messages to be executed. The required signers of + // those messages define the number and order of elements in AuthInfo's + // signer_infos and Tx's signatures. Each required signer address is added to + // the list only the first time it occurs. + // By convention, the first required signer (usually from the first message) + // is referred to as the primary signer and pays the fee for the whole + // transaction. + repeated google.protobuf.Any messages = 1; + + // memo is any arbitrary note/comment to be added to the transaction. + // WARNING: in clients, any publicly exposed text should not be called memo, + // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + string memo = 2; + + // timeout is the block height after which this transaction will not + // be processed by the chain + uint64 timeout_height = 3; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, the transaction will be rejected + repeated google.protobuf.Any extension_options = 1023; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, they will be ignored + repeated google.protobuf.Any non_critical_extension_options = 2047; +} + +// AuthInfo describes the fee and signer modes that are used to sign a +// transaction. +message AuthInfo { + // signer_infos defines the signing modes for the required signers. The number + // and order of elements must match the required signers from TxBody's + // messages. The first element is the primary signer and the one which pays + // the fee. + repeated SignerInfo signer_infos = 1; + + // Fee is the fee and gas limit for the transaction. The first signer is the + // primary signer and the one which pays the fee. The fee can be calculated + // based on the cost of evaluating the body and doing signature verification + // of the signers. This can be estimated via simulation. + Fee fee = 2; + + // Tip is the optional tip used for meta-transactions. + // + // Since: cosmos-sdk 0.46 + Tip tip = 3; +} + +// SignerInfo describes the public key and signing mode of a single top-level +// signer. +message SignerInfo { + // public_key is the public key of the signer. It is optional for accounts + // that already exist in state. If unset, the verifier can use the required \ + // signer address for this position and lookup the public key. + google.protobuf.Any public_key = 1; + + // mode_info describes the signing mode of the signer and is a nested + // structure to support nested multisig pubkey's + ModeInfo mode_info = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to + // prevent replay attacks. + uint64 sequence = 3; +} + +// ModeInfo describes the signing mode of a single or nested multisig signer. +message ModeInfo { + // sum is the oneof that specifies whether this represents a single or nested + // multisig signer + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a nested multisig signer + Multi multi = 2; + } + + // Single is the mode info for a single signer. It is structured as a message + // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + // future + message Single { + // mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 1; + } + + // Multi is the mode info for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // mode_infos is the corresponding modes of the signers of the multisig + // which could include nested multisig public keys + repeated ModeInfo mode_infos = 2; + } +} + +// Fee includes the amount of coins paid in fees and the maximum +// gas to be used by the transaction. The ratio yields an effective "gasprice", +// which must be above some miminum to be accepted into the mempool. +message Fee { + // amount is the amount of coins to be paid as a fee + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // gas_limit is the maximum gas that can be used in transaction processing + // before an out of gas error occurs + uint64 gas_limit = 2; + + // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + // the payer must be a tx signer (and thus have signed this field in AuthInfo). + // setting this field does *not* change the ordering of required signers for the transaction. + string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + // not support fee grants, this will fail + string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// Tip is the tip used for meta-transactions. +// +// Since: cosmos-sdk 0.46 +message Tip { + // amount is the amount of the tip + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // tipper is the address of the account paying for the tip + string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a +// tipper) builds and sends to the fee payer (who will build and broadcast the +// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected +// by the node if sent directly as-is. +// +// Since: cosmos-sdk 0.46 +message AuxSignerData { + // address is the bech32-encoded address of the auxiliary signer. If using + // AuxSignerData across different chains, the bech32 prefix of the target + // chain (where the final transaction is broadcasted) should be used. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer + // signs. Note: we use the same sign doc even if we're signing with + // LEGACY_AMINO_JSON. + SignDocDirectAux sign_doc = 2; + // mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 3; + // sig is the signature of the sign doc. + bytes sig = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/query.proto b/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/query.proto new file mode 100644 index 00000000..e8c4baa0 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/query.proto @@ -0,0 +1,120 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; + +// Query defines the gRPC upgrade querier service. +service Query { + // CurrentPlan queries the current upgrade plan. + rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan"; + } + + // AppliedPlan queries a previously applied upgrade plan by its name. + rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}"; + } + + // UpgradedConsensusState queries the consensus state that will serve + // as a trusted kernel for the next version of this chain. It will only be + // stored at the last height of this chain. + // UpgradedConsensusState RPC not supported with legacy querier + // This rpc is deprecated now that IBC has its own replacement + // (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { + option deprecated = true; + option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}"; + } + + // ModuleVersions queries the list of module versions from state. + // + // Since: cosmos-sdk 0.43 + rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; + } + + // Returns the account with authority to conduct upgrades + rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority"; + } +} + +// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanRequest {} + +// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanResponse { + // plan is the current upgrade plan. + Plan plan = 1; +} + +// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanRequest { + // name is the name of the applied plan to query for. + string name = 1; +} + +// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanResponse { + // height is the block height at which the plan was applied. + int64 height = 1; +} + +// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateRequest { + option deprecated = true; + + // last height of the current chain must be sent in request + // as this is the height under which next consensus state is stored + int64 last_height = 1; +} + +// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateResponse { + option deprecated = true; + reserved 1; + + // Since: cosmos-sdk 0.43 + bytes upgraded_consensus_state = 2; +} + +// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions +// RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryModuleVersionsRequest { + // module_name is a field to query a specific module + // consensus version from state. Leaving this empty will + // fetch the full list of module versions from state + string module_name = 1; +} + +// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions +// RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryModuleVersionsResponse { + // module_versions is a list of module names with their consensus versions. + repeated ModuleVersion module_versions = 1; +} + +// QueryAuthorityRequest is the request type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityRequest {} + +// QueryAuthorityResponse is the response type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityResponse { + string address = 1; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/tx.proto new file mode 100644 index 00000000..9b04bf44 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/tx.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; + +// Msg defines the upgrade Msg service. +service Msg { + // SoftwareUpgrade is a governance operation for initiating a software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse); + // CancelUpgrade is a governance operation for cancelling a previously + // approvid software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse); +} + +// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // plan is the upgrade plan. + Plan plan = 2 [(gogoproto.nullable) = false]; +} + +// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgradeResponse {} + +// MsgCancelUpgrade is the Msg/CancelUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgradeResponse {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/upgrade.proto b/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/upgrade.proto new file mode 100644 index 00000000..dc15e27c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -0,0 +1,86 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; +option (gogoproto.goproto_getters_all) = false; + +// Plan specifies information about a planned upgrade and when it should occur. +message Plan { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // Sets the name for the upgrade. This name will be used by the upgraded + // version of the software to apply any special "on-upgrade" commands during + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + string name = 1; + + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + // The height at which the upgrade must be performed. + // Only used if Time is not set. + int64 height = 3; + + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; + + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. + google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; +} + +// SoftwareUpgradeProposal is a gov Content type for initiating a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgSoftwareUpgrade. +message SoftwareUpgradeProposal { + option deprecated = true; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + Plan plan = 3 [(gogoproto.nullable) = false]; +} + +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgCancelUpgrade. +message CancelSoftwareUpgradeProposal { + option deprecated = true; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; +} + +// ModuleVersion specifies a module and its consensus version. +// +// Since: cosmos-sdk 0.43 +message ModuleVersion { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // name of the app module + string name = 1; + + // consensus version of the app module + uint64 version = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/vesting/v1beta1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmos/vesting/v1beta1/tx.proto new file mode 100644 index 00000000..211bad09 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/vesting/v1beta1/tx.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/vesting/v1beta1/vesting.proto"; + +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// Msg defines the bank Msg service. +service Msg { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); + // CreatePermanentLockedAccount defines a method that enables creating a permanent + // locked account. + rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse); + // CreatePeriodicVestingAccount defines a method that enables creating a + // periodic vesting account. + rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse); +} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +message MsgCreateVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + + option (gogoproto.equal) = true; + + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + int64 end_time = 4; + bool delayed = 5; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +message MsgCreateVestingAccountResponse {} + +// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent +// locked account. +message MsgCreatePermanentLockedAccount { + option (gogoproto.equal) = true; + + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. +message MsgCreatePermanentLockedAccountResponse {} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +message MsgCreatePeriodicVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + + option (gogoproto.equal) = false; + + string from_address = 1; + string to_address = 2; + int64 start_time = 3; + repeated Period vesting_periods = 4 [(gogoproto.nullable) = false]; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount +// response type. +message MsgCreatePeriodicVestingAccountResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmos/vesting/v1beta1/vesting.proto b/dydxjs/packages/dydxjs/proto/cosmos/vesting/v1beta1/vesting.proto new file mode 100644 index 00000000..824cc30d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos/vesting/v1beta1/vesting.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// BaseVestingAccount implements the VestingAccount interface. It contains all +// the necessary fields needed for any vesting account implementation. +message BaseVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; + repeated cosmos.base.v1beta1.Coin original_vesting = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin delegated_free = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + int64 end_time = 5; +} + +// ContinuousVestingAccount implements the VestingAccount interface. It +// continuously vests by unlocking coins linearly with respect to time. +message ContinuousVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2; +} + +// DelayedVestingAccount implements the VestingAccount interface. It vests all +// coins after a specific time, but non prior. In other words, it keeps them +// locked until a specified time. +message DelayedVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} + +// Period defines a length of time and amount of coins that will vest. +message Period { + option (gogoproto.goproto_stringer) = false; + + int64 length = 1; + repeated cosmos.base.v1beta1.Coin amount = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// PeriodicVestingAccount implements the VestingAccount interface. It +// periodically vests by unlocking coins during each specified period. +message PeriodicVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false]; +} + +// PermanentLockedAccount implements the VestingAccount interface. It does +// not ever release coins, locking them indefinitely. Coins in this account can +// still be used for delegating and for governance votes even while locked. +// +// Since: cosmos-sdk 0.43 +message PermanentLockedAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmos_proto/LICENSE b/dydxjs/packages/dydxjs/proto/cosmos_proto/LICENSE new file mode 100644 index 00000000..6b3e3508 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos_proto/LICENSE @@ -0,0 +1,204 @@ +Pulsar +License: Apache2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 Regen Network Development, Inc. & All in Bits, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos_proto/README.md b/dydxjs/packages/dydxjs/proto/cosmos_proto/README.md new file mode 100644 index 00000000..9599cc65 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos_proto/README.md @@ -0,0 +1 @@ +# cosmos_proto \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmos_proto/cosmos.proto b/dydxjs/packages/dydxjs/proto/cosmos_proto/cosmos.proto new file mode 100644 index 00000000..5c63b86f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmos_proto/cosmos.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; + +extend google.protobuf.MessageOptions { + + // implements_interface is used to indicate the type name of the interface + // that a message implements so that it can be used in google.protobuf.Any + // fields that accept that interface. A message can implement multiple + // interfaces. Interfaces should be declared using a declare_interface + // file option. + repeated string implements_interface = 93001; +} + +extend google.protobuf.FieldOptions { + + // accepts_interface is used to annotate that a google.protobuf.Any + // field accepts messages that implement the specified interface. + // Interfaces should be declared using a declare_interface file option. + string accepts_interface = 93001; + + // scalar is used to indicate that this field follows the formatting defined + // by the named scalar which should be declared with declare_scalar. Code + // generators may choose to use this information to map this field to a + // language-specific type representing the scalar. + string scalar = 93002; +} + +extend google.protobuf.FileOptions { + + // declare_interface declares an interface type to be used with + // accepts_interface and implements_interface. Interface names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given interface type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/interfaces.proto in the file descriptor set. + repeated InterfaceDescriptor declare_interface = 793021; + + // declare_scalar declares a scalar type to be used with + // the scalar field option. Scalar names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given scalar type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/scalars.proto in the file descriptor set. + repeated ScalarDescriptor declare_scalar = 793022; +} + +// InterfaceDescriptor describes an interface type to be used with +// accepts_interface and implements_interface and declared by declare_interface. +message InterfaceDescriptor { + + // name is the name of the interface. It should be a short-name (without + // a period) such that the fully qualified name of the interface will be + // package.name, ex. for the package a.b and interface named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the interface and its + // purpose. + string description = 2; +} + +// ScalarDescriptor describes an scalar type to be used with +// the scalar field option and declared by declare_scalar. +// Scalars extend simple protobuf built-in types with additional +// syntax and semantics, for instance to represent big integers. +// Scalars should ideally define an encoding such that there is only one +// valid syntactical representation for a given semantic meaning, +// i.e. the encoding should be deterministic. +message ScalarDescriptor { + + // name is the name of the scalar. It should be a short-name (without + // a period) such that the fully qualified name of the scalar will be + // package.name, ex. for the package a.b and scalar named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the scalar and its + // encoding format. For instance a big integer or decimal scalar should + // specify precisely the expected encoding format. + string description = 2; + + // field_type is the type of field with which this scalar can be used. + // Scalars can be used with one and only one type of field so that + // encoding standards and simple and clear. Currently only string and + // bytes fields are supported for scalars. + repeated ScalarType field_type = 3; +} + +enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0; + SCALAR_TYPE_STRING = 1; + SCALAR_TYPE_BYTES = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/LICENSE b/dydxjs/packages/dydxjs/proto/cosmwasm/LICENSE new file mode 100644 index 00000000..5a23302b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/LICENSE @@ -0,0 +1,204 @@ +Cosmos-SDK +License: Apache2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 All in Bits, Inc + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/README.md b/dydxjs/packages/dydxjs/proto/cosmwasm/README.md new file mode 100644 index 00000000..63192e81 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/README.md @@ -0,0 +1 @@ +# cosmwasm \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/authz.proto b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/authz.proto new file mode 100644 index 00000000..6d6260c2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/authz.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_getters_all) = false; + +// ContractExecutionAuthorization defines authorization for wasm execute. +// Since: wasmd 0.30 +message ContractExecutionAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + + // Grants for contract executions + repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ]; +} + +// ContractMigrationAuthorization defines authorization for wasm contract +// migration. Since: wasmd 0.30 +message ContractMigrationAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + + // Grants for contract migrations + repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ]; +} + +// ContractGrant a granted permission for a single contract +// Since: wasmd 0.30 +message ContractGrant { + // Contract is the bech32 address of the smart contract + string contract = 1; + + // Limit defines execution limits that are enforced and updated when the grant + // is applied. When the limit lapsed the grant is removed. + google.protobuf.Any limit = 2 + [ (cosmos_proto.accepts_interface) = "ContractAuthzLimitX" ]; + + // Filter define more fine-grained control on the message payload passed + // to the contract in the operation. When no filter applies on execution, the + // operation is prohibited. + google.protobuf.Any filter = 3 + [ (cosmos_proto.accepts_interface) = "ContractAuthzFilterX" ]; +} + +// MaxCallsLimit limited number of calls to the contract. No funds transferable. +// Since: wasmd 0.30 +message MaxCallsLimit { + option (cosmos_proto.implements_interface) = "ContractAuthzLimitX"; + + // Remaining number that is decremented on each execution + uint64 remaining = 1; +} + +// MaxFundsLimit defines the maximal amounts that can be sent to the contract. +// Since: wasmd 0.30 +message MaxFundsLimit { + option (cosmos_proto.implements_interface) = "ContractAuthzLimitX"; + + // Amounts is the maximal amount of tokens transferable to the contract. + repeated cosmos.base.v1beta1.Coin amounts = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// CombinedLimit defines the maximal amounts that can be sent to a contract and +// the maximal number of calls executable. Both need to remain >0 to be valid. +// Since: wasmd 0.30 +message CombinedLimit { + option (cosmos_proto.implements_interface) = "ContractAuthzLimitX"; + + // Remaining number that is decremented on each execution + uint64 calls_remaining = 1; + // Amounts is the maximal amount of tokens transferable to the contract. + repeated cosmos.base.v1beta1.Coin amounts = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// AllowAllMessagesFilter is a wildcard to allow any type of contract payload +// message. +// Since: wasmd 0.30 +message AllowAllMessagesFilter { + option (cosmos_proto.implements_interface) = "ContractAuthzFilterX"; +} + +// AcceptedMessageKeysFilter accept only the specific contract message keys in +// the json object to be executed. +// Since: wasmd 0.30 +message AcceptedMessageKeysFilter { + option (cosmos_proto.implements_interface) = "ContractAuthzFilterX"; + + // Messages is the list of unique keys + repeated string keys = 1; +} + +// AcceptedMessagesFilter accept only the specific raw contract messages to be +// executed. +// Since: wasmd 0.30 +message AcceptedMessagesFilter { + option (cosmos_proto.implements_interface) = "ContractAuthzFilterX"; + + // Messages is the list of raw contract messages + repeated bytes messages = 1 [ (gogoproto.casttype) = "RawContractMessage" ]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/genesis.proto new file mode 100644 index 00000000..4e728ff4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/genesis.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "gogoproto/gogo.proto"; +import "cosmwasm/wasm/v1/types.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; + +// GenesisState - genesis state of x/wasm +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated Code codes = 2 + [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ]; + repeated Contract contracts = 3 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "contracts,omitempty" + ]; + repeated Sequence sequences = 4 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "sequences,omitempty" + ]; +} + +// Code struct encompasses CodeInfo and CodeBytes +message Code { + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + CodeInfo code_info = 2 [ (gogoproto.nullable) = false ]; + bytes code_bytes = 3; + // Pinned to wasmvm cache + bool pinned = 4; +} + +// Contract struct encompasses ContractAddress, ContractInfo, and ContractState +message Contract { + string contract_address = 1; + ContractInfo contract_info = 2 [ (gogoproto.nullable) = false ]; + repeated Model contract_state = 3 [ (gogoproto.nullable) = false ]; + repeated ContractCodeHistoryEntry contract_code_history = 4 + [ (gogoproto.nullable) = false ]; +} + +// Sequence key and value of an id generation counter +message Sequence { + bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ]; + uint64 value = 2; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/ibc.proto b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/ibc.proto new file mode 100644 index 00000000..d880a707 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/ibc.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_getters_all) = false; + +// MsgIBCSend +message MsgIBCSend { + // the channel by which the packet will be sent + string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; + + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + uint64 timeout_height = 4 + [ (gogoproto.moretags) = "yaml:\"timeout_height\"" ]; + // Timeout timestamp (in nanoseconds) relative to the current block timestamp. + // The timeout is disabled when set to 0. + uint64 timeout_timestamp = 5 + [ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ]; + + // Data is the payload to transfer. We must not make assumption what format or + // content is in here. + bytes data = 6; +} + +// MsgIBCCloseChannel port and channel need to be owned by the contract +message MsgIBCCloseChannel { + string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/proposal.proto b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/proposal.proto new file mode 100644 index 00000000..013b4daf --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/proposal.proto @@ -0,0 +1,272 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmwasm/wasm/v1/types.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// StoreCodeProposal gov proposal content type to submit WASM code to the system +message StoreCodeProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // Used in v1beta1 + reserved 5, 6; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 7; + // UnpinCode code on upload, optional + bool unpin_code = 8; + // Source is the URL where the code is hosted + string source = 9; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 10; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 11; +} + +// InstantiateContractProposal gov proposal content type to instantiate a +// contract. +message InstantiateContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3; + // Admin is an optional address that can execute migrations + string admin = 4; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// InstantiateContract2Proposal gov proposal content type to instantiate +// contract 2 +message InstantiateContract2Proposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's enviroment as sender + string run_as = 3; + // Admin is an optional address that can execute migrations + string admin = 4; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encode message to be passed to the contract on instantiation + bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 9; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 10; +} + +// MigrateContractProposal gov proposal content type to migrate a contract. +message MigrateContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Note: skipping 3 as this was previously used for unneeded run_as + + // Contract is the address of the smart contract + string contract = 4; + // CodeID references the new WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Msg json encoded message to be passed to the contract on migration + bytes msg = 6 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// SudoContractProposal gov proposal content type to call sudo on a contract. +message SudoContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3; + // Msg json encoded message to be passed to the contract as sudo + bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// ExecuteContractProposal gov proposal content type to call execute on a +// contract. +message ExecuteContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3; + // Contract is the address of the smart contract + string contract = 4; + // Msg json encoded message to be passed to the contract as execute + bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// UpdateAdminProposal gov proposal content type to set an admin for a contract. +message UpdateAdminProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // NewAdmin address to be set + string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; + // Contract is the address of the smart contract + string contract = 4; +} + +// ClearAdminProposal gov proposal content type to clear the admin of a +// contract. +message ClearAdminProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3; +} + +// PinCodesProposal gov proposal content type to pin a set of code ids in the +// wasmvm cache. +message PinCodesProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // CodeIDs references the new WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// UnpinCodesProposal gov proposal content type to unpin a set of code ids in +// the wasmvm cache. +message UnpinCodesProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // CodeIDs references the WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// AccessConfigUpdate contains the code id and the access config to be +// applied. +message AccessConfigUpdate { + // CodeID is the reference to the stored WASM code to be updated + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // InstantiatePermission to apply to the set of code ids + AccessConfig instantiate_permission = 2 [ (gogoproto.nullable) = false ]; +} + +// UpdateInstantiateConfigProposal gov proposal content type to update +// instantiate config to a set of code ids. +message UpdateInstantiateConfigProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // AccessConfigUpdate contains the list of code ids and the access config + // to be applied. + repeated AccessConfigUpdate access_config_updates = 3 + [ (gogoproto.nullable) = false ]; +} + +// StoreAndInstantiateContractProposal gov proposal content type to store +// and instantiate the contract. +message StoreAndInstantiateContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 5; + // UnpinCode code on upload, optional + bool unpin_code = 6; + // Admin is an optional address that can execute migrations + string admin = 7; + // Label is optional metadata to be stored with a constract instance. + string label = 8; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 9 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 10 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Source is the URL where the code is hosted + string source = 11; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 12; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 13; +} diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/query.proto b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/query.proto new file mode 100644 index 00000000..ffe48d24 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/query.proto @@ -0,0 +1,263 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "gogoproto/gogo.proto"; +import "cosmwasm/wasm/v1/types.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = false; + +// Query provides defines the gRPC querier service +service Query { + // ContractInfo gets the contract meta data + rpc ContractInfo(QueryContractInfoRequest) + returns (QueryContractInfoResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}"; + } + // ContractHistory gets the contract code history + rpc ContractHistory(QueryContractHistoryRequest) + returns (QueryContractHistoryResponse) { + option (google.api.http).get = + "/cosmwasm/wasm/v1/contract/{address}/history"; + } + // ContractsByCode lists all smart contracts for a code id + rpc ContractsByCode(QueryContractsByCodeRequest) + returns (QueryContractsByCodeResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}/contracts"; + } + // AllContractState gets all raw store data for a single contract + rpc AllContractState(QueryAllContractStateRequest) + returns (QueryAllContractStateResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/state"; + } + // RawContractState gets single key from the raw store data of a contract + rpc RawContractState(QueryRawContractStateRequest) + returns (QueryRawContractStateResponse) { + option (google.api.http).get = + "/cosmwasm/wasm/v1/contract/{address}/raw/{query_data}"; + } + // SmartContractState get smart query result from the contract + rpc SmartContractState(QuerySmartContractStateRequest) + returns (QuerySmartContractStateResponse) { + option (google.api.http).get = + "/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}"; + } + // Code gets the binary code and metadata for a singe wasm code + rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}"; + } + // Codes gets the metadata for all stored wasm codes + rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/code"; + } + + // PinnedCodes gets the pinned code ids + rpc PinnedCodes(QueryPinnedCodesRequest) returns (QueryPinnedCodesResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/codes/pinned"; + } + + // Params gets the module params + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/codes/params"; + } + + // ContractsByCreator gets the contracts by creator + rpc ContractsByCreator(QueryContractsByCreatorRequest) + returns (QueryContractsByCreatorResponse) { + option (google.api.http).get = + "/cosmwasm/wasm/v1/contracts/creator/{creator_address}"; + } +} + +// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC +// method +message QueryContractInfoRequest { + // address is the address of the contract to query + string address = 1; +} +// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC +// method +message QueryContractInfoResponse { + option (gogoproto.equal) = true; + + // address is the address of the contract + string address = 1; + ContractInfo contract_info = 2 [ + (gogoproto.embed) = true, + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "" + ]; +} + +// QueryContractHistoryRequest is the request type for the Query/ContractHistory +// RPC method +message QueryContractHistoryRequest { + // address is the address of the contract to query + string address = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryContractHistoryResponse is the response type for the +// Query/ContractHistory RPC method +message QueryContractHistoryResponse { + repeated ContractCodeHistoryEntry entries = 1 + [ (gogoproto.nullable) = false ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode +// RPC method +message QueryContractsByCodeRequest { + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryContractsByCodeResponse is the response type for the +// Query/ContractsByCode RPC method +message QueryContractsByCodeResponse { + // contracts are a set of contract addresses + repeated string contracts = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAllContractStateRequest is the request type for the +// Query/AllContractState RPC method +message QueryAllContractStateRequest { + // address is the address of the contract + string address = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllContractStateResponse is the response type for the +// Query/AllContractState RPC method +message QueryAllContractStateResponse { + repeated Model models = 1 [ (gogoproto.nullable) = false ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRawContractStateRequest is the request type for the +// Query/RawContractState RPC method +message QueryRawContractStateRequest { + // address is the address of the contract + string address = 1; + bytes query_data = 2; +} + +// QueryRawContractStateResponse is the response type for the +// Query/RawContractState RPC method +message QueryRawContractStateResponse { + // Data contains the raw store data + bytes data = 1; +} + +// QuerySmartContractStateRequest is the request type for the +// Query/SmartContractState RPC method +message QuerySmartContractStateRequest { + // address is the address of the contract + string address = 1; + // QueryData contains the query data passed to the contract + bytes query_data = 2 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// QuerySmartContractStateResponse is the response type for the +// Query/SmartContractState RPC method +message QuerySmartContractStateResponse { + // Data contains the json data returned from the smart contract + bytes data = 1 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// QueryCodeRequest is the request type for the Query/Code RPC method +message QueryCodeRequest { + uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID +} + +// CodeInfoResponse contains code meta data from CodeInfo +message CodeInfoResponse { + option (gogoproto.equal) = true; + + uint64 code_id = 1 [ + (gogoproto.customname) = "CodeID", + (gogoproto.jsontag) = "id" + ]; // id for legacy support + string creator = 2; + bytes data_hash = 3 + [ (gogoproto.casttype) = + "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; + // Used in v1beta1 + reserved 4, 5; + AccessConfig instantiate_permission = 6 [ (gogoproto.nullable) = false ]; +} + +// QueryCodeResponse is the response type for the Query/Code RPC method +message QueryCodeResponse { + option (gogoproto.equal) = true; + CodeInfoResponse code_info = 1 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; + bytes data = 2 [ (gogoproto.jsontag) = "data" ]; +} + +// QueryCodesRequest is the request type for the Query/Codes RPC method +message QueryCodesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryCodesResponse is the response type for the Query/Codes RPC method +message QueryCodesResponse { + repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes +// RPC method +message QueryPinnedCodesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryPinnedCodesResponse is the response type for the +// Query/PinnedCodes RPC method +message QueryPinnedCodesResponse { + repeated uint64 code_ids = 1 + [ (gogoproto.nullable) = false, (gogoproto.customname) = "CodeIDs" ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryContractsByCreatorRequest is the request type for the +// Query/ContractsByCreator RPC method. +message QueryContractsByCreatorRequest { + // CreatorAddress is the address of contract creator + string creator_address = 1; + // Pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryContractsByCreatorResponse is the response type for the +// Query/ContractsByCreator RPC method. +message QueryContractsByCreatorResponse { + // ContractAddresses result set + repeated string contract_addresses = 1; + // Pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/tx.proto b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/tx.proto new file mode 100644 index 00000000..04acc8ef --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/tx.proto @@ -0,0 +1,176 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "cosmwasm/wasm/v1/types.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the wasm Msg service. +service Msg { + // StoreCode to submit Wasm code to the system + rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); + // InstantiateContract creates a new smart contract instance for the given + // code id. + rpc InstantiateContract(MsgInstantiateContract) + returns (MsgInstantiateContractResponse); + // InstantiateContract2 creates a new smart contract instance for the given + // code id with a predictable address + rpc InstantiateContract2(MsgInstantiateContract2) + returns (MsgInstantiateContract2Response); + // Execute submits the given message data to a smart contract + rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse); + // Migrate runs a code upgrade/ downgrade for a smart contract + rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); + // UpdateAdmin sets a new admin for a smart contract + rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); + // ClearAdmin removes any admin stored for a smart contract + rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); +} + +// MsgStoreCode submit Wasm code to the system +message MsgStoreCode { + // Sender is the that actor that signed the messages + string sender = 1; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; + // Used in v1beta1 + reserved 3, 4; + // InstantiatePermission access control to apply on contract creation, + // optional + AccessConfig instantiate_permission = 5; +} +// MsgStoreCodeResponse returns store result data. +message MsgStoreCodeResponse { + // CodeID is the reference to the stored WASM code + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // Checksum is the sha256 hash of the stored code + bytes checksum = 2; +} + +// MsgInstantiateContract create a new smart contract instance for the given +// code id. +message MsgInstantiateContract { + // Sender is the that actor that signed the messages + string sender = 1; + // Admin is an optional address that can execute migrations + string admin = 2; + // CodeID is the reference to the stored WASM code + uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a contract instance. + string label = 4; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgInstantiateContract2 create a new smart contract instance for the given +// code id with a predicable address. +message MsgInstantiateContract2 { + // Sender is the that actor that signed the messages + string sender = 1; + // Admin is an optional address that can execute migrations + string admin = 2; + // CodeID is the reference to the stored WASM code + uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a contract instance. + string label = 4; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 7; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 8; +} + +// MsgInstantiateContractResponse return instantiation result data +message MsgInstantiateContractResponse { + // Address is the bech32 address of the new contract instance. + string address = 1; + // Data contains bytes to returned from the contract + bytes data = 2; +} + +// MsgInstantiateContract2Response return instantiation result data +message MsgInstantiateContract2Response { + // Address is the bech32 address of the new contract instance. + string address = 1; + // Data contains bytes to returned from the contract + bytes data = 2; +} + +// MsgExecuteContract submits the given message data to a smart contract +message MsgExecuteContract { + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 2; + // Msg json encoded message to be passed to the contract + bytes msg = 3 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on execution + repeated cosmos.base.v1beta1.Coin funds = 5 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgExecuteContractResponse returns execution result data. +message MsgExecuteContractResponse { + // Data contains bytes to returned from the contract + bytes data = 1; +} + +// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +message MsgMigrateContract { + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 2; + // CodeID references the new WASM code + uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; + // Msg json encoded message to be passed to the contract on migration + bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// MsgMigrateContractResponse returns contract migration result data. +message MsgMigrateContractResponse { + // Data contains same raw bytes returned as data from the wasm contract. + // (May be empty) + bytes data = 1; +} + +// MsgUpdateAdmin sets a new admin for a smart contract +message MsgUpdateAdmin { + // Sender is the that actor that signed the messages + string sender = 1; + // NewAdmin address to be set + string new_admin = 2; + // Contract is the address of the smart contract + string contract = 3; +} + +// MsgUpdateAdminResponse returns empty data +message MsgUpdateAdminResponse {} + +// MsgClearAdmin removes any admin stored for a smart contract +message MsgClearAdmin { + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 3; +} + +// MsgClearAdminResponse returns empty data +message MsgClearAdminResponse {} diff --git a/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/types.proto b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/types.proto new file mode 100644 index 00000000..216b24e3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/cosmwasm/wasm/v1/types.proto @@ -0,0 +1,144 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// AccessType permission types +enum AccessType { + option (gogoproto.goproto_enum_prefix) = false; + option (gogoproto.goproto_enum_stringer) = false; + // AccessTypeUnspecified placeholder for empty value + ACCESS_TYPE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "AccessTypeUnspecified" ]; + // AccessTypeNobody forbidden + ACCESS_TYPE_NOBODY = 1 + [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; + // AccessTypeOnlyAddress restricted to a single address + // Deprecated: use AccessTypeAnyOfAddresses instead + ACCESS_TYPE_ONLY_ADDRESS = 2 + [ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ]; + // AccessTypeEverybody unrestricted + ACCESS_TYPE_EVERYBODY = 3 + [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ]; + // AccessTypeAnyOfAddresses allow any of the addresses + ACCESS_TYPE_ANY_OF_ADDRESSES = 4 + [ (gogoproto.enumvalue_customname) = "AccessTypeAnyOfAddresses" ]; +} + +// AccessTypeParam +message AccessTypeParam { + option (gogoproto.goproto_stringer) = true; + AccessType value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; +} + +// AccessConfig access control type. +message AccessConfig { + option (gogoproto.goproto_stringer) = true; + AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; + + // Address + // Deprecated: replaced by addresses + string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + repeated string addresses = 3 [ (gogoproto.moretags) = "yaml:\"addresses\"" ]; +} + +// Params defines the set of wasm parameters. +message Params { + option (gogoproto.goproto_stringer) = false; + AccessConfig code_upload_access = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"code_upload_access\"" + ]; + AccessType instantiate_default_permission = 2 + [ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ]; +} + +// CodeInfo is data for the uploaded contract WASM code +message CodeInfo { + // CodeHash is the unique identifier created by wasmvm + bytes code_hash = 1; + // Creator address who initially stored the code + string creator = 2; + // Used in v1beta1 + reserved 3, 4; + // InstantiateConfig access control to apply on contract creation, optional + AccessConfig instantiate_config = 5 [ (gogoproto.nullable) = false ]; +} + +// ContractInfo stores a WASM contract instance +message ContractInfo { + option (gogoproto.equal) = true; + + // CodeID is the reference to the stored Wasm code + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // Creator address who initially instantiated the contract + string creator = 2; + // Admin is an optional address that can execute migrations + string admin = 3; + // Label is optional metadata to be stored with a contract instance. + string label = 4; + // Created Tx position when the contract was instantiated. + AbsoluteTxPosition created = 5; + string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ]; + + // Extension is an extension point to store custom metadata within the + // persistence model. + google.protobuf.Any extension = 7 + [ (cosmos_proto.accepts_interface) = "ContractInfoExtension" ]; +} + +// ContractCodeHistoryOperationType actions that caused a code change +enum ContractCodeHistoryOperationType { + option (gogoproto.goproto_enum_prefix) = false; + // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeUnspecified" ]; + // ContractCodeHistoryOperationTypeInit on chain contract instantiation + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeInit" ]; + // ContractCodeHistoryOperationTypeMigrate code migration + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeMigrate" ]; + // ContractCodeHistoryOperationTypeGenesis based on genesis data + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeGenesis" ]; +} + +// ContractCodeHistoryEntry metadata to a contract. +message ContractCodeHistoryEntry { + ContractCodeHistoryOperationType operation = 1; + // CodeID is the reference to the stored WASM code + uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; + // Updated Tx position when the operation was executed. + AbsoluteTxPosition updated = 3; + bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// AbsoluteTxPosition is a unique transaction position that allows for global +// ordering of transactions. +message AbsoluteTxPosition { + // BlockHeight is the block the contract was created at + uint64 block_height = 1; + // TxIndex is a monotonic counter within the block (actual transaction index, + // or gas consumed) + uint64 tx_index = 2; +} + +// Model is a struct that holds a KV pair +message Model { + // hex-encode key to read it better (this is often ascii) + bytes key = 1 [ (gogoproto.casttype) = + "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; + // base64-encode raw value + bytes value = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol-src b/dydxjs/packages/dydxjs/proto/dydxprotocol-src new file mode 160000 index 00000000..5b998ca5 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol-src @@ -0,0 +1 @@ +Subproject commit 5b998ca50ccbd34fc4cc31e4fb233fcd5d493464 diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/accountplus/accountplus.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/accountplus/accountplus.proto new file mode 100644 index 00000000..838fa5ab --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/accountplus/accountplus.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package dydxprotocol.accountplus; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/accountplus/types"; + +// Account State +message AccountState { + string address = 1; + TimestampNonceDetails timestamp_nonce_details = 2 + [ (gogoproto.nullable) = false ]; +} + +// Timestamp nonce details +message TimestampNonceDetails { + // unsorted list of n most recent timestamp nonces + repeated uint64 timestamp_nonces = 1; + + // max timestamp nonce that was ejected from list above + uint64 max_ejected_nonce = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/accountplus/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/accountplus/genesis.proto new file mode 100644 index 00000000..9358dca1 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/accountplus/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package dydxprotocol.accountplus; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/accountplus/accountplus.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/accountplus/types"; + +// Module genesis state +message GenesisState { + repeated AccountState accounts = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/affiliates.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/affiliates.proto new file mode 100644 index 00000000..66b6e74c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/affiliates.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package dydxprotocol.affiliates; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types"; + +// AffiliateTiers defines the affiliate tiers. +message AffiliateTiers { + // Tier defines an affiliate tier. + message Tier { + // Level of the tier + uint32 level = 1; + // Required all-time referred volume in quote quantums. + uint64 req_referred_volume = 2; + // Required currently staked native tokens (in whole coins). + uint32 req_staked_whole_coins = 3; + // Taker fee share in parts-per-million. + uint32 taker_fee_share_ppm = 4; + } + // All affiliate tiers + repeated Tier tiers = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/genesis.proto new file mode 100644 index 00000000..62315d2c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/genesis.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; +package dydxprotocol.affiliates; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types"; + +// GenesisState defines generis state of `x/affiliates` +message GenesisState {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/query.proto new file mode 100644 index 00000000..21d81e2b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/query.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package dydxprotocol.affiliates; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/affiliates/affiliates.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types"; + +// Query defines the gRPC querier service. +service Query { + // Query AffiliateInfo returns the affiliate info for a given address. + rpc AffiliateInfo(AffiliateInfoRequest) returns (AffiliateInfoResponse); + // Query ReferredBy returns the affiliate that referred a given address. + rpc ReferredBy(ReferredByRequest) returns (ReferredByResponse); + // Query AllAffiliateTiers returns all affiliate tiers. + rpc AllAffiliateTiers(AllAffiliateTiersRequest) + returns (AllAffiliateTiersResponse); +} +// AffiliateInfoRequest is the request type for the Query/AffiliateInfo RPC +// method. +message AffiliateInfoRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// AffiliateInfoResponse is the response type for the Query/AffiliateInfo RPC +// method. +message AffiliateInfoResponse { + // The affiliate's tier. + uint32 tier = 1; + // The affiliate's taker fee share in parts-per-million. + uint32 fee_share_ppm = 2; + // The affiliate's all-time referred volume in quote quantums. + bytes referred_volume = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // The affiliate's currently staked native tokens (in whole coins). + bytes staked_amount = 4 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// ReferredByRequest is the request type for the Query/ReferredBy RPC method. +message ReferredByRequest { + // The address to query. + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} +// ReferredByResponse is the response type for the Query/ReferredBy RPC method. +message ReferredByResponse { + // The affiliate's address that referred the queried address. + string affiliate_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// AllAffiliateTiersRequest is the request type for the Query/AllAffiliateTiers +// RPC method. +message AllAffiliateTiersRequest {} + +// AllAffiliateTiersResponse is the response type for the +// Query/AllAffiliateTiers RPC method. +message AllAffiliateTiersResponse { + // All affiliate tiers information. + AffiliateTiers tiers = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/tx.proto new file mode 100644 index 00000000..99d7940d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/affiliates/tx.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package dydxprotocol.affiliates; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/affiliates/affiliates.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types"; + +// Msg defines the Msg service. +service Msg { + // RegisterAffiliate registers a referee-affiliate relationship + rpc RegisterAffiliate(MsgRegisterAffiliate) + returns (MsgRegisterAffiliateResponse); + // UpdateAffiliateTiers updates affiliate tiers + rpc UpdateAffiliateTiers(MsgUpdateAffiliateTiers) + returns (MsgUpdateAffiliateTiersResponse); +} + +// Message to register a referee-affiliate relationship +message MsgRegisterAffiliate { + option (cosmos.msg.v1.signer) = "referee"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // Address of the referee + string referee = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Address of the affiliate + string affiliate = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Response to MsgRegisterAffiliate +message MsgRegisterAffiliateResponse {} + +// Message to update affiliate tiers +message MsgUpdateAffiliateTiers { + option (cosmos.msg.v1.signer) = "authority"; + // Authority sending this message. Will be sent by gov + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Updated affiliate tiers information + AffiliateTiers tiers = 2; +} + +// Response to MsgUpdateAffiliateTiers +message MsgUpdateAffiliateTiersResponse {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/asset.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/asset.proto new file mode 100644 index 00000000..c4e6eb9f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/asset.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package dydxprotocol.assets; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/assets/types"; + +// Asset defines a single exchangable asset. +message Asset { + + // Unique, sequentially-generated. + uint32 id = 1; + + // The human readable symbol of the `Asset` (e.g. `USDC`, `ATOM`). + // Must be uppercase, unique and correspond to the canonical symbol of the + // full coin. + string symbol = 2; + + // The name of base denomination unit of the `Asset` (e.g. `uatom`, + // 'ibc/xxxxx'). Must be unique and match the `denom` used in the `sdk.Coin` + // type in the `x/bank` module. + string denom = 3; + + // The exponent of converting one unit of `denom` to a full coin. + // For example, `name=USDC, denom=uusdc, denom_exponent=-6` defines that + // `1 uusdc = 10^(-6) USDC`. Note that `uusdc` refers to a `Coin` type in + // `x/bank`, where the prefix `u` means `micro` by convetion. `uusdc` is + // a different concept from a "quantum" defined by `atomic_resolution` below. + // To convert from an amount of `denom` to quantums: + // `quantums = denom_amount * 10^(denom_exponent - atomic_resolution)` + sint32 denom_exponent = 4; + + // `true` if this `Asset` has a valid `MarketId` value. + bool has_market = 5; + + // The `Id` of the `Market` associated with this `Asset`. It acts as the + // oracle price for the purposes of calculating collateral + // and margin requirements. + uint32 market_id = 6; + + // The exponent for converting an atomic amount (1 'quantum') + // to a full coin. For example, if `atomic_resolution = -8` + // then an `asset_position` with `base_quantums = 1e8` is equivalent to + // a position size of one full coin. + sint32 atomic_resolution = 7; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/genesis.proto new file mode 100644 index 00000000..764d7f14 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package dydxprotocol.assets; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/assets/asset.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/assets/types"; + +// GenesisState defines the assets module's genesis state. +message GenesisState { + repeated Asset assets = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/query.proto new file mode 100644 index 00000000..a6c718fd --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/query.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package dydxprotocol.assets; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "dydxprotocol/assets/asset.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/assets/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries a Asset by id. + rpc Asset(QueryAssetRequest) returns (QueryAssetResponse) { + option (google.api.http).get = "/dydxprotocol/assets/asset/{id}"; + } + + // Queries a list of Asset items. + rpc AllAssets(QueryAllAssetsRequest) returns (QueryAllAssetsResponse) { + option (google.api.http).get = "/dydxprotocol/assets/asset"; + } +} + +// Queries an Asset by id. +message QueryAssetRequest { uint32 id = 1; } + +// QueryAssetResponse is response type for the Asset RPC method. +message QueryAssetResponse { Asset asset = 1 [ (gogoproto.nullable) = false ]; } + +// Queries a list of Asset items. +message QueryAllAssetsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllAssetsResponse is response type for the AllAssets RPC method. +message QueryAllAssetsResponse { + repeated Asset asset = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/tx.proto new file mode 100644 index 00000000..fadb0472 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/assets/tx.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package dydxprotocol.assets; + +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/assets/types"; + +// Msg defines the Msg service. +service Msg { + // this line is used by starport scaffolding # proto/tx/rpc +} + +// this line is used by starport scaffolding # proto/tx/message diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/blocktime.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/blocktime.proto new file mode 100644 index 00000000..369123f7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/blocktime.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package dydxprotocol.blocktime; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/blocktime/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +// BlockInfo stores information about a block +message BlockInfo { + uint32 height = 1; + google.protobuf.Timestamp timestamp = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; +} + +// AllDowntimeInfo stores information for all downtime durations. +message AllDowntimeInfo { + // Stores information about downtime. block_info corresponds to the most + // recent block at which a downtime occurred. + message DowntimeInfo { + google.protobuf.Duration duration = 1 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + BlockInfo block_info = 2 [ (gogoproto.nullable) = false ]; + } + + // The downtime information for each tracked duration. Sorted by duration, + // ascending. (i.e. the same order as they appear in DowntimeParams). + repeated DowntimeInfo infos = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/genesis.proto new file mode 100644 index 00000000..afaf5368 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package dydxprotocol.blocktime; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/blocktime/types"; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/blocktime/params.proto"; + +// GenesisState defines the blocktime module's genesis state. +message GenesisState { + DowntimeParams params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/params.proto new file mode 100644 index 00000000..72b63e3e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/params.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package dydxprotocol.blocktime; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/blocktime/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +// DowntimeParams defines the parameters for downtime. +message DowntimeParams { + // Durations tracked for downtime. The durations must be sorted from + // shortest to longest and must all be positive. + repeated google.protobuf.Duration durations = 1 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/query.proto new file mode 100644 index 00000000..b06e1828 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/query.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; +package dydxprotocol.blocktime; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/blocktime/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "dydxprotocol/blocktime/blocktime.proto"; +import "dydxprotocol/blocktime/params.proto"; + +// Query defines the gRPC querier service. +service Query { + // Queries the DowntimeParams. + rpc DowntimeParams(QueryDowntimeParamsRequest) + returns (QueryDowntimeParamsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/blocktime/downtime_params"; + } + + // Queries the information of the previous block + rpc PreviousBlockInfo(QueryPreviousBlockInfoRequest) + returns (QueryPreviousBlockInfoResponse); + + // Queries all recorded downtime info. + rpc AllDowntimeInfo(QueryAllDowntimeInfoRequest) + returns (QueryAllDowntimeInfoResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/blocktime/all_downtime_info"; + } +} + +// QueryDowntimeParamsRequest is a request type for the DowntimeParams +// RPC method. +message QueryDowntimeParamsRequest {} + +// QueryDowntimeParamsResponse is a response type for the DowntimeParams +// RPC method. +message QueryDowntimeParamsResponse { + DowntimeParams params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryPreviousBlockInfoRequest is a request type for the PreviousBlockInfo +// RPC method. +message QueryPreviousBlockInfoRequest {} + +// QueryPreviousBlockInfoResponse is a request type for the PreviousBlockInfo +// RPC method. +message QueryPreviousBlockInfoResponse { BlockInfo info = 1; } + +// QueryAllDowntimeInfoRequest is a request type for the AllDowntimeInfo +// RPC method. +message QueryAllDowntimeInfoRequest {} + +// QueryAllDowntimeInfoResponse is a request type for the AllDowntimeInfo +// RPC method. +message QueryAllDowntimeInfoResponse { AllDowntimeInfo info = 1; } diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/tx.proto new file mode 100644 index 00000000..80779c1d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/blocktime/tx.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package dydxprotocol.blocktime; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/blocktime/types"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/blocktime/params.proto"; +import "gogoproto/gogo.proto"; + +// Msg defines the Msg service. +service Msg { + // UpdateDowntimeParams updates the DowntimeParams in state. + rpc UpdateDowntimeParams(MsgUpdateDowntimeParams) + returns (MsgUpdateDowntimeParamsResponse); +} + +// MsgUpdateDowntimeParams is the Msg/UpdateDowntimeParams request type. +message MsgUpdateDowntimeParams { + // The address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Defines the parameters to update. All parameters must be supplied. + DowntimeParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateDowntimeParamsResponse is the Msg/UpdateDowntimeParams response +// type. +message MsgUpdateDowntimeParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/bridge_event.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/bridge_event.proto new file mode 100644 index 00000000..c6a33af2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/bridge_event.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package dydxprotocol.bridge; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/bridge/types"; + +// BridgeEvent is a recognized event from the Ethereum blockchain. +message BridgeEvent { + // The unique id of the Ethereum event log. + uint32 id = 1; + + // The tokens bridged. + cosmos.base.v1beta1.Coin coin = 2 [ (gogoproto.nullable) = false ]; + + // The account address or module address to bridge to. + string address = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The Ethereum block height of the event. + uint64 eth_block_height = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/bridge_event_info.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/bridge_event_info.proto new file mode 100644 index 00000000..b28cc76c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/bridge_event_info.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package dydxprotocol.bridge; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/bridge/types"; + +// BridgeEventInfo stores information about the most recently processed bridge +// event. +message BridgeEventInfo { + // The next event id (the last processed id plus one) of the logs from the + // Ethereum contract. + uint32 next_id = 1; + + // The Ethereum block height of the most recently processed bridge event. + uint64 eth_block_height = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/genesis.proto new file mode 100644 index 00000000..35a7cd71 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/genesis.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package dydxprotocol.bridge; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/bridge/bridge_event_info.proto"; +import "dydxprotocol/bridge/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/bridge/types"; + +// GenesisState defines the bridge module's genesis state. +message GenesisState { + // The parameters of the module. + EventParams event_params = 1 [ (gogoproto.nullable) = false ]; + ProposeParams propose_params = 2 [ (gogoproto.nullable) = false ]; + SafetyParams safety_params = 3 [ (gogoproto.nullable) = false ]; + + // Acknowledged event info that stores: + // - the next event ID to be added to consensus. + // - Ethereum block height of the most recently acknowledged bridge event. + BridgeEventInfo acknowledged_event_info = 4 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/params.proto new file mode 100644 index 00000000..d1fe774e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/params.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; +package dydxprotocol.bridge; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/bridge/types"; + +// EventParams stores parameters about which events to recognize and which +// tokens to mint. +message EventParams { + // The denom of the token to mint. + string denom = 1; + + // The numerical chain ID of the Ethereum chain to query. + uint64 eth_chain_id = 2; + + // The address of the Ethereum contract to monitor for logs. + string eth_address = 3; +} + +// ProposeParams stores parameters for proposing to the module. +message ProposeParams { + // The maximum number of bridge events to propose per block. + // Limits the number of events to propose in a single block + // in-order to smooth out the flow of events. + uint32 max_bridges_per_block = 1; + + // The minimum duration to wait between a finalized bridge and + // proposing it. This allows other validators to have enough time to + // also recognize its occurence. Therefore the bridge daemon should + // pool for new finalized events at least as often as this parameter. + google.protobuf.Duration propose_delay_duration = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // Do not propose any events if a [0, 1_000_000) random number generator + // generates a number smaller than this number. + // Setting this parameter to 1_000_000 means always skipping proposing events. + uint32 skip_rate_ppm = 3; + + // Do not propose any events if the timestamp of the proposal block is + // behind the proposers' wall-clock by at least this duration. + google.protobuf.Duration skip_if_block_delayed_by_duration = 4 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; +} + +// SafetyParams stores safety parameters for the module. +message SafetyParams { + // True if bridging is disabled. + bool is_disabled = 1; + + // The number of blocks that bridges accepted in-consensus will be pending + // until the minted tokens are granted. + uint32 delay_blocks = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/query.proto new file mode 100644 index 00000000..d2af3a75 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/query.proto @@ -0,0 +1,120 @@ +syntax = "proto3"; +package dydxprotocol.bridge; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "dydxprotocol/bridge/bridge_event_info.proto"; +import "dydxprotocol/bridge/params.proto"; +import "dydxprotocol/bridge/tx.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/bridge/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the EventParams. + rpc EventParams(QueryEventParamsRequest) returns (QueryEventParamsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/bridge/event_params"; + } + + // Queries the ProposeParams. + rpc ProposeParams(QueryProposeParamsRequest) + returns (QueryProposeParamsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/bridge/propose_params"; + } + + // Queries the SafetyParams. + rpc SafetyParams(QuerySafetyParamsRequest) + returns (QuerySafetyParamsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/bridge/safety_params"; + } + + // Queries the AcknowledgedEventInfo. + // An "acknowledged" event is one that is in-consensus and has been stored + // in-state. + rpc AcknowledgedEventInfo(QueryAcknowledgedEventInfoRequest) + returns (QueryAcknowledgedEventInfoResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/bridge/acknowledged_event_info"; + } + + // Queries the RecognizedEventInfo. + // A "recognized" event is one that is finalized on the Ethereum blockchain + // and has been identified by the queried node. It is not yet in-consensus. + rpc RecognizedEventInfo(QueryRecognizedEventInfoRequest) + returns (QueryRecognizedEventInfoResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/bridge/recognized_event_info"; + } + + // Queries all `MsgCompleteBridge` messages that are delayed (not yet + // executed) and corresponding block heights at which they will execute. + rpc DelayedCompleteBridgeMessages(QueryDelayedCompleteBridgeMessagesRequest) + returns (QueryDelayedCompleteBridgeMessagesResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/bridge/delayed_complete_bridge_messages"; + } +} + +// QueryEventParamsRequest is a request type for the EventParams RPC method. +message QueryEventParamsRequest {} + +// QueryEventParamsResponse is a response type for the EventParams RPC method. +message QueryEventParamsResponse { + EventParams params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryProposeParamsRequest is a request type for the ProposeParams RPC method. +message QueryProposeParamsRequest {} + +// QueryProposeParamsResponse is a response type for the ProposeParams RPC +// method. +message QueryProposeParamsResponse { + ProposeParams params = 1 [ (gogoproto.nullable) = false ]; +} + +// QuerySafetyParamsRequest is a request type for the SafetyParams RPC method. +message QuerySafetyParamsRequest {} + +// QuerySafetyParamsResponse is a response type for the SafetyParams RPC method. +message QuerySafetyParamsResponse { + SafetyParams params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAcknowledgedEventInfoRequest is a request type for the +// AcknowledgedEventInfo RPC method. +message QueryAcknowledgedEventInfoRequest {} + +// QueryAcknowledgedEventInfoResponse is a response type for the +// AcknowledgedEventInfo RPC method. +message QueryAcknowledgedEventInfoResponse { + BridgeEventInfo info = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryRecognizedEventInfoRequest is a request type for the +// RecognizedEventInfo RPC method. +message QueryRecognizedEventInfoRequest {} + +// QueryRecognizedEventInfoResponse is a response type for the +// RecognizedEventInfo RPC method. +message QueryRecognizedEventInfoResponse { + BridgeEventInfo info = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryDelayedCompleteBridgeMessagesRequest is a request type for the +// DelayedCompleteBridgeMessages RPC method. +message QueryDelayedCompleteBridgeMessagesRequest { string address = 1; } + +// QueryDelayedCompleteBridgeMessagesResponse is a response type for the +// DelayedCompleteBridgeMessages RPC method. +message QueryDelayedCompleteBridgeMessagesResponse { + repeated DelayedCompleteBridgeMessage messages = 1 + [ (gogoproto.nullable) = false ]; +} + +// DelayedCompleteBridgeMessage is a message type for the response of +// DelayedCompleteBridgeMessages RPC method. It contains the message +// and the block height at which it will execute. +message DelayedCompleteBridgeMessage { + MsgCompleteBridge message = 1 [ (gogoproto.nullable) = false ]; + uint32 block_height = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/tx.proto new file mode 100644 index 00000000..4b8fa1c8 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/bridge/tx.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; +package dydxprotocol.bridge; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/bridge/bridge_event.proto"; +import "dydxprotocol/bridge/params.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/bridge/types"; + +// Msg defines the Msg service. +service Msg { + // AcknowledgeBridges acknowledges bridges and sets them to complete at a + // later block. + rpc AcknowledgeBridges(MsgAcknowledgeBridges) + returns (MsgAcknowledgeBridgesResponse); + + // CompleteBridge finalizes a bridge by minting coins to an address. + rpc CompleteBridge(MsgCompleteBridge) returns (MsgCompleteBridgeResponse); + + // UpdateEventParams updates the EventParams in state. + rpc UpdateEventParams(MsgUpdateEventParams) + returns (MsgUpdateEventParamsResponse); + + // UpdateProposeParams updates the ProposeParams in state. + rpc UpdateProposeParams(MsgUpdateProposeParams) + returns (MsgUpdateProposeParamsResponse); + + // UpdateSafetyParams updates the SafetyParams in state. + rpc UpdateSafetyParams(MsgUpdateSafetyParams) + returns (MsgUpdateSafetyParamsResponse); +} + +// MsgAcknowledgeBridges is the Msg/AcknowledgeBridges request type. +message MsgAcknowledgeBridges { + // The events to acknowledge. + repeated BridgeEvent events = 1 [ (gogoproto.nullable) = false ]; +} + +// MsgAcknowledgeBridgesResponse is the Msg/AcknowledgeBridgesResponse response +// type. +message MsgAcknowledgeBridgesResponse {} + +// MsgCompleteBridge is the Msg/CompleteBridgeResponse request type. +message MsgCompleteBridge { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The event to complete. + BridgeEvent event = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCompleteBridgeResponse is the Msg/CompleteBridgeResponse response type. +message MsgCompleteBridgeResponse {} + +// MsgUpdateEventParams is the Msg/UpdateEventParams request type. +message MsgUpdateEventParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The parameters to update. Each field must be set. + EventParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateEventParamsResponse is the Msg/UpdateEventParams response type. +message MsgUpdateEventParamsResponse {} + +// MsgUpdateProposeParams is the Msg/UpdateProposeParams request type. +message MsgUpdateProposeParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The parameters to update. Each field must be set. + ProposeParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateProposeParamsResponse is the Msg/UpdateProposeParams response type. +message MsgUpdateProposeParamsResponse {} + +// MsgUpdateSafetyParams is the Msg/UpdateSafetyParams request type. +message MsgUpdateSafetyParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The parameters to update. Each field must be set. + SafetyParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateSafetyParamsResponse is the Msg/UpdateSafetyParams response type. +message MsgUpdateSafetyParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/block_rate_limit_config.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/block_rate_limit_config.proto new file mode 100644 index 00000000..273c2d53 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/block_rate_limit_config.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// Defines the block rate limits for CLOB specific operations. +message BlockRateLimitConfiguration { + // How many short term order attempts (successful and failed) are allowed for + // an account per N blocks. Note that the rate limits are applied + // in an AND fashion such that an order placement must pass all rate limit + // configurations. + // + // Specifying 0 values disables this rate limit. + // Deprecated in favor of `max_short_term_orders_and_cancels_per_n_blocks` + // for v5.x onwards. + repeated MaxPerNBlocksRateLimit max_short_term_orders_per_n_blocks = 1 + [ (gogoproto.nullable) = false, deprecated = true ]; + + // How many stateful order attempts (successful and failed) are allowed for + // an account per N blocks. Note that the rate limits are applied + // in an AND fashion such that an order placement must pass all rate limit + // configurations. + // + // Specifying 0 values disables this rate limit. + repeated MaxPerNBlocksRateLimit max_stateful_orders_per_n_blocks = 2 + [ (gogoproto.nullable) = false ]; + + // How many short term order cancellation attempts (successful and failed) are + // allowed for an account per N blocks. Note that the rate limits are + // applied in an AND fashion such that an order cancellation must pass all + // rate limit configurations. + // + // Specifying 0 values disables this rate limit. + // Deprecated in favor of `max_short_term_orders_and_cancels_per_n_blocks` + // for v5.x onwards. + repeated MaxPerNBlocksRateLimit + max_short_term_order_cancellations_per_n_blocks = 3 + [ (gogoproto.nullable) = false, deprecated = true ]; + + // How many short term order place and cancel attempts (successful and failed) + // are allowed for an account per N blocks. Note that the rate limits are + // applied in an AND fashion such that an order placement must pass all rate + // limit configurations. + // + // Specifying 0 values disables this rate limit. + repeated MaxPerNBlocksRateLimit + max_short_term_orders_and_cancels_per_n_blocks = 4 + [ (gogoproto.nullable) = false ]; +} + +// Defines a rate limit over a specific number of blocks. +message MaxPerNBlocksRateLimit { + // How many blocks the rate limit is over. + // Specifying 0 is invalid. + uint32 num_blocks = 1; + // What the limit is for `num_blocks`. + // Specifying 0 is invalid. + uint32 limit = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/clob_pair.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/clob_pair.proto new file mode 100644 index 00000000..7b0e7184 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/clob_pair.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "amino/amino.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// PerpetualClobMetadata contains metadata for a `ClobPair` +// representing a Perpetual product. +message PerpetualClobMetadata { + option (amino.name) = "dydxprotocol/clob/PerpetualClobMetadata"; + + // Id of the Perpetual the CLOB allows trading of. + uint32 perpetual_id = 1; +} + +// PerpetualClobMetadata contains metadata for a `ClobPair` +// representing a Spot product. +message SpotClobMetadata { + option (amino.name) = "dydxprotocol/clob/SpotClobMetadata"; + + // Id of the base Asset in the trading pair. + uint32 base_asset_id = 1; + + // Id of the quote Asset in the trading pair. + uint32 quote_asset_id = 2; +} + +// ClobPair represents a single CLOB pair for a given product +// in state. +message ClobPair { + // ID of the orderbook that stores all resting liquidity for this CLOB. + uint32 id = 1; + + // Product-specific metadata. Perpetual CLOBs will have + // PerpetualClobMetadata, and Spot CLOBs will have SpotClobMetadata. + oneof metadata { + PerpetualClobMetadata perpetual_clob_metadata = 2 + [ (amino.oneof_name) = "dydxprotocol/clob/PerpetualClobMetadata" ]; + SpotClobMetadata spot_clob_metadata = 3 + [ (amino.oneof_name) = "dydxprotocol/clob/SpotClobMetadata" ]; + } + + // Minimum increment in the size of orders on the CLOB, in base quantums. + uint64 step_base_quantums = 4; + + // Defines the tick size of the orderbook by defining how many subticks + // are in one tick. That is, the subticks of any valid order must be a + // multiple of this value. Generally this value should start `>= 100`to + // allow room for decreasing it. + uint32 subticks_per_tick = 5; + + // `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + // per Subtick. + sint32 quantum_conversion_exponent = 6; + + // Status of the CLOB. + enum Status { + // Default value. This value is invalid and unused. + STATUS_UNSPECIFIED = 0; + // STATUS_ACTIVE represents an active clob pair. + STATUS_ACTIVE = 1; + // STATUS_PAUSED behavior is unfinalized. + // TODO(DEC-600): update this documentation. + STATUS_PAUSED = 2; + // STATUS_CANCEL_ONLY behavior is unfinalized. + // TODO(DEC-600): update this documentation. + STATUS_CANCEL_ONLY = 3; + // STATUS_POST_ONLY behavior is unfinalized. + // TODO(DEC-600): update this documentation. + STATUS_POST_ONLY = 4; + // STATUS_INITIALIZING represents a newly-added clob pair. + // Clob pairs in this state only accept orders which are + // both short-term and post-only. + STATUS_INITIALIZING = 5; + // STATUS_FINAL_SETTLEMENT represents a clob pair which is deactivated + // and trading has ceased. All open positions will be closed by the + // protocol. Open stateful orders will be cancelled. Open short-term + // orders will be left to expire. + STATUS_FINAL_SETTLEMENT = 6; + } + + Status status = 7; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/equity_tier_limit_config.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/equity_tier_limit_config.proto new file mode 100644 index 00000000..64ac2a3a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/equity_tier_limit_config.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// Defines the set of equity tiers to limit how many open orders +// a subaccount is allowed to have. +message EquityTierLimitConfiguration { + // How many short term stateful orders are allowed per equity tier. + // Specifying 0 values disables this limit. + repeated EquityTierLimit short_term_order_equity_tiers = 1 + [ (gogoproto.nullable) = false ]; + // How many open stateful orders are allowed per equity tier. + // Specifying 0 values disables this limit. + repeated EquityTierLimit stateful_order_equity_tiers = 2 + [ (gogoproto.nullable) = false ]; +} + +// Defines an equity tier limit. +message EquityTierLimit { + // The total net collateral in USDC quote quantums of equity required. + bytes usd_tnc_required = 1 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + + // What the limit is for `usd_tnc_required`. + uint32 limit = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/genesis.proto new file mode 100644 index 00000000..27aade4c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/genesis.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/clob/block_rate_limit_config.proto"; +import "dydxprotocol/clob/clob_pair.proto"; +import "dydxprotocol/clob/equity_tier_limit_config.proto"; +import "dydxprotocol/clob/liquidations_config.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// GenesisState defines the clob module's genesis state. +message GenesisState { + repeated ClobPair clob_pairs = 1 [ (gogoproto.nullable) = false ]; + LiquidationsConfig liquidations_config = 2 [ (gogoproto.nullable) = false ]; + BlockRateLimitConfiguration block_rate_limit_config = 3 + [ (gogoproto.nullable) = false ]; + EquityTierLimitConfiguration equity_tier_limit_config = 4 + [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/liquidations.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/liquidations.proto new file mode 100644 index 00000000..61bb750f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/liquidations.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// PerpetualLiquidationInfo holds information about a liquidation that occurred +// for a position held by a subaccount. +// Note this proto is defined to make it easier to hash +// the metadata of a liquidation, and is never written to state. +message PerpetualLiquidationInfo { + // The id of the subaccount that got liquidated/deleveraged or was deleveraged + // onto. + dydxprotocol.subaccounts.SubaccountId subaccount_id = 1 + [ (gogoproto.nullable) = false ]; + // The id of the perpetual involved. + uint32 perpetual_id = 2; +} + +// SubaccountLiquidationInfo holds liquidation information per-subaccount in the +// current block. +message SubaccountLiquidationInfo { + // An unsorted list of unique perpetual IDs that the subaccount has previously + // liquidated. + repeated uint32 perpetuals_liquidated = 1; + // The notional value (in quote quantums, determined by the oracle price) of + // all positions liquidated for this subaccount. + uint64 notional_liquidated = 2; + // The amount of funds that the insurance fund has lost + // covering this subaccount. + uint64 quantums_insurance_lost = 3; +} + +// SubaccountOpenPositionInfo holds information about open positions for a +// perpetual. +message SubaccountOpenPositionInfo { + // The id of the perpetual. + uint32 perpetual_id = 1; + // The ids of the subaccounts with long positions. + repeated dydxprotocol.subaccounts.SubaccountId + subaccounts_with_long_position = 2 [ (gogoproto.nullable) = false ]; + // The ids of the subaccounts with short positions. + repeated dydxprotocol.subaccounts.SubaccountId + subaccounts_with_short_position = 3 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/liquidations_config.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/liquidations_config.proto new file mode 100644 index 00000000..d485d493 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/liquidations_config.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// LiquidationsConfig stores all configurable fields related to liquidations. +message LiquidationsConfig { + // The maximum liquidation fee (in parts-per-million). This fee goes + // 100% to the insurance fund. + uint32 max_liquidation_fee_ppm = 1; + + // Limits around how much of a single position can be liquidated + // within a single block. + PositionBlockLimits position_block_limits = 2 + [ (gogoproto.nullable) = false ]; + + // Limits around how many quote quantums from a single subaccount can + // be liquidated within a single block. + SubaccountBlockLimits subaccount_block_limits = 3 + [ (gogoproto.nullable) = false ]; + + // Config about how the fillable-price spread from the oracle price + // increases based on the adjusted bankruptcy rating of the subaccount. + FillablePriceConfig fillable_price_config = 4 + [ (gogoproto.nullable) = false ]; +} + +// PositionBlockLimits stores all configurable fields related to limits +// around how much of a single position can be liquidated within a single block. +message PositionBlockLimits { + // The minimum amount of quantums to liquidate for each message (in + // quote quantums). + // Overridden by the maximum size of the position. + uint64 min_position_notional_liquidated = 1; + + // The maximum portion of the position liquidated (in parts-per- + // million). Overridden by min_position_notional_liquidated. + uint32 max_position_portion_liquidated_ppm = 2; +} + +// SubaccountBlockLimits stores all configurable fields related to limits +// around how many quote quantums from a single subaccount can +// be liquidated within a single block. +message SubaccountBlockLimits { + // The maximum notional amount that a single subaccount can have + // liquidated (in quote quantums) per block. + uint64 max_notional_liquidated = 1; + + // The maximum insurance-fund payout amount for a given subaccount + // per block. I.e. how much it can cover for that subaccount. + uint64 max_quantums_insurance_lost = 2; +} + +// FillablePriceConfig stores all configurable fields related to calculating +// the fillable price for liquidating a position. +message FillablePriceConfig { + // The rate at which the Adjusted Bankruptcy Rating increases. + uint32 bankruptcy_adjustment_ppm = 1; + + // The maximum value that the liquidation spread can take, as + // a ratio against the position's maintenance margin. + uint32 spread_to_maintenance_margin_ratio_ppm = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/matches.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/matches.proto new file mode 100644 index 00000000..8b7b299f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/matches.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/clob/order.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// ClobMatch represents an operations queue entry around all different types +// of matches, specifically regular matches, liquidation matches, and +// deleveraging matches. +message ClobMatch { + // The match type that this message includes. + oneof match { + MatchOrders match_orders = 1; + MatchPerpetualLiquidation match_perpetual_liquidation = 2; + MatchPerpetualDeleveraging match_perpetual_deleveraging = 3; + } +} + +// MakerFill represents the filled amount of a matched maker order. +message MakerFill { + // The filled amount of the matched maker order, in base quantums. + // TODO(CLOB-571): update to use SerializableInt. + uint64 fill_amount = 1; + // The `OrderId` of the matched maker order. + dydxprotocol.clob.OrderId maker_order_id = 2 [ (gogoproto.nullable) = false ]; +} + +// MatchOrders is an injected message used for matching orders. +message MatchOrders { + // The `OrderId` of the taker order. + dydxprotocol.clob.OrderId taker_order_id = 1 [ (gogoproto.nullable) = false ]; + // An ordered list of fills created by this taker order. + repeated MakerFill fills = 2 [ (gogoproto.nullable) = false ]; +} + +// MatchPerpetualLiquidation is an injected message used for liquidating a +// subaccount. +message MatchPerpetualLiquidation { + // ID of the subaccount that was liquidated. + dydxprotocol.subaccounts.SubaccountId liquidated = 1 + [ (gogoproto.nullable) = false ]; + // The ID of the clob pair involved in the liquidation. + uint32 clob_pair_id = 2; + // The ID of the perpetual involved in the liquidation. + uint32 perpetual_id = 3; + // The total size of the liquidation order including any unfilled size. + uint64 total_size = 4; + // `true` if liquidating a short position, `false` otherwise. + bool is_buy = 5; + // An ordered list of fills created by this liquidation. + repeated MakerFill fills = 6 [ (gogoproto.nullable) = false ]; +} + +// MatchPerpetualDeleveraging is an injected message used for deleveraging a +// subaccount. +message MatchPerpetualDeleveraging { + // ID of the subaccount that was liquidated. + dydxprotocol.subaccounts.SubaccountId liquidated = 1 + [ (gogoproto.nullable) = false ]; + // The ID of the perpetual that was liquidated. + uint32 perpetual_id = 2; + // Fill represents a fill between the liquidated and offsetting subaccount. + message Fill { + // ID of the subaccount that was used to offset the liquidated subaccount's + // position. + dydxprotocol.subaccounts.SubaccountId offsetting_subaccount_id = 1 + [ (gogoproto.nullable) = false ]; + // The amount filled between the liquidated and offsetting position, in + // base quantums. + // TODO(CLOB-571): update to use SerializableInt. + uint64 fill_amount = 2; + } + // An ordered list of fills created by this liquidation. + repeated Fill fills = 3 [ (gogoproto.nullable) = false ]; + + // Flag denoting whether the deleveraging operation was for the purpose + // of final settlement. Final settlement matches are at the oracle price, + // whereas deleveraging happens at the bankruptcy price of the deleveraged + // subaccount. + bool is_final_settlement = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/mev.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/mev.proto new file mode 100644 index 00000000..dfd4024d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/mev.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/clob/clob_pair.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// MEVMatch represents all necessary data to calculate MEV for a regular match. +message MEVMatch { + dydxprotocol.subaccounts.SubaccountId taker_order_subaccount_id = 1; + int32 taker_fee_ppm = 2; + + dydxprotocol.subaccounts.SubaccountId maker_order_subaccount_id = 3; + uint64 maker_order_subticks = 4; + bool maker_order_is_buy = 5; + int32 maker_fee_ppm = 6; + + uint32 clob_pair_id = 7; + uint64 fill_amount = 8; +} + +// MEVLiquidationMatch represents all necessary data to calculate MEV for a +// liquidation. +message MEVLiquidationMatch { + dydxprotocol.subaccounts.SubaccountId liquidated_subaccount_id = 1 + [ (gogoproto.nullable) = false ]; + int64 insurance_fund_delta_quote_quantums = 2; + + dydxprotocol.subaccounts.SubaccountId maker_order_subaccount_id = 3 + [ (gogoproto.nullable) = false ]; + uint64 maker_order_subticks = 4; + bool maker_order_is_buy = 5; + int32 maker_fee_ppm = 6; + + uint32 clob_pair_id = 7; + uint64 fill_amount = 8; +} + +// ClobMidPrice contains the mid price of a CLOB pair, represented by it's ID. +message ClobMidPrice { + dydxprotocol.clob.ClobPair clob_pair = 1 [ (gogoproto.nullable) = false ]; + uint64 subticks = 2; +} + +// ValidatorMevMatches contains all matches from the validator's local +// operations queue. +message ValidatorMevMatches { + repeated MEVMatch matches = 1 [ (gogoproto.nullable) = false ]; + repeated MEVLiquidationMatch liquidation_matches = 2 + [ (gogoproto.nullable) = false ]; +} + +// MevNodeToNodeMetrics is a data structure for encapsulating all MEV node <> +// node metrics. +message MevNodeToNodeMetrics { + ValidatorMevMatches validator_mev_matches = 1; + repeated ClobMidPrice clob_mid_prices = 2 [ (gogoproto.nullable) = false ]; + ValidatorMevMatches bp_mev_matches = 3; + uint64 proposal_receive_time = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/operation.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/operation.proto new file mode 100644 index 00000000..53d27afc --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/operation.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "dydxprotocol/clob/matches.proto"; +import "dydxprotocol/clob/order.proto"; +import "dydxprotocol/clob/order_removals.proto"; +import "dydxprotocol/clob/tx.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// Operation represents an operation in the proposed operations. Operation is +// used internally within the memclob only. +message Operation { + // operation represents the operation that occurred, which can be a match, + // short term order placement, short term order cancellation, or the placement + // of a pre-existing stateful order. + oneof operation { + ClobMatch match = 1; + MsgPlaceOrder short_term_order_placement = 2; + MsgCancelOrder short_term_order_cancellation = 3; + OrderId preexisting_stateful_order = 4; + } +} + +// InternalOperation represents an internal operation in the operations to +// propose. InternalOperation is used internally within the memclob only. +message InternalOperation { + // operation represents the operation that occurred, which can be a match, + // Short-Term order placement, or the placement of a pre-existing stateful + // order. + oneof operation { + ClobMatch match = 1; + MsgPlaceOrder short_term_order_placement = 2; + OrderId preexisting_stateful_order = 3; + OrderRemoval order_removal = 4; + } +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/order.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/order.proto new file mode 100644 index 00000000..7045122a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/order.proto @@ -0,0 +1,251 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/clob/liquidations.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// OrderId refers to a single order belonging to a Subaccount. +message OrderId { + // The subaccount ID that opened this order. + // Note that this field has `gogoproto.nullable = false` so that it is + // generated as a value instead of a pointer. This is because the `OrderId` + // proto is used as a key within maps, and map comparisons will compare + // pointers for equality (when the desired behavior is to compare the values). + dydxprotocol.subaccounts.SubaccountId subaccount_id = 1 + [ (gogoproto.nullable) = false ]; + + // The client ID of this order, unique with respect to the specific + // sub account (I.E., the same subaccount can't have two orders with + // the same ClientId). + fixed32 client_id = 2; + + // order_flags represent order flags for the order. This field is invalid if + // it's greater than 127 (larger than one byte). Each bit in the first byte + // represents a different flag. Currently only two flags are supported. + // + // Starting from the bit after the most MSB (note that the MSB is used in + // proto varint encoding, and therefore cannot be used): Bit 1 is set if this + // order is a Long-Term order (0x40, or 64 as a uint8). Bit 2 is set if this + // order is a Conditional order (0x20, or 32 as a uint8). + // + // If neither bit is set, the order is assumed to be a Short-Term order. + // + // If both bits are set or bits other than the 2nd and 3rd are set, the order + // ID is invalid. + uint32 order_flags = 3; + + // ID of the CLOB the order is created for. + uint32 clob_pair_id = 4; +} + +// OrdersFilledDuringLatestBlock represents a list of `OrderIds` that were +// filled by any non-zero amount in the latest block. +message OrdersFilledDuringLatestBlock { + // A list of unique order_ids that were filled by any non-zero amount in the + // latest block. + repeated OrderId order_ids = 1 [ (gogoproto.nullable) = false ]; +} + +// PotentiallyPrunableOrders represents a list of orders that may be prunable +// from state at a future block height. +message PotentiallyPrunableOrders { + // A list of unique order_ids that may potentially be pruned from state at a + // future block height. + repeated OrderId order_ids = 1 [ (gogoproto.nullable) = false ]; +} + +// OrderFillState represents the fill amount of an order according to on-chain +// state. This proto includes both the current on-chain fill amount of the +// order, as well as the block at which this information can be pruned from +// state. +message OrderFillState { + // The current fillAmount of the order according to on-chain state. + uint64 fill_amount = 1; + // The block height at which the fillAmount state for this order can be + // pruned. + uint32 prunable_block_height = 2; +} + +// StatefulOrderTimeSliceValue represents the type of the value of the +// `StatefulOrdersTimeSlice` in state. The `StatefulOrdersTimeSlice` +// in state consists of key/value pairs where the keys are UTF-8-encoded +// `RFC3339NANO` timestamp strings with right-padded zeroes and no +// time zone info, and the values are of type `StatefulOrderTimeSliceValue`. +// This `StatefulOrderTimeSliceValue` in state is used for managing stateful +// order expiration. Stateful order expirations can be for either long term +// or conditional orders. +message StatefulOrderTimeSliceValue { + // A unique list of order_ids that expire at this timestamp, sorted in + // ascending order by block height and transaction index of each stateful + // order. + repeated OrderId order_ids = 1 [ (gogoproto.nullable) = false ]; +} + +// LongTermOrderPlacement represents the placement of a stateful order in +// state. It stores the stateful order itself and the `BlockHeight` and +// `TransactionIndex` at which the order was placed. +message LongTermOrderPlacement { + Order order = 1 [ (gogoproto.nullable) = false ]; + + // The block height and transaction index at which the order was placed. + // Used for ordering by time priority when the chain is restarted. + TransactionOrdering placement_index = 2 [ (gogoproto.nullable) = false ]; +} + +// ConditionalOrderPlacement represents the placement of a conditional order in +// state. It stores the stateful order itself, the `BlockHeight` and +// `TransactionIndex` at which the order was placed and triggered. +message ConditionalOrderPlacement { + Order order = 1 [ (gogoproto.nullable) = false ]; + + // The block height and transaction index at which the order was placed. + TransactionOrdering placement_index = 2 [ (gogoproto.nullable) = false ]; + + // The block height and transaction index at which the order was triggered. + // Set to be nil if the transaction has not been triggered. + // Used for ordering by time priority when the chain is restarted. + TransactionOrdering trigger_index = 3; +} + +// Order represents a single order belonging to a `Subaccount` +// for a particular `ClobPair`. +message Order { + // The unique ID of this order. Meant to be unique across all orders. + OrderId order_id = 1 [ (gogoproto.nullable) = false ]; + + // Represents the side of the orderbook the order will be placed on. + // Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be + // placed on the orderbook. + enum Side { + // Default value. This value is invalid and unused. + SIDE_UNSPECIFIED = 0; + // SIDE_BUY is used to represent a BUY order. + SIDE_BUY = 1; + // SIDE_SELL is used to represent a SELL order. + SIDE_SELL = 2; + } + + Side side = 2; + + // The size of this order in base quantums. Must be a multiple of + // `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`). + uint64 quantums = 3; + + // The price level that this order will be placed at on the orderbook, + // in subticks. Must be a multiple of ClobPair.SubticksPerTick + // (where `ClobPair.Id = orderId.ClobPairId`). + uint64 subticks = 4; + + // Information about when the order expires. + oneof good_til_oneof { + // The last block this order can be executed at (after which it will be + // unfillable). Used only for Short-Term orders. If this value is non-zero + // then the order is assumed to be a Short-Term order. + uint32 good_til_block = 5; + + // good_til_block_time represents the unix timestamp (in seconds) at which a + // stateful order will be considered expired. The + // good_til_block_time is always evaluated against the previous block's + // `BlockTime` instead of the block in which the order is committed. If this + // value is non-zero then the order is assumed to be a stateful or + // conditional order. + fixed32 good_til_block_time = 6; + } + + // TimeInForce indicates how long an order will remain active before it + // is executed or expires. + enum TimeInForce { + // TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an + // order will first match with existing orders on the book, and any + // remaining size will be added to the book as a maker order. + TIME_IN_FORCE_UNSPECIFIED = 0; + // TIME_IN_FORCE_IOC enforces that an order only be matched with + // maker orders on the book. If the order has remaining size after + // matching with existing orders on the book, the remaining size + // is not placed on the book. + TIME_IN_FORCE_IOC = 1; + // TIME_IN_FORCE_POST_ONLY enforces that an order only be placed + // on the book as a maker order. Note this means that validators will cancel + // any newly-placed post only orders that would cross with other maker + // orders. + TIME_IN_FORCE_POST_ONLY = 2; + // TIME_IN_FORCE_FILL_OR_KILL has been deprecated and will be removed in + // future versions. + TIME_IN_FORCE_FILL_OR_KILL = 3 [ deprecated = true ]; + } + + // The time in force of this order. + TimeInForce time_in_force = 7; + + // Enforces that the order can only reduce the size of an existing position. + // If a ReduceOnly order would change the side of the existing position, + // its size is reduced to that of the remaining size of the position. + // If existing orders on the book with ReduceOnly + // would already close the position, the least aggressive (out-of-the-money) + // ReduceOnly orders are resized and canceled first. + bool reduce_only = 8; + + // Set of bit flags set arbitrarily by clients and ignored by the protocol. + // Used by indexer to infer information about a placed order. + uint32 client_metadata = 9; + + enum ConditionType { + // CONDITION_TYPE_UNSPECIFIED represents the default behavior where an + // order will be placed immediately on the orderbook. + CONDITION_TYPE_UNSPECIFIED = 0; + // CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will + // trigger when the oracle price moves at or above the trigger price for + // buys, and at or below the trigger price for sells. + CONDITION_TYPE_STOP_LOSS = 1; + // CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit + // order will trigger when the oracle price moves at or below the trigger + // price for buys and at or above the trigger price for sells. + CONDITION_TYPE_TAKE_PROFIT = 2; + } + + ConditionType condition_type = 10; + + // conditional_order_trigger_subticks represents the price at which this order + // will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED, + // this value is enforced to be 0. If this value is nonzero, condition_type + // cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks. + // Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id = + // orderId.ClobPairId`). + uint64 conditional_order_trigger_subticks = 11; +} + +// TransactionOrdering represents a unique location in the block where a +// transaction was placed. This proto includes both block height and the +// transaction index that the specific transaction was placed. This information +// is used for ordering by time priority when the chain is restarted. +message TransactionOrdering { + // Block height in which the transaction was placed. + uint32 block_height = 1; + + // Within the block, the unique transaction index. + uint32 transaction_index = 2; +} + +// StreamLiquidationOrder represents an protocol-generated IOC liquidation +// order. Used in full node streaming. +message StreamLiquidationOrder { + // Information about this liquidation order. + PerpetualLiquidationInfo liquidation_info = 1; + + // CLOB pair ID of the CLOB pair the liquidation order will be matched + // against. + uint32 clob_pair_id = 2; + + // True if this is a buy order liquidating a short position, false if vice + // versa. + bool is_buy = 3; + + // The number of base quantums for this liquidation order. + uint64 quantums = 4; + + // The subticks this liquidation order will be submitted at. + uint64 subticks = 5; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/order_removals.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/order_removals.proto new file mode 100644 index 00000000..5c6d45a9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/order_removals.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/clob/order.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// OrderRemoval is a request type used for forced removal of stateful orders. +message OrderRemoval { + OrderId order_id = 1 [ (gogoproto.nullable) = false ]; + + enum RemovalReason { + // REMOVAL_REASON_UNSPECIFIED represents an unspecified removal reason. This + // removal reason is used as a catchall and should never appear on an + // OrderRemoval in the operations queue. + REMOVAL_REASON_UNSPECIFIED = 0; + // REMOVAL_REASON_UNDERCOLLATERALIZED represents a removal of an order which + // if filled in isolation with respect to the current state of the + // subaccount would leave the subaccount undercollateralized. + REMOVAL_REASON_UNDERCOLLATERALIZED = 1; + // REMOVAL_REASON_INVALID_REDUCE_ONLY represents a removal of a reduce-only + // order which if filled in isolation with respect to the current state of + // the subaccount would cause the subaccount's existing position to increase + // or change sides. + REMOVAL_REASON_INVALID_REDUCE_ONLY = 2; + // REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER represents a removal of + // a stateful post-only order that was deemed invalid because it crossed + // maker orders on the book of the proposer. + REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER = 3; + // REMOVAL_REASON_INVALID_SELF_TRADE represents a removal of a stateful + // order that was deemed invalid because it constituted a self trade on the + // proposers orderbook. + REMOVAL_REASON_INVALID_SELF_TRADE = 4; + // REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED represents a + // removal of a conditional FOK order that was deemed invalid because it + // could not be completely filled. Conditional FOK orders should always be + // fully-filled or removed in the block after they are triggered. + REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED = 5; + // REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK represents a removal + // of a conditional IOC order. + // Conditional IOC orders should always have their remaining size removed + // in the block after they are triggered. + REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK = 6; + // REMOVAL_REASON_FULLY_FILLED represents a removal of an order that + // was fully filled and should therefore be removed from state. + REMOVAL_REASON_FULLY_FILLED = 7; + // REMOVAL_REASON_FULLY_FILLED represents a removal of an order that + // would lead to the subaccount violating isolated subaccount constraints. + REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS = 8; + } + + RemovalReason removal_reason = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/process_proposer_matches_events.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/process_proposer_matches_events.proto new file mode 100644 index 00000000..722aec8b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/process_proposer_matches_events.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/clob/order.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// ProcessProposerMatchesEvents is used for communicating which events occurred +// in the last block that require updating the state of the memclob in the +// Commit blocker. It contains information about the following state updates: +// - Long term order IDs that were placed in the last block. +// - Stateful order IDs that were expired in the last block. +// - Order IDs that were filled in the last block. +// - Stateful cancellations order IDs that were placed in the last block. +// - Stateful order IDs forcefully removed in the last block. +// - Conditional order IDs triggered in the last block. +// - Conditional order IDs placed, but not triggered in the last block. +// - The height of the block in which the events occurred. +message ProcessProposerMatchesEvents { + repeated dydxprotocol.clob.OrderId placed_long_term_order_ids = 1 + [ (gogoproto.nullable) = false, deprecated = true ]; + repeated dydxprotocol.clob.OrderId expired_stateful_order_ids = 2 + [ (gogoproto.nullable) = false ]; + repeated dydxprotocol.clob.OrderId order_ids_filled_in_last_block = 3 + [ (gogoproto.nullable) = false ]; + repeated dydxprotocol.clob.OrderId placed_stateful_cancellation_order_ids = 4 + [ (gogoproto.nullable) = false, deprecated = true ]; + repeated dydxprotocol.clob.OrderId removed_stateful_order_ids = 5 + [ (gogoproto.nullable) = false ]; + repeated dydxprotocol.clob.OrderId + conditional_order_ids_triggered_in_last_block = 6 + [ (gogoproto.nullable) = false ]; + repeated dydxprotocol.clob.OrderId placed_conditional_order_ids = 7 + [ (gogoproto.nullable) = false, deprecated = true ]; + uint32 block_height = 8; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/query.proto new file mode 100644 index 00000000..b0342bc3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/query.proto @@ -0,0 +1,265 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "dydxprotocol/clob/block_rate_limit_config.proto"; +import "dydxprotocol/clob/clob_pair.proto"; +import "dydxprotocol/clob/equity_tier_limit_config.proto"; +import "dydxprotocol/clob/order.proto"; +import "dydxprotocol/clob/matches.proto"; +import "dydxprotocol/clob/liquidations_config.proto"; +import "dydxprotocol/clob/mev.proto"; +import "dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto"; +import "dydxprotocol/subaccounts/streaming.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries a ClobPair by id. + rpc ClobPair(QueryGetClobPairRequest) returns (QueryClobPairResponse) { + option (google.api.http).get = "/dydxprotocol/clob/clob_pair/{id}"; + } + + // Queries a list of ClobPair items. + rpc ClobPairAll(QueryAllClobPairRequest) returns (QueryClobPairAllResponse) { + option (google.api.http).get = "/dydxprotocol/clob/clob_pair"; + } + + // Runs the MEV node <> node calculation with the provided parameters. + rpc MevNodeToNodeCalculation(MevNodeToNodeCalculationRequest) + returns (MevNodeToNodeCalculationResponse) { + option (google.api.http) = { + post : "/dydxprotocol/clob/mev_node_to_node_calculation" + body : "*" + }; + } + + // Queries EquityTierLimitConfiguration. + rpc EquityTierLimitConfiguration(QueryEquityTierLimitConfigurationRequest) + returns (QueryEquityTierLimitConfigurationResponse) { + option (google.api.http).get = "/dydxprotocol/clob/equity_tier"; + } + + // Queries BlockRateLimitConfiguration. + rpc BlockRateLimitConfiguration(QueryBlockRateLimitConfigurationRequest) + returns (QueryBlockRateLimitConfigurationResponse) { + option (google.api.http).get = "/dydxprotocol/clob/block_rate"; + } + + // Queries LiquidationsConfiguration. + rpc LiquidationsConfiguration(QueryLiquidationsConfigurationRequest) + returns (QueryLiquidationsConfigurationResponse) { + option (google.api.http).get = "/dydxprotocol/clob/liquidations_config"; + } + + // Queries the stateful order for a given order id. + rpc StatefulOrder(QueryStatefulOrderRequest) + returns (QueryStatefulOrderResponse) {} + + // GRPC Streams + + // Streams orderbook updates. Updates contain orderbook data + // such as order placements, updates, and fills. + rpc StreamOrderbookUpdates(StreamOrderbookUpdatesRequest) + returns (stream StreamOrderbookUpdatesResponse); +} + +// QueryGetClobPairRequest is request type for the ClobPair method. +message QueryGetClobPairRequest { uint32 id = 1; } + +// QueryClobPairResponse is response type for the ClobPair method. +message QueryClobPairResponse { + ClobPair clob_pair = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAllClobPairRequest is request type for the ClobPairAll method. +message QueryAllClobPairRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClobPairAllResponse is response type for the ClobPairAll method. +message QueryClobPairAllResponse { + repeated ClobPair clob_pair = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// MevNodeToNodeCalculationRequest is a request message used to run the +// MEV node <> node calculation. +message MevNodeToNodeCalculationRequest { + // Represents the matches on the "block proposer". Note that this field + // does not need to be the actual block proposer's matches for a block, since + // the MEV calculation logic is run with this nodes matches as the "block + // proposer" matches. + dydxprotocol.clob.ValidatorMevMatches block_proposer_matches = 1; + // Represents the matches and mid-prices on the validator. + dydxprotocol.clob.MevNodeToNodeMetrics validator_mev_metrics = 2; +} + +// MevNodeToNodeCalculationResponse is a response message that contains the +// MEV node <> node calculation result. +message MevNodeToNodeCalculationResponse { + // MevAndVolumePerClob contains information about the MEV and volume per CLOB. + message MevAndVolumePerClob { + uint32 clob_pair_id = 1; + float mev = 2; + uint64 volume = 3; + } + repeated MevAndVolumePerClob results = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryEquityTierLimitConfigurationRequest is a request message for +// EquityTierLimitConfiguration. +message QueryEquityTierLimitConfigurationRequest {} + +// QueryEquityTierLimitConfigurationResponse is a response message that contains +// the EquityTierLimitConfiguration. +message QueryEquityTierLimitConfigurationResponse { + EquityTierLimitConfiguration equity_tier_limit_config = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryBlockRateLimitConfigurationRequest is a request message for +// BlockRateLimitConfiguration. +message QueryBlockRateLimitConfigurationRequest {} + +// QueryBlockRateLimitConfigurationResponse is a response message that contains +// the BlockRateLimitConfiguration. +message QueryBlockRateLimitConfigurationResponse { + BlockRateLimitConfiguration block_rate_limit_config = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryStatefulOrderRequest is a request message for StatefulOrder. +message QueryStatefulOrderRequest { + // Order id to query. + OrderId order_id = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryStatefulOrderResponse is a response message that contains the stateful +// order. +message QueryStatefulOrderResponse { + // Stateful order placement. + LongTermOrderPlacement order_placement = 1 [ (gogoproto.nullable) = false ]; + + // Fill amounts. + uint64 fill_amount = 2; + + // Triggered status. + bool triggered = 3; +} + +// QueryLiquidationsConfigurationRequest is a request message for +// LiquidationsConfiguration. +message QueryLiquidationsConfigurationRequest {} + +// QueryLiquidationsConfigurationResponse is a response message that contains +// the LiquidationsConfiguration. +message QueryLiquidationsConfigurationResponse { + LiquidationsConfig liquidations_config = 1 [ (gogoproto.nullable) = false ]; +} + +// StreamOrderbookUpdatesRequest is a request message for the +// StreamOrderbookUpdates method. +message StreamOrderbookUpdatesRequest { + // Clob pair ids to stream orderbook updates for. + repeated uint32 clob_pair_id = 1; + + // Subaccount ids to stream subaccount updates for. + repeated dydxprotocol.subaccounts.SubaccountId subaccount_ids = 2; +} + +// StreamOrderbookUpdatesResponse is a response message for the +// StreamOrderbookUpdates method. +message StreamOrderbookUpdatesResponse { + // Batch of updates for the clob pair. + repeated StreamUpdate updates = 1 [ (gogoproto.nullable) = false ]; +} + +// StreamUpdate is an update that will be pushed through the +// GRPC stream. +message StreamUpdate { + // Contains one of an StreamOrderbookUpdate, + // StreamOrderbookFill, StreamTakerOrderStatus. + oneof update_message { + StreamOrderbookUpdate orderbook_update = 1; + StreamOrderbookFill order_fill = 2; + StreamTakerOrder taker_order = 3; + dydxprotocol.subaccounts.StreamSubaccountUpdate subaccount_update = 4; + } + + // Block height of the update. + uint32 block_height = 5; + + // Exec mode of the update. + uint32 exec_mode = 6; +} + +// StreamOrderbookUpdate provides information on an orderbook update. Used in +// the full node GRPC stream. +message StreamOrderbookUpdate { + // Orderbook updates for the clob pair. Can contain order place, removals, + // or updates. + repeated dydxprotocol.indexer.off_chain_updates.OffChainUpdateV1 updates = 1 + [ (gogoproto.nullable) = false ]; + + // Snapshot indicates if the response is from a snapshot of the orderbook. + // All updates should be ignored until snapshot is recieved. + // If the snapshot is true, then all previous entries should be + // discarded and the orderbook should be resynced. + bool snapshot = 2; +} + +// StreamOrderbookFill provides information on an orderbook fill. Used in +// the full node GRPC stream. +message StreamOrderbookFill { + // Clob match. Provides information on which orders were matched + // and the type of order. + ClobMatch clob_match = 1; + + // All orders involved in the specified clob match. Used to look up + // price of a match through a given maker order id. + repeated Order orders = 2 [ (gogoproto.nullable) = false ]; + + // Resulting fill amounts for each order in the orders array. + repeated uint64 fill_amounts = 3; +} + +// StreamTakerOrder provides information on a taker order that was attempted +// to be matched on the orderbook. +// It is intended to be used only in full node streaming. +message StreamTakerOrder { + // The taker order that was matched on the orderbook. Can be a + // regular order or a liquidation order. + oneof taker_order { + Order order = 1; + StreamLiquidationOrder liquidation_order = 2; + } + + // Information on the taker order after it is matched on the book, + // either successfully or unsuccessfully. + StreamTakerOrderStatus taker_order_status = 3; +} + +// StreamTakerOrderStatus is a representation of a taker order +// after it is attempted to be matched on the orderbook. +// It is intended to be used only in full node streaming. +message StreamTakerOrderStatus { + // The state of the taker order after attempting to match it against the + // orderbook. Possible enum values can be found here: + // https://github.com/dydxprotocol/v4-chain/blob/main/protocol/x/clob/types/orderbook.go#L105 + uint32 order_status = 1; + + // The amount of remaining (non-matched) base quantums of this taker order. + uint64 remaining_quantums = 2; + + // The amount of base quantums that were *optimistically* filled for this + // taker order when the order is matched against the orderbook. Note that if + // any quantums of this order were optimistically filled or filled in state + // before this invocation of the matching loop, this value will not include + // them. + uint64 optimistically_filled_quantums = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/tx.proto new file mode 100644 index 00000000..d11ebb35 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/clob/tx.proto @@ -0,0 +1,213 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/clob/block_rate_limit_config.proto"; +import "dydxprotocol/clob/clob_pair.proto"; +import "dydxprotocol/clob/equity_tier_limit_config.proto"; +import "dydxprotocol/clob/matches.proto"; +import "dydxprotocol/clob/order.proto"; +import "dydxprotocol/clob/order_removals.proto"; +import "dydxprotocol/clob/liquidations_config.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; + +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// Msg defines the Msg service. +service Msg { + // ProposedOperations is a temporary message used by block proposers + // for matching orders as part of the ABCI++ workaround. + rpc ProposedOperations(MsgProposedOperations) + returns (MsgProposedOperationsResponse); + // PlaceOrder allows accounts to place orders on the orderbook. + rpc PlaceOrder(MsgPlaceOrder) returns (MsgPlaceOrderResponse); + // CancelOrder allows accounts to cancel existing orders on the orderbook. + rpc CancelOrder(MsgCancelOrder) returns (MsgCancelOrderResponse); + // BatchCancel allows accounts to cancel a batch of orders on the orderbook. + rpc BatchCancel(MsgBatchCancel) returns (MsgBatchCancelResponse); + // CreateClobPair creates a new clob pair. + rpc CreateClobPair(MsgCreateClobPair) returns (MsgCreateClobPairResponse); + // UpdateClobPair sets the status of a clob pair. Should return an error + // if the authority is not in the clob keeper's set of authorities, + // if the ClobPair id is not found in state, or if the update includes + // an unsupported status transition. + rpc UpdateClobPair(MsgUpdateClobPair) returns (MsgUpdateClobPairResponse); + // UpdateEquityTierLimitConfiguration updates the equity tier limit + // configuration in state. + rpc UpdateEquityTierLimitConfiguration(MsgUpdateEquityTierLimitConfiguration) + returns (MsgUpdateEquityTierLimitConfigurationResponse); + // UpdateBlockRateLimitConfiguration updates the block rate limit + // configuration in state. + rpc UpdateBlockRateLimitConfiguration(MsgUpdateBlockRateLimitConfiguration) + returns (MsgUpdateBlockRateLimitConfigurationResponse); + // UpdateLiquidationsConfig updates the liquidations configuration in state. + rpc UpdateLiquidationsConfig(MsgUpdateLiquidationsConfig) + returns (MsgUpdateLiquidationsConfigResponse); +} + +// MsgCreateClobPair is a message used by x/gov for creating a new clob pair. +message MsgCreateClobPair { + option (cosmos.msg.v1.signer) = "authority"; + + // The address that controls the module. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // `clob_pair` defines parameters for the new clob pair. + ClobPair clob_pair = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateClobPairResponse defines the CreateClobPair response type. +message MsgCreateClobPairResponse {} + +// MsgProposedOperations is a message injected by block proposers to +// specify the operations that occurred in a block. +message MsgProposedOperations { + // The list of operations proposed by the block proposer. + repeated OperationRaw operations_queue = 1 [ (gogoproto.nullable) = false ]; +} + +// MsgProposedOperationsResponse is the response type of the message injected +// by block proposers to specify the operations that occurred in a block. +message MsgProposedOperationsResponse {} + +// MsgPlaceOrder is a request type used for placing orders. +message MsgPlaceOrder { Order order = 1 [ (gogoproto.nullable) = false ]; } + +// MsgPlaceOrderResponse is a response type used for placing orders. +message MsgPlaceOrderResponse {} + +// MsgCancelOrder is a request type used for canceling orders. +message MsgCancelOrder { + OrderId order_id = 1 [ (gogoproto.nullable) = false ]; + // Information about when the order cancellation expires. + oneof good_til_oneof { + // The last block this order cancellation can be executed at. + // Used only for Short-Term orders and must be zero for stateful orders. + uint32 good_til_block = 2; + + // good_til_block_time represents the unix timestamp (in seconds) at which a + // stateful order cancellation will be considered expired. The + // good_til_block_time is always evaluated against the previous block's + // `BlockTime` instead of the block in which the order is committed. + // This value must be zero for Short-Term orders. + fixed32 good_til_block_time = 3; + } +} + +// MsgCancelOrderResponse is a response type used for canceling orders. +message MsgCancelOrderResponse {} + +// MsgBatchCancel is a request type used for batch canceling orders. +// This msg is not atomic. Cancels will be performed optimistically even +// if some cancels are invalid or fail. +message MsgBatchCancel { + // The subaccount this batch cancel will be applied for. + dydxprotocol.subaccounts.SubaccountId subaccount_id = 1 + [ (gogoproto.nullable) = false ]; + + // The batch of short term orders that will be cancelled. + repeated OrderBatch short_term_cancels = 2 [ (gogoproto.nullable) = false ]; + + // The last block the short term order cancellations can be executed at. + uint32 good_til_block = 3; +} + +// OrderBatch represents a batch of orders all belonging to a single clob pair +// id. Along with a subaccount id and an order flag, is used to represent a +// batch of orders that share the same subaccount, order flag, and clob pair id. +message OrderBatch { + // The Clob Pair ID all orders in this order batch belong to. + uint32 clob_pair_id = 1; + // List of client ids in this order batch. + // Note that this is serialized as a uint32 instead of a fixed32 to + // avoid issues when decoding repeated packed fixed32. + repeated uint32 client_ids = 2; +} + +// MsgBatchCancelResponse is a response type used for batch canceling orders. +// It indicates which cancel orders have succeeded or failed. +message MsgBatchCancelResponse { + // A batch of short term cancel orders that have succeeded. + repeated OrderBatch short_term_succeeded = 1; + // A batch of short term cancel orders that have failed. + repeated OrderBatch short_term_failed = 2; +} + +// MsgUpdateClobPair is a request type used for updating a ClobPair in state. +message MsgUpdateClobPair { + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address that may send this message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // `clob_pair` is the ClobPair to write to state. + ClobPair clob_pair = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateClobPairResponse is a response type used for setting a ClobPair's +// status. +message MsgUpdateClobPairResponse {} + +// OperationRaw represents an operation in the proposed operations. +// Note that the `order_placement` operation is a signed message. +message OperationRaw { + // operationRaw represents an operation that occurred, which can be a match, + // a signed order placement, or an order removal. + oneof operation { + ClobMatch match = 1; + bytes short_term_order_placement = 2; + OrderRemoval order_removal = 3; + } +} + +// MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration +// request type. +message MsgUpdateEquityTierLimitConfiguration { + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Defines the equity tier limit configuration to update to. All fields must + // be set. + EquityTierLimitConfiguration equity_tier_limit_config = 2 + [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration +// response type. +message MsgUpdateEquityTierLimitConfigurationResponse {} + +// MsgUpdateBlockRateLimitConfiguration is the Msg/BlockRateLimitConfiguration +// request type. +message MsgUpdateBlockRateLimitConfiguration { + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Defines the block rate limit configuration to update to. All fields must be + // set. + BlockRateLimitConfiguration block_rate_limit_config = 3 + [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateBlockRateLimitConfiguration is a response type for updating the +// liquidations config. +message MsgUpdateBlockRateLimitConfigurationResponse {} + +// MsgUpdateLiquidationsConfig is a request type for updating the liquidations +// config. +message MsgUpdateLiquidationsConfig { + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address that may send this message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Defines the liquidations configuration to update to. All fields must + // be set. + LiquidationsConfig liquidations_config = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type. +message MsgUpdateLiquidationsConfigResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/bridge/bridge.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/bridge/bridge.proto new file mode 100644 index 00000000..8bffd1d3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/bridge/bridge.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package dydxprotocol.daemons.bridge; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/bridge/bridge_event.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/daemons/bridge/api"; + +// BridgeService defines the gRPC service used by bridge daemon. +service BridgeService { + // Sends a list of newly recognized bridge events. + rpc AddBridgeEvents(AddBridgeEventsRequest) returns (AddBridgeEventsResponse); +} + +// AddBridgeEventsRequest is a request message that contains a list of new +// bridge events. The events should be contiguous and sorted by (unique) id. +message AddBridgeEventsRequest { + repeated dydxprotocol.bridge.BridgeEvent bridge_events = 1 + [ (gogoproto.nullable) = false ]; +} + +// AddBridgeEventsResponse is a response message for BridgeEventRequest. +message AddBridgeEventsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/liquidation/liquidation.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/liquidation/liquidation.proto new file mode 100644 index 00000000..b48584fa --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/liquidation/liquidation.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package dydxprotocol.daemons.liquidation; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/clob/liquidations.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/daemons/liquidation/api"; + +// LiquidationService defines the gRPC service used by liquidation daemon. +service LiquidationService { + // Sends a list of subaccount ids that are potentially liquidatable. + rpc LiquidateSubaccounts(LiquidateSubaccountsRequest) + returns (LiquidateSubaccountsResponse); +} + +// LiquidateSubaccountsRequest is a request message that contains a list of +// subaccount ids that potentially need to be liquidated. The list of subaccount +// ids should not contain duplicates. The application should re-verify these +// subaccount ids against current state before liquidating their positions. +message LiquidateSubaccountsRequest { + // The block height at which the liquidation daemon is processing. + uint32 block_height = 1; + + // The list of liquidatable subaccount ids. + repeated dydxprotocol.subaccounts.SubaccountId liquidatable_subaccount_ids = 2 + [ (gogoproto.nullable) = false ]; + + // The list of subaccount ids with negative total net collateral. + repeated dydxprotocol.subaccounts.SubaccountId negative_tnc_subaccount_ids = 3 + [ (gogoproto.nullable) = false ]; + + // A map of perpetual id to subaccount open position info. + repeated dydxprotocol.clob.SubaccountOpenPositionInfo + subaccount_open_position_info = 4 [ (gogoproto.nullable) = false ]; +} + +// LiquidateSubaccountsResponse is a response message for +// LiquidateSubaccountsRequest. +message LiquidateSubaccountsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/pricefeed/price_feed.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/pricefeed/price_feed.proto new file mode 100644 index 00000000..baeefa26 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/daemons/pricefeed/price_feed.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package dydxprotocol.daemons.pricefeed; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/api"; + +// PriceFeedService provides methods related to market prices. +service PriceFeedService { + // Updates market prices. + rpc UpdateMarketPrices(UpdateMarketPricesRequest) + returns (UpdateMarketPricesResponse) {} +} + +// UpdateMarketPriceRequest is a request message updating market prices. +message UpdateMarketPricesRequest { + repeated MarketPriceUpdate market_price_updates = 1; +} + +// UpdateMarketPricesResponse is a response message for updating market prices. +message UpdateMarketPricesResponse {} + +// ExchangePrice represents a specific exchange's market price +message ExchangePrice { + string exchange_id = 1; + uint64 price = 2; + google.protobuf.Timestamp last_update_time = 3 + [ (gogoproto.nullable) = true, (gogoproto.stdtime) = true ]; +} + +// MarketPriceUpdate represents an update to a single market +message MarketPriceUpdate { + uint32 market_id = 1; + repeated ExchangePrice exchange_prices = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/block_message_ids.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/block_message_ids.proto new file mode 100644 index 00000000..3d1778e9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/block_message_ids.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package dydxprotocol.delaymsg; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/delaymsg/types"; + +// BlockMessageIds stores the id of each message that should be processed at a +// given block height. +message BlockMessageIds { + // ids stores a list of DelayedMessage ids that should be processed at a given + // block height. + repeated uint32 ids = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/delayed_message.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/delayed_message.proto new file mode 100644 index 00000000..c7372e01 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/delayed_message.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package dydxprotocol.delaymsg; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/delaymsg/types"; + +// DelayedMessage is a message that is delayed until a certain block height. +message DelayedMessage { + // The ID of the delayed message. + uint32 id = 1; + + // The message to be executed. + google.protobuf.Any msg = 2; + + // The block height at which the message should be executed. + uint32 block_height = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/genesis.proto new file mode 100644 index 00000000..9793276d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package dydxprotocol.delaymsg; + +import "dydxprotocol/delaymsg/delayed_message.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/delaymsg/types"; + +// GenesisState defines the delaymsg module's genesis state. +message GenesisState { + // delayed_messages is a list of delayed messages. + repeated DelayedMessage delayed_messages = 1; + + // next_delayed_message_id is the id to be assigned to next delayed message. + uint32 next_delayed_message_id = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/query.proto new file mode 100644 index 00000000..16492943 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/query.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package dydxprotocol.delaymsg; + +import "google/api/annotations.proto"; +import "dydxprotocol/delaymsg/delayed_message.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/delaymsg/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the next DelayedMessage's id. + rpc NextDelayedMessageId(QueryNextDelayedMessageIdRequest) + returns (QueryNextDelayedMessageIdResponse) { + option (google.api.http).get = "/dydxprotocol/v4/delaymsg/next_id"; + } + + // Queries the DelayedMessage by id. + rpc Message(QueryMessageRequest) returns (QueryMessageResponse) { + option (google.api.http).get = "/dydxprotocol/v4/delaymsg/message/{id}"; + } + + // Queries the DelayedMessages at a given block height. + rpc BlockMessageIds(QueryBlockMessageIdsRequest) + returns (QueryBlockMessageIdsResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/delaymsg/block/message_ids/{block_height}"; + } +} + +// QueryNextDelayedMessageIdRequest is the request type for the +// NextDelayedMessageId RPC method. +message QueryNextDelayedMessageIdRequest {} + +// QueryNextDelayedMessageIdResponse is the response type for the +// NextDelayedMessageId RPC method. +message QueryNextDelayedMessageIdResponse { + uint32 next_delayed_message_id = 1; +} + +// QueryMessageRequest is the request type for the Message RPC method. +message QueryMessageRequest { uint32 id = 1; } + +// QueryGetMessageResponse is the response type for the Message RPC method. +message QueryMessageResponse { DelayedMessage message = 1; } + +// QueryBlockMessageIdsRequest is the request type for the BlockMessageIds +// RPC method. +message QueryBlockMessageIdsRequest { uint32 block_height = 1; } + +// QueryGetBlockMessageIdsResponse is the response type for the BlockMessageIds +// RPC method. +message QueryBlockMessageIdsResponse { repeated uint32 message_ids = 1; } diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/tx.proto new file mode 100644 index 00000000..a345dab2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/delaymsg/tx.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package dydxprotocol.delaymsg; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/delaymsg/types"; + +// Msg defines the Msg service. +service Msg { + // DelayMessage delays the execution of a message for a given number of + // blocks. + rpc DelayMessage(MsgDelayMessage) returns (MsgDelayMessageResponse); +} + +// MsgDelayMessage is a request type for the DelayMessage method. +message MsgDelayMessage { + // Authority is the address of the module that delays the message. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The message to be delayed. + google.protobuf.Any msg = 2; + + // The number of blocks to delay the message for. + uint32 delay_blocks = 3; +} + +// MsgDelayMessageResponse is a response type for the DelayMessage method. +message MsgDelayMessageResponse { + // The id of the created delayed message. + uint64 id = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/epoch_info.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/epoch_info.proto new file mode 100644 index 00000000..a92121bb --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/epoch_info.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package dydxprotocol.epochs; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/epochs/types"; + +// EpochInfo stores metadata of an epoch timer. +message EpochInfo { + // name is the unique identifier. + string name = 1; + + // next_tick indicates when the next epoch starts (in Unix Epoch seconds), + // if `EpochInfo` has been initialized. + // If `EpochInfo` is not initialized yet, `next_tick` indicates the earliest + // initialization time (see `is_initialized` below). + uint32 next_tick = 2; + + // duration of the epoch in seconds. + uint32 duration = 3; + + // current epoch is the number of the current epoch. + // 0 if `next_tick` has never been reached, positive otherwise. + uint32 current_epoch = 4; + + // current_epoch_start_block indicates the block height when the current + // epoch started. 0 if `current_epoch` is 0. + uint32 current_epoch_start_block = 5; + + // is_initialized indicates whether the `EpochInfo` has been initialized + // and started ticking. + // An `EpochInfo` is initialized when all below conditions are true: + // - Not yet initialized + // - `BlockHeight` >= 2 + // - `BlockTime` >= `next_tick` + bool is_initialized = 6; + + // fast_forward_next_tick specifies whether during initialization, `next_tick` + // should be fast-forwarded to be greater than the current block time. + // If `false`, the original `next_tick` value is + // unchanged during initialization. + // If `true`, `next_tick` will be set to the smallest value `x` greater than + // the current block time such that `(x - next_tick) % duration = 0`. + bool fast_forward_next_tick = 7; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/genesis.proto new file mode 100644 index 00000000..b751ee2a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package dydxprotocol.epochs; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/epochs/epoch_info.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/epochs/types"; + +// GenesisState defines the epochs module's genesis state. +message GenesisState { + repeated EpochInfo epoch_info_list = 1 [ (gogoproto.nullable) = false ]; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/query.proto new file mode 100644 index 00000000..edfbf1d7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/epochs/query.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package dydxprotocol.epochs; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "dydxprotocol/epochs/epoch_info.proto"; +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/epochs/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries a EpochInfo by name. + rpc EpochInfo(QueryGetEpochInfoRequest) returns (QueryEpochInfoResponse) { + option (google.api.http).get = "/dydxprotocol/v4/epochs/epoch_info/{name}"; + } + + // Queries a list of EpochInfo items. + rpc EpochInfoAll(QueryAllEpochInfoRequest) + returns (QueryEpochInfoAllResponse) { + option (google.api.http).get = "/dydxprotocol/v4/epochs/epoch_info"; + } + + // this line is used by starport scaffolding # 2 +} + +// QueryGetEpochInfoRequest is request type for the GetEpochInfo RPC method. +message QueryGetEpochInfoRequest { string name = 1; } + +// QueryEpochInfoResponse is response type for the GetEpochInfo RPC method. +message QueryEpochInfoResponse { + EpochInfo epoch_info = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAllEpochInfoRequest is request type for the AllEpochInfo RPC method. +message QueryAllEpochInfoRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryEpochInfoAllResponse is response type for the AllEpochInfo RPC method. +message QueryEpochInfoAllResponse { + repeated EpochInfo epoch_info = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// this line is used by starport scaffolding # 3 diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/genesis.proto new file mode 100644 index 00000000..1a9ad003 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package dydxprotocol.feetiers; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/feetiers/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types"; + +// GenesisState defines the feetiers module's genesis state. +message GenesisState { + // The parameters for perpetual fees. + PerpetualFeeParams params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/params.proto new file mode 100644 index 00000000..2ae7c941 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/params.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package dydxprotocol.feetiers; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types"; + +// PerpetualFeeParams defines the parameters for perpetual fees. +message PerpetualFeeParams { + // Sorted fee tiers (lowest requirements first). + repeated PerpetualFeeTier tiers = 1; +} + +// A fee tier for perpetuals +message PerpetualFeeTier { + // Human-readable name of the tier, e.g. "Gold". + string name = 1; + + // The trader's absolute volume requirement in quote quantums. + uint64 absolute_volume_requirement = 2; + + // The total volume share requirement. + uint32 total_volume_share_requirement_ppm = 3; + + // The maker volume share requirement. + uint32 maker_volume_share_requirement_ppm = 4; + + // The maker fee once this tier is reached. + sint32 maker_fee_ppm = 5; + + // The taker fee once this tier is reached. + sint32 taker_fee_ppm = 6; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/query.proto new file mode 100644 index 00000000..f1d81fac --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/query.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package dydxprotocol.feetiers; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "dydxprotocol/feetiers/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the PerpetualFeeParams. + rpc PerpetualFeeParams(QueryPerpetualFeeParamsRequest) + returns (QueryPerpetualFeeParamsResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/feetiers/perpetual_fee_params"; + } + + // Queries a user's fee tier + rpc UserFeeTier(QueryUserFeeTierRequest) returns (QueryUserFeeTierResponse) { + option (google.api.http).get = "/dydxprotocol/v4/feetiers/user_fee_tier"; + } +} + +// QueryPerpetualFeeParamsRequest is a request type for the PerpetualFeeParams +// RPC method. +message QueryPerpetualFeeParamsRequest {} + +// QueryPerpetualFeeParamsResponse is a response type for the PerpetualFeeParams +// RPC method. +message QueryPerpetualFeeParamsResponse { + PerpetualFeeParams params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryUserFeeTierRequest is a request type for the UserFeeTier RPC method. +message QueryUserFeeTierRequest { + string user = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// QueryUserFeeTierResponse is a request type for the UserFeeTier RPC method. +message QueryUserFeeTierResponse { + // Index of the fee tier in the list queried from PerpetualFeeParams. + uint32 index = 1; + PerpetualFeeTier tier = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/tx.proto new file mode 100644 index 00000000..e771f041 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/feetiers/tx.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package dydxprotocol.feetiers; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/feetiers/params.proto"; +import "gogoproto/gogo.proto"; + +// Msg defines the Msg service. +service Msg { + // UpdatePerpetualFeeParams updates the PerpetualFeeParams in state. + rpc UpdatePerpetualFeeParams(MsgUpdatePerpetualFeeParams) + returns (MsgUpdatePerpetualFeeParamsResponse); +} + +// MsgUpdatePerpetualFeeParams is the Msg/UpdatePerpetualFeeParams request type. +message MsgUpdatePerpetualFeeParams { + // The address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Defines the parameters to update. All parameters must be supplied. + PerpetualFeeParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdatePerpetualFeeParamsResponse is the Msg/UpdatePerpetualFeeParams +// response type. +message MsgUpdatePerpetualFeeParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/genesis.proto new file mode 100644 index 00000000..fd3ba923 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/genesis.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; +package dydxprotocol.govplus; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/govplus/types"; + +// GenesisState defines the govplus module's genesis state. +message GenesisState {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/query.proto new file mode 100644 index 00000000..434a45a3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/query.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; +package dydxprotocol.govplus; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/govplus/types"; + +// Query defines the gRPC querier service. +service Query {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/tx.proto new file mode 100644 index 00000000..42280bef --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/govplus/tx.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; +package dydxprotocol.govplus; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/govplus/types"; + +// Msg defines the Msg service. +service Msg { + // SlashValidator is exposed to allow slashing of a misbehaving validator via + // governance. + rpc SlashValidator(MsgSlashValidator) returns (MsgSlashValidatorResponse); +} + +// MsgSlashValidator is the Msg/SlashValidator request type. +message MsgSlashValidator { + // The address that controls the module (the gov module account). + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Consensus address of the validator to slash + string validator_address = 2 + [ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ]; + + // Colloquially, the height at which the validator is deemed to have + // misbehaved. In practice, this is the height used to determine the targets + // of the slash. For example, undelegating after this height will not escape + // slashing. This height should be set to a recent height at the time of the + // proposal to prevent delegators from undelegating during the vote period. + // i.e. infraction_height <= proposal submission height. + // + // NB: At the time this message is applied, this height must have occured + // equal to or less than an unbonding period in the past in order for the + // slash to be effective. + // i.e. time(proposal pass height) - time(infraction_height) < unbonding + // period + uint32 infraction_height = 3; + + // Tokens of the validator at the specified height. Used to compute the slash + // amount. The x/staking HistoricalInfo query endpoint can be used to find + // this. + bytes tokens_at_infraction_height = 4 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + + // Multiplier for how much of the validator's stake should be slashed. + // slash_factor * tokens_at_infraction_height = tokens slashed + string slash_factor = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgSlashValidatorResponse is the Msg/SlashValidator response type. +message MsgSlashValidatorResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/events/events.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/events/events.proto new file mode 100644 index 00000000..269011c8 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/events/events.proto @@ -0,0 +1,594 @@ +syntax = "proto3"; +package dydxprotocol.indexer.events; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/indexer/shared/removal_reason.proto"; +import "dydxprotocol/indexer/protocol/v1/clob.proto"; +import "dydxprotocol/indexer/protocol/v1/perpetual.proto"; +import "dydxprotocol/indexer/protocol/v1/subaccount.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/events"; + +// Do not make any breaking changes to these protos, a new version should be +// created if a breaking change is needed. + +// FundingUpdate is used for funding update events and includes a funding +// value and an optional funding index that correspond to a perpetual market. +message FundingUpdateV1 { + // The id of the perpetual market. + uint32 perpetual_id = 1; + // funding value (in parts-per-million) can be premium vote, premium sample, + // or funding rate. + int32 funding_value_ppm = 2; + // funding index is required if and only if parent `FundingEvent` type is + // `TYPE_FUNDING_RATE_AND_INDEX`. + bytes funding_index = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// FundingEvent message contains a list of per-market funding values. The +// funding values in the list is of the same type and the types are: which can +// have one of the following types: +// 1. Premium vote: votes on the premium values injected by block proposers. +// 2. Premium sample: combined value from all premium votes during a +// `funding-sample` epoch. +// 3. Funding rate and index: final funding rate combining all premium samples +// during a `funding-tick` epoch and funding index accordingly updated with +// `funding rate * price`. +message FundingEventV1 { + // updates is a list of per-market funding updates for all existing perpetual + // markets. The list is sorted by `perpetualId`s which are unique. + repeated FundingUpdateV1 updates = 1 [ (gogoproto.nullable) = false ]; + + // Type is the type for funding values. + enum Type { + // Unspecified type. + TYPE_UNSPECIFIED = 0; + // Premium sample is the combined value from all premium votes during a + // `funding-sample` epoch. + TYPE_PREMIUM_SAMPLE = 1; + // Funding rate is the final funding rate combining all premium samples + // during a `funding-tick` epoch. + TYPE_FUNDING_RATE_AND_INDEX = 2; + // TODO(DEC-1513): Investigate whether premium vote values need to be + // sent to indexer. + TYPE_PREMIUM_VOTE = 3; + } + + // type stores the type of funding updates. + Type type = 2; +} + +// MarketEvent message contains all the information about a market event on +// the dYdX chain. +message MarketEventV1 { + // market id. + uint32 market_id = 1; + + // either an event for price update, market creation, or market modification. + oneof event { + MarketPriceUpdateEventV1 price_update = 2; + MarketCreateEventV1 market_create = 3; + MarketModifyEventV1 market_modify = 4; + } +} + +// MarketPriceUpdateEvent message contains all the information about a price +// update on the dYdX chain. +message MarketPriceUpdateEventV1 { + // price_with_exponent. Multiply by 10 ^ Exponent to get the human readable + // price in dollars. For example if `Exponent == -5` then a `exponent_price` + // of `1,000,000,000` represents “$10,000`. + uint64 price_with_exponent = 1; +} + +// shared fields between MarketCreateEvent and MarketModifyEvent +message MarketBaseEventV1 { + // String representation of the market pair, e.g. `BTC-USD` + string pair = 1; + // The minimum allowable change in the Price value for a given update. + // Measured as 1e-6. + uint32 min_price_change_ppm = 2; +} + +// MarketCreateEvent message contains all the information about a new market on +// the dYdX chain. +message MarketCreateEventV1 { + MarketBaseEventV1 base = 1; + // Static value. The exponent of the price. + // For example if Exponent == -5 then a `exponent_price` of 1,000,000,000 + // represents $10,000. Therefore 10 ^ Exponent represents the smallest + // price step (in dollars) that can be recorded. + sint32 exponent = 2; +} + +// MarketModifyEvent message contains all the information about a market update +// on the dYdX chain +message MarketModifyEventV1 { MarketBaseEventV1 base = 1; } + +// SourceOfFunds is the source of funds in a transfer event. +message SourceOfFunds { + // one of below + // - a subaccount ID + // - a wallet address + oneof source { + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId subaccount_id = 1; + string address = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + } +} +// TransferEvent message contains all the information about a transfer, +// deposit-to-subaccount, or withdraw-from-subaccount on the dYdX chain. +// When a subaccount is involved, a SubaccountUpdateEvent message will +// be produced with the updated asset positions. +message TransferEventV1 { + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId sender_subaccount_id = 1; + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId recipient_subaccount_id = + 2; + // Id of the asset transfered. + uint32 asset_id = 3; + // The amount of asset in quantums to transfer. + uint64 amount = 4; + // The sender is one of below + // - a subaccount ID (in transfer and withdraw events). + // - a wallet address (in deposit events). + SourceOfFunds sender = 5; + // The recipient is one of below + // - a subaccount ID (in transfer and deposit events). + // - a wallet address (in withdraw events). + SourceOfFunds recipient = 6; +} + +// OrderFillEvent message contains all the information from an order match in +// the dYdX chain. This includes the maker/taker orders that matched and the +// amount filled. +message OrderFillEventV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrder maker_order = 1 + [ (gogoproto.nullable) = false ]; + // The type of order fill this event represents. + oneof taker_order { + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 2; + LiquidationOrderV1 liquidation_order = 4; + } + // Fill amount in base quantums. + uint64 fill_amount = 3; + // Maker fee in USDC quantums. + sint64 maker_fee = 5; + // Taker fee in USDC quantums. If the taker order is a liquidation, then this + // represents the special liquidation fee, not the standard taker fee. + sint64 taker_fee = 6; + // Total filled of the maker order in base quantums. + uint64 total_filled_maker = 7; + // Total filled of the taker order in base quantums. + uint64 total_filled_taker = 8; + // rev share for affiliates in USDC quantums. + uint64 affiliate_rev_share = 9; +} + +// DeleveragingEvent message contains all the information for a deleveraging +// on the dYdX chain. This includes the liquidated/offsetting subaccounts and +// the amount filled. +message DeleveragingEventV1 { + // ID of the subaccount that was liquidated. + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId liquidated = 1 + [ (gogoproto.nullable) = false ]; + // ID of the subaccount that was used to offset the position. + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId offsetting = 2 + [ (gogoproto.nullable) = false ]; + // The ID of the perpetual that was liquidated. + uint32 perpetual_id = 3; + // The amount filled between the liquidated and offsetting position, in + // base quantums. + uint64 fill_amount = 4; + // Total quote quantums filled. + uint64 total_quote_quantums = 5; + // `true` if liquidating a short position, `false` otherwise. + bool is_buy = 6; + // `true` if the deleveraging event is for final settlement, indicating + // the match occurred at the oracle price rather than bankruptcy price. + // When this flag is `false`, the fill price is the bankruptcy price + // of the liquidated subaccount. + bool is_final_settlement = 7; +} + +// LiquidationOrder represents the liquidation taker order to be included in a +// liquidation order fill event. +message LiquidationOrderV1 { + // ID of the subaccount that was liquidated. + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId liquidated = 1 + [ (gogoproto.nullable) = false ]; + // The ID of the clob pair involved in the liquidation. + uint32 clob_pair_id = 2; + // The ID of the perpetual involved in the liquidation. + uint32 perpetual_id = 3; + // The total size of the liquidation order including any unfilled size, + // in base quantums. + uint64 total_size = 4; + // `true` if liquidating a short position, `false` otherwise. + bool is_buy = 5; + // The fillable price in subticks. + // This represents the lower-price-bound for liquidating longs + // and the upper-price-bound for liquidating shorts. + // Must be a multiple of ClobPair.SubticksPerTick + // (where `ClobPair.Id = orderId.ClobPairId`). + uint64 subticks = 6; +} + +// SubaccountUpdateEvent message contains information about an update to a +// subaccount in the dYdX chain. This includes the list of updated perpetual +// and asset positions for the subaccount. +// Note: This event message will contain all the updates to a subaccount +// at the end of a block which is why multiple asset/perpetual position +// updates may exist. +message SubaccountUpdateEventV1 { + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId subaccount_id = 1; + // deprecated new_quote_balance field + reserved 2; + // updated_perpetual_positions will each be for unique perpetuals. + repeated dydxprotocol.indexer.protocol.v1.IndexerPerpetualPosition + updated_perpetual_positions = 3; + // updated_asset_positions will each be for unique assets. + repeated dydxprotocol.indexer.protocol.v1.IndexerAssetPosition + updated_asset_positions = 4; +} + +// StatefulOrderEvent message contains information about a change to a stateful +// order. Currently, this is either the placement of a long-term order, the +// placement or triggering of a conditional order, or the removal of a +// stateful order. +message StatefulOrderEventV1 { + reserved 2, 3; + + // The type of event that this StatefulOrderEvent contains. + oneof event { + StatefulOrderPlacementV1 order_place = 1 + [ deprecated = + true ]; // Deprecated in favor of long_term_order_placement + StatefulOrderRemovalV1 order_removal = 4; + ConditionalOrderPlacementV1 conditional_order_placement = 5; + ConditionalOrderTriggeredV1 conditional_order_triggered = 6; + LongTermOrderPlacementV1 long_term_order_placement = 7; + LongTermOrderReplacementV1 order_replacement = 8; + } + + // A stateful order placement contains an order. + // Deprecated in favor of LongTermOrderPlacementV1. + message StatefulOrderPlacementV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 1; + } + + // A stateful order removal contains the id of an order that was already + // placed and is now removed and the reason for the removal. + message StatefulOrderRemovalV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrderId removed_order_id = 1; + dydxprotocol.indexer.shared.OrderRemovalReason reason = 2; + } + + // A conditional order placement contains an order. The order is newly-placed + // and untriggered when this event is emitted. + message ConditionalOrderPlacementV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 1; + } + + // A conditional order trigger event contains an order id and is emitted when + // an order is triggered. + message ConditionalOrderTriggeredV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrderId triggered_order_id = 1; + } + + // A long term order placement contains an order. + message LongTermOrderPlacementV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 1; + } + + // A long term order replacement contains an old order ID and the new order. + message LongTermOrderReplacementV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrderId old_order_id = + 1; // vault replaces orders with a different order ID + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 2; + } +} + +// AssetCreateEventV1 message contains all the information about an new Asset on +// the dYdX chain. +message AssetCreateEventV1 { + // Unique, sequentially-generated. + uint32 id = 1; + + // The human readable symbol of the `Asset` (e.g. `USDC`, `ATOM`). + // Must be uppercase, unique and correspond to the canonical symbol of the + // full coin. + string symbol = 2; + + // `true` if this `Asset` has a valid `MarketId` value. + bool has_market = 3; + + // The `Id` of the `Market` associated with this `Asset`. It acts as the + // oracle price for the purposes of calculating collateral + // and margin requirements. + uint32 market_id = 4; + + // The exponent for converting an atomic amount (1 'quantum') + // to a full coin. For example, if `atomic_resolution = -8` + // then an `asset_position` with `base_quantums = 1e8` is equivalent to + // a position size of one full coin. + sint32 atomic_resolution = 5; +} + +// PerpetualMarketCreateEventV1 message contains all the information about a +// new Perpetual Market on the dYdX chain. +// Deprecated. See PerpetualMarketCreateEventV2 for the most up to date message +// for the event to create a new Perpetual Market. +message PerpetualMarketCreateEventV1 { + option deprecated = true; + // Unique Perpetual id. + // Defined in perpetuals.perpetual + uint32 id = 1; + + // Unique clob pair Id associated with this perpetual market + // Defined in clob.clob_pair + uint32 clob_pair_id = 2; + + // The name of the `Perpetual` (e.g. `BTC-USD`). + // Defined in perpetuals.perpetual + string ticker = 3; + + // Unique id of market param associated with this perpetual market. + // Defined in perpetuals.perpetual + uint32 market_id = 4; + + // Status of the CLOB + dydxprotocol.indexer.protocol.v1.ClobPairStatus status = 5; + + // `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + // per Subtick. + // Defined in clob.clob_pair + sint32 quantum_conversion_exponent = 6; + + // The exponent for converting an atomic amount (`size = 1`) + // to a full coin. For example, if `AtomicResolution = -8` + // then a `PerpetualPosition` with `size = 1e8` is equivalent to + // a position size of one full coin. + // Defined in perpetuals.perpetual + sint32 atomic_resolution = 7; + + // Defines the tick size of the orderbook by defining how many subticks + // are in one tick. That is, the subticks of any valid order must be a + // multiple of this value. Generally this value should start `>= 100`to + // allow room for decreasing it. + // Defined in clob.clob_pair + uint32 subticks_per_tick = 8; + + // Minimum increment in the size of orders on the CLOB, in base quantums. + // Defined in clob.clob_pair + uint64 step_base_quantums = 9; + + // The liquidity_tier that this perpetual is associated with. + // Defined in perpetuals.perpetual + uint32 liquidity_tier = 10; +} + +// PerpetualMarketCreateEventV2 message contains all the information about a +// new Perpetual Market on the dYdX chain. +message PerpetualMarketCreateEventV2 { + // Unique Perpetual id. + // Defined in perpetuals.perpetual + uint32 id = 1; + + // Unique clob pair Id associated with this perpetual market + // Defined in clob.clob_pair + uint32 clob_pair_id = 2; + + // The name of the `Perpetual` (e.g. `BTC-USD`). + // Defined in perpetuals.perpetual + string ticker = 3; + + // Unique id of market param associated with this perpetual market. + // Defined in perpetuals.perpetual + uint32 market_id = 4; + + // Status of the CLOB + dydxprotocol.indexer.protocol.v1.ClobPairStatus status = 5; + + // `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + // per Subtick. + // Defined in clob.clob_pair + sint32 quantum_conversion_exponent = 6; + + // The exponent for converting an atomic amount (`size = 1`) + // to a full coin. For example, if `AtomicResolution = -8` + // then a `PerpetualPosition` with `size = 1e8` is equivalent to + // a position size of one full coin. + // Defined in perpetuals.perpetual + sint32 atomic_resolution = 7; + + // Defines the tick size of the orderbook by defining how many subticks + // are in one tick. That is, the subticks of any valid order must be a + // multiple of this value. Generally this value should start `>= 100`to + // allow room for decreasing it. + // Defined in clob.clob_pair + uint32 subticks_per_tick = 8; + + // Minimum increment in the size of orders on the CLOB, in base quantums. + // Defined in clob.clob_pair + uint64 step_base_quantums = 9; + + // The liquidity_tier that this perpetual is associated with. + // Defined in perpetuals.perpetual + uint32 liquidity_tier = 10; + + // Market type of the perpetual. + dydxprotocol.indexer.protocol.v1.PerpetualMarketType market_type = 11; +} + +// LiquidityTierUpsertEventV1 message contains all the information to +// create/update a Liquidity Tier on the dYdX chain. +message LiquidityTierUpsertEventV1 { + // Unique id. + uint32 id = 1; + + // The name of the tier purely for mnemonic purposes, e.g. "Gold". + string name = 2; + + // The margin fraction needed to open a position. + // In parts-per-million. + uint32 initial_margin_ppm = 3; + + // The fraction of the initial-margin that the maintenance-margin is, + // e.g. 50%. In parts-per-million. + uint32 maintenance_fraction_ppm = 4; + + // The maximum position size at which the margin requirements are + // not increased over the default values. Above this position size, + // the margin requirements increase at a rate of sqrt(size). + // + // Deprecated since v3.x. + uint64 base_position_notional = 5 [ deprecated = true ]; + + // Previously existed in v1 for open interest caps. Removed and + // now in v2. + reserved 6, 7; + + // reserved fields for open interest caps. Removed and now in v2. + reserved "open_interest_lower_cap", "open_interest_upper_cap"; +} + +// UpdateClobPairEventV1 message contains all the information about an update to +// a clob pair on the dYdX chain. +message UpdateClobPairEventV1 { + // Unique clob pair Id associated with this perpetual market + // Defined in clob.clob_pair + uint32 clob_pair_id = 1; + + // Status of the CLOB + dydxprotocol.indexer.protocol.v1.ClobPairStatus status = 2; + + // `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + // per Subtick. + // Defined in clob.clob_pair + sint32 quantum_conversion_exponent = 3; + + // Defines the tick size of the orderbook by defining how many subticks + // are in one tick. That is, the subticks of any valid order must be a + // multiple of this value. Generally this value should start `>= 100`to + // allow room for decreasing it. + // Defined in clob.clob_pair + uint32 subticks_per_tick = 4; + + // Minimum increment in the size of orders on the CLOB, in base quantums. + // Defined in clob.clob_pair + uint64 step_base_quantums = 5; +} + +// UpdatePerpetualEventV1 message contains all the information about an update +// to a perpetual on the dYdX chain. +message UpdatePerpetualEventV1 { + // Unique Perpetual id. + // Defined in perpetuals.perpetual + uint32 id = 1; + + // The name of the `Perpetual` (e.g. `BTC-USD`). + // Defined in perpetuals.perpetual + string ticker = 2; + + // Unique id of market param associated with this perpetual market. + // Defined in perpetuals.perpetual + uint32 market_id = 3; + + // The exponent for converting an atomic amount (`size = 1`) + // to a full coin. For example, if `AtomicResolution = -8` + // then a `PerpetualPosition` with `size = 1e8` is equivalent to + // a position size of one full coin. + // Defined in perpetuals.perpetual + sint32 atomic_resolution = 4; + + // The liquidity_tier that this perpetual is associated with. + // Defined in perpetuals.perpetual + uint32 liquidity_tier = 5; +} + +// TradingRewardsEventV1 is communicates all trading rewards for all accounts +// that receive trade rewards in the block. +message TradingRewardsEventV1 { + // The list of all trading rewards in the block. + repeated AddressTradingReward trading_rewards = 1; +} + +// AddressTradingReward contains info on an instance of an address receiving a +// reward +message AddressTradingReward { + // The address of the wallet that will receive the trading reward. + string owner = 1; + + // The amount of trading rewards earned by the address above in denoms. 1e18 + // denoms is equivalent to a single coin. + bytes denom_amount = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// OpenInterestUpdateEventV1 is used for open interest update events +message OpenInterestUpdateEventV1 { + // The list of all open interest updates in the block. + repeated OpenInterestUpdate open_interest_updates = 1; +} + +// OpenInterestUpdate contains a single open interest update for a perpetual +message OpenInterestUpdate { + // The ID of the perpetual market. + uint32 perpetual_id = 1; + + // The new open interest value for the perpetual market. + bytes open_interest = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// LiquidationEventV2 message contains all the information needed to update +// the liquidity tiers. It contains all the fields from V1 along with the +// open interest caps. +message LiquidityTierUpsertEventV2 { + // Unique id. + uint32 id = 1; + + // The name of the tier purely for mnemonic purposes, e.g. "Gold". + string name = 2; + + // The margin fraction needed to open a position. + // In parts-per-million. + uint32 initial_margin_ppm = 3; + + // The fraction of the initial-margin that the maintenance-margin is, + // e.g. 50%. In parts-per-million. + uint32 maintenance_fraction_ppm = 4; + + // The maximum position size at which the margin requirements are + // not increased over the default values. Above this position size, + // the margin requirements increase at a rate of sqrt(size). + // + // Deprecated since v3.x. + uint64 base_position_notional = 5 [ deprecated = true ]; + + // Lower cap of open interest in quote quantums. optional + uint64 open_interest_lower_cap = 6; + + // Upper cap of open interest in quote quantums. + uint64 open_interest_upper_cap = 7; +} + +// Event emitted when a referee is registered with an affiliate. +message RegisterAffiliateEventV1 { + // Address of the referee being registered. + string referee = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Address of the affiliate associated with the referee. + string affiliate = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Block number at which the affiliate was registered. + uint64 registered_at_block = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/indexer_manager/event.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/indexer_manager/event.proto new file mode 100644 index 00000000..ad4006fc --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/indexer_manager/event.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; +package dydxprotocol.indexer.indexer_manager; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/indexer_manager"; + +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +// IndexerTendermintEventWrapper is a wrapper around IndexerTendermintEvent, +// with an additional txn_hash field. +message IndexerTendermintEventWrapper { + IndexerTendermintEvent event = 1; + string txn_hash = 2; +} + +// IndexerEventsStoreValue represents the type of the value of the +// `IndexerEventsStore` in state. +message IndexerEventsStoreValue { + repeated IndexerTendermintEventWrapper events = 1; +} + +// IndexerTendermintEvent contains the base64 encoded event proto emitted from +// the dYdX application as well as additional metadata to determine the ordering +// of the event within the block and the subtype of the event. +message IndexerTendermintEvent { + reserved 2; + // Subtype of the event e.g. "order_fill", "subaccount_update", etc. + string subtype = 1; + // enum to specify that the IndexerTendermintEvent is a block event. + enum BlockEvent { + // Default value. This value is invalid and unused. + BLOCK_EVENT_UNSPECIFIED = 0; + // BLOCK_EVENT_BEGIN_BLOCK indicates that the event was generated during + // BeginBlock. + BLOCK_EVENT_BEGIN_BLOCK = 1; + // BLOCK_EVENT_END_BLOCK indicates that the event was generated during + // EndBlock. + BLOCK_EVENT_END_BLOCK = 2; + } + // ordering_within_block is either the transaction index or a boolean + // indicating the event was generated during processing the block rather than + // any specific transaction e.g. during FinalizeBlock. + oneof ordering_within_block { + uint32 transaction_index = 3; + BlockEvent block_event = 4; + } + // Index of the event within the list of events that happened either during a + // transaction or during processing of a block. + // TODO(DEC-537): Deprecate this field because events are already ordered. + uint32 event_index = 5; + + // Version of the event. + uint32 version = 6; + + // Tendermint event bytes. + bytes data_bytes = 7; +} + +// IndexerTendermintBlock contains all the events for the block along with +// metadata for the block height, timestamp of the block and a list of all the +// hashes of the transactions within the block. The transaction hashes follow +// the ordering of the transactions as they appear within the block. +message IndexerTendermintBlock { + uint32 height = 1; + google.protobuf.Timestamp time = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + repeated IndexerTendermintEvent events = 3; + repeated string tx_hashes = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto new file mode 100644 index 00000000..04ddda19 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; +package dydxprotocol.indexer.off_chain_updates; + +import "dydxprotocol/indexer/shared/removal_reason.proto"; +import "dydxprotocol/indexer/protocol/v1/clob.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/off_chain_updates/types"; + +// Do not make any breaking changes to these protos, a new version should be +// created if a breaking change is needed. + +// OrderPlace messages contain the order placed/replaced. +message OrderPlaceV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 1; + OrderPlacementStatus placement_status = 2; + + // OrderPlacementStatus is an enum for the resulting status after an order is + // placed. + enum OrderPlacementStatus { + // Default value, this is invalid and unused. + ORDER_PLACEMENT_STATUS_UNSPECIFIED = 0; + // A best effort opened order is one that has only been confirmed to be + // placed on the dYdX node sending the off-chain update message. + // The cases where this happens includes: + // - The dYdX node places an order in it's in-memory orderbook during the + // CheckTx flow. + // A best effort placed order may not have been placed on other dYdX + // nodes including other dYdX validator nodes and may still be excluded in + // future order matches. + ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED = 1; + // An opened order is one that is confirmed to be placed on all dYdX nodes + // (discounting dishonest dYdX nodes) and will be included in any future + // order matches. + // This status is used internally by the indexer and will not be sent + // out by protocol. + ORDER_PLACEMENT_STATUS_OPENED = 2; + } + + // The timestamp of the order placement. + google.protobuf.Timestamp time_stamp = 3 + [ (gogoproto.nullable) = true, (gogoproto.stdtime) = true ]; +} + +// OrderRemove messages contain the id of the order removed, the reason for the +// removal and the resulting status from the removal. +message OrderRemoveV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrderId removed_order_id = 1; + dydxprotocol.indexer.shared.OrderRemovalReason reason = 2; + OrderRemovalStatus removal_status = 3; + + // OrderRemovalStatus is an enum for the resulting status after an order is + // removed. + enum OrderRemovalStatus { + // Default value, this is invalid and unused. + ORDER_REMOVAL_STATUS_UNSPECIFIED = 0; + // A best effort canceled order is one that has only been confirmed to be + // removed on the dYdX node sending the off-chain update message. + // The cases where this happens includes: + // - the order was removed due to the dYdX node receiving a CancelOrder + // transaction for the order. + // - the order was removed due to being undercollateralized during + // optimistic matching. + // A best effort canceled order may not have been removed on other dYdX + // nodes including other dYdX validator nodes and may still be included in + // future order matches. + ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED = 1; + // A canceled order is one that is confirmed to be removed on all dYdX nodes + // (discounting dishonest dYdX nodes) and will not be included in any future + // order matches. + // The cases where this happens includes: + // - the order is expired. + ORDER_REMOVAL_STATUS_CANCELED = 2; + // An order was fully-filled. Only sent by the Indexer for stateful orders. + ORDER_REMOVAL_STATUS_FILLED = 3; + } + + // The timestamp of the order removal. + google.protobuf.Timestamp time_stamp = 4 + [ (gogoproto.nullable) = true, (gogoproto.stdtime) = true ]; +} + +// OrderUpdate messages contain the id of the order being updated, and the +// updated total filled quantums of the order. +message OrderUpdateV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrderId order_id = 1; + uint64 total_filled_quantums = 2; +} + +// OrderReplace messages contain the old order ID and the replacement order. +message OrderReplaceV1 { + dydxprotocol.indexer.protocol.v1.IndexerOrderId old_order_id = + 1; // vault replaces orders with a different order ID + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 2; + dydxprotocol.indexer.off_chain_updates.OrderPlaceV1.OrderPlacementStatus + placement_status = 3; + + google.protobuf.Timestamp time_stamp = 4 + [ (gogoproto.nullable) = true, (gogoproto.stdtime) = true ]; +} + +// An OffChainUpdate message is the message type which will be sent on Kafka to +// the Indexer. +message OffChainUpdateV1 { + // Contains one of an OrderPlaceV1, OrderRemoveV1, OrderUpdateV1, and + // OrderReplaceV1 message. + oneof update_message { + OrderPlaceV1 order_place = 1; + OrderRemoveV1 order_remove = 2; + OrderUpdateV1 order_update = 3; + OrderReplaceV1 order_replace = 4; + } +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/clob.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/clob.proto new file mode 100644 index 00000000..b840d848 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/clob.proto @@ -0,0 +1,182 @@ +syntax = "proto3"; +package dydxprotocol.indexer.protocol.v1; + +import "dydxprotocol/indexer/protocol/v1/subaccount.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types"; + +// Initial copy of protos from dYdX chain application state protos for the clob +// module for use to send Indexer specific messages. Do not make any breaking +// changes to these protos, a new version should be created if a breaking change +// is needed. + +// IndexerOrderId refers to a single order belonging to a Subaccount. +message IndexerOrderId { + // The subaccount ID that opened this order. + // Note that this field has `gogoproto.nullable = false` so that it is + // generated as a value instead of a pointer. This is because the `OrderId` + // proto is used as a key within maps, and map comparisons will compare + // pointers for equality (when the desired behavior is to compare the values). + IndexerSubaccountId subaccount_id = 1 [ (gogoproto.nullable) = false ]; + + // The client ID of this order, unique with respect to the specific + // sub account (I.E., the same subaccount can't have two orders with + // the same ClientId). + fixed32 client_id = 2; + + // order_flags represent order flags for the order. This field is invalid if + // it's greater than 127 (larger than one byte). Each bit in the first byte + // represents a different flag. Currently only two flags are supported. + // + // Starting from the bit after the most MSB (note that the MSB is used in + // proto varint encoding, and therefore cannot be used): Bit 1 is set if this + // order is a Long-Term order (0x40, or 64 as a uint8). Bit 2 is set if this + // order is a Conditional order (0x20, or 32 as a uint8). + // + // If neither bit is set, the order is assumed to be a Short-Term order. + // + // If both bits are set or bits other than the 2nd and 3rd are set, the order + // ID is invalid. + uint32 order_flags = 3; + + // ID of the CLOB the order is created for. + uint32 clob_pair_id = 4; +} + +// IndexerOrderV1 represents a single order belonging to a `Subaccount` +// for a particular `ClobPair`. +message IndexerOrder { + // The unique ID of this order. Meant to be unique across all orders. + IndexerOrderId order_id = 1 [ (gogoproto.nullable) = false ]; + + // Represents the side of the orderbook the order will be placed on. + // Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be + // placed on the orderbook. + enum Side { + // Default value. This value is invalid and unused. + SIDE_UNSPECIFIED = 0; + // SIDE_BUY is used to represent a BUY order. + SIDE_BUY = 1; + // SIDE_SELL is used to represent a SELL order. + SIDE_SELL = 2; + } + + Side side = 2; + + // The size of this order in base quantums. Must be a multiple of + // `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`). + uint64 quantums = 3; + + // The price level that this order will be placed at on the orderbook, + // in subticks. Must be a multiple of ClobPair.SubticksPerTick + // (where `ClobPair.Id = orderId.ClobPairId`). + uint64 subticks = 4; + + // Information about when the order expires. + oneof good_til_oneof { + // The last block this order can be executed at (after which it will be + // unfillable). Used only for Short-Term orders. If this value is non-zero + // then the order is assumed to be a Short-Term order. + uint32 good_til_block = 5; + + // good_til_block_time represents the unix timestamp (in seconds) at which a + // stateful order will be considered expired. The + // good_til_block_time is always evaluated against the previous block's + // `BlockTime` instead of the block in which the order is committed. If this + // value is non-zero then the order is assumed to be a stateful or + // conditional order. + fixed32 good_til_block_time = 6; + } + + // TimeInForce indicates how long an order will remain active before it + // is executed or expires. + enum TimeInForce { + // TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an + // order will first match with existing orders on the book, and any + // remaining size will be added to the book as a maker order. + TIME_IN_FORCE_UNSPECIFIED = 0; + // TIME_IN_FORCE_IOC enforces that an order only be matched with + // maker orders on the book. If the order has remaining size after + // matching with existing orders on the book, the remaining size + // is not placed on the book. + TIME_IN_FORCE_IOC = 1; + // TIME_IN_FORCE_POST_ONLY enforces that an order only be placed + // on the book as a maker order. Note this means that validators will cancel + // any newly-placed post only orders that would cross with other maker + // orders. + TIME_IN_FORCE_POST_ONLY = 2; + // TIME_IN_FORCE_FILL_OR_KILL enforces that an order will either be filled + // completely and immediately by maker orders on the book or canceled if the + // entire amount can‘t be matched. + TIME_IN_FORCE_FILL_OR_KILL = 3; + } + + // The time in force of this order. + TimeInForce time_in_force = 7; + + // Enforces that the order can only reduce the size of an existing position. + // If a ReduceOnly order would change the side of the existing position, + // its size is reduced to that of the remaining size of the position. + // If existing orders on the book with ReduceOnly + // would already close the position, the least aggressive (out-of-the-money) + // ReduceOnly orders are resized and canceled first. + bool reduce_only = 8; + + // Set of bit flags set arbitrarily by clients and ignored by the protocol. + // Used by indexer to infer information about a placed order. + uint32 client_metadata = 9; + + enum ConditionType { + // CONDITION_TYPE_UNSPECIFIED represents the default behavior where an + // order will be placed immediately on the orderbook. + CONDITION_TYPE_UNSPECIFIED = 0; + // CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will + // trigger when the oracle price moves at or above the trigger price for + // buys, and at or below the trigger price for sells. + CONDITION_TYPE_STOP_LOSS = 1; + // CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit + // order will trigger when the oracle price moves at or below the trigger + // price for buys and at or above the trigger price for sells. + CONDITION_TYPE_TAKE_PROFIT = 2; + } + + ConditionType condition_type = 10; + + // conditional_order_trigger_subticks represents the price at which this order + // will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED, + // this value is enforced to be 0. If this value is nonzero, condition_type + // cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks. + // Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id = + // orderId.ClobPairId`). + uint64 conditional_order_trigger_subticks = 11; +} + +// Status of the CLOB. +// Defined in clob.clob_pair +enum ClobPairStatus { + // Default value. This value is invalid and unused. + CLOB_PAIR_STATUS_UNSPECIFIED = 0; + // CLOB_PAIR_STATUS_ACTIVE behavior is unfinalized. + // TODO(DEC-600): update this documentation. + CLOB_PAIR_STATUS_ACTIVE = 1; + // CLOB_PAIR_STATUS_PAUSED behavior is unfinalized. + // TODO(DEC-600): update this documentation. + CLOB_PAIR_STATUS_PAUSED = 2; + // CLOB_PAIR_STATUS_CANCEL_ONLY behavior is unfinalized. + // TODO(DEC-600): update this documentation. + CLOB_PAIR_STATUS_CANCEL_ONLY = 3; + // CLOB_PAIR_STATUS_POST_ONLY behavior is unfinalized. + // TODO(DEC-600): update this documentation. + CLOB_PAIR_STATUS_POST_ONLY = 4; + // CLOB_PAIR_STATUS_INITIALIZING represents a newly-added clob pair. + // Clob pairs in this state only accept orders which are + // both short-term and post-only. + CLOB_PAIR_STATUS_INITIALIZING = 5; + // CLOB_PAIR_STATUS_FINAL_SETTLEMENT represents a clob pair that has been + // deactivated. Clob pairs in this state do not accept new orders and trading + // is blocked. All open positions are closed and open stateful orders canceled + // by the protocol when the clob pair transitions to this status. All + // short-term orders are left to expire. + CLOB_PAIR_STATUS_FINAL_SETTLEMENT = 6; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/perpetual.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/perpetual.proto new file mode 100644 index 00000000..5becdf8b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/perpetual.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package dydxprotocol.indexer.protocol.v1; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types"; + +// Market type of perpetual. +// Defined in perpetual. +enum PerpetualMarketType { + // Unspecified market type. + PERPETUAL_MARKET_TYPE_UNSPECIFIED = 0; + // Market type for cross margin perpetual markets. + PERPETUAL_MARKET_TYPE_CROSS = 1; + // Market type for isolated margin perpetual markets. + PERPETUAL_MARKET_TYPE_ISOLATED = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/subaccount.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/subaccount.proto new file mode 100644 index 00000000..d04ce617 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/protocol/v1/subaccount.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; +package dydxprotocol.indexer.protocol.v1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types"; + +// Initial copy of protos from dYdX chain application state protos for the +// subaccount module for use to send Indexer specific messages. Do not make any +// breaking changes to these protos, a new version should be created if a +// breaking change is needed. + +// IndexerSubaccountId defines a unique identifier for a Subaccount. +message IndexerSubaccountId { + // The address of the wallet that owns this subaccount. + string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // < 128 Since 128 should be enough to start and it fits within + // 1 Byte (1 Bit needed to indicate that the first byte is the last). + uint32 number = 2; +} + +// IndexerPerpetualPosition are an account’s positions of a `Perpetual`. +// Therefore they hold any information needed to trade perpetuals. +message IndexerPerpetualPosition { + // The `Id` of the `Perpetual`. + uint32 perpetual_id = 1; + // The size of the position in base quantums. + bytes quantums = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // The funding_index of the `Perpetual` the last time this position was + // settled. + bytes funding_index = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // Amount of funding payment (in quote quantums). + // Note: 1. this field is not cumulative. + // 2. a positive value means funding payment was paid out and + // a negative value means funding payment was received. + bytes funding_payment = 4 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// IndexerAssetPosition define an account’s positions of an `Asset`. +// Therefore they hold any information needed to trade on Spot and Margin. +message IndexerAssetPosition { + // The `Id` of the `Asset`. + uint32 asset_id = 1; + // The absolute size of the position in base quantums. + bytes quantums = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last + // time this position was settled + // TODO(DEC-582): pending margin trading being added. + uint64 index = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/redis/redis_order.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/redis/redis_order.proto new file mode 100644 index 00000000..429be9a8 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/redis/redis_order.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package dydxprotocol.indexer.redis; + +import "dydxprotocol/indexer/protocol/v1/clob.proto"; + +// RedisOrder is a proto for orders stored in Redis. This proto holds some +// human-readable values such as price, size and ticker as well as the original +// `Order` proto from the dYdX application. +message RedisOrder { + // uuid of the Order generated by the Indexer based on the `OrderId`. + string id = 1; + + // Order proto from the protocol. + dydxprotocol.indexer.protocol.v1.IndexerOrder order = 2; + + // Ticker for the exchange pair for the order. + string ticker = 3; + + // Type of the ticker, PERPETUAL or SPOT. + TickerType ticker_type = 4; + + // Human-readable price of the order. + string price = 5; + + // Human-readable size of the order. + string size = 6; + + // Enum for the ticker type, PERPETUAL or SPOT. + enum TickerType { + // Default value for the enum. Should never be used in an initialized + // `RedisOrder`. + TICKER_TYPE_UNSPECIFIED = 0; + + // Ticker is for a perpetual pair. + TICKER_TYPE_PERPETUAL = 1; + + // Ticker is for a spot pair. + TICKER_TYPE_SPOT = 2; + } +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/shared/removal_reason.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/shared/removal_reason.proto new file mode 100644 index 00000000..da0804f9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/shared/removal_reason.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package dydxprotocol.indexer.shared; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/shared/types"; + +// TODO(DEC-869): Update reasons/statuses for Advanced Orders. + +// OrderRemovalReason is an enum of all the reasons an order was removed. +enum OrderRemovalReason { + // Default value, this is invalid and unused. + ORDER_REMOVAL_REASON_UNSPECIFIED = 0; + // The order was removed due to being expired. + ORDER_REMOVAL_REASON_EXPIRED = 1; + // The order was removed due to being canceled by a user. + ORDER_REMOVAL_REASON_USER_CANCELED = 2; + // The order was removed due to being undercollateralized. + ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED = 3; + // The order caused an internal error during order placement and was + // removed. + ORDER_REMOVAL_REASON_INTERNAL_ERROR = 4; + // The order would have matched against another order placed by the same + // subaccount and was removed. + ORDER_REMOVAL_REASON_SELF_TRADE_ERROR = 5; + // The order would have matched against maker orders on the orderbook + // despite being a post-only order and was removed. + ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER = 6; + // The order was an ICO order and would have been placed on the orderbook as + // resting liquidity and was removed. + ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK = 7; + // The order was a fill-or-kill order that could not be fully filled and was + // removed. + ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED = 8; + // The order was a reduce-only order that was removed due to either: + // - being a taker order and fully-filling the order would flip the side of + // the subaccount's position, in this case the remaining size of the + // order is removed + // - being a maker order resting on the book and being removed when either + // the subaccount's position is closed or flipped sides + ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE = 9; + // The order should be expired, according to the Indexer's cached data, but + // the Indexer has yet to receive a message to remove the order. In order to + // keep the data cached by the Indexer up-to-date and accurate, clear out + // the data if it's expired by sending an order removal with this reason. + // Protocol should never send this reason to Indexer. + ORDER_REMOVAL_REASON_INDEXER_EXPIRED = 10; + // The order has been replaced. + ORDER_REMOVAL_REASON_REPLACED = 11; + // The order has been fully-filled. Only sent by the Indexer for stateful + // orders. + ORDER_REMOVAL_REASON_FULLY_FILLED = 12; + // The order has been removed since the subaccount does not satisfy the + // equity tier requirements. + ORDER_REMOVAL_REASON_EQUITY_TIER = 13; + // The order has been removed since its ClobPair has entered final settlement. + ORDER_REMOVAL_REASON_FINAL_SETTLEMENT = 14; + // The order has been removed since filling it would lead to the subaccount + // violating isolated subaccount constraints. + ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS = 15; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/socks/messages.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/socks/messages.proto new file mode 100644 index 00000000..b3577388 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/indexer/socks/messages.proto @@ -0,0 +1,106 @@ +syntax = "proto3"; +package dydxprotocol.indexer.socks; + +import "dydxprotocol/indexer/protocol/v1/subaccount.proto"; + +// Message to be sent through the 'to-websockets-orderbooks` kafka topic. +message OrderbookMessage { + // Stringified JSON object of all events to be streamed. + string contents = 1; + + // Clob pair id of the Orderbook message. + string clob_pair_id = 2; + + // Version of the websocket message. + string version = 3; +} + +// Message to be sent through the 'to-websockets-subaccounts` kafka topic. +message SubaccountMessage { + // Block height where the contents occur. + string block_height = 1; + + // Transaction index where the contents occur. + int32 transaction_index = 2; + + // Event index where the contents occur. + uint32 event_index = 3; + + // Stringified JSON object of all events to be streamed. + string contents = 4; + + // Subaccount id that the content corresponds to. + dydxprotocol.indexer.protocol.v1.IndexerSubaccountId subaccount_id = 5; + + // Version of the websocket message. + string version = 6; +} + +// Message to be sent through the 'to-websockets-trades` kafka topic. +message TradeMessage { + // Block height where the contents occur. + string block_height = 1; + + // Stringified JSON object of all events to be streamed. + string contents = 4; + + // Clob pair id of the Trade message. + string clob_pair_id = 5; + + // Version of the websocket message. + string version = 6; +} + +// Message to be sent through the 'to-websockets-markets` kafka topic. +message MarketMessage { + // Stringified JSON object of all events to be streamed. + string contents = 1; + + // Version of the websocket message. + string version = 2; +} + +// Message to be sent through the 'to-websockets-candles` kafka topic. +message CandleMessage { + // Stringified JSON object of all events to be streamed. + string contents = 1; + + // Clob pair id of the Candle message. + string clob_pair_id = 2; + + // TODO(IND-210): Make this proto conform and update downstream indexer logic + enum Resolution { + // buf:lint:ignore ENUM_VALUE_PREFIX + // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX + ONE_MINUTE = 0; + // buf:lint:ignore ENUM_VALUE_PREFIX + FIVE_MINUTES = 1; + // buf:lint:ignore ENUM_VALUE_PREFIX + FIFTEEN_MINUTES = 2; + // buf:lint:ignore ENUM_VALUE_PREFIX + THIRTY_MINUTES = 3; + // buf:lint:ignore ENUM_VALUE_PREFIX + ONE_HOUR = 4; + // buf:lint:ignore ENUM_VALUE_PREFIX + FOUR_HOURS = 5; + // buf:lint:ignore ENUM_VALUE_PREFIX + ONE_DAY = 6; + } + // Resolution of the candle update. + Resolution resolution = 3; + + // Version of the websocket message. + string version = 4; +} + +// Message to be sent through the 'to-websockets-block-height` kafka topic. +message BlockHeightMessage { + // Block height where the contents occur. + string block_height = 1; + + // ISO formatted time of the block height. + string time = 2; + + // Version of the websocket message. + string version = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/genesis.proto new file mode 100644 index 00000000..98d3d29a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/genesis.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package dydxprotocol.listing; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"; + +// GenesisState defines `x/listing`'s genesis state. +message GenesisState { + // hard_cap_for_markets is the hard cap for the number of markets that can be + // listed + uint32 hard_cap_for_markets = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/params.proto new file mode 100644 index 00000000..3e3c9392 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/params.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package dydxprotocol.listing; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"; + +// ListingVaultDepositParams represents the params for PML megavault deposits +message ListingVaultDepositParams { + // Amount that will be deposited into the new market vault exclusively + bytes new_vault_deposit_amount = 1 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + + // Amount deposited into the main vault exclusively. This amount does not + // include the amount deposited into the new vault. + bytes main_vault_deposit_amount = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + + // Lockup period for this deposit + uint32 num_blocks_to_lock_shares = 3; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/query.proto new file mode 100644 index 00000000..b200a763 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/query.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package dydxprotocol.listing; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "dydxprotocol/listing/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries for the hard cap number of listed markets + rpc MarketsHardCap(QueryMarketsHardCap) returns (QueryMarketsHardCapResponse); + + // Queries the listing vault deposit params + rpc ListingVaultDepositParams(QueryListingVaultDepositParams) + returns (QueryListingVaultDepositParamsResponse) { + option (google.api.http).get = "/dydxprotocol/listing/vault_deposit_params"; + } +} + +// Queries for the hard cap on listed markets +message QueryMarketsHardCap {} + +// Response type indicating the hard cap on listed markets +message QueryMarketsHardCapResponse { uint32 hard_cap = 1; } + +// Queries the listing vault deposit params +message QueryListingVaultDepositParams {} + +// Response type for QueryListingVaultDepositParams +message QueryListingVaultDepositParamsResponse { + ListingVaultDepositParams params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/tx.proto new file mode 100644 index 00000000..572586e1 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/listing/tx.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; +package dydxprotocol.listing; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/listing/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"; + +// Msg defines the Msg service. +service Msg { + // SetMarketsHardCap sets a hard cap on the number of markets listed + rpc SetMarketsHardCap(MsgSetMarketsHardCap) + returns (MsgSetMarketsHardCapResponse); + + // CreateMarketPermissionless creates a new market without going through x/gov + rpc CreateMarketPermissionless(MsgCreateMarketPermissionless) + returns (MsgCreateMarketPermissionlessResponse); + + // SetListingVaultDepositParams sets PML megavault deposit params + rpc SetListingVaultDepositParams(MsgSetListingVaultDepositParams) + returns (MsgSetListingVaultDepositParamsResponse); +} + +// MsgSetMarketsHardCap is used to set a hard cap on the number of markets +// listed +message MsgSetMarketsHardCap { + // The address that controls the module (the gov module account). + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Hard cap for the total number of markets listed + uint32 hard_cap_for_markets = 2; +} + +// MsgSetMarketsHardCapResponse defines the MsgSetMarketsHardCap response +message MsgSetMarketsHardCapResponse {} + +// MsgCreateMarketPermissionless is a message used to create new markets without +// going through x/gov +message MsgCreateMarketPermissionless { + option (cosmos.msg.v1.signer) = "subaccount_id"; + + // The name of the `Perpetual` (e.g. `BTC-USD`). + string ticker = 1; + + // The subaccount to deposit from. + dydxprotocol.subaccounts.SubaccountId subaccount_id = 2; + + // Number of quote quantums to deposit. + bytes quote_quantums = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// MsgCreateMarketPermissionlessResponse defines the +// MsgCreateMarketPermissionless response +message MsgCreateMarketPermissionlessResponse {} + +// MsgSetListingVaultDepositParams is a message used to set PML megavault +// deposit params +message MsgSetListingVaultDepositParams { + // The address that controls the module (the gov module account). + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Params which define the vault deposit for market listing + ListingVaultDepositParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgSetListingVaultDepositParamsResponse defines the +// MsgSetListingVaultDepositParams response +message MsgSetListingVaultDepositParamsResponse {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/genesis.proto new file mode 100644 index 00000000..119417f9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package dydxprotocol.perpetuals; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/perpetuals/perpetual.proto"; +import "dydxprotocol/perpetuals/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"; + +// GenesisState defines the perpetuals module's genesis state. +message GenesisState { + repeated Perpetual perpetuals = 1 [ (gogoproto.nullable) = false ]; + repeated LiquidityTier liquidity_tiers = 2 [ (gogoproto.nullable) = false ]; + Params params = 3 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/params.proto new file mode 100644 index 00000000..1c3ca6e7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/params.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package dydxprotocol.perpetuals; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"; + +// Params defines the parameters for x/perpetuals module. +message Params { + // Funding rate clamp factor in parts-per-million, used for clamping 8-hour + // funding rates according to equation: |R| <= funding_rate_clamp_factor * + // (initial margin - maintenance margin). + uint32 funding_rate_clamp_factor_ppm = 1; + // Premium vote clamp factor in parts-per-million, used for clamping premium + // votes according to equation: |V| <= premium_vote_clamp_factor * + // (initial margin - maintenance margin). + uint32 premium_vote_clamp_factor_ppm = 2; + // Minimum number of premium votes per premium sample. If number of premium + // votes is smaller than this number, pad with zeros up to this number. + uint32 min_num_votes_per_sample = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/perpetual.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/perpetual.proto new file mode 100644 index 00000000..cb5132ea --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/perpetual.proto @@ -0,0 +1,139 @@ +syntax = "proto3"; +package dydxprotocol.perpetuals; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"; + +// Perpetual represents a perpetual on the dYdX exchange. +message Perpetual { + // PerpetualParams is the parameters of the perpetual. + PerpetualParams params = 1 [ (gogoproto.nullable) = false ]; + + // The current index determined by the cumulative all-time + // history of the funding mechanism. Starts at zero. + bytes funding_index = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + + // Total size of open long contracts, measured in base_quantums. + bytes open_interest = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +enum PerpetualMarketType { + // Unspecified market type. + PERPETUAL_MARKET_TYPE_UNSPECIFIED = 0; + // Market type for cross margin perpetual markets. + PERPETUAL_MARKET_TYPE_CROSS = 1; + // Market type for isolated margin perpetual markets. + PERPETUAL_MARKET_TYPE_ISOLATED = 2; +} + +// PerpetualParams represents the parameters of a perpetual on the dYdX +// exchange. +message PerpetualParams { + // Unique, sequentially-generated. + uint32 id = 1; + + // The name of the `Perpetual` (e.g. `BTC-USD`). + string ticker = 2; + + // The market associated with this `Perpetual`. It + // acts as the oracle price for the purposes of calculating + // collateral, margin requirements, and funding rates. + uint32 market_id = 3; + + // The exponent for converting an atomic amount (`size = 1`) + // to a full coin. For example, if `AtomicResolution = -8` + // then a `PerpetualPosition` with `size = 1e8` is equivalent to + // a position size of one full coin. + sint32 atomic_resolution = 4; + + // The default funding payment if there is no price premium. In + // parts-per-million. + sint32 default_funding_ppm = 5; + + // The liquidity_tier that this perpetual is associated with. + uint32 liquidity_tier = 6; + + // The market type specifying if this perpetual is cross or isolated + PerpetualMarketType market_type = 7; +} + +// MarketPremiums stores a list of premiums for a single perpetual market. +message MarketPremiums { + // perpetual_id is the Id of the perpetual market. + uint32 perpetual_id = 1; + // premiums is a list of premium values for a perpetual market. Since most + // premiums are zeros under "stable" market conditions, only non-zero values + // are stored in this list. + repeated sint32 premiums = 2; +} + +// PremiumStore is a struct to store a perpetual premiums for all +// perpetual markets. It stores a list of `MarketPremiums`, each of which +// corresponds to a perpetual market and stores a list of non-zero premium +// values for that market. +// This struct can either be used to store `PremiumVotes` or +// `PremiumSamples`. +message PremiumStore { + // all_market_premiums a list of `MarketPremiums`, each corresponding to + // a perpetual market. + repeated MarketPremiums all_market_premiums = 1 + [ (gogoproto.nullable) = false ]; + // number of rounds where premium values were added. This value indicates + // the total number of premiums (zeros and non-zeros) for each + // `MarketPremiums` struct. Note that in the edge case a perpetual market was + // added in the middle of a epoch, we don't keep a seperate count for that + // market. This means we treat this market as having zero premiums before it + // was added. + uint32 num_premiums = 2; +} + +// LiquidityTier stores margin information. +message LiquidityTier { + // Unique id. + uint32 id = 1; + + // The name of the tier purely for mnemonic purposes, e.g. "Gold". + string name = 2; + + // The margin fraction needed to open a position. + // In parts-per-million. + uint32 initial_margin_ppm = 3; + + // The fraction of the initial-margin that the maintenance-margin is, + // e.g. 50%. In parts-per-million. + uint32 maintenance_fraction_ppm = 4; + + // The maximum position size at which the margin requirements are + // not increased over the default values. Above this position size, + // the margin requirements increase at a rate of sqrt(size). + // + // Deprecated since v3.x. + uint64 base_position_notional = 5 [ deprecated = true ]; + + // The impact notional amount (in quote quantums) is used to determine impact + // bid/ask prices and its recommended value is 500 USDC / initial margin + // fraction. + // - Impact bid price = average execution price for a market sell of the + // impact notional value. + // - Impact ask price = average execution price for a market buy of the + // impact notional value. + uint64 impact_notional = 6; + + // Lower cap for Open Interest Margin Fracton (OIMF), in quote quantums. + // IMF is not affected when OI <= open_interest_lower_cap. + uint64 open_interest_lower_cap = 7; + + // Upper cap for Open Interest Margin Fracton (OIMF), in quote quantums. + // IMF scales linearly to 100% as OI approaches open_interest_upper_cap. + // If zero, then the IMF does not scale with OI. + uint64 open_interest_upper_cap = 8; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/query.proto new file mode 100644 index 00000000..8433b112 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/query.proto @@ -0,0 +1,107 @@ +syntax = "proto3"; +package dydxprotocol.perpetuals; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "dydxprotocol/perpetuals/params.proto"; +import "dydxprotocol/perpetuals/perpetual.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries a Perpetual by id. + rpc Perpetual(QueryPerpetualRequest) returns (QueryPerpetualResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/perpetual/{id}"; + } + + // Queries a list of Perpetual items. + rpc AllPerpetuals(QueryAllPerpetualsRequest) + returns (QueryAllPerpetualsResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/perpetual"; + } + + // Queries a list of LiquidityTiers. + rpc AllLiquidityTiers(QueryAllLiquidityTiersRequest) + returns (QueryAllLiquidityTiersResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/liquidity_tiers"; + } + + // Queries a list of premium votes. + rpc PremiumVotes(QueryPremiumVotesRequest) + returns (QueryPremiumVotesResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/premium_votes"; + } + + // Queries a list of premium samples. + rpc PremiumSamples(QueryPremiumSamplesRequest) + returns (QueryPremiumSamplesResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/premium_samples"; + } + + // Queries the perpetual params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/params"; + } +} + +// Queries a Perpetual by id. +message QueryPerpetualRequest { uint32 id = 1; } + +// QueryPerpetualResponse is response type for the Perpetual RPC method. +message QueryPerpetualResponse { + Perpetual perpetual = 1 [ (gogoproto.nullable) = false ]; +} + +// Queries a list of Perpetual items. +message QueryAllPerpetualsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllPerpetualsResponse is response type for the AllPerpetuals RPC method. +message QueryAllPerpetualsResponse { + repeated Perpetual perpetual = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// Queries a list of LiquidityTier items. +message QueryAllLiquidityTiersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC +// method. +message QueryAllLiquidityTiersResponse { + repeated LiquidityTier liquidity_tiers = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. +message QueryPremiumVotesRequest {} + +// QueryPremiumVotesResponse is the response type for the PremiumVotes RPC +// method. +message QueryPremiumVotesResponse { + PremiumStore premium_votes = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryPremiumSamplesRequest is the request type for the PremiumSamples RPC +// method. +message QueryPremiumSamplesRequest {} + +// QueryPremiumSamplesResponse is the response type for the PremiumSamples RPC +// method. +message QueryPremiumSamplesResponse { + PremiumStore premium_samples = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryParamsResponse is the response type for the Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Params RPC method. +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// this line is used by starport scaffolding # 3 diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/tx.proto new file mode 100644 index 00000000..3a9847cd --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/perpetuals/tx.proto @@ -0,0 +1,105 @@ +syntax = "proto3"; +package dydxprotocol.perpetuals; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/perpetuals/params.proto"; +import "dydxprotocol/perpetuals/perpetual.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"; + +// Msg defines the Msg service. +service Msg { + // AddPremiumVotes add new samples of the funding premiums to the + // application. + rpc AddPremiumVotes(MsgAddPremiumVotes) returns (MsgAddPremiumVotesResponse); + // CreatePerpetual creates a new perpetual object. + rpc CreatePerpetual(MsgCreatePerpetual) returns (MsgCreatePerpetualResponse); + // SetLiquidityTier creates an liquidity tier if the ID doesn't exist, and + // updates the existing liquidity tier otherwise. + rpc SetLiquidityTier(MsgSetLiquidityTier) + returns (MsgSetLiquidityTierResponse); + // UpdatePerpetualParams updates the parameters of a perpetual market. + rpc UpdatePerpetualParams(MsgUpdatePerpetualParams) + returns (MsgUpdatePerpetualParamsResponse); + // UpdateParams updates the parameters of perpetuals module. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgCreatePerpetual is a message used by x/gov to create a new perpetual. +message MsgCreatePerpetual { + option (cosmos.msg.v1.signer) = "authority"; + + // The address that controls the module. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // `params` defines parameters for the new perpetual market. + PerpetualParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreatePerpetualResponse defines the CreatePerpetual +// response type. +message MsgCreatePerpetualResponse {} + +// MsgSetLiquidityTier is a message used by x/gov to create or update a +// liquidity tier. +message MsgSetLiquidityTier { + option (cosmos.msg.v1.signer) = "authority"; + + // The address that controls the module. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The liquidity tier to create or update. + LiquidityTier liquidity_tier = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgSetLiquidityTierResponse defines the SetLiquidityTier response type. +message MsgSetLiquidityTierResponse {} + +// MsgUpdatePerpetualParams is a message used by x/gov to update the parameters +// of a perpetual. +message MsgUpdatePerpetualParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The perpetual to update. Each field must be set. + PerpetualParams perpetual_params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdatePerpetualParamsResponse defines the UpdatePerpetualParams +// response type. +message MsgUpdatePerpetualParamsResponse {} + +// FundingPremium represents a funding premium value for a perpetual +// market. Can be used to represent a premium vote or a premium sample. +message FundingPremium { + // The id of the perpetual market. + uint32 perpetual_id = 1; + // The sampled premium rate. In parts-per-million. + int32 premium_ppm = 2; +} + +// MsgAddPremiumVotes is a request type for the AddPremiumVotes method. +message MsgAddPremiumVotes { + repeated FundingPremium votes = 1 [ (gogoproto.nullable) = false ]; +} + +// MsgAddPremiumVotesResponse defines the AddPremiumVotes +// response type. +message MsgAddPremiumVotesResponse {} + +// MsgUpdateParams is a message used by x/gov to update the parameters of the +// perpetuals module. +message MsgUpdateParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The parameters to update. Each field must be set. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateParamsResponse defines the UpdateParams response type. +message MsgUpdateParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/genesis.proto new file mode 100644 index 00000000..1ee85c7c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package dydxprotocol.prices; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/prices/market_param.proto"; +import "dydxprotocol/prices/market_price.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"; + +// GenesisState defines the prices module's genesis state. +message GenesisState { + repeated MarketParam market_params = 1 [ (gogoproto.nullable) = false ]; + repeated MarketPrice market_prices = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/market_param.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/market_param.proto new file mode 100644 index 00000000..0ad48809 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/market_param.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package dydxprotocol.prices; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"; + +// MarketParam represents the x/prices configuration for markets, including +// representing price values, resolving markets on individual exchanges, and +// generating price updates. This configuration is specific to the quote +// currency. +message MarketParam { + // Unique, sequentially-generated value. + uint32 id = 1; + + // The human-readable name of the market pair (e.g. `BTC-USD`). + string pair = 2; + + // Static value. The exponent of the price. + // For example if `Exponent == -5` then a `Value` of `1,000,000,000` + // represents ``$10,000`. Therefore `10 ^ Exponent` represents the smallest + // price step (in dollars) that can be recorded. + sint32 exponent = 3; + + // The minimum number of exchanges that should be reporting a live price for + // a price update to be considered valid. + uint32 min_exchanges = 4; + + // The minimum allowable change in `price` value that would cause a price + // update on the network. Measured as `1e-6` (parts per million). + uint32 min_price_change_ppm = 5; + + // A string of json that encodes the configuration for resolving the price + // of this market on various exchanges. + string exchange_config_json = 6; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/market_price.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/market_price.proto new file mode 100644 index 00000000..acfd9967 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/market_price.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package dydxprotocol.prices; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"; + +// MarketPrice is used by the application to store/retrieve oracle price. +message MarketPrice { + // Unique, sequentially-generated value that matches `MarketParam`. + uint32 id = 1; + + // Static value. The exponent of the price. See the comment on the duplicate + // MarketParam field for more information. + sint32 exponent = 2; + + // The variable value that is updated by oracle price updates. `0` if it has + // never been updated, `>0` otherwise. + uint64 price = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/query.proto new file mode 100644 index 00000000..624db55d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/query.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; +package dydxprotocol.prices; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "dydxprotocol/prices/market_param.proto"; +import "dydxprotocol/prices/market_price.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries a MarketPrice by id. + rpc MarketPrice(QueryMarketPriceRequest) returns (QueryMarketPriceResponse) { + option (google.api.http).get = "/dydxprotocol/prices/market/{id}"; + } + + // Queries a list of MarketPrice items. + rpc AllMarketPrices(QueryAllMarketPricesRequest) + returns (QueryAllMarketPricesResponse) { + option (google.api.http).get = "/dydxprotocol/prices/market"; + } + + // Queries a MarketParam by id. + rpc MarketParam(QueryMarketParamRequest) returns (QueryMarketParamResponse) { + option (google.api.http).get = "/dydxprotocol/prices/params/market/{id}"; + } + + // Queries a list of MarketParam items. + rpc AllMarketParams(QueryAllMarketParamsRequest) + returns (QueryAllMarketParamsResponse) { + option (google.api.http).get = "/dydxprotocol/prices/params/market"; + } +} + +// QueryMarketPriceRequest is request type for the Query/Params `MarketPrice` +// RPC method. +message QueryMarketPriceRequest { uint32 id = 1; } + +// QueryMarketPriceResponse is response type for the Query/Params `MarketPrice` +// RPC method. +message QueryMarketPriceResponse { + MarketPrice market_price = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAllMarketPricesRequest is request type for the Query/Params +// `AllMarketPrices` RPC method. +message QueryAllMarketPricesRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllMarketPricesResponse is response type for the Query/Params +// `AllMarketPrices` RPC method. +message QueryAllMarketPricesResponse { + repeated MarketPrice market_prices = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryMarketParamsRequest is request type for the Query/Params `MarketParams` +// RPC method. +message QueryMarketParamRequest { uint32 id = 1; } + +// QueryMarketParamResponse is response type for the Query/Params `MarketParams` +// RPC method. +message QueryMarketParamResponse { + MarketParam market_param = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAllMarketParamsRequest is request type for the Query/Params +// `AllMarketParams` RPC method. +message QueryAllMarketParamsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllMarketParamsResponse is response type for the Query/Params +// `AllMarketParams` RPC method. +message QueryAllMarketParamsResponse { + repeated MarketParam market_params = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/tx.proto new file mode 100644 index 00000000..f63127f8 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/prices/tx.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; +package dydxprotocol.prices; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/prices/market_param.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"; + +// Msg defines the Msg service. +service Msg { + // UpdateMarketPrices updates the oracle price of a market relative to + // quoteCurrency. + rpc UpdateMarketPrices(MsgUpdateMarketPrices) + returns (MsgUpdateMarketPricesResponse); + // CreateOracleMarket creates a new oracle market. + rpc CreateOracleMarket(MsgCreateOracleMarket) + returns (MsgCreateOracleMarketResponse); + // UpdateMarketParams allows governance to update the parameters of an + // oracle market. + rpc UpdateMarketParam(MsgUpdateMarketParam) + returns (MsgUpdateMarketParamResponse); +} + +// MsgCreateOracleMarket is a message used by x/gov for creating a new oracle +// market. +message MsgCreateOracleMarket { + option (cosmos.msg.v1.signer) = "authority"; + + // The address that controls the module. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // `params` defines parameters for the new oracle market. + MarketParam params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgCreateOracleMarketResponse defines the CreateOracleMarket response type. +message MsgCreateOracleMarketResponse {} + +// MsgUpdateMarketPrices is a request type for the UpdateMarketPrices method. +message MsgUpdateMarketPrices { + // MarketPrice represents a price update for a single market + message MarketPrice { + // The id of market to update + uint32 market_id = 1; + // The updated price + uint64 price = 2; + } + + repeated MarketPrice market_price_updates = 1; +} + +// MsgUpdateMarketPricesResponse defines the MsgUpdateMarketPrices response +// type. +message MsgUpdateMarketPricesResponse {} + +// MsgUpdateMarketParam is a message used by x/gov for updating the parameters +// of an oracle market. +message MsgUpdateMarketParam { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The market param to update. Each field must be set. + MarketParam market_param = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateMarketParamResponse defines the UpdateMarketParam response type. +message MsgUpdateMarketParamResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/capacity.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/capacity.proto new file mode 100644 index 00000000..9c9845ec --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/capacity.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package dydxprotocol.ratelimit; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/ratelimit/limit_params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types"; + +// DenomCapacity stores a list of rate limit capacity for a denom. +message DenomCapacity { + // denom is the denomination of the token being rate limited. + // e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + string denom = 1; + // capacity_list is a list of capacity amount tracked for each `Limiter` + // on the denom. This list has a 1:1 mapping to `limiter` list under + // `LimitParams`. + repeated bytes capacity_list = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// LimiterCapacity contains a pair of limiter and its corresponding capacity. +message LimiterCapacity { + Limiter limiter = 1 [ (gogoproto.nullable) = false ]; + bytes capacity = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/genesis.proto new file mode 100644 index 00000000..b15662a3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package dydxprotocol.ratelimit; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/ratelimit/limit_params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types"; + +// GenesisState defines the ratelimit module's genesis state. +message GenesisState { + // limit_params_list defines the list of `LimitParams` at genesis. + repeated LimitParams limit_params_list = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/limit_params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/limit_params.proto new file mode 100644 index 00000000..d9d01ed8 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/limit_params.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package dydxprotocol.ratelimit; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types"; + +// LimitParams defines rate limit params on a denom. +message LimitParams { + // denom is the denomination of the token being rate limited. + // e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + string denom = 1; + // limiters is a list of rate-limiters on this denom. All limiters + // must be satified for a withdrawal to proceed. + repeated Limiter limiters = 2 [ (gogoproto.nullable) = false ]; +} + +// Limiter defines one rate-limiter on a specfic denom. +message Limiter { + // period is the rolling time period for which the limit applies + // e.g. 3600 (an hour) + google.protobuf.Duration period = 1 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // baseline_minimum is the minimum maximum withdrawal coin amount within the + // time period. + // e.g. 100_000_000_000 uusdc for 100k USDC; 5e22 adv4tnt for 50k DV4TNT + bytes baseline_minimum = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // baseline_tvl_ppm is the maximum ratio of TVL withdrawable in + // the time period, in part-per-million. + // e.g. 100_000 (10%) + uint32 baseline_tvl_ppm = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/pending_send_packet.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/pending_send_packet.proto new file mode 100644 index 00000000..e52677c4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/pending_send_packet.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package dydxprotocol.ratelimit; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types"; + +// PendingSendPacket contains the channel_id and sequence pair to identify a +// pending packet +message PendingSendPacket { + string channel_id = 1; + uint64 sequence = 2; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/query.proto new file mode 100644 index 00000000..ad462251 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/query.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package dydxprotocol.ratelimit; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "dydxprotocol/ratelimit/limit_params.proto"; +import "dydxprotocol/ratelimit/capacity.proto"; +import "dydxprotocol/ratelimit/pending_send_packet.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types"; + +// Query defines the gRPC querier service. +service Query { + // List all limit params. + rpc ListLimitParams(ListLimitParamsRequest) + returns (ListLimitParamsResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/ratelimit/list_limit_params"; + } + + // Query capacity by denom. + rpc CapacityByDenom(QueryCapacityByDenomRequest) + returns (QueryCapacityByDenomResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/ratelimit/capacity_by_denom"; + } + // Get all pending send packets + rpc AllPendingSendPackets(QueryAllPendingSendPacketsRequest) + returns (QueryAllPendingSendPacketsResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/ratelimit/get_all_pending_send_packet"; + } +} + +// ListLimitParamsRequest is a request type of the ListLimitParams RPC method. +message ListLimitParamsRequest {} + +// ListLimitParamsResponse is a response type of the ListLimitParams RPC method. +message ListLimitParamsResponse { + repeated LimitParams limit_params_list = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC +// method. +message QueryCapacityByDenomRequest { string denom = 1; } + +// QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC +// method. +message QueryCapacityByDenomResponse { + repeated LimiterCapacity limiter_capacity_list = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryAllPendingSendPacketsRequest is a request type for the +// AllPendingSendPackets RPC +message QueryAllPendingSendPacketsRequest {} + +// QueryAllPendingSendPacketsResponse is a response type of the +// AllPendingSendPackets RPC +message QueryAllPendingSendPacketsResponse { + repeated PendingSendPacket pending_send_packets = 1 + [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/tx.proto new file mode 100644 index 00000000..fd3c32b0 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/ratelimit/tx.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package dydxprotocol.ratelimit; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types"; + +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/ratelimit/limit_params.proto"; +import "gogoproto/gogo.proto"; + +// Msg defines the Msg service. +service Msg { + // SetLimitParams sets a `LimitParams` object in state. + rpc SetLimitParams(MsgSetLimitParams) returns (MsgSetLimitParamsResponse); +} + +// MsgSetLimitParams is the Msg/SetLimitParams request type. +message MsgSetLimitParams { + // The address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1; + + // Defines the parameters to set. All parameters must be supplied. + LimitParams limit_params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. +message MsgSetLimitParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/genesis.proto new file mode 100644 index 00000000..981a5140 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package dydxprotocol.revshare; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/revshare/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"; + +// GenesisState defines `x/revshare`'s genesis state. +message GenesisState { + MarketMapperRevenueShareParams params = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/params.proto new file mode 100644 index 00000000..22cd2a07 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/params.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package dydxprotocol.revshare; + +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"; + +// MarketMappeRevenueShareParams represents params for the above message +message MarketMapperRevenueShareParams { + // The address which will receive the revenue share payouts + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The fraction of the fees which will go to the above mentioned address. + // In parts-per-million + uint32 revenue_share_ppm = 2; + + // This parameter defines how many days post market initiation will the + // revenue share be applied for. After valid_days from market initiation + // the revenue share goes down to 0 + uint32 valid_days = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/query.proto new file mode 100644 index 00000000..51ecd481 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/query.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package dydxprotocol.revshare; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; + +import "dydxprotocol/revshare/params.proto"; +import "dydxprotocol/revshare/revshare.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"; + +// Query defines the gRPC querier service. +service Query { + // MarketMapperRevenueShareParams queries the revenue share params for the + // market mapper + rpc MarketMapperRevenueShareParams(QueryMarketMapperRevenueShareParams) + returns (QueryMarketMapperRevenueShareParamsResponse) { + option (google.api.http).get = + "/dydxprotocol/revshare/market_mapper_rev_share_params"; + } + + // Queries market mapper revenue share details for a specific market + rpc MarketMapperRevShareDetails(QueryMarketMapperRevShareDetails) + returns (QueryMarketMapperRevShareDetailsResponse) { + option (google.api.http).get = + "/dydxprotocol/revshare/market_mapper_rev_share_details/{market_id}"; + } +} + +// Queries for the default market mapper revenue share params +message QueryMarketMapperRevenueShareParams {} + +// Response type for QueryMarketMapperRevenueShareParams +message QueryMarketMapperRevenueShareParamsResponse { + MarketMapperRevenueShareParams params = 1 [ (gogoproto.nullable) = false ]; +} + +// Queries market mapper revenue share details for a specific market +message QueryMarketMapperRevShareDetails { uint32 market_id = 1; } + +// Response type for QueryMarketMapperRevShareDetails +message QueryMarketMapperRevShareDetailsResponse { + MarketMapperRevShareDetails details = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/revshare.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/revshare.proto new file mode 100644 index 00000000..210b72d4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/revshare.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package dydxprotocol.revshare; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"; + +// MarketMapperRevShareDetails specifies any details associated with the market +// mapper revenue share +message MarketMapperRevShareDetails { + // Unix timestamp recorded when the market revenue share expires + uint64 expiration_ts = 1; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/tx.proto new file mode 100644 index 00000000..5429103a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/revshare/tx.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; +package dydxprotocol.revshare; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/revshare/params.proto"; +import "dydxprotocol/revshare/revshare.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"; + +// Msg defines the Msg service. +service Msg { + // SetMarketMapperRevenueShare sets the revenue share for a market + // mapper. + rpc SetMarketMapperRevenueShare(MsgSetMarketMapperRevenueShare) + returns (MsgSetMarketMapperRevenueShareResponse); + + // SetMarketMapperRevenueShareDetails sets the revenue share details for a + // market mapper. + rpc SetMarketMapperRevShareDetailsForMarket( + MsgSetMarketMapperRevShareDetailsForMarket) + returns (MsgSetMarketMapperRevShareDetailsForMarketResponse); +} + +// Message to set the market mapper revenue share +message MsgSetMarketMapperRevenueShare { + // The address that controls the module (the gov module account). + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Parameters for the revenue share + MarketMapperRevenueShareParams params = 2 [ (gogoproto.nullable) = false ]; +} + +// Response to a MsgSetMarketMapperRevenueShare +message MsgSetMarketMapperRevenueShareResponse {} + +// Msg to set market mapper revenue share details (e.g. expiration timestamp) +// for a specific market. To be used as an override for existing revenue share +// settings set by the MsgSetMarketMapperRevenueShare msg +message MsgSetMarketMapperRevShareDetailsForMarket { + // The address that controls the module (the gov module account). + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The market ID for which to set the revenue share details + uint32 market_id = 2; + + // Parameters for the revenue share details + MarketMapperRevShareDetails params = 3 [ (gogoproto.nullable) = false ]; +} + +// Response to a MsgSetMarketMapperRevShareDetailsForMarket +message MsgSetMarketMapperRevShareDetailsForMarketResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/genesis.proto new file mode 100644 index 00000000..d833e17d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package dydxprotocol.rewards; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/rewards/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types"; + +// GenesisState defines the rewards module's genesis state. +message GenesisState { + // The parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/params.proto new file mode 100644 index 00000000..18366a00 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/params.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package dydxprotocol.rewards; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types"; + +// Params defines the parameters for x/rewards module. +message Params { + // The module account to distribute rewards from. + string treasury_account = 1; + + // The denom of the rewards token. + string denom = 2; + + // The exponent of converting one unit of `denom` to a full coin. + // For example, `denom=uatom, denom_exponent=-6` defines that + // `1 uatom = 10^(-6) ATOM`. This conversion is needed since the + // `market_id` retrieves the price of a full coin of the reward token. + sint32 denom_exponent = 3; + + // The id of the market that has the price of the rewards token. + uint32 market_id = 4; + + // The amount (in ppm) that fees are multiplied by to get + // the maximum rewards amount. + uint32 fee_multiplier_ppm = 5; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/query.proto new file mode 100644 index 00000000..693df1fc --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/query.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package dydxprotocol.rewards; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "dydxprotocol/rewards/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the Params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/rewards/params"; + } +} + +// QueryParamsRequest is a request type for the Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is a response type for the Params RPC method. +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/reward_share.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/reward_share.proto new file mode 100644 index 00000000..0c009dc4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/reward_share.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package dydxprotocol.rewards; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types"; + +// RewardShare stores the relative weight of rewards that each address is +// entitled to. +message RewardShare { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bytes weight = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/tx.proto new file mode 100644 index 00000000..f6400359 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/rewards/tx.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package dydxprotocol.rewards; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/rewards/params.proto"; +import "gogoproto/gogo.proto"; + +// Msg defines the Msg service. +service Msg { + // UpdateParams updates the Params in state. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The parameters to update. Each field must be set. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateParamsResponse is the Msg/UpdateParams response type. +message MsgUpdateParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/genesis.proto new file mode 100644 index 00000000..f2991340 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/genesis.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package dydxprotocol.sending; + +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/sending/types"; + +// GenesisState defines the sending module's genesis state. +message GenesisState { + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/query.proto new file mode 100644 index 00000000..341c372f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/query.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package dydxprotocol.sending; + +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/sending/types"; + +// Query defines the gRPC querier service. +service Query { + // this line is used by starport scaffolding # 2 +} + +// this line is used by starport scaffolding # 3 diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/transfer.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/transfer.proto new file mode 100644 index 00000000..5feea351 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/transfer.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; +package dydxprotocol.sending; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/sending/types"; + +// Transfer represents a single transfer between two subaccounts. +message Transfer { + // The sender subaccount ID. + dydxprotocol.subaccounts.SubaccountId sender = 1 + [ (gogoproto.nullable) = false ]; + + // The recipient subaccount ID. + dydxprotocol.subaccounts.SubaccountId recipient = 2 + [ (gogoproto.nullable) = false ]; + + // Id of the asset to transfer. + uint32 asset_id = 3; + + // The amount of asset to transfer + uint64 amount = 4; +} + +// MsgDepositToSubaccount represents a single transfer from an `x/bank` +// account to an `x/subaccounts` subaccount. +message MsgDepositToSubaccount { + option (cosmos.msg.v1.signer) = "sender"; + + // The sender wallet address. + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The recipient subaccount ID. + dydxprotocol.subaccounts.SubaccountId recipient = 2 + [ (gogoproto.nullable) = false ]; + + // Id of the asset to transfer. + uint32 asset_id = 3; + + // The number of quantums of asset to transfer. + uint64 quantums = 4; +} + +// MsgWithdrawFromSubaccount represents a single transfer from an +// `x/subaccounts` subaccount to an `x/bank` account. +message MsgWithdrawFromSubaccount { + option (cosmos.msg.v1.signer) = "sender"; + + // The sender subaccount ID. + dydxprotocol.subaccounts.SubaccountId sender = 2 + [ (gogoproto.nullable) = false ]; + + // The recipient wallet address. + string recipient = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Id of the asset to transfer. + uint32 asset_id = 3; + + // The number of quantums of asset to transfer. + uint64 quantums = 4; +} + +// MsgSendFromModuleToAccount represents a single transfer from a module +// to an `x/bank` account (can be either a module account address or a user +// account address). +// Should only be executed by governance. +message MsgSendFromModuleToAccount { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The sender module name. + string sender_module_name = 2; + + // The recipient account address (can be either a module account address + // or a user account address). + string recipient = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The coin to transfer, which specifies both denom and amount. + cosmos.base.v1beta1.Coin coin = 4 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/tx.proto new file mode 100644 index 00000000..028845af --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/sending/tx.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package dydxprotocol.sending; + +import "dydxprotocol/sending/transfer.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/sending/types"; + +// Msg defines the Msg service. +service Msg { + // CreateTransfer initiates a new transfer between subaccounts. + rpc CreateTransfer(MsgCreateTransfer) returns (MsgCreateTransferResponse); + // DepositToSubaccount initiates a new transfer from an `x/bank` account + // to an `x/subaccounts` subaccount. + rpc DepositToSubaccount(MsgDepositToSubaccount) + returns (MsgDepositToSubaccountResponse); + // WithdrawFromSubaccount initiates a new transfer from an `x/subaccounts` + // subaccount to an `x/bank` account. + rpc WithdrawFromSubaccount(MsgWithdrawFromSubaccount) + returns (MsgWithdrawFromSubaccountResponse); + // SendFromModuleToAccount initiates a new transfer from a module to an + // `x/bank` account (should only be executed by governance). + rpc SendFromModuleToAccount(MsgSendFromModuleToAccount) + returns (MsgSendFromModuleToAccountResponse); +} + +// MsgCreateTransfer is a request type used for initiating new transfers. +message MsgCreateTransfer { Transfer transfer = 1; } + +// MsgCreateTransferResponse is a response type used for new transfers. +message MsgCreateTransferResponse {} + +// MsgDepositToSubaccountResponse is a response type used for new +// account-to-subaccount transfers. +message MsgDepositToSubaccountResponse {} + +// MsgWithdrawFromSubaccountResponse is a response type used for new +// subaccount-to-account transfers. +message MsgWithdrawFromSubaccountResponse {} + +// MsgSendFromModuleToAccountResponse is a response type used for new +// module-to-account transfers. +message MsgSendFromModuleToAccountResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/genesis.proto new file mode 100644 index 00000000..1ad57efd --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package dydxprotocol.stats; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/stats/params.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/stats/types"; + +// GenesisState defines the stats module's genesis state. +message GenesisState { + // The parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/params.proto new file mode 100644 index 00000000..4628dd67 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/params.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package dydxprotocol.stats; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/stats/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +// Params defines the parameters for x/stats module. +message Params { + // The desired number of seconds in the look-back window. + google.protobuf.Duration window_duration = 1 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/query.proto new file mode 100644 index 00000000..9b6c9b53 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/query.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package dydxprotocol.stats; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "dydxprotocol/stats/params.proto"; +import "dydxprotocol/stats/stats.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/stats/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the Params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/stats/params"; + } + + // Queries StatsMetadata. + rpc StatsMetadata(QueryStatsMetadataRequest) + returns (QueryStatsMetadataResponse) { + option (google.api.http).get = "/dydxprotocol/v4/stats/stats_metadata"; + } + + // Queries GlobalStats. + rpc GlobalStats(QueryGlobalStatsRequest) returns (QueryGlobalStatsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/stats/global_stats"; + } + + // Queries UserStats. + rpc UserStats(QueryUserStatsRequest) returns (QueryUserStatsResponse) { + option (google.api.http).get = "/dydxprotocol/v4/stats/user_stats"; + } +} + +// QueryParamsRequest is a request type for the Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is a response type for the Params RPC method. +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryStatsMetadataRequest is a request type for the StatsMetadata RPC method. +message QueryStatsMetadataRequest {} + +// QueryStatsMetadataResponse is a response type for the StatsMetadata RPC +// method. +message QueryStatsMetadataResponse { StatsMetadata metadata = 1; } + +// QueryGlobalStatsRequest is a request type for the GlobalStats RPC method. +message QueryGlobalStatsRequest {} + +// QueryGlobalStatsResponse is a response type for the GlobalStats RPC method. +message QueryGlobalStatsResponse { GlobalStats stats = 1; } + +// QueryUserStatsRequest is a request type for the UserStats RPC method. +message QueryUserStatsRequest { string user = 1; } +// QueryUserStatsResponse is a request type for the UserStats RPC method. +message QueryUserStatsResponse { UserStats stats = 1; } diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/stats.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/stats.proto new file mode 100644 index 00000000..4186554d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/stats.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package dydxprotocol.stats; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/stats/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +// BlockStats is used to store stats transiently within the scope of a block. +message BlockStats { + // Fill records data about a fill on this block. + message Fill { + // Taker wallet address + string taker = 1; + + // Maker wallet address + string maker = 2; + + // Notional USDC filled in quantums + uint64 notional = 3; + } + + // The fills that occured on this block. + repeated Fill fills = 1; +} + +// StatsMetadata stores metadata for the x/stats module +message StatsMetadata { + // The oldest epoch that is included in the stats. The next epoch to be + // removed from the window. + uint32 trailing_epoch = 1; +} + +// EpochStats stores stats for a particular epoch +message EpochStats { + // A user and its associated stats + message UserWithStats { + string user = 1; + UserStats stats = 2; + } + + // Epoch end time + google.protobuf.Timestamp epoch_end_time = 1 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // Stats for each user in this epoch. Sorted by user. + repeated UserWithStats stats = 2; +} + +// GlobalStats stores global stats +message GlobalStats { + // Notional USDC traded in quantums + uint64 notional_traded = 1; +} + +// UserStats stores stats for a User +message UserStats { + // Taker USDC in quantums + uint64 taker_notional = 1; + + // Maker USDC in quantums + uint64 maker_notional = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/tx.proto new file mode 100644 index 00000000..0db777fd --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/stats/tx.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package dydxprotocol.stats; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/stats/types"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/stats/params.proto"; +import "gogoproto/gogo.proto"; + +// Msg defines the Msg service. +service Msg { + // UpdateParams updates the Params in state. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The parameters to update. Each field must be set. + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateParamsResponse is the Msg/UpdateParams response type. +message MsgUpdateParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/asset_position.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/asset_position.proto new file mode 100644 index 00000000..047ec195 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/asset_position.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package dydxprotocol.subaccounts; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"; + +// AssetPositions define an account’s positions of an `Asset`. +// Therefore they hold any information needed to trade on Spot and Margin. +message AssetPosition { + // The `Id` of the `Asset`. + uint32 asset_id = 1; + // The absolute size of the position in base quantums. + bytes quantums = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last + // time this position was settled + // TODO(DEC-582): pending margin trading being added. + uint64 index = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/genesis.proto new file mode 100644 index 00000000..e57e7c6e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package dydxprotocol.subaccounts; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"; + +// GenesisState defines the subaccounts module's genesis state. +message GenesisState { + repeated Subaccount subaccounts = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/perpetual_position.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/perpetual_position.proto new file mode 100644 index 00000000..da429e4d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/perpetual_position.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package dydxprotocol.subaccounts; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"; + +// PerpetualPositions are an account’s positions of a `Perpetual`. +// Therefore they hold any information needed to trade perpetuals. +message PerpetualPosition { + // The `Id` of the `Perpetual`. + uint32 perpetual_id = 1; + // The size of the position in base quantums. + bytes quantums = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // The funding_index of the `Perpetual` the last time this position was + // settled. + bytes funding_index = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + + // The quote_balance of the `Perpetual`. + bytes quote_balance = 4 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/query.proto new file mode 100644 index 00000000..63a1578d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/query.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; +package dydxprotocol.subaccounts; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries a Subaccount by id + rpc Subaccount(QueryGetSubaccountRequest) returns (QuerySubaccountResponse) { + option (google.api.http).get = + "/dydxprotocol/subaccounts/subaccount/{owner}/{number}"; + } + + // Queries a list of Subaccount items. + rpc SubaccountAll(QueryAllSubaccountRequest) + returns (QuerySubaccountAllResponse) { + option (google.api.http).get = "/dydxprotocol/subaccounts/subaccount"; + } + + // Queries information about whether withdrawal and transfers are blocked, and + // if so which block they are re-enabled on. + rpc GetWithdrawalAndTransfersBlockedInfo( + QueryGetWithdrawalAndTransfersBlockedInfoRequest) + returns (QueryGetWithdrawalAndTransfersBlockedInfoResponse) { + option (google.api.http).get = + "/dydxprotocol/subaccounts/withdrawals_and_transfers_blocked_info/" + "{perpetual_id}"; + } + + // Queries the collateral pool account address for a perpetual id. + rpc CollateralPoolAddress(QueryCollateralPoolAddressRequest) + returns (QueryCollateralPoolAddressResponse) { + option (google.api.http).get = + "/dydxprotocol/subaccounts/collateral_pool_address/{perpetual_id}"; + } +} + +// QueryGetSubaccountRequest is request type for the Query RPC method. +message QueryGetSubaccountRequest { + string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + uint32 number = 2; +} + +// QuerySubaccountResponse is response type for the Query RPC method. +message QuerySubaccountResponse { + Subaccount subaccount = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAllSubaccountRequest is request type for the Query RPC method. +message QueryAllSubaccountRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QuerySubaccountAllResponse is response type for the Query RPC method. +message QuerySubaccountAllResponse { + repeated Subaccount subaccount = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGetWithdrawalAndTransfersBlockedInfoRequest is a request type for +// fetching information about whether withdrawals and transfers are blocked for +// a collateral pool associated with the passed in perpetual id. +message QueryGetWithdrawalAndTransfersBlockedInfoRequest { + uint32 perpetual_id = 1; +} + +// QueryGetWithdrawalAndTransfersBlockedInfoRequest is a response type for +// fetching information about whether withdrawals and transfers are blocked. +message QueryGetWithdrawalAndTransfersBlockedInfoResponse { + uint32 negative_tnc_subaccount_seen_at_block = 1; + uint32 chain_outage_seen_at_block = 2; + uint32 withdrawals_and_transfers_unblocked_at_block = 3; +} + +// QueryCollateralPoolAddressRequest is the request type for fetching the +// account address of the collateral pool associated with the passed in +// perpetual id. +message QueryCollateralPoolAddressRequest { uint32 perpetual_id = 1; } + +// QueryCollateralPoolAddressResponse is a response type for fetching the +// account address of the collateral pool associated with the passed in +// perpetual id. +message QueryCollateralPoolAddressResponse { + string collateral_pool_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/streaming.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/streaming.proto new file mode 100644 index 00000000..13b71ee1 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/streaming.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package dydxprotocol.subaccounts; + +import "dydxprotocol/subaccounts/subaccount.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"; + +// StreamSubaccountUpdate provides information on a subaccount update. Used in +// the full node GRPC stream. +message StreamSubaccountUpdate { + SubaccountId subaccount_id = 1; + // updated_perpetual_positions will each be for unique perpetuals. + repeated SubaccountPerpetualPosition updated_perpetual_positions = 2; + // updated_asset_positions will each be for unique assets. + repeated SubaccountAssetPosition updated_asset_positions = 3; + // Snapshot indicates if the response is from a snapshot of the subaccount. + // All updates should be ignored until snapshot is received. + // If the snapshot is true, then all previous entries should be + // discarded and the subaccount should be resynced. + // For a snapshot subaccount update, the `updated_perpetual_positions` and + // `updated_asset_positions` fields will contain the full state of the + // subaccount. + bool snapshot = 4; +} + +// SubaccountPerpetualPosition provides information on a subaccount's updated +// perpetual positions. +message SubaccountPerpetualPosition { + // The `Id` of the `Perpetual`. + uint32 perpetual_id = 1; + // The size of the position in base quantums. + uint64 quantums = 2; +} + +// SubaccountAssetPosition provides information on a subaccount's updated asset +// positions. +message SubaccountAssetPosition { + // The `Id` of the `Asset`. + uint32 asset_id = 1; + // The absolute size of the position in base quantums. + uint64 quantums = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/subaccount.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/subaccount.proto new file mode 100644 index 00000000..d0158a63 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/subaccounts/subaccount.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package dydxprotocol.subaccounts; + +import "cosmos_proto/cosmos.proto"; +import "dydxprotocol/subaccounts/asset_position.proto"; +import "dydxprotocol/subaccounts/perpetual_position.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"; + +// SubaccountId defines a unique identifier for a Subaccount. +message SubaccountId { + // The address of the wallet that owns this subaccount. + string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // The unique number of this subaccount for the owner. + // Currently limited to 128*1000 subaccounts per owner. + uint32 number = 2; +} + +// Subaccount defines a single sub-account for a given address. +// Subaccounts are uniquely indexed by a subaccountNumber/owner pair. +message Subaccount { + // The Id of the Subaccount + SubaccountId id = 1; + // All `AssetPosition`s associated with this subaccount. + // Always sorted ascending by `asset_id`. + repeated AssetPosition asset_positions = 2; + // All `PerpetualPosition`s associated with this subaccount. + // Always sorted ascending by `perpetual_id. + repeated PerpetualPosition perpetual_positions = 3; + // Set by the owner. If true, then margin trades can be made in this + // subaccount. + bool margin_enabled = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/genesis.proto new file mode 100644 index 00000000..7ef64bce --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/genesis.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; +package dydxprotocol.vault; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/vault/params.proto"; +import "dydxprotocol/vault/share.proto"; +import "dydxprotocol/vault/vault.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; + +// GenesisState defines `x/vault`'s genesis state. +message GenesisState { + // The total number of shares. + NumShares total_shares = 1 [ (gogoproto.nullable) = false ]; + // The shares of each owner. + repeated OwnerShare owner_shares = 2 [ (gogoproto.nullable) = false ]; + // The vaults. + repeated Vault vaults = 3 [ (gogoproto.nullable) = false ]; + // The default quoting parameters for all vaults. + QuotingParams default_quoting_params = 4 [ (gogoproto.nullable) = false ]; +} + +// Vault defines the state of a vault. +message Vault { + // The ID of the vault. + VaultId vault_id = 1 [ (gogoproto.nullable) = false ]; + // The parameters of the vault. + VaultParams vault_params = 2 [ (gogoproto.nullable) = false ]; + // The client IDs of the most recently placed orders of the vault. + repeated uint32 most_recent_client_ids = 3; +} + +// GenesisStateV6 defines `x/vault`'s genesis state in v6.x. +// Deprecated since v7.x in favor of GenesisState. +message GenesisStateV6 { + // `params` field replaced since v6.x by default_quoting_params. + reserved 1; + // The vaults. + repeated Vault vaults = 2; + // The default quoting parameters for all vaults. + QuotingParams default_quoting_params = 3 [ (gogoproto.nullable) = false ]; +} + +// VaultV6 defines the state of a vault. +// Deprecated since v7.x in favor of Vault. +message VaultV6 { + // The ID of the vault. + VaultId vault_id = 1; + // The total number of shares in the vault. + NumShares total_shares = 2; + // The shares of each owner in the vault. + repeated OwnerShare owner_shares = 3; + // The parameters of the vault. + VaultParams vault_params = 4 [ (gogoproto.nullable) = false ]; + // The client IDs of the most recently placed orders of the vault. + repeated uint32 most_recent_client_ids = 5; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/params.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/params.proto new file mode 100644 index 00000000..73f5c528 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/params.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; +package dydxprotocol.vault; + +import "dydxprotocol/vault/vault.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; + +// QuotingParams stores vault quoting parameters. +message QuotingParams { + // The number of layers of orders a vault places. For example if + // `layers=2`, a vault places 2 asks and 2 bids. + uint32 layers = 1; + + // The minimum base spread when a vault quotes around reservation price. + uint32 spread_min_ppm = 2; + + // The buffer amount to add to min_price_change_ppm to arrive at `spread` + // according to formula: + // `spread = max(spread_min_ppm, min_price_change_ppm + spread_buffer_ppm)`. + uint32 spread_buffer_ppm = 3; + + // The factor that determines how aggressive a vault skews its orders. + uint32 skew_factor_ppm = 4; + + // The percentage of vault equity that each order is sized at. + uint32 order_size_pct_ppm = 5; + + // The duration that a vault's orders are valid for. + uint32 order_expiration_seconds = 6; + + // The number of quote quantums in quote asset that a vault with no perpetual + // positions must have to activate, i.e. if a vault has no perpetual positions + // and has strictly less than this amount of quote asset, it will not + // activate. + bytes activation_threshold_quote_quantums = 7 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// VaultParams stores vault parameters. +message VaultParams { + // Status of the vault. + VaultStatus status = 1; + // Quoting parameters of the vault. + QuotingParams quoting_params = 2; +} + +// Deprecated: Params stores `x/vault` parameters. +// Deprecated since v6.x as is replaced by QuotingParams. +message Params { + // The number of layers of orders a vault places. For example if + // `layers=2`, a vault places 2 asks and 2 bids. + uint32 layers = 1; + + // The minimum base spread when a vault quotes around reservation price. + uint32 spread_min_ppm = 2; + + // The buffer amount to add to min_price_change_ppm to arrive at `spread` + // according to formula: + // `spread = max(spread_min_ppm, min_price_change_ppm + spread_buffer_ppm)`. + uint32 spread_buffer_ppm = 3; + + // The factor that determines how aggressive a vault skews its orders. + uint32 skew_factor_ppm = 4; + + // The percentage of vault equity that each order is sized at. + uint32 order_size_pct_ppm = 5; + + // The duration that a vault's orders are valid for. + uint32 order_expiration_seconds = 6; + + // The number of quote quantums in quote asset that a vault with no perpetual + // positions must have to activate, i.e. if a vault has no perpetual positions + // and has strictly less than this amount of quote asset, it will not + // activate. + bytes activation_threshold_quote_quantums = 7 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/query.proto new file mode 100644 index 00000000..f1c21c6e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/query.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; +package dydxprotocol.vault; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/vault/params.proto"; +import "dydxprotocol/vault/share.proto"; +import "dydxprotocol/vault/vault.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the Params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/dydxprotocol/vault/params"; + } + // Queries a Vault by type and number. + rpc Vault(QueryVaultRequest) returns (QueryVaultResponse) { + option (google.api.http).get = "/dydxprotocol/vault/vault/{type}/{number}"; + } + // Queries all vaults. + rpc AllVaults(QueryAllVaultsRequest) returns (QueryAllVaultsResponse) { + option (google.api.http).get = "/dydxprotocol/vault/vault"; + } + // Queries total shares of megavault. + rpc MegavaultTotalShares(QueryMegavaultTotalSharesRequest) + returns (QueryMegavaultTotalSharesResponse) { + option (google.api.http).get = "/dydxprotocol/vault/megavault/total_shares"; + } + // Queries owner shares of megavault. + rpc MegavaultOwnerShares(QueryMegavaultOwnerSharesRequest) + returns (QueryMegavaultOwnerSharesResponse) { + option (google.api.http).get = "/dydxprotocol/vault/megavault/owner_shares"; + } +} + +// QueryParamsRequest is a request type for the Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is a response type for the Params RPC method. +message QueryParamsResponse { + // Deprecated since v6.x in favor of default_quoting_params. + Params params = 1 [ (gogoproto.nullable) = false, deprecated = true ]; + QuotingParams default_quoting_params = 2 [ (gogoproto.nullable) = false ]; +} + +// QueryVaultRequest is a request type for the Vault RPC method. +message QueryVaultRequest { + VaultType type = 1; + uint32 number = 2; +} + +// QueryVaultResponse is a response type for the Vault RPC method. +message QueryVaultResponse { + VaultId vault_id = 1 [ (gogoproto.nullable) = false ]; + dydxprotocol.subaccounts.SubaccountId subaccount_id = 2 + [ (gogoproto.nullable) = false ]; + bytes equity = 3 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + bytes inventory = 4 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + VaultParams vault_params = 5 [ (gogoproto.nullable) = false ]; +} + +// QueryAllVaultsRequest is a request type for the AllVaults RPC method. +message QueryAllVaultsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllVaultsResponse is a response type for the AllVaults RPC method. +message QueryAllVaultsResponse { + repeated QueryVaultResponse vaults = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryMegavaultTotalSharesRequest is a request type for the +// MegavaultTotalShares RPC method. +message QueryMegavaultTotalSharesRequest {} + +// QueryMegavaultTotalSharesResponse is a response type for the +// MegavaultTotalShares RPC method. +message QueryMegavaultTotalSharesResponse { NumShares total_shares = 1; } + +// QueryMegavaultOwnerSharesRequest is a request type for the +// MegavaultOwnerShares RPC method. +message QueryMegavaultOwnerSharesRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryMegavaultOwnerSharesResponse is a response type for the +// MegavaultOwnerShares RPC method. +message QueryMegavaultOwnerSharesResponse { + repeated OwnerShare owner_shares = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/share.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/share.proto new file mode 100644 index 00000000..cfe94cd5 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/share.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package dydxprotocol.vault; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; + +// NumShares represents the number of shares. +message NumShares { + // Number of shares. + bytes num_shares = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// OwnerShare is a type for owner shares. +message OwnerShare { + string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + NumShares shares = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/tx.proto new file mode 100644 index 00000000..b904fb15 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/tx.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; +package dydxprotocol.vault; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/vault/params.proto"; +import "dydxprotocol/vault/share.proto"; +import "dydxprotocol/vault/vault.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; + +// Msg defines the Msg service. +service Msg { + // DepositToMegavault deposits funds into megavault. + rpc DepositToMegavault(MsgDepositToMegavault) + returns (MsgDepositToMegavaultResponse); + + // UpdateDefaultQuotingParams updates the default quoting params in state. + rpc UpdateDefaultQuotingParams(MsgUpdateDefaultQuotingParams) + returns (MsgUpdateDefaultQuotingParamsResponse); + + // SetVaultParams sets the parameters of a specific vault. + rpc SetVaultParams(MsgSetVaultParams) returns (MsgSetVaultParamsResponse); +} + +// MsgDepositToMegavault deposits the specified asset from the subaccount to +// megavault. +message MsgDepositToMegavault { + // This annotation enforces that the tx signer is the owner specified in + // subaccount_id. Therefore, this enforces that only the owner of the + // subaccount can deposit into the vault using that subaccount. + option (cosmos.msg.v1.signer) = "subaccount_id"; + + // The subaccount to deposit from. + dydxprotocol.subaccounts.SubaccountId subaccount_id = 1; + + // Number of quote quantums to deposit. + bytes quote_quantums = 2 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. +message MsgDepositToMegavaultResponse { + // The number of shares minted from the deposit. + NumShares minted_shares = 1 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request +// type. +message MsgUpdateDefaultQuotingParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The quoting parameters to update to. Every field must be set. + QuotingParams default_quoting_params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateDefaultQuotingParamsResponse is the Msg/UpdateDefaultQuotingParams +// response type. +message MsgUpdateDefaultQuotingParamsResponse {} + +// MsgSetVaultParams is the Msg/SetVaultParams request type. +message MsgSetVaultParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The vault to set params of. + VaultId vault_id = 2 [ (gogoproto.nullable) = false ]; + + // The parameters to set. + VaultParams vault_params = 3 [ (gogoproto.nullable) = false ]; +} + +// MsgSetVaultParamsResponse is the Msg/SetVaultParams response type. +message MsgSetVaultParamsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/vault.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/vault.proto new file mode 100644 index 00000000..76c30482 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vault/vault.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package dydxprotocol.vault; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; + +// VaultType represents different types of vaults. +enum VaultType { + // Default value, invalid and unused. + VAULT_TYPE_UNSPECIFIED = 0; + + // Vault is associated with a CLOB pair. + VAULT_TYPE_CLOB = 1; +} + +// VaultId uniquely identifies a vault by its type and number. +message VaultId { + // Type of the vault. + VaultType type = 1; + + // Unique ID of the vault within above type. + uint32 number = 2; +} + +// VaultStatus represents the status of a vault. +enum VaultStatus { + // Default value, invalid and unused. + VAULT_STATUS_UNSPECIFIED = 0; + + // Don’t place orders. Does not count toward global vault balances. + VAULT_STATUS_DEACTIVATED = 1; + + // Don’t place orders. Does count towards global vault balances. + VAULT_STATUS_STAND_BY = 2; + + // Places orders on both sides of the book. + VAULT_STATUS_QUOTING = 3; + + // Only place orders that close the position. + VAULT_STATUS_CLOSE_ONLY = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/genesis.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/genesis.proto new file mode 100644 index 00000000..15249b41 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package dydxprotocol.vest; + +import "gogoproto/gogo.proto"; +import "dydxprotocol/vest/vest_entry.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vest/types"; + +// GenesisState defines the vest module's genesis state. +message GenesisState { + // The vest entries at genesis. + repeated VestEntry vest_entries = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/query.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/query.proto new file mode 100644 index 00000000..92085cea --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/query.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package dydxprotocol.vest; + +import "google/api/annotations.proto"; +import "dydxprotocol/vest/vest_entry.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vest/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the VestEntry. + rpc VestEntry(QueryVestEntryRequest) returns (QueryVestEntryResponse) { + option (google.api.http).get = "/dydxprotocol/v4/vest/vest_entry"; + } +} + +// QueryVestEntryRequest is a request type for the VestEntry RPC method. +message QueryVestEntryRequest { string vester_account = 1; } + +// QueryVestEntryResponse is a response type for the VestEntry RPC method. +message QueryVestEntryResponse { + VestEntry entry = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/tx.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/tx.proto new file mode 100644 index 00000000..42764d51 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/tx.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package dydxprotocol.vest; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "dydxprotocol/vest/vest_entry.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vest/types"; + +// Msg defines the Msg service. +service Msg { + // SetVestEntry sets a VestEntry in state. + rpc SetVestEntry(MsgSetVestEntry) returns (MsgSetVestEntryResponse); + // DeleteVestEntry deletes a VestEntry from state. + rpc DeleteVestEntry(MsgDeleteVestEntry) returns (MsgDeleteVestEntryResponse); +} + +// MsgDeleteVestEntry is the Msg/DeleteVestEntry request type. +message MsgDeleteVestEntry { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The vester account of the vest entry to delete. + string vester_account = 2; +} + +// MsgDeleteVestEntryResponse is the Msg/DeleteVestEntry response type. +message MsgDeleteVestEntryResponse {} + +// MsgSetVestEntry is the Msg/SetVestEntry request type. +message MsgSetVestEntry { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The vest entry to set. + VestEntry entry = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgSetVestEntryResponse is the Msg/SetVestEntry response type. +message MsgSetVestEntryResponse {} diff --git a/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/vest_entry.proto b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/vest_entry.proto new file mode 100644 index 00000000..03384b1f --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/dydxprotocol/vest/vest_entry.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package dydxprotocol.vest; + +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vest/types"; + +// VestEntry specifies a Vester Account and the rate at which tokens are +// dripped into the corresponding Treasury Account. +message VestEntry { + // The module account to vest tokens from. + // This is also the key to this `VestEntry` in state. + string vester_account = 1; + + // The module account to vest tokens to. + string treasury_account = 2; + + // The denom of the token to vest. + string denom = 3; + + // The start time of vest. Before this time, no vest will occur. + google.protobuf.Timestamp start_time = 4 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // The end time of vest. At this target date, all funds should be in the + // Treasury Account and none left in the Vester Account. + google.protobuf.Timestamp end_time = 5 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; +} diff --git a/dydxjs/packages/dydxjs/proto/gogoproto/LICENSE b/dydxjs/packages/dydxjs/proto/gogoproto/LICENSE new file mode 100644 index 00000000..992eb2bd --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/gogoproto/LICENSE @@ -0,0 +1,34 @@ +Copyright (c) 2013, The GoGo Authors. All rights reserved. + +Protocol Buffers for Go with Gadgets + +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dydxjs/packages/dydxjs/proto/gogoproto/README.md b/dydxjs/packages/dydxjs/proto/gogoproto/README.md new file mode 100644 index 00000000..4cfc4768 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/gogoproto/README.md @@ -0,0 +1 @@ +# gogoproto \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/gogoproto/gogo.proto b/dydxjs/packages/dydxjs/proto/gogoproto/gogo.proto new file mode 100644 index 00000000..49e78f99 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/gogoproto/gogo.proto @@ -0,0 +1,145 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/gogo/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "GoGoProtos"; +option go_package = "github.com/gogo/protobuf/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; + + optional string castrepeated = 65013; +} diff --git a/dydxjs/packages/dydxjs/proto/google/LICENSE b/dydxjs/packages/dydxjs/proto/google/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/dydxjs/packages/dydxjs/proto/google/README.md b/dydxjs/packages/dydxjs/proto/google/README.md new file mode 100644 index 00000000..3bdc1f83 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/README.md @@ -0,0 +1 @@ +# google \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/google/api/annotations.proto b/dydxjs/packages/dydxjs/proto/google/api/annotations.proto new file mode 100644 index 00000000..efdab3db --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/dydxjs/packages/dydxjs/proto/google/api/http.proto b/dydxjs/packages/dydxjs/proto/google/api/http.proto new file mode 100644 index 00000000..113fa936 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/google/protobuf/any.proto b/dydxjs/packages/dydxjs/proto/google/protobuf/any.proto new file mode 100644 index 00000000..4cf3843b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/protobuf/any.proto @@ -0,0 +1,155 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "types"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := ptypes.MarshalAny(foo) +// ... +// foo := &pb.Foo{} +// if err := ptypes.UnmarshalAny(any, foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/google/protobuf/descriptor.proto b/dydxjs/packages/dydxjs/proto/google/protobuf/descriptor.proto new file mode 100644 index 00000000..4a08905a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/protobuf/descriptor.proto @@ -0,0 +1,885 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "descriptor"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // If set, all the classes from the .proto file are wrapped in a single + // outer class with the given name. This applies to both Proto1 + // (equivalent to the old "--one_java_file" option) and Proto2 (where + // a .proto always translates to a single class, but you may want to + // explicitly choose the class name). + optional string java_outer_classname = 8; + + // If set true, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the outer class + // named by java_outer_classname. However, the outer class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = false]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + //reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + //reserved 8; // javalite_serializable + //reserved 9; // javanano_as_lite + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + optional bool lazy = 5 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + //reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + //reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/dydxjs/packages/dydxjs/proto/google/protobuf/duration.proto b/dydxjs/packages/dydxjs/proto/google/protobuf/duration.proto new file mode 100644 index 00000000..b14bea5d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/protobuf/duration.proto @@ -0,0 +1,116 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "types"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (durations.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/google/protobuf/empty.proto b/dydxjs/packages/dydxjs/proto/google/protobuf/empty.proto new file mode 100644 index 00000000..6057c852 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/protobuf/empty.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "types"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} diff --git a/dydxjs/packages/dydxjs/proto/google/protobuf/timestamp.proto b/dydxjs/packages/dydxjs/proto/google/protobuf/timestamp.proto new file mode 100644 index 00000000..0ebe36ea --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/google/protobuf/timestamp.proto @@ -0,0 +1,138 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "types"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/LICENSE b/dydxjs/packages/dydxjs/proto/ibc/LICENSE new file mode 100644 index 00000000..c04a16b3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 COSMOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/ibc/README.md b/dydxjs/packages/dydxjs/proto/ibc/README.md new file mode 100644 index 00000000..e4ee70c7 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/README.md @@ -0,0 +1 @@ +# ibc \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/genesis.proto new file mode 100644 index 00000000..73d9fddd --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/genesis.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"; + +import "ibc/applications/transfer/v1/transfer.proto"; +import "gogoproto/gogo.proto"; + +// GenesisState defines the ibc-transfer genesis state +message GenesisState { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + repeated DenomTrace denom_traces = 2 [ + (gogoproto.castrepeated) = "Traces", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"denom_traces\"" + ]; + Params params = 3 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/query.proto b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/query.proto new file mode 100644 index 00000000..f2faa87b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/query.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/applications/transfer/v1/transfer.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"; + +// Query provides defines the gRPC querier service. +service Query { + // DenomTrace queries a denomination trace information. + rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}"; + } + + // DenomTraces queries all denomination traces. + rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces"; + } + + // Params queries all parameters of the ibc-transfer module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/params"; + } +} + +// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC +// method +message QueryDenomTraceRequest { + // hash (in hex format) of the denomination trace information. + string hash = 1; +} + +// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC +// method. +message QueryDenomTraceResponse { + // denom_trace returns the requested denomination trace information. + DenomTrace denom_trace = 1; +} + +// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC +// method +message QueryDenomTracesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC +// method. +message QueryDenomTracesResponse { + // denom_traces returns all denominations trace information. + repeated DenomTrace denom_traces = 1 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/transfer.proto b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/transfer.proto new file mode 100644 index 00000000..10ce92f9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/transfer.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"; + +import "gogoproto/gogo.proto"; + +// DenomTrace contains the base denomination for ICS20 fungible tokens and the +// source tracing information path. +message DenomTrace { + // path defines the chain of port/channel identifiers used for tracing the + // source of the fungible token. + string path = 1; + // base denomination of the relayed fungible token. + string base_denom = 2; +} + +// Params defines the set of IBC transfer parameters. +// NOTE: To prevent a single token from being transferred, set the +// TransfersEnabled parameter to true and then set the bank module's SendEnabled +// parameter for the denomination to false. +message Params { + // send_enabled enables or disables all cross-chain token transfers from this + // chain. + bool send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled\""]; + // receive_enabled enables or disables all cross-chain token transfers to this + // chain. + bool receive_enabled = 2 [(gogoproto.moretags) = "yaml:\"receive_enabled\""]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/tx.proto b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/tx.proto new file mode 100644 index 00000000..dfc480d0 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v1/tx.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "ibc/core/client/v1/client.proto"; + +// Msg defines the ibc/transfer Msg service. +service Msg { + // Transfer defines a rpc handler method for MsgTransfer. + rpc Transfer(MsgTransfer) returns (MsgTransferResponse); +} + +// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +// ICS20 enabled chains. See ICS Spec here: +// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures +message MsgTransfer { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // the port on which the packet will be sent + string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + // the channel by which the packet will be sent + string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + // the tokens to be transferred + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; + // the sender address + string sender = 4; + // the recipient address on the destination chain + string receiver = 5; + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + ibc.core.client.v1.Height timeout_height = 6 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + // Timeout timestamp (in nanoseconds) relative to the current block timestamp. + // The timeout is disabled when set to 0. + uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; +} + +// MsgTransferResponse defines the Msg/Transfer response type. +message MsgTransferResponse {} diff --git a/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v2/packet.proto b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v2/packet.proto new file mode 100644 index 00000000..593392a9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/applications/transfer/v2/packet.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v2; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"; + +// FungibleTokenPacketData defines a struct for the packet payload +// See FungibleTokenPacketData spec: +// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures +message FungibleTokenPacketData { + // the token denomination to be transferred + string denom = 1; + // the token amount to be transferred + string amount = 2; + // the sender address + string sender = 3; + // the recipient address on the destination chain + string receiver = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/channel.proto b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/channel.proto new file mode 100644 index 00000000..c7f42dbf --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/channel.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// Channel defines pipeline for exactly-once packet delivery between specific +// modules on separate blockchains, which has at least one end capable of +// sending packets and one end capable of receiving packets. +message Channel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + Counterparty counterparty = 3 [(gogoproto.nullable) = false]; + // list of connection identifiers, in order, along which packets sent on + // this channel will travel + repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + // opaque channel version, which is agreed upon during the handshake + string version = 5; +} + +// IdentifiedChannel defines a channel with additional port and channel +// identifier fields. +message IdentifiedChannel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + Counterparty counterparty = 3 [(gogoproto.nullable) = false]; + // list of connection identifiers, in order, along which packets sent on + // this channel will travel + repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + // opaque channel version, which is agreed upon during the handshake + string version = 5; + // port identifier + string port_id = 6; + // channel identifier + string channel_id = 7; +} + +// State defines if a channel is in one of the following states: +// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +enum State { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; + // A channel has just started the opening handshake. + STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; + // A channel has acknowledged the handshake step on the counterparty chain. + STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; + // A channel has completed the handshake. Open channels are + // ready to send and receive packets. + STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; + // A channel has been closed and can no longer be used to send or receive + // packets. + STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; +} + +// Order defines if a channel is ORDERED or UNORDERED +enum Order { + option (gogoproto.goproto_enum_prefix) = false; + + // zero-value for channel ordering + ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; + // packets can be delivered in any order, which may differ from the order in + // which they were sent. + ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"]; + // packets are delivered exactly in the order which they were sent + ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; +} + +// Counterparty defines a channel end counterparty +message Counterparty { + option (gogoproto.goproto_getters) = false; + + // port on the counterparty chain which owns the other end of the channel. + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + // channel end on the counterparty chain + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; +} + +// Packet defines a type that carries data across different chains through IBC +message Packet { + option (gogoproto.goproto_getters) = false; + + // number corresponds to the order of sends and receives, where a Packet + // with an earlier sequence number must be sent and received before a Packet + // with a later sequence number. + uint64 sequence = 1; + // identifies the port on the sending chain. + string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""]; + // identifies the channel end on the sending chain. + string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + // identifies the port on the receiving chain. + string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""]; + // identifies the channel end on the receiving chain. + string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""]; + // actual opaque bytes transferred directly to the application module + bytes data = 6; + // block height after which the packet times out + ibc.core.client.v1.Height timeout_height = 7 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet times out + uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; +} + +// PacketState defines the generic type necessary to retrieve and store +// packet commitments, acknowledgements, and receipts. +// Caller is responsible for knowing the context necessary to interpret this +// state as a commitment, acknowledgement, or a receipt. +message PacketState { + option (gogoproto.goproto_getters) = false; + + // channel port identifier. + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + // channel unique identifier. + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + // packet sequence. + uint64 sequence = 3; + // embedded data that represents packet state. + bytes data = 4; +} + +// Acknowledgement is the recommended acknowledgement format to be used by +// app-specific protocols. +// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental +// conflicts with other protobuf message formats used for acknowledgements. +// The first byte of any message with this format will be the non-ASCII values +// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: +// https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope +message Acknowledgement { + // response contains either a result or an error and must be non-empty + oneof response { + bytes result = 21; + string error = 22; + } +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/genesis.proto new file mode 100644 index 00000000..38b57ed6 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/genesis.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// GenesisState defines the ibc channel submodule's genesis state. +message GenesisState { + repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false]; + repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; + repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; + repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; + repeated PacketSequence send_sequences = 5 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"send_sequences\""]; + repeated PacketSequence recv_sequences = 6 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recv_sequences\""]; + repeated PacketSequence ack_sequences = 7 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ack_sequences\""]; + // the sequence for the next generated channel identifier + uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""]; +} + +// PacketSequence defines the genesis type necessary to retrieve and store +// next send and receive sequences. +message PacketSequence { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + uint64 sequence = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/query.proto b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/query.proto new file mode 100644 index 00000000..212cb645 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/query.proto @@ -0,0 +1,376 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types"; + +import "ibc/core/client/v1/client.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; + +// Query provides defines the gRPC querier service +service Query { + // Channel queries an IBC Channel. + rpc Channel(QueryChannelRequest) returns (QueryChannelResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}"; + } + + // Channels queries all the IBC channels of a chain. + rpc Channels(QueryChannelsRequest) returns (QueryChannelsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels"; + } + + // ConnectionChannels queries all the channels associated with a connection + // end. + rpc ConnectionChannels(QueryConnectionChannelsRequest) returns (QueryConnectionChannelsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/connections/{connection}/channels"; + } + + // ChannelClientState queries for the client state for the channel associated + // with the provided channel identifiers. + rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/client_state"; + } + + // ChannelConsensusState queries for the consensus state for the channel + // associated with the provided channel identifiers. + rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/consensus_state/revision/" + "{revision_number}/height/{revision_height}"; + } + + // PacketCommitment queries a stored packet commitment hash. + rpc PacketCommitment(QueryPacketCommitmentRequest) returns (QueryPacketCommitmentResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" + "packet_commitments/{sequence}"; + } + + // PacketCommitments returns all the packet commitments hashes associated + // with a channel. + rpc PacketCommitments(QueryPacketCommitmentsRequest) returns (QueryPacketCommitmentsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_commitments"; + } + + // PacketReceipt queries if a given packet sequence has been received on the + // queried chain + rpc PacketReceipt(QueryPacketReceiptRequest) returns (QueryPacketReceiptResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_receipts/{sequence}"; + } + + // PacketAcknowledgement queries a stored packet acknowledgement hash. + rpc PacketAcknowledgement(QueryPacketAcknowledgementRequest) returns (QueryPacketAcknowledgementResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_acks/{sequence}"; + } + + // PacketAcknowledgements returns all the packet acknowledgements associated + // with a channel. + rpc PacketAcknowledgements(QueryPacketAcknowledgementsRequest) returns (QueryPacketAcknowledgementsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_acknowledgements"; + } + + // UnreceivedPackets returns all the unreceived IBC packets associated with a + // channel and sequences. + rpc UnreceivedPackets(QueryUnreceivedPacketsRequest) returns (QueryUnreceivedPacketsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" + "packet_commitments/" + "{packet_commitment_sequences}/unreceived_packets"; + } + + // UnreceivedAcks returns all the unreceived IBC acknowledgements associated + // with a channel and sequences. + rpc UnreceivedAcks(QueryUnreceivedAcksRequest) returns (QueryUnreceivedAcksResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/packet_commitments/" + "{packet_ack_sequences}/unreceived_acks"; + } + + // NextSequenceReceive returns the next receive sequence for a given channel. + rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/next_sequence"; + } +} + +// QueryChannelRequest is the request type for the Query/Channel RPC method +message QueryChannelRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryChannelResponse is the response type for the Query/Channel RPC method. +// Besides the Channel end, it includes a proof and the height from which the +// proof was retrieved. +message QueryChannelResponse { + // channel associated with the request identifiers + ibc.core.channel.v1.Channel channel = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelsRequest is the request type for the Query/Channels RPC method +message QueryChannelsRequest { + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryChannelsResponse is the response type for the Query/Channels RPC method. +message QueryChannelsResponse { + // list of stored channels of the chain. + repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionChannelsRequest is the request type for the +// Query/QueryConnectionChannels RPC method +message QueryConnectionChannelsRequest { + // connection unique identifier + string connection = 1; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryConnectionChannelsResponse is the Response type for the +// Query/QueryConnectionChannels RPC method +message QueryConnectionChannelsResponse { + // list of channels associated with a connection. + repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelClientStateRequest is the request type for the Query/ClientState +// RPC method +message QueryChannelClientStateRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryChannelClientStateResponse is the Response type for the +// Query/QueryChannelClientState RPC method +message QueryChannelClientStateResponse { + // client state associated with the channel + ibc.core.client.v1.IdentifiedClientState identified_client_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelConsensusStateRequest is the request type for the +// Query/ConsensusState RPC method +message QueryChannelConsensusStateRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // revision number of the consensus state + uint64 revision_number = 3; + // revision height of the consensus state + uint64 revision_height = 4; +} + +// QueryChannelClientStateResponse is the Response type for the +// Query/QueryChannelClientState RPC method +message QueryChannelConsensusStateResponse { + // consensus state associated with the channel + google.protobuf.Any consensus_state = 1; + // client ID associated with the consensus state + string client_id = 2; + // merkle proof of existence + bytes proof = 3; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; +} + +// QueryPacketCommitmentRequest is the request type for the +// Query/PacketCommitment RPC method +message QueryPacketCommitmentRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// QueryPacketCommitmentResponse defines the client query response for a packet +// which also includes a proof and the height from which the proof was +// retrieved +message QueryPacketCommitmentResponse { + // packet associated with the request fields + bytes commitment = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryPacketCommitmentsRequest is the request type for the +// Query/QueryPacketCommitments RPC method +message QueryPacketCommitmentsRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryPacketCommitmentsResponse is the request type for the +// Query/QueryPacketCommitments RPC method +message QueryPacketCommitmentsResponse { + repeated ibc.core.channel.v1.PacketState commitments = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryPacketReceiptRequest is the request type for the +// Query/PacketReceipt RPC method +message QueryPacketReceiptRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// QueryPacketReceiptResponse defines the client query response for a packet +// receipt which also includes a proof, and the height from which the proof was +// retrieved +message QueryPacketReceiptResponse { + // success flag for if receipt exists + bool received = 2; + // merkle proof of existence + bytes proof = 3; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; +} + +// QueryPacketAcknowledgementRequest is the request type for the +// Query/PacketAcknowledgement RPC method +message QueryPacketAcknowledgementRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// QueryPacketAcknowledgementResponse defines the client query response for a +// packet which also includes a proof and the height from which the +// proof was retrieved +message QueryPacketAcknowledgementResponse { + // packet associated with the request fields + bytes acknowledgement = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryPacketAcknowledgementsRequest is the request type for the +// Query/QueryPacketCommitments RPC method +message QueryPacketAcknowledgementsRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 3; + // list of packet sequences + repeated uint64 packet_commitment_sequences = 4; +} + +// QueryPacketAcknowledgemetsResponse is the request type for the +// Query/QueryPacketAcknowledgements RPC method +message QueryPacketAcknowledgementsResponse { + repeated ibc.core.channel.v1.PacketState acknowledgements = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUnreceivedPacketsRequest is the request type for the +// Query/UnreceivedPackets RPC method +message QueryUnreceivedPacketsRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // list of packet sequences + repeated uint64 packet_commitment_sequences = 3; +} + +// QueryUnreceivedPacketsResponse is the response type for the +// Query/UnreceivedPacketCommitments RPC method +message QueryUnreceivedPacketsResponse { + // list of unreceived packet sequences + repeated uint64 sequences = 1; + // query block height + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; +} + +// QueryUnreceivedAcks is the request type for the +// Query/UnreceivedAcks RPC method +message QueryUnreceivedAcksRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // list of acknowledgement sequences + repeated uint64 packet_ack_sequences = 3; +} + +// QueryUnreceivedAcksResponse is the response type for the +// Query/UnreceivedAcks RPC method +message QueryUnreceivedAcksResponse { + // list of unreceived acknowledgement sequences + repeated uint64 sequences = 1; + // query block height + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; +} + +// QueryNextSequenceReceiveRequest is the request type for the +// Query/QueryNextSequenceReceiveRequest RPC method +message QueryNextSequenceReceiveRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QuerySequenceResponse is the request type for the +// Query/QueryNextSequenceReceiveResponse RPC method +message QueryNextSequenceReceiveResponse { + // next sequence receive number + uint64 next_sequence_receive = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/tx.proto b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/tx.proto new file mode 100644 index 00000000..dab45080 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/channel/v1/tx.proto @@ -0,0 +1,211 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Msg defines the ibc/channel Msg service. +service Msg { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); + + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); + + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); + + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); + + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); + + // ChannelCloseConfirm defines a rpc handler method for + // MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + + // Timeout defines a rpc handler method for MsgTimeout. + rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); +} + +// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +// is called by a relayer on Chain A. +message MsgChannelOpenInit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + Channel channel = 2 [(gogoproto.nullable) = false]; + string signer = 3; +} + +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +message MsgChannelOpenInitResponse {} + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// on Chain B. +message MsgChannelOpenTry { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + // in the case of crossing hello's, when both chains call OpenInit, we need + // the channel identifier of the previous channel in state INIT + string previous_channel_id = 2 [(gogoproto.moretags) = "yaml:\"previous_channel_id\""]; + Channel channel = 3 [(gogoproto.nullable) = false]; + string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; + bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + ibc.core.client.v1.Height proof_height = 6 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +message MsgChannelOpenTryResponse {} + +// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +// the change of channel state to TRYOPEN on Chain B. +message MsgChannelOpenAck { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; + string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; + bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + ibc.core.client.v1.Height proof_height = 6 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +message MsgChannelOpenAckResponse {} + +// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of channel state to OPEN on Chain A. +message MsgChannelOpenConfirm { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response +// type. +message MsgChannelOpenConfirmResponse {} + +// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +// to close a channel with Chain B. +message MsgChannelCloseInit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string signer = 3; +} + +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +message MsgChannelCloseInitResponse {} + +// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +// to acknowledge the change of channel state to CLOSED on Chain A. +message MsgChannelCloseConfirm { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response +// type. +message MsgChannelCloseConfirmResponse {} + +// MsgRecvPacket receives incoming IBC packet +message MsgRecvPacket { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_commitment = 2 [(gogoproto.moretags) = "yaml:\"proof_commitment\""]; + ibc.core.client.v1.Height proof_height = 3 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +message MsgRecvPacketResponse {} + +// MsgTimeout receives timed-out packet +message MsgTimeout { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; + ibc.core.client.v1.Height proof_height = 3 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; + string signer = 5; +} + +// MsgTimeoutResponse defines the Msg/Timeout response type. +message MsgTimeoutResponse {} + +// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +message MsgTimeoutOnClose { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; + bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""]; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; + string signer = 6; +} + +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +message MsgTimeoutOnCloseResponse {} + +// MsgAcknowledgement receives incoming IBC acknowledgement +message MsgAcknowledgement { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes acknowledgement = 2; + bytes proof_acked = 3 [(gogoproto.moretags) = "yaml:\"proof_acked\""]; + ibc.core.client.v1.Height proof_height = 4 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +message MsgAcknowledgementResponse {} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/client.proto b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/client.proto new file mode 100644 index 00000000..f0a1538e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/client.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos_proto/cosmos.proto"; + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +message IdentifiedClientState { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // client state + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height +// field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // consensus state + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""]; +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +message ClientConsensusStates { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 + [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; +} + +// ClientUpdateProposal is a governance proposal. If it passes, the substitute +// client's latest consensus state is copied over to the subject client. The proposal +// handler may fail if the subject and the substitute do not match in client and +// chain parameters (with exception to latest height, frozen height, and chain-id). +message ClientUpdateProposal { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // the client identifier for the client to be updated if the proposal passes + string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""]; + // the substitute client identifier for the client standing in for the subject + // client + string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""]; +} + +// UpgradeProposal is a gov Content type for initiating an IBC breaking +// upgrade. +message UpgradeProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false]; + + // An UpgradedClientState must be provided to perform an IBC breaking upgrade. + // This will make the chain commit to the correct upgraded (self) client state + // before the upgrade occurs, so that connecting chains can verify that the + // new upgraded client is valid by verifying a proof on the previous version + // of the chain. This will allow IBC connections to persist smoothly across + // planned chain upgrades + google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; +} + +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +message Height { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // the revision that the client is currently on + uint64 revision_number = 1 [(gogoproto.moretags) = "yaml:\"revision_number\""]; + // the height within the given revision + uint64 revision_height = 2 [(gogoproto.moretags) = "yaml:\"revision_height\""]; +} + +// Params defines the set of IBC light client parameters. +message Params { + // allowed_clients defines the list of allowed client state types. + repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/genesis.proto new file mode 100644 index 00000000..6668f2ca --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/genesis.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"; + +import "ibc/core/client/v1/client.proto"; +import "gogoproto/gogo.proto"; + +// GenesisState defines the ibc client submodule's genesis state. +message GenesisState { + // client states with their corresponding identifiers + repeated IdentifiedClientState clients = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; + // consensus states from each client + repeated ClientConsensusStates clients_consensus = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "ClientsConsensusStates", + (gogoproto.moretags) = "yaml:\"clients_consensus\"" + ]; + // metadata from each client + repeated IdentifiedGenesisMetadata clients_metadata = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"clients_metadata\""]; + Params params = 4 [(gogoproto.nullable) = false]; + // create localhost on initialization + bool create_localhost = 5 [(gogoproto.moretags) = "yaml:\"create_localhost\""]; + // the sequence for the next generated client identifier + uint64 next_client_sequence = 6 [(gogoproto.moretags) = "yaml:\"next_client_sequence\""]; +} + +// GenesisMetadata defines the genesis type for metadata that clients may return +// with ExportMetadata +message GenesisMetadata { + option (gogoproto.goproto_getters) = false; + + // store key of metadata without clientID-prefix + bytes key = 1; + // metadata value + bytes value = 2; +} + +// IdentifiedGenesisMetadata has the client metadata with the corresponding +// client id. +message IdentifiedGenesisMetadata { + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + repeated GenesisMetadata client_metadata = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_metadata\""]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/query.proto b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/query.proto new file mode 100644 index 00000000..b6f8eb47 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/query.proto @@ -0,0 +1,184 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/core/client/v1/client.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; + +// Query provides defines the gRPC querier service +service Query { + // ClientState queries an IBC light client. + rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/client_states/{client_id}"; + } + + // ClientStates queries all the IBC light clients of a chain. + rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) { + option (google.api.http).get = "/ibc/core/client/v1/client_states"; + } + + // ConsensusState queries a consensus state associated with a client state at + // a given height. + rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/consensus_states/" + "{client_id}/revision/{revision_number}/" + "height/{revision_height}"; + } + + // ConsensusStates queries all the consensus state associated with a given + // client. + rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) { + option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}"; + } + + // Status queries the status of an IBC client. + rpc ClientStatus(QueryClientStatusRequest) returns (QueryClientStatusResponse) { + option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}"; + } + + // ClientParams queries all parameters of the ibc client. + rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) { + option (google.api.http).get = "/ibc/client/v1/params"; + } + + // UpgradedClientState queries an Upgraded IBC light client. + rpc UpgradedClientState(QueryUpgradedClientStateRequest) returns (QueryUpgradedClientStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/upgraded_client_states"; + } + + // UpgradedConsensusState queries an Upgraded IBC consensus state. + rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states"; + } +} + +// QueryClientStateRequest is the request type for the Query/ClientState RPC +// method +message QueryClientStateRequest { + // client state unique identifier + string client_id = 1; +} + +// QueryClientStateResponse is the response type for the Query/ClientState RPC +// method. Besides the client state, it includes a proof and the height from +// which the proof was retrieved. +message QueryClientStateResponse { + // client state associated with the request identifier + google.protobuf.Any client_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryClientStatesRequest is the request type for the Query/ClientStates RPC +// method +message QueryClientStatesRequest { + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClientStatesResponse is the response type for the Query/ClientStates RPC +// method. +message QueryClientStatesResponse { + // list of stored ClientStates of the chain. + repeated IdentifiedClientState client_states = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryConsensusStateRequest is the request type for the Query/ConsensusState +// RPC method. Besides the consensus state, it includes a proof and the height +// from which the proof was retrieved. +message QueryConsensusStateRequest { + // client identifier + string client_id = 1; + // consensus state revision number + uint64 revision_number = 2; + // consensus state revision height + uint64 revision_height = 3; + // latest_height overrrides the height field and queries the latest stored + // ConsensusState + bool latest_height = 4; +} + +// QueryConsensusStateResponse is the response type for the Query/ConsensusState +// RPC method +message QueryConsensusStateResponse { + // consensus state associated with the client identifier at the given height + google.protobuf.Any consensus_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates +// RPC method. +message QueryConsensusStatesRequest { + // client identifier + string client_id = 1; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryConsensusStatesResponse is the response type for the +// Query/ConsensusStates RPC method +message QueryConsensusStatesResponse { + // consensus states associated with the identifier + repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false]; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC +// method +message QueryClientStatusRequest { + // client unique identifier + string client_id = 1; +} + +// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC +// method. It returns the current status of the IBC client. +message QueryClientStatusResponse { + string status = 1; +} + +// QueryClientParamsRequest is the request type for the Query/ClientParams RPC +// method. +message QueryClientParamsRequest {} + +// QueryClientParamsResponse is the response type for the Query/ClientParams RPC +// method. +message QueryClientParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} + +// QueryUpgradedClientStateRequest is the request type for the +// Query/UpgradedClientState RPC method +message QueryUpgradedClientStateRequest {} + +// QueryUpgradedClientStateResponse is the response type for the +// Query/UpgradedClientState RPC method. +message QueryUpgradedClientStateResponse { + // client state associated with the request identifier + google.protobuf.Any upgraded_client_state = 1; +} + +// QueryUpgradedConsensusStateRequest is the request type for the +// Query/UpgradedConsensusState RPC method +message QueryUpgradedConsensusStateRequest {} + +// QueryUpgradedConsensusStateResponse is the response type for the +// Query/UpgradedConsensusState RPC method. +message QueryUpgradedConsensusStateResponse { + // Consensus state associated with the request identifier + google.protobuf.Any upgraded_consensus_state = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/tx.proto b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/tx.proto new file mode 100644 index 00000000..82df96de --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/client/v1/tx.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// Msg defines the ibc/client Msg service. +service Msg { + // CreateClient defines a rpc handler method for MsgCreateClient. + rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); + + // UpdateClient defines a rpc handler method for MsgUpdateClient. + rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); + + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); + + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); +} + +// MsgCreateClient defines a message to create an IBC client +message MsgCreateClient { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // light client state + google.protobuf.Any client_state = 1 [(gogoproto.moretags) = "yaml:\"client_state\""]; + // consensus state associated with the client that corresponds to a given + // height. + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + // signer address + string signer = 3; +} + +// MsgCreateClientResponse defines the Msg/CreateClient response type. +message MsgCreateClientResponse {} + +// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +// the given header. +message MsgUpdateClient { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // header to update the light client + google.protobuf.Any header = 2; + // signer address + string signer = 3; +} + +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +message MsgUpdateClientResponse {} + +// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client +// state +message MsgUpgradeClient { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // upgraded client state + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + // upgraded consensus state, only contains enough information to serve as a + // basis of trust in update logic + google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + // proof that old chain committed to new client + bytes proof_upgrade_client = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade_client\""]; + // proof that old chain committed to new consensus state + bytes proof_upgrade_consensus_state = 5 [(gogoproto.moretags) = "yaml:\"proof_upgrade_consensus_state\""]; + // signer address + string signer = 6; +} + +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +message MsgUpgradeClientResponse {} + +// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +// light client misbehaviour. +message MsgSubmitMisbehaviour { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // client unique identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // misbehaviour used for freezing the light client + google.protobuf.Any misbehaviour = 2; + // signer address + string signer = 3; +} + +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response +// type. +message MsgSubmitMisbehaviourResponse {} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/commitment/v1/commitment.proto b/dydxjs/packages/dydxjs/proto/ibc/core/commitment/v1/commitment.proto new file mode 100644 index 00000000..b460b9a1 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/commitment/v1/commitment.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package ibc.core.commitment.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/23-commitment/types"; + +import "gogoproto/gogo.proto"; +import "confio/proofs.proto"; + +// MerkleRoot defines a merkle root hash. +// In the Cosmos SDK, the AppHash of a block header becomes the root. +message MerkleRoot { + option (gogoproto.goproto_getters) = false; + + bytes hash = 1; +} + +// MerklePrefix is merkle path prefixed to the key. +// The constructed key from the Path and the key will be append(Path.KeyPath, +// append(Path.KeyPrefix, key...)) +message MerklePrefix { + bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""]; +} + +// MerklePath is the path used to verify commitment proofs, which can be an +// arbitrary structured object (defined by a commitment type). +// MerklePath is represented from root-to-leaf +message MerklePath { + option (gogoproto.goproto_stringer) = false; + + repeated string key_path = 1 [(gogoproto.moretags) = "yaml:\"key_path\""]; +} + +// MerkleProof is a wrapper type over a chain of CommitmentProofs. +// It demonstrates membership or non-membership for an element or set of +// elements, verifiable in conjunction with a known commitment root. Proofs +// should be succinct. +// MerkleProofs are ordered from leaf-to-root +message MerkleProof { + repeated ics23.CommitmentProof proofs = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/connection.proto b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/connection.proto new file mode 100644 index 00000000..74c39e26 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/connection.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/commitment/v1/commitment.proto"; + +// ICS03 - Connection Data Structures as defined in +// https://github.com/cosmos/ibc/blob/master/spec/core/ics-003-connection-semantics#data-structures + +// ConnectionEnd defines a stateful object on a chain connected to another +// separate one. +// NOTE: there must only be 2 defined ConnectionEnds to establish +// a connection between two chains. +message ConnectionEnd { + option (gogoproto.goproto_getters) = false; + // client associated with this connection. + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // IBC version which can be utilised to determine encodings or protocols for + // channels or packets utilising this connection. + repeated Version versions = 2; + // current state of the connection end. + State state = 3; + // counterparty chain associated with this connection. + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + // delay period that must pass before a consensus state can be used for + // packet-verification NOTE: delay period logic is only implemented by some + // clients. + uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; +} + +// IdentifiedConnection defines a connection with additional connection +// identifier field. +message IdentifiedConnection { + option (gogoproto.goproto_getters) = false; + // connection identifier. + string id = 1 [(gogoproto.moretags) = "yaml:\"id\""]; + // client associated with this connection. + string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // IBC version which can be utilised to determine encodings or protocols for + // channels or packets utilising this connection + repeated Version versions = 3; + // current state of the connection end. + State state = 4; + // counterparty chain associated with this connection. + Counterparty counterparty = 5 [(gogoproto.nullable) = false]; + // delay period associated with this connection. + uint64 delay_period = 6 [(gogoproto.moretags) = "yaml:\"delay_period\""]; +} + +// State defines if a connection is in one of the following states: +// INIT, TRYOPEN, OPEN or UNINITIALIZED. +enum State { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; + // A connection end has just started the opening handshake. + STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; + // A connection end has acknowledged the handshake step on the counterparty + // chain. + STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; + // A connection end has completed the handshake. + STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; +} + +// Counterparty defines the counterparty chain associated with a connection end. +message Counterparty { + option (gogoproto.goproto_getters) = false; + + // identifies the client on the counterparty chain associated with a given + // connection. + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // identifies the connection end on the counterparty chain associated with a + // given connection. + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + // commitment merkle prefix of the counterparty chain. + ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; +} + +// ClientPaths define all the connection paths for a client state. +message ClientPaths { + // list of connection paths + repeated string paths = 1; +} + +// ConnectionPaths define all the connection paths for a given client state. +message ConnectionPaths { + // client state unique identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // list of connection paths + repeated string paths = 2; +} + +// Version defines the versioning scheme used to negotiate the IBC verison in +// the connection handshake. +message Version { + option (gogoproto.goproto_getters) = false; + + // unique version identifier + string identifier = 1; + // list of features compatible with the specified identifier + repeated string features = 2; +} + +// Params defines the set of Connection parameters. +message Params { + // maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + // largest amount of time that the chain might reasonably take to produce the next block under normal operating + // conditions. A safe choice is 3-5x the expected time per block. + uint64 max_expected_time_per_block = 1 [(gogoproto.moretags) = "yaml:\"max_expected_time_per_block\""]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/genesis.proto new file mode 100644 index 00000000..ec5be642 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/connection/v1/connection.proto"; + +// GenesisState defines the ibc connection submodule's genesis state. +message GenesisState { + repeated IdentifiedConnection connections = 1 [(gogoproto.nullable) = false]; + repeated ConnectionPaths client_connection_paths = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_connection_paths\""]; + // the sequence for the next generated connection identifier + uint64 next_connection_sequence = 3 [(gogoproto.moretags) = "yaml:\"next_connection_sequence\""]; + Params params = 4 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/query.proto b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/query.proto new file mode 100644 index 00000000..d668c3d2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/query.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/connection/v1/connection.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; + +// Query provides defines the gRPC querier service +service Query { + // Connection queries an IBC connection end. + rpc Connection(QueryConnectionRequest) returns (QueryConnectionResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}"; + } + + // Connections queries all the IBC connections of a chain. + rpc Connections(QueryConnectionsRequest) returns (QueryConnectionsResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections"; + } + + // ClientConnections queries the connection paths associated with a client + // state. + rpc ClientConnections(QueryClientConnectionsRequest) returns (QueryClientConnectionsResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/client_connections/{client_id}"; + } + + // ConnectionClientState queries the client state associated with the + // connection. + rpc ConnectionClientState(QueryConnectionClientStateRequest) returns (QueryConnectionClientStateResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/client_state"; + } + + // ConnectionConsensusState queries the consensus state associated with the + // connection. + rpc ConnectionConsensusState(QueryConnectionConsensusStateRequest) returns (QueryConnectionConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/consensus_state/" + "revision/{revision_number}/height/{revision_height}"; + } +} + +// QueryConnectionRequest is the request type for the Query/Connection RPC +// method +message QueryConnectionRequest { + // connection unique identifier + string connection_id = 1; +} + +// QueryConnectionResponse is the response type for the Query/Connection RPC +// method. Besides the connection end, it includes a proof and the height from +// which the proof was retrieved. +message QueryConnectionResponse { + // connection associated with the request identifier + ibc.core.connection.v1.ConnectionEnd connection = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionsRequest is the request type for the Query/Connections RPC +// method +message QueryConnectionsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryConnectionsResponse is the response type for the Query/Connections RPC +// method. +message QueryConnectionsResponse { + // list of stored connections of the chain. + repeated ibc.core.connection.v1.IdentifiedConnection connections = 1; + // pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + +// QueryClientConnectionsRequest is the request type for the +// Query/ClientConnections RPC method +message QueryClientConnectionsRequest { + // client identifier associated with a connection + string client_id = 1; +} + +// QueryClientConnectionsResponse is the response type for the +// Query/ClientConnections RPC method +message QueryClientConnectionsResponse { + // slice of all the connection paths associated with a client. + repeated string connection_paths = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was generated + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionClientStateRequest is the request type for the +// Query/ConnectionClientState RPC method +message QueryConnectionClientStateRequest { + // connection identifier + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// QueryConnectionClientStateResponse is the response type for the +// Query/ConnectionClientState RPC method +message QueryConnectionClientStateResponse { + // client state associated with the channel + ibc.core.client.v1.IdentifiedClientState identified_client_state = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryConnectionConsensusStateRequest is the request type for the +// Query/ConnectionConsensusState RPC method +message QueryConnectionConsensusStateRequest { + // connection identifier + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + uint64 revision_number = 2; + uint64 revision_height = 3; +} + +// QueryConnectionConsensusStateResponse is the response type for the +// Query/ConnectionConsensusState RPC method +message QueryConnectionConsensusStateResponse { + // consensus state associated with the channel + google.protobuf.Any consensus_state = 1; + // client ID associated with the consensus state + string client_id = 2; + // merkle proof of existence + bytes proof = 3; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/tx.proto b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/tx.proto new file mode 100644 index 00000000..9d4e577e --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/connection/v1/tx.proto @@ -0,0 +1,119 @@ +syntax = "proto3"; + +package ibc.core.connection.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/connection/v1/connection.proto"; + +// Msg defines the ibc/connection Msg service. +service Msg { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); + + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); + + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); + + // ConnectionOpenConfirm defines a rpc handler method for + // MsgConnectionOpenConfirm. + rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); +} + +// MsgConnectionOpenInit defines the msg sent by an account on Chain A to +// initialize a connection with Chain B. +message MsgConnectionOpenInit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + Counterparty counterparty = 2 [(gogoproto.nullable) = false]; + Version version = 3; + uint64 delay_period = 4 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + string signer = 5; +} + +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response +// type. +message MsgConnectionOpenInitResponse {} + +// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +// connection on Chain B. +message MsgConnectionOpenTry { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // in the case of crossing hello's, when both chains call OpenInit, we need + // the connection identifier of the previous connection in state INIT + string previous_connection_id = 2 [(gogoproto.moretags) = "yaml:\"previous_connection_id\""]; + google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""]; + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + repeated Version counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; + ibc.core.client.v1.Height proof_height = 7 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + // proof of the initialization the connection on Chain A: `UNITIALIZED -> + // INIT` + bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + // proof of client state included in message + bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + // proof of client consensus state + bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; + ibc.core.client.v1.Height consensus_height = 11 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; + string signer = 12; +} + +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +message MsgConnectionOpenTryResponse {} + +// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to +// acknowledge the change of connection state to TRYOPEN on Chain B. +message MsgConnectionOpenAck { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; + Version version = 3; + google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; + ibc.core.client.v1.Height proof_height = 5 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + // proof of the initialization the connection on Chain B: `UNITIALIZED -> + // TRYOPEN` + bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + // proof of client state included in message + bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + // proof of client consensus state + bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; + ibc.core.client.v1.Height consensus_height = 9 + [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; + string signer = 10; +} + +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +message MsgConnectionOpenAckResponse {} + +// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to +// acknowledge the change of connection state to OPEN on Chain A. +message MsgConnectionOpenConfirm { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + // proof for the change of the connection state on Chain A: `INIT -> OPEN` + bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; + ibc.core.client.v1.Height proof_height = 3 + [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm +// response type. +message MsgConnectionOpenConfirmResponse {} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/port/v1/query.proto b/dydxjs/packages/dydxjs/proto/ibc/core/port/v1/query.proto new file mode 100644 index 00000000..3c7fb7cb --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/port/v1/query.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package ibc.core.port.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"; + +import "ibc/core/channel/v1/channel.proto"; + +// Query defines the gRPC querier service +service Query { + // AppVersion queries an IBC Port and determines the appropriate application version to be used + rpc AppVersion(QueryAppVersionRequest) returns (QueryAppVersionResponse) {} +} + +// QueryAppVersionRequest is the request type for the Query/AppVersion RPC method +message QueryAppVersionRequest { + // port unique identifier + string port_id = 1; + // connection unique identifier + string connection_id = 2; + // whether the channel is ordered or unordered + ibc.core.channel.v1.Order ordering = 3; + // counterparty channel end + ibc.core.channel.v1.Counterparty counterparty = 4; + // proposed version + string proposed_version = 5; +} + +// QueryAppVersionResponse is the response type for the Query/AppVersion RPC method. +message QueryAppVersionResponse { + // port id associated with the request identifiers + string port_id = 1; + // supported app version + string version = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/core/types/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/ibc/core/types/v1/genesis.proto new file mode 100644 index 00000000..e39f6cdb --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/core/types/v1/genesis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package ibc.core.types.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/genesis.proto"; +import "ibc/core/connection/v1/genesis.proto"; +import "ibc/core/channel/v1/genesis.proto"; + +// GenesisState defines the ibc module's genesis state. +message GenesisState { + // ICS002 - Clients genesis state + ibc.core.client.v1.GenesisState client_genesis = 1 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_genesis\""]; + // ICS003 - Connections genesis state + ibc.core.connection.v1.GenesisState connection_genesis = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"connection_genesis\""]; + // ICS004 - Channel genesis state + ibc.core.channel.v1.GenesisState channel_genesis = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"channel_genesis\""]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/lightclients/localhost/v1/localhost.proto b/dydxjs/packages/dydxjs/proto/ibc/lightclients/localhost/v1/localhost.proto new file mode 100644 index 00000000..4fe05b78 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/lightclients/localhost/v1/localhost.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package ibc.lightclients.localhost.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/light-clients/09-localhost/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// ClientState defines a loopback (localhost) client. It requires (read-only) +// access to keys outside the client prefix. +message ClientState { + option (gogoproto.goproto_getters) = false; + // self chain ID + string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""]; + // self latest block height + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/lightclients/solomachine/v1/solomachine.proto b/dydxjs/packages/dydxjs/proto/ibc/lightclients/solomachine/v1/solomachine.proto new file mode 100644 index 00000000..b9b8a3a2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/lightclients/solomachine/v1/solomachine.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/legacy/v100"; + +import "ibc/core/connection/v1/connection.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +message ClientState { + option (gogoproto.goproto_getters) = false; + // latest sequence of the client state + uint64 sequence = 1; + // frozen sequence of the solo machine + uint64 frozen_sequence = 2 [(gogoproto.moretags) = "yaml:\"frozen_sequence\""]; + ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + // when set to true, will allow governance to update a solo machine client. + // The client will be unfrozen if it is frozen. + bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; +} + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // public key of the solo machine + google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + string diversifier = 2; + uint64 timestamp = 3; +} + +// Header defines a solo machine consensus header +message Header { + option (gogoproto.goproto_getters) = false; + // sequence to update solo machine public key at + uint64 sequence = 1; + uint64 timestamp = 2; + bytes signature = 3; + google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; + string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + uint64 sequence = 2; + SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; + SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; +} + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +message SignatureAndData { + option (gogoproto.goproto_getters) = false; + bytes signature = 1; + DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; + bytes data = 3; + uint64 timestamp = 4; +} + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +message TimestampedSignatureData { + option (gogoproto.goproto_getters) = false; + bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; + uint64 timestamp = 2; +} + +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; + uint64 timestamp = 2; + string diversifier = 3; + // type of the data used + DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; + // marshaled data + bytes data = 5; +} + +// DataType defines the type of solo machine proof being created. This is done +// to preserve uniqueness of different data sign byte encodings. +enum DataType { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; + // Data type for client state verification + DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; + // Data type for consensus state verification + DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; + // Data type for connection state verification + DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; + // Data type for channel state verification + DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; + // Data type for packet commitment verification + DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; + // Data type for packet acknowledgement verification + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; + // Data type for packet receipt absence verification + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; + // Data type for next sequence recv verification + DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; + // Data type for header verification + DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; +} + +// HeaderData returns the SignBytes data for update verification. +message HeaderData { + option (gogoproto.goproto_getters) = false; + + // header public key + google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; + // header diversifier + string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} + +// ClientStateData returns the SignBytes data for client state verification. +message ClientStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; +} + +// ConsensusStateData returns the SignBytes data for consensus state +// verification. +message ConsensusStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; +} + +// ConnectionStateData returns the SignBytes data for connection state +// verification. +message ConnectionStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.connection.v1.ConnectionEnd connection = 2; +} + +// ChannelStateData returns the SignBytes data for channel state +// verification. +message ChannelStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.channel.v1.Channel channel = 2; +} + +// PacketCommitmentData returns the SignBytes data for packet commitment +// verification. +message PacketCommitmentData { + bytes path = 1; + bytes commitment = 2; +} + +// PacketAcknowledgementData returns the SignBytes data for acknowledgement +// verification. +message PacketAcknowledgementData { + bytes path = 1; + bytes acknowledgement = 2; +} + +// PacketReceiptAbsenceData returns the SignBytes data for +// packet receipt absence verification. +message PacketReceiptAbsenceData { + bytes path = 1; +} + +// NextSequenceRecvData returns the SignBytes data for verification of the next +// sequence to be received. +message NextSequenceRecvData { + bytes path = 1; + uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/dydxjs/packages/dydxjs/proto/ibc/lightclients/solomachine/v2/solomachine.proto new file mode 100644 index 00000000..0c8c638c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v2; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/light-clients/06-solomachine/types"; + +import "ibc/core/connection/v1/connection.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +message ClientState { + option (gogoproto.goproto_getters) = false; + // latest sequence of the client state + uint64 sequence = 1; + // frozen sequence of the solo machine + bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; + ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + // when set to true, will allow governance to update a solo machine client. + // The client will be unfrozen if it is frozen. + bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; +} + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // public key of the solo machine + google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + string diversifier = 2; + uint64 timestamp = 3; +} + +// Header defines a solo machine consensus header +message Header { + option (gogoproto.goproto_getters) = false; + // sequence to update solo machine public key at + uint64 sequence = 1; + uint64 timestamp = 2; + bytes signature = 3; + google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; + string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + uint64 sequence = 2; + SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; + SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; +} + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +message SignatureAndData { + option (gogoproto.goproto_getters) = false; + bytes signature = 1; + DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; + bytes data = 3; + uint64 timestamp = 4; +} + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +message TimestampedSignatureData { + option (gogoproto.goproto_getters) = false; + bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; + uint64 timestamp = 2; +} + +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; + uint64 timestamp = 2; + string diversifier = 3; + // type of the data used + DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; + // marshaled data + bytes data = 5; +} + +// DataType defines the type of solo machine proof being created. This is done +// to preserve uniqueness of different data sign byte encodings. +enum DataType { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; + // Data type for client state verification + DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; + // Data type for consensus state verification + DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; + // Data type for connection state verification + DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; + // Data type for channel state verification + DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; + // Data type for packet commitment verification + DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; + // Data type for packet acknowledgement verification + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; + // Data type for packet receipt absence verification + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; + // Data type for next sequence recv verification + DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; + // Data type for header verification + DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; +} + +// HeaderData returns the SignBytes data for update verification. +message HeaderData { + option (gogoproto.goproto_getters) = false; + + // header public key + google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; + // header diversifier + string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; +} + +// ClientStateData returns the SignBytes data for client state verification. +message ClientStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; +} + +// ConsensusStateData returns the SignBytes data for consensus state +// verification. +message ConsensusStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; +} + +// ConnectionStateData returns the SignBytes data for connection state +// verification. +message ConnectionStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.connection.v1.ConnectionEnd connection = 2; +} + +// ChannelStateData returns the SignBytes data for channel state +// verification. +message ChannelStateData { + option (gogoproto.goproto_getters) = false; + + bytes path = 1; + ibc.core.channel.v1.Channel channel = 2; +} + +// PacketCommitmentData returns the SignBytes data for packet commitment +// verification. +message PacketCommitmentData { + bytes path = 1; + bytes commitment = 2; +} + +// PacketAcknowledgementData returns the SignBytes data for acknowledgement +// verification. +message PacketAcknowledgementData { + bytes path = 1; + bytes acknowledgement = 2; +} + +// PacketReceiptAbsenceData returns the SignBytes data for +// packet receipt absence verification. +message PacketReceiptAbsenceData { + bytes path = 1; +} + +// NextSequenceRecvData returns the SignBytes data for verification of the next +// sequence to be received. +message NextSequenceRecvData { + bytes path = 1; + uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; +} diff --git a/dydxjs/packages/dydxjs/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/dydxjs/packages/dydxjs/proto/ibc/lightclients/tendermint/v1/tendermint.proto new file mode 100644 index 00000000..54e229b2 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/ibc/lightclients/tendermint/v1/tendermint.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package ibc.lightclients.tendermint.v1; + +option go_package = "github.com/cosmos/ibc-go/v2/modules/light-clients/07-tendermint/types"; + +import "tendermint/types/validator.proto"; +import "tendermint/types/types.proto"; +import "confio/proofs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/commitment/v1/commitment.proto"; +import "gogoproto/gogo.proto"; + +// ClientState from Tendermint tracks the current validator set, latest height, +// and a possible frozen height. +message ClientState { + option (gogoproto.goproto_getters) = false; + + string chain_id = 1; + Fraction trust_level = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trust_level\""]; + // duration of the period since the LastestTimestamp during which the + // submitted headers are valid for upgrade + google.protobuf.Duration trusting_period = 3 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"trusting_period\""]; + // duration of the staking unbonding period + google.protobuf.Duration unbonding_period = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"unbonding_period\"" + ]; + // defines how much new (untrusted) header's Time can drift into the future. + google.protobuf.Duration max_clock_drift = 5 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"max_clock_drift\""]; + // Block height when the client was frozen due to a misbehaviour + ibc.core.client.v1.Height frozen_height = 6 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"frozen_height\""]; + // Latest height the client was updated to + ibc.core.client.v1.Height latest_height = 7 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""]; + + // Proof specifications used in verifying counterparty state + repeated ics23.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""]; + + // Path at which next upgraded client will be committed. + // Each element corresponds to the key for a single CommitmentProof in the + // chained proof. NOTE: ClientState must stored under + // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + // the default upgrade module, upgrade_path should be []string{"upgrade", + // "upgradedIBCState"}` + repeated string upgrade_path = 9 [(gogoproto.moretags) = "yaml:\"upgrade_path\""]; + + // This flag, when set to true, will allow governance to recover a client + // which has expired + bool allow_update_after_expiry = 10 [(gogoproto.moretags) = "yaml:\"allow_update_after_expiry\""]; + // This flag, when set to true, will allow governance to unfreeze a client + // whose chain has experienced a misbehaviour event + bool allow_update_after_misbehaviour = 11 [(gogoproto.moretags) = "yaml:\"allow_update_after_misbehaviour\""]; +} + +// ConsensusState defines the consensus state from Tendermint. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + + // timestamp that corresponds to the block height in which the ConsensusState + // was stored. + google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // commitment root (i.e app hash) + ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; + bytes next_validators_hash = 3 [ + (gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes", + (gogoproto.moretags) = "yaml:\"next_validators_hash\"" + ]; +} + +// Misbehaviour is a wrapper over two conflicting Headers +// that implements Misbehaviour interface expected by ICS-02 +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""]; + Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""]; +} + +// Header defines the Tendermint client consensus Header. +// It encapsulates all the information necessary to update from a trusted +// Tendermint ConsensusState. The inclusion of TrustedHeight and +// TrustedValidators allows this update to process correctly, so long as the +// ConsensusState for the TrustedHeight exists, this removes race conditions +// among relayers The SignedHeader and ValidatorSet are the new untrusted update +// fields for the client. The TrustedHeight is the height of a stored +// ConsensusState on the client that will be used to verify the new untrusted +// header. The Trusted ConsensusState must be within the unbonding period of +// current time in order to correctly verify, and the TrustedValidators must +// hash to TrustedConsensusState.NextValidatorsHash since that is the last +// trusted validator set at the TrustedHeight. +message Header { + .tendermint.types.SignedHeader signed_header = 1 + [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"signed_header\""]; + + .tendermint.types.ValidatorSet validator_set = 2 [(gogoproto.moretags) = "yaml:\"validator_set\""]; + ibc.core.client.v1.Height trusted_height = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trusted_height\""]; + .tendermint.types.ValidatorSet trusted_validators = 4 [(gogoproto.moretags) = "yaml:\"trusted_validators\""]; +} + +// Fraction defines the protobuf message type for tmmath.Fraction that only +// supports positive values. +message Fraction { + uint64 numerator = 1; + uint64 denominator = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/noble-cctp-src b/dydxjs/packages/dydxjs/proto/noble-cctp-src new file mode 160000 index 00000000..b16cee30 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/noble-cctp-src @@ -0,0 +1 @@ +Subproject commit b16cee303b2d9be3e230400cc193474e043c138e diff --git a/dydxjs/packages/dydxjs/proto/slinky-src b/dydxjs/packages/dydxjs/proto/slinky-src new file mode 160000 index 00000000..61747144 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky-src @@ -0,0 +1 @@ +Subproject commit 6174714497a78ce2414b50c1b739baf4492ae20c diff --git a/dydxjs/packages/dydxjs/proto/slinky/abci/v1/vote_extensions.proto b/dydxjs/packages/dydxjs/proto/slinky/abci/v1/vote_extensions.proto new file mode 100644 index 00000000..59ee4e78 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/abci/v1/vote_extensions.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package slinky.abci.v1; + +option go_package = "github.com/skip-mev/connect/v2/abci/ve/types"; + +// OracleVoteExtension defines the vote extension structure for oracle prices. +message OracleVoteExtension { + // Prices defines a map of id(CurrencyPair) -> price.Bytes() . i.e. 1 -> + // 0x123.. (bytes). Notice the `id` function is determined by the + // `CurrencyPairIDStrategy` used in the VoteExtensionHandler. + map prices = 1; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/alerts.proto b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/alerts.proto new file mode 100644 index 00000000..a2af87df --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/alerts.proto @@ -0,0 +1,123 @@ +syntax = "proto3"; +package slinky.alerts.v1; + +import "slinky/oracle/v1/genesis.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; +import "google/protobuf/any.proto"; +import "slinky/types/v1/currency_pair.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/alerts/types"; + +// Alert defines the basic meta-data necessary for the alerts module to resolve +// a claim that the price of a CurrencyPair on-chain is deviating from the price +// off-chain. +message Alert { + option (amino.name) = "slinky/x/alerts/Alert"; + + // height represents the height for which the alert is filed. + uint64 height = 1; + + // signer is the signer of this alert, this is the address that will receive + // the reward in the case of a positive conclusion, or whose bond will get + // slashed in the event of a negative conclusion. + string signer = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // currency_pair is the currency-pair that this claim asserts is deviating + // from the price off-chain. + slinky.types.v1.CurrencyPair currency_pair = 3 + [ (gogoproto.nullable) = false ]; +} + +// AlertStatus contains the module specific state for an alert: Has the alert +// been concluded? What height was the alert submitted, what height should the +// alert be purged? +message AlertStatus { + option (amino.name) = "slinky/x/alerts/AlertStatus"; + + // ConclusionStatus determines whether the alert has been concluded. + uint64 conclusion_status = 1; + + // SubmissionHeight is the height that the alert was submitted in. + uint64 submission_height = 2; + + // SubmissionTimestamp is the block-timestamp of the block that the alert was + // submitted in (as a UTC value in Unix time). + uint64 submission_timestamp = 3; + + // PurgeHeight is the height at which the alert should be purged. + uint64 purge_height = 4; +} + +// AlertWithStatus represents a wrapper around the Alert and AlertStatus +// objects, this is so that the module specific information about Alerts can be +// packaged together. +message AlertWithStatus { + option (amino.name) = "slinky/x/alerts/AlertWithStatus"; + + // alert is the alert that this status corresponds to. + Alert alert = 1 [ (gogoproto.nullable) = false ]; + + // status is the status of the alert. + AlertStatus status = 2 [ (gogoproto.nullable) = false ]; +} + +// Signature is a container for a signer address mapped to a signature. +message Signature { + string signer = 1; + bytes signature = 2; +} + +// MultiSigConcluson defines a conclusion that is accompanied by a set of +// signatures. The signature is defined over the alert UID, status, OracleData, +// and PriceBound. The signatures are used to verify that the conclusion is +// valid. +message MultiSigConclusion { + option (amino.name) = "slinky/x/alerts/Conclusion"; + option (cosmos_proto.implements_interface) = "slinky.alerts.v1.Conclusion"; + + // alert is the alert that this conclusion corresponds to. + Alert alert = 1 [ (gogoproto.nullable) = false ]; + + // oracle_data is the oracle data that this conclusion references. + tendermint.abci.ExtendedCommitInfo extended_commit_info = 2 + [ (gogoproto.nullable) = false ]; + + // signatures is a map of signer -> signature. Where the signature is over + // Alert.UID, PriceBound, the marshalled ExtendedCommitInfo, and status. + repeated Signature signatures = 3 [ (gogoproto.nullable) = false ]; + + // price-bound is the price bound of the currency-pair off-chain for the + // designated time-range. + PriceBound price_bound = 4 [ (gogoproto.nullable) = false ]; + + // status is the status of the conclusion. + bool status = 5; + + // CurrencyPairID is the ID of the currency-pair that this conclusion + // corresponds to. + uint64 currency_pair_i_d = 6; +} + +// MultiSigConclusionVerificationParams defines the parameters necessary to +// verify a MultiSigConclusion. It contains a map between signer and public key. +// Notice, the public-key (value) are the base-64 encoded bytes of the public +// key. And the signer (key) is the bech32 encoded address of the signer. +// Notice, all public keys must be secp256 keys. +message MultiSigConclusionVerificationParams { + option (amino.name) = "slinky/x/alerts/ConclusionVerificationParams"; + option (cosmos_proto.implements_interface) = + "slinky.alerts.v1.ConclusionVerificationParams"; + + // signers is a map of signer -> public key. + repeated google.protobuf.Any signers = 1; +} + +// PriceBound represents the bounds of the price of a currency-pair off chain +// for a designated time-range +message PriceBound { + string high = 1; + string low = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/genesis.proto new file mode 100644 index 00000000..814f72fb --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/genesis.proto @@ -0,0 +1,68 @@ + +syntax = "proto3"; +package slinky.alerts.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "slinky/alerts/v1/alerts.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/alerts/types"; + +// AlertParams is the set of parameters for the x/Alerts module's Alerting. It +// defines whether or not Alerts can be submitted, and if so, the minimum +// bond amount required to submit an Alert. +message AlertParams { + // Enabled is a boolean defining whether or not Alerts can be submitted + // to the module + bool enabled = 1; + + // BondAmount is the minimum amount of bond required to submit an + // Alert + cosmos.base.v1beta1.Coin bond_amount = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // MaxBlockAge defines the maximum age of an Alert before it is pruned, notice + // this is defined wrt. the height that the Alert references, i.e Alerts are + // only relevant until Alert.Height + MaxBlockAge is reached. + uint64 max_block_age = 3; +} + +// PruningParams defines the criterion for pruning Alerts from the state. +message PruningParams { + // Enabled defines whether Alerts are to be pruned + bool enabled = 1; + + // BlocksToPrune defines the number of blocks until an Alert will be pruned + // from state, notice this is defined wrt. the current block height, i.e + // Alerts will be stored in state until current_height + BlocksToPrune is + // reached. + uint64 blocks_to_prune = 2; +} + +// Params is the set of parameters for the x/Alerts module. +message Params { + // AlertParams is the set of parameters for the x/Alerts module's Alerting. + AlertParams alert_params = 1 [ (gogoproto.nullable) = false ]; + + // ConclusionVerificationParams is the set of parameters for the x/Alerts + // module's conclusion verification. + google.protobuf.Any conclusion_verification_params = 2 + [ (cosmos_proto.accepts_interface) = + "slinky.alerts.v1.ConclusionVerificationParams" ]; + + // PruningParams is the set of parameters for the x/Alerts module's pruning. + PruningParams pruning_params = 3 [ (gogoproto.nullable) = false ]; +} + +// GenesisState is the state that must be provided at genesis. It contains +// params for the module, and the set initial Alerts. +message GenesisState { + // Params is the set of x/Alerts parameters + Params params = 1 [ (gogoproto.nullable) = false ]; + + // Alerts is the set of Alerts that have been submitted to the module + repeated AlertWithStatus alerts = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/query.proto b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/query.proto new file mode 100644 index 00000000..621efb57 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/query.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package slinky.alerts.v1; + +import "google/api/annotations.proto"; +import "slinky/alerts/v1/alerts.proto"; +import "slinky/alerts/v1/genesis.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/alerts/types"; + +// Query is the query service for the x/alerts module. +service Query { + // Alerts gets all alerts in state under the given status. If no status is + // given, all Alerts are returned + rpc Alerts(AlertsRequest) returns (AlertsResponse) { + option (google.api.http) = { + get : "/slinky/alerts/v1/alerts" + }; + } + + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http) = { + get : "/slinky/alerts/v1/params" + }; + } +} + +// AlertStatus is the type for the status of an Alert, it can be Unconcluded or +// Concluded. +enum AlertStatusID { + CONCLUSION_STATUS_UNSPECIFIED = 0; + CONCLUSION_STATUS_UNCONCLUDED = 1; + CONCLUSION_STATUS_CONCLUDED = 2; +} + +// AlertsRequest is the request type for the Query.Alerts RPC method, the status +// field indicates whether the request should return only Unconcluded / +// Concluded Alerts, or all Alerts. +message AlertsRequest { AlertStatusID status = 1; } + +// AlertsResponse is the response type for the Query.Alerts RPC method, it +// contains the list of Alerts that are being tracked by the alerts module. +message AlertsResponse { + repeated Alert alerts = 1 [ (gogoproto.nullable) = false ]; +} + +// ParamsRequest is the request type for the Query.Params RPC method. +message ParamsRequest {} + +// ParamsResponse is the response type for the Query.Params RPC method, it +// contains the Params of the module. +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } diff --git a/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/strategies.proto b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/strategies.proto new file mode 100644 index 00000000..04db52f4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/strategies.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package slinky.alerts.v1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/alerts/types/strategies"; + +// ValidatorAlertIncentive defines the incentive strategy to be executed for a +// validator that has been confirmed to have at fault for an x/alerts alert. +// This strategy is expected to slash half of the validator's stake. +message ValidatorAlertIncentive { + option (cosmos_proto.implements_interface) = "slinky.incentives.v1.Incentive"; + option (amino.name) = "slinky/x/alerts/ValidatorAlertIncentive"; + + // The validator that has been confirmed to have been at fault for an alert. + tendermint.abci.Validator validator = 1 [ (gogoproto.nullable) = false ]; + + // AlertSigner is the signer of the alert referenced by the conclusion that + // created this incentive. + string alert_signer = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // AlertHeight is the height at which the infraction occurred + uint64 alert_height = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/tx.proto b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/tx.proto new file mode 100644 index 00000000..aaf7b7b9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/alerts/v1/tx.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +package slinky.alerts.v1; + +import "slinky/alerts/v1/alerts.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "slinky/alerts/v1/genesis.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/alerts/types"; + +// Msg is the message service for the x/alerts module. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Alert creates a new alert. On alert creation (if valid), the alert will be + // saved to state, and its bond will be escrowed until a corresponding + // Conclusion is filed to close the alert. + rpc Alert(MsgAlert) returns (MsgAlertResponse); + + // Conclusion closes an alert. On alert conclusion (if valid), the alert will + // be marked as Concluded, the bond for the alert will either be burned or + // returned, and a set of incentives will be issued to the validators deemed + // malicious by the conclusion. + rpc Conclusion(MsgConclusion) returns (MsgConclusionResponse); + + // UpdateParams updates the parameters of the alerts module. Specifically, the + // only address that is capable of submitting this Msg is the + // module-authority, in general, the x/gov module-account. The process for + // executing this message will be via governance proposal + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgAlert defines a message to create an alert. +message MsgAlert { + option (amino.name) = "slinky/x/alerts/MsgAlert"; + + option (gogoproto.equal) = false; + + // alert is the alert to be filed + Alert alert = 1 [ (gogoproto.nullable) = false ]; +} + +message MsgAlertResponse {} + +// MsgConclusion defines a message carrying a Conclusion made by the SecondTier, +// which will be used to close an alert. And trigger any ramifications of the +// conclusion. +message MsgConclusion { + option (cosmos.msg.v1.signer) = "signer"; + option (amino.name) = "slinky/x/alerts/MsgConclusion"; + + option (gogoproto.equal) = false; + + // signer is the signer of this transaction (notice, this may not always be a + // node from the SecondTier) + string signer = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // conclusion is the conclusion to be filed + google.protobuf.Any conclusion = 2 + [ (cosmos_proto.accepts_interface) = "slinky.alerts.v1.Conclusion" ]; +} + +message MsgConclusionResponse {} + +// MsgUpdateParams defines the message type expected by the UpdateParams rpc. It +// contains an authority address, and the new Params for the x/alerts module. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/alerts/MsgUpdateParams"; + + option (gogoproto.equal) = false; + + // authority is the address of the authority that is submitting the update + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params is the new set of parameters for the x/alerts module + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/examples/badprice.proto b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/examples/badprice.proto new file mode 100644 index 00000000..dc08cc5b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/examples/badprice.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package slinky.incentives.v1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/incentives/types/examples/badprice"; + +// BadPriceIncentive is a message that contains the information about a bad +// price that was submitted by a validator. +// +// NOTE: This is an example of a bad price incentive. It is not used in +// production. +message BadPriceIncentive { + option (cosmos_proto.implements_interface) = "slinky.incentives.v1.Incentive"; + option (amino.name) = "slinky/oracle/BadPriceIncentive"; + + // Validator is the address of the validator that submitted the bad price. + string validator = 1; + // Amount is the amount to slash. + string amount = 2; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/examples/goodprice.proto b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/examples/goodprice.proto new file mode 100644 index 00000000..032a30b9 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/examples/goodprice.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package slinky.incentives.v1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/incentives/types/examples/goodprice"; + +// GoodPriceIncentive is a message that contains the information about a good +// price that was submitted by a validator. +// +// NOTE: This is an example of a good price incentive. It is not used in +// production. +message GoodPriceIncentive { + option (cosmos_proto.implements_interface) = "slinky.incentives.v1.Incentive"; + option (amino.name) = "slinky/oracle/BadPriceIncentive"; + + // Validator is the address of the validator that submitted the good price. + string validator = 1; + // Amount is the amount to reward. + string amount = 2; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/genesis.proto new file mode 100644 index 00000000..311cd8ba --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/genesis.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package slinky.incentives.v1; + +option go_package = "github.com/skip-mev/connect/v2/x/incentives/types"; + +import "gogoproto/gogo.proto"; + +// GenesisState is the genesis-state for the x/incentives module. +message GenesisState { + // Registry is a list of incentives by type. The registry defined here + // should be a subset of the incentive types defined in the incentive + // module (keeper). + repeated IncentivesByType registry = 1 [ (gogoproto.nullable) = false ]; +} + +// IncentivesByType encapsulates a list of incentives by type. Each of the +// entries here must correspond to the same incentive type defined here. +message IncentivesByType { + // IncentiveType is the incentive type i.e. (BadPriceIncentiveType, + // GoodPriceIncentiveType). + string incentive_type = 1; + // Entries is a list of incentive bytes. + repeated bytes entries = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/query.proto b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/query.proto new file mode 100644 index 00000000..3dab2778 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/incentives/v1/query.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; +package slinky.incentives.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "slinky/incentives/v1/genesis.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/incentives/types"; + +// Query is the query service for the x/incentives module. +service Query { + // GetIncentivesByType returns all incentives of a given type. If the type is + // not registered with the module, an error is returned. + rpc GetIncentivesByType(GetIncentivesByTypeRequest) + returns (GetIncentivesByTypeResponse) { + option (google.api.http).get = + "/slinky/incentives/v1/get_incentives_by_type/{incentive_type}"; + } + + // GetAllIncentives returns all incentives. + rpc GetAllIncentives(GetAllIncentivesRequest) + returns (GetAllIncentivesResponse) { + option (google.api.http).get = "/slinky/incentives/v1/get_all_incentives"; + } +} + +// GetIncentivesByTypeRequest is the request type for the +// Query/GetIncentivesByType RPC method. +message GetIncentivesByTypeRequest { + // IncentiveType is the incentive type i.e. (BadPriceIncentiveType, + // GoodPriceIncentiveType). + string incentive_type = 1; +} + +// GetIncentivesByTypeResponse is the response type for the +// Query/GetIncentivesByType RPC method. +message GetIncentivesByTypeResponse { + // Entries is the list of incentives of the given type. + repeated bytes entries = 1; +} + +// GetAllIncentivesRequest is the request type for the Query/GetAllIncentives +// RPC method. +message GetAllIncentivesRequest {} + +// GetAllIncentivesResponse is the response type for the Query/GetAllIncentives +// RPC method. +message GetAllIncentivesResponse { + // Registry is the list of all incentives, grouped by type. + repeated IncentivesByType registry = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/genesis.proto new file mode 100644 index 00000000..61f0384a --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/genesis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package slinky.marketmap.v1; + +import "gogoproto/gogo.proto"; +import "slinky/marketmap/v1/market.proto"; +import "slinky/marketmap/v1/params.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types"; + +// GenesisState defines the x/marketmap module's genesis state. +message GenesisState { + // MarketMap defines the global set of market configurations for all providers + // and markets. + MarketMap market_map = 1 [ (gogoproto.nullable) = false ]; + + // LastUpdated is the last block height that the market map was updated. + // This field can be used as an optimization for clients checking if there + // is a new update to the map. + uint64 last_updated = 2; + + // Params are the parameters for the x/marketmap module. + Params params = 3 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/market.proto b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/market.proto new file mode 100644 index 00000000..68074a40 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/market.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; +package slinky.marketmap.v1; + +option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types"; + +import "gogoproto/gogo.proto"; +import "slinky/types/v1/currency_pair.proto"; + +// Market encapsulates a Ticker and its provider-specific configuration. +message Market { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + + // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The + // price feed is scaled to a number of decimal places and has a minimum number + // of providers required to consider the ticker valid. + Ticker ticker = 1 [ (gogoproto.nullable) = false ]; + + // ProviderConfigs is the list of provider-specific configs for this Market. + repeated ProviderConfig provider_configs = 2 [ (gogoproto.nullable) = false ]; +} + +// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price +// feed is scaled to a number of decimal places and has a minimum number of +// providers required to consider the ticker valid. +message Ticker { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + + // CurrencyPair is the currency pair for this ticker. + slinky.types.v1.CurrencyPair currency_pair = 1 + [ (gogoproto.nullable) = false ]; + + // Decimals is the number of decimal places for the ticker. The number of + // decimal places is used to convert the price to a human-readable format. + uint64 decimals = 2; + + // MinProviderCount is the minimum number of providers required to consider + // the ticker valid. + uint64 min_provider_count = 3; + + // Enabled is the flag that denotes if the Ticker is enabled for price + // fetching by an oracle. + bool enabled = 14; + + // MetadataJSON is a string of JSON that encodes any extra configuration + // for the given ticker. + string metadata_JSON = 15; +} + +message ProviderConfig { + // Name corresponds to the name of the provider for which the configuration is + // being set. + string name = 1; + + // OffChainTicker is the off-chain representation of the ticker i.e. BTC/USD. + // The off-chain ticker is unique to a given provider and is used to fetch the + // price of the ticker from the provider. + string off_chain_ticker = 2; + + // NormalizeByPair is the currency pair for this ticker to be normalized by. + // For example, if the desired Ticker is BTC/USD, this market could be reached + // using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is + // optional and nullable. + slinky.types.v1.CurrencyPair normalize_by_pair = 3; + + // Invert is a boolean indicating if the BASE and QUOTE of the market should + // be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE + bool invert = 4; + + // MetadataJSON is a string of JSON that encodes any extra configuration + // for the given provider config. + string metadata_JSON = 15; +} + +// MarketMap maps ticker strings to their Markets. +message MarketMap { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + + // Markets is the full list of tickers and their associated configurations + // to be stored on-chain. + map markets = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/params.proto b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/params.proto new file mode 100644 index 00000000..eb4b4fc3 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/params.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package slinky.marketmap.v1; + +option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types"; + +// Params defines the parameters for the x/marketmap module. +message Params { + // MarketAuthorities is the list of authority accounts that are able to + // control updating the marketmap. + repeated string market_authorities = 1; + + // Admin is an address that can remove addresses from the MarketAuthorities + // list. Only governance can add to the MarketAuthorities or change the Admin. + string admin = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/query.proto b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/query.proto new file mode 100644 index 00000000..d50a4fb4 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/query.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; +package slinky.marketmap.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "slinky/types/v1/currency_pair.proto"; +import "slinky/marketmap/v1/market.proto"; +import "slinky/marketmap/v1/params.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types"; + +// Query is the query service for the x/marketmap module. +service Query { + // MarketMap returns the full market map stored in the x/marketmap + // module. + rpc MarketMap(MarketMapRequest) returns (MarketMapResponse) { + option (google.api.http).get = "/slinky/marketmap/v1/marketmap"; + } + + // Market returns a market stored in the x/marketmap + // module. + rpc Market(MarketRequest) returns (MarketResponse) { + option (google.api.http).get = "/slinky/marketmap/v1/market"; + } + + // LastUpdated returns the last height the market map was updated at. + rpc LastUpdated(LastUpdatedRequest) returns (LastUpdatedResponse) { + option (google.api.http).get = "/slinky/marketmap/v1/last_updated"; + } + + // Params returns the current x/marketmap module parameters. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http) = { + get : "/slinky/marketmap/v1/params" + }; + } +} + +// MarketMapRequest is the query request for the MarketMap query. +// It takes no arguments. +message MarketMapRequest {} + +// MarketMapResponse is the query response for the MarketMap query. +message MarketMapResponse { + // MarketMap defines the global set of market configurations for all providers + // and markets. + MarketMap market_map = 1 [ (gogoproto.nullable) = false ]; + + // LastUpdated is the last block height that the market map was updated. + // This field can be used as an optimization for clients checking if there + // is a new update to the map. + uint64 last_updated = 2; + + // ChainId is the chain identifier for the market map. + string chain_id = 3; +} + +// MarketRequest is the query request for the Market query. +// It takes the currency pair of the market as an argument. +message MarketRequest { + // CurrencyPair is the currency pair associated with the market being + // requested. + slinky.types.v1.CurrencyPair currency_pair = 1 + [ (gogoproto.nullable) = false ]; +} + +// MarketResponse is the query response for the Market query. +message MarketResponse { + // Market is the configuration of a single market to be price-fetched for. + Market market = 1 [ (gogoproto.nullable) = false ]; +} + +// ParamsRequest is the request type for the Query/Params RPC method. +message ParamsRequest {} + +// ParamsResponse is the response type for the Query/Params RPC method. +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } + +// LastUpdatedRequest is the request type for the Query/LastUpdated RPC +// method. +message LastUpdatedRequest {} + +// LastUpdatedResponse is the response type for the Query/LastUpdated RPC +// method. +message LastUpdatedResponse { uint64 last_updated = 1; } \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/tx.proto b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/tx.proto new file mode 100644 index 00000000..17e220f5 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/marketmap/v1/tx.proto @@ -0,0 +1,136 @@ +syntax = "proto3"; +package slinky.marketmap.v1; + +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; +import "slinky/marketmap/v1/market.proto"; +import "slinky/marketmap/v1/params.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types"; + +// Msg is the message service for the x/marketmap module. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateMarkets creates markets from the given message. + rpc CreateMarkets(MsgCreateMarkets) returns (MsgCreateMarketsResponse); + + // UpdateMarkets updates markets from the given message. + rpc UpdateMarkets(MsgUpdateMarkets) returns (MsgUpdateMarketsResponse); + + // UpdateParams defines a method for updating the x/marketmap module + // parameters. + rpc UpdateParams(MsgParams) returns (MsgParamsResponse); + + // RemoveMarketAuthorities defines a method for removing market authorities + // from the x/marketmap module. the signer must be the admin. + rpc RemoveMarketAuthorities(MsgRemoveMarketAuthorities) + returns (MsgRemoveMarketAuthoritiesResponse); + + // UpsertMarkets wraps both Create / Update markets into a single message. + // Specifically if a market does not exist it will be created, otherwise it + // will be updated. The response will be a map between ticker -> updated. + rpc UpsertMarkets(MsgUpsertMarkets) returns (MsgUpsertMarketsResponse); +} + +// MsgUpsertMarkets defines a message carrying a payload for performing market +// upserts (update or create if does not exist) in the x/marketmap module. +message MsgUpsertMarkets { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/marketmap/MsgUpsertMarkets"; + + option (gogoproto.equal) = false; + + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // CreateMarkets is the list of all markets to be created for the given + // transaction. + repeated Market markets = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpsertMarketsResponse is the response from the UpsertMarkets API in the +// x/marketmap module. +message MsgUpsertMarketsResponse { + option (gogoproto.stable_marshaler) = true; + // UpdatedMarkets is a map between the ticker and whether the market was + // updated. + // Deprecated: This field will be empty in all responses. + map market_updates = 1 [ deprecated = true ]; +} + +// MsgCreateMarkets defines a message carrying a payload for creating markets in +// the x/marketmap module. +message MsgCreateMarkets { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/marketmap/MsgCreateMarkets"; + + option (gogoproto.equal) = false; + + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // CreateMarkets is the list of all markets to be created for the given + // transaction. + repeated Market create_markets = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. +message MsgCreateMarketsResponse {} + +// MsgUpdateMarkets defines a message carrying a payload for updating the +// x/marketmap module. +message MsgUpdateMarkets { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/marketmap/MsgUpdateMarkets"; + + option (gogoproto.equal) = false; + + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // UpdateMarkets is the list of all markets to be updated for the given + // transaction. + repeated Market update_markets = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. +message MsgUpdateMarketsResponse {} + +// MsgParams defines the Msg/Params request type. It contains the +// new parameters for the x/marketmap module. +message MsgParams { + option (cosmos.msg.v1.signer) = "authority"; + + // Params defines the new parameters for the x/marketmap module. + Params params = 1 [ (gogoproto.nullable) = false ]; + // Authority defines the authority that is updating the x/marketmap module + // parameters. + string authority = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgParamsResponse defines the Msg/Params response type. +message MsgParamsResponse {} + +// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse +// request type. It contains the new addresses to remove from the list of +// authorities +message MsgRemoveMarketAuthorities { + option (cosmos.msg.v1.signer) = "admin"; + + // RemoveAddresses is the list of addresses to remove. + repeated string remove_addresses = 1; + + // Admin defines the authority that is the x/marketmap + // Admin account. This account is set in the module parameters. + string admin = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgRemoveMarketAuthoritiesResponse defines the +// Msg/RemoveMarketAuthoritiesResponse response type. +message MsgRemoveMarketAuthoritiesResponse {} diff --git a/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/genesis.proto new file mode 100644 index 00000000..2f576d5d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/genesis.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +package slinky.oracle.v1; + +option go_package = "github.com/skip-mev/connect/v2/x/oracle/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "slinky/types/v1/currency_pair.proto"; + +// QuotePrice is the representation of the aggregated prices for a CurrencyPair, +// where price represents the price of Base in terms of Quote +message QuotePrice { + string price = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // BlockTimestamp tracks the block height associated with this price update. + // We include block timestamp alongside the price to ensure that smart + // contracts and applications are not utilizing stale oracle prices + google.protobuf.Timestamp block_timestamp = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // BlockHeight is height of block mentioned above + uint64 block_height = 3; +} + +// CurrencyPairState represents the stateful information tracked by the x/oracle +// module per-currency-pair. +message CurrencyPairState { + // QuotePrice is the latest price for a currency-pair, notice this value can + // be null in the case that no price exists for the currency-pair + QuotePrice price = 1 [ (gogoproto.nullable) = true ]; + + // Nonce is the number of updates this currency-pair has received + uint64 nonce = 2; + + // ID is the ID of the CurrencyPair + uint64 id = 3; +} + +// CurrencyPairGenesis is the information necessary for initialization of a +// CurrencyPair. +message CurrencyPairGenesis { + // The CurrencyPair to be added to module state + slinky.types.v1.CurrencyPair currency_pair = 1 + [ (gogoproto.nullable) = false ]; + // A genesis price if one exists (note this will be empty, unless it results + // from forking the state of this module) + QuotePrice currency_pair_price = 2 [ (gogoproto.nullable) = true ]; + // nonce is the nonce (number of updates) for the CP (same case as above, + // likely 0 unless it results from fork of module) + uint64 nonce = 3; + // id is the ID of the CurrencyPair + uint64 id = 4; +} + +// GenesisState is the genesis-state for the x/oracle module, it takes a set of +// predefined CurrencyPairGeneses +message GenesisState { + // CurrencyPairGenesis is the set of CurrencyPairGeneses for the module. I.e + // the starting set of CurrencyPairs for the module + information regarding + // their latest update. + repeated CurrencyPairGenesis currency_pair_genesis = 1 + [ (gogoproto.nullable) = false ]; + + // NextID is the next ID to be used for a CurrencyPair + uint64 next_id = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/query.proto b/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/query.proto new file mode 100644 index 00000000..d7423cc6 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/query.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; +package slinky.oracle.v1; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "slinky/oracle/v1/genesis.proto"; +import "slinky/types/v1/currency_pair.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/oracle/types"; + +// Query is the query service for the x/oracle module. +service Query { + // Get all the currency pairs the x/oracle module is tracking price-data for. + rpc GetAllCurrencyPairs(GetAllCurrencyPairsRequest) + returns (GetAllCurrencyPairsResponse) { + option (google.api.http).get = "/slinky/oracle/v1/get_all_tickers"; + }; + + // Given a CurrencyPair (or its identifier) return the latest QuotePrice for + // that CurrencyPair. + rpc GetPrice(GetPriceRequest) returns (GetPriceResponse) { + option (google.api.http).get = "/slinky/oracle/v1/get_price"; + }; + + rpc GetPrices(GetPricesRequest) returns (GetPricesResponse) { + option (google.api.http).get = "/slinky/oracle/v1/get_prices"; + } + + // Get the mapping of currency pair ID -> currency pair. This is useful for + // indexers that have access to the ID of a currency pair, but no way to get + // the underlying currency pair from it. + rpc GetCurrencyPairMapping(GetCurrencyPairMappingRequest) + returns (GetCurrencyPairMappingResponse) { + option (google.api.http).get = + "/slinky/oracle/v1/get_currency_pair_mapping"; + } +} + +message GetAllCurrencyPairsRequest {} + +// GetAllCurrencyPairsResponse returns all CurrencyPairs that the module is +// currently tracking. +message GetAllCurrencyPairsResponse { + repeated slinky.types.v1.CurrencyPair currency_pairs = 1 + [ (gogoproto.nullable) = false ]; +} + +// GetPriceRequest either takes a CurrencyPair, or an identifier for the +// CurrencyPair in the format base/quote. +message GetPriceRequest { + // CurrencyPair represents the pair that the user wishes to query. + slinky.types.v1.CurrencyPair currency_pair = 1 + [ (gogoproto.nullable) = false ]; +} + +// GetPriceResponse is the response from the GetPrice grpc method exposed from +// the x/oracle query service. +message GetPriceResponse { + // QuotePrice represents the quote-price for the CurrencyPair given in + // GetPriceRequest (possibly nil if no update has been made) + QuotePrice price = 1 [ (gogoproto.nullable) = true ]; + // nonce represents the nonce for the CurrencyPair if it exists in state + uint64 nonce = 2; + // decimals represents the number of decimals that the quote-price is + // represented in. For Pairs where ETHEREUM is the quote this will be 18, + // otherwise it will be 8. + uint64 decimals = 3; + // ID represents the identifier for the CurrencyPair. + uint64 id = 4; +} + +// GetPricesRequest takes an identifier for the CurrencyPair +// in the format base/quote. +message GetPricesRequest { repeated string currency_pair_ids = 1; } + +// GetPricesResponse is the response from the GetPrices grpc method exposed from +// the x/oracle query service. +message GetPricesResponse { + repeated GetPriceResponse prices = 1 [ (gogoproto.nullable) = false ]; +} + +// GetCurrencyPairMappingRequest is the GetCurrencyPairMapping request type. +message GetCurrencyPairMappingRequest {} + +// GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response type. +message GetCurrencyPairMappingResponse { + // currency_pair_mapping is a mapping of the id representing the currency pair + // to the currency pair itself. + map currency_pair_mapping = 1 + [ (gogoproto.nullable) = false ]; +} diff --git a/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/tx.proto b/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/tx.proto new file mode 100644 index 00000000..e36b466d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/oracle/v1/tx.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +package slinky.oracle.v1; + +import "slinky/oracle/v1/genesis.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "slinky/types/v1/currency_pair.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/oracle/types"; + +// Msg is the message service for the x/oracle module. +service Msg { + option (cosmos.msg.v1.service) = true; + + // AddCurrencyPairs will be used only by governance to update the set of + // available CurrencyPairs. Given a set of CurrencyPair objects, update + // the available currency pairs in the module . + rpc AddCurrencyPairs(MsgAddCurrencyPairs) + returns (MsgAddCurrencyPairsResponse); + + // RemoveCurrencyPairs will be used explicitly by governance to remove the + // given set of currency-pairs from the module's state. Thus these + // CurrencyPairs will no longer have price-data available from this module. + rpc RemoveCurrencyPairs(MsgRemoveCurrencyPairs) + returns (MsgRemoveCurrencyPairsResponse); +} + +// Given an authority + a set of CurrencyPairs, the x/oracle module will +// check to see that the authority has permissions to update the set of +// CurrencyPairs tracked in the oracle, and add the given CurrencyPairs to be +// tracked in each VoteExtension +message MsgAddCurrencyPairs { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/oracle/MsgAddCurrencyPairs"; + + option (gogoproto.equal) = false; + + // authority is the address of the account that is authorized to update the + // x/oracle's CurrencyPairs + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // set of CurrencyPairs to be added to the module (+ prices if they are to be + // set) + repeated slinky.types.v1.CurrencyPair currency_pairs = 2 + [ (gogoproto.nullable) = false ]; +} + +message MsgAddCurrencyPairsResponse {} + +// Given an authority + a set of CurrencyPairIDs, the x/oracle module's message +// service will remove all of the CurrencyPairs identified by each +// CurrencyPairID in the request from state. Notice, if a given currency-pair +// does not exist in state, the module ignores that currency-pair and continues +// removing the rest. +message MsgRemoveCurrencyPairs { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/oracle/MsgSetCurrencyPairs"; + + option (gogoproto.equal) = false; + + // authority is the address of the account that is authorized to update the + // x/oracle's CurrencyPairs + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // currency_pair_ids are the stringified representation of a currency-pairs + // (base/quote) to be removed from the module's state + repeated string currency_pair_ids = 2; +} + +message MsgRemoveCurrencyPairsResponse {} diff --git a/dydxjs/packages/dydxjs/proto/slinky/service/v1/oracle.proto b/dydxjs/packages/dydxjs/proto/slinky/service/v1/oracle.proto new file mode 100644 index 00000000..742b5e72 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/service/v1/oracle.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package slinky.service.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "slinky/marketmap/v1/market.proto"; + +option go_package = "github.com/skip-mev/connect/v2/service/servers/oracle/types"; + +// Oracle defines the gRPC oracle service. +service Oracle { + // Prices defines a method for fetching the latest prices. + rpc Prices(QueryPricesRequest) returns (QueryPricesResponse) { + option (google.api.http).get = "/slinky/oracle/v1/prices"; + }; + + // MarketMap defines a method for fetching the latest market map + // configuration. + rpc MarketMap(QueryMarketMapRequest) returns (QueryMarketMapResponse) { + option (google.api.http).get = "/slinky/oracle/v1/marketmap"; + } + + // Version defines a method for fetching the current version of the oracle + // service. + rpc Version(QueryVersionRequest) returns (QueryVersionResponse) { + option (google.api.http).get = "/slinky/oracle/v1/version"; + } +} + +// QueryPricesRequest defines the request type for the the Prices method. +message QueryPricesRequest {} + +// QueryPricesResponse defines the response type for the Prices method. +message QueryPricesResponse { + // Prices defines the list of prices. + map prices = 1 [ (gogoproto.nullable) = false ]; + + // Timestamp defines the timestamp of the prices. + google.protobuf.Timestamp timestamp = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // Version defines the version of the oracle service that provided the prices. + string version = 3; +} + +// QueryMarketMapRequest defines the request type for the MarketMap method. +message QueryMarketMapRequest {} + +// QueryMarketMapResponse defines the response type for the MarketMap method. +message QueryMarketMapResponse { + // MarketMap defines the current market map configuration. + slinky.marketmap.v1.MarketMap market_map = 1; +} + +// QueryVersionRequest defines the request type for the Version method. +message QueryVersionRequest {} + +// QueryVersionResponse defines the response type for the Version method. +message QueryVersionResponse { + // Version defines the current version of the oracle service. + string version = 1; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/sla/v1/genesis.proto b/dydxjs/packages/dydxjs/proto/slinky/sla/v1/genesis.proto new file mode 100644 index 00000000..40f98ab0 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/sla/v1/genesis.proto @@ -0,0 +1,87 @@ +syntax = "proto3"; +package slinky.sla.v1; + +option go_package = "github.com/skip-mev/connect/v2/x/sla/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "slinky/oracle/v1/genesis.proto"; +import "slinky/types/v1/currency_pair.proto"; + +// GenesisState defines the sla module's genesis state. +message GenesisState { + // SLAs are the SLAs that are currently active. + repeated PriceFeedSLA slas = 1 + [ (gogoproto.nullable) = false, (gogoproto.customname) = "SLAs" ]; + + // PrceFeeds are the price feeds that are currently active. + repeated PriceFeed price_feeds = 2 [ (gogoproto.nullable) = false ]; + + // Params are the parameters for the sla module. + Params params = 3 [ (gogoproto.nullable) = false ]; +} + +// Params defines the parameters for the sla module. +message Params { + // Enabled is a flag to enable or disable the sla module. + bool enabled = 1; +} + +// PriceFeedSLA defines the the desired SLA for a given set of price feeds. A +// price feed is defined to be a set of price prices for the same (currency +// pair, validator). +message PriceFeedSLA { + // MaximumViableWindow is the maximum time window that we are interested + // for the SLA. This is used to determine the moving window of blocks that + // we are interested in. + uint64 maximum_viable_window = 1; + + // ExpectedUptime is the expected uptime for the given validator and price + // feed. + string expected_uptime = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // SlashConstant is the constant by which we will multiply the deviation from + // the expected uptime. + string slash_constant = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // MinimumBlockUpdates is the minimum number of blocks that the + // validator had to have voted on in the maximum viable window + // in order to be considered for the SLA. + uint64 minimum_block_updates = 4; + + // Frequency is the frequency at which we will check the SLA. + uint64 frequency = 5; + + // ID is the unique identifier for the SLA. + string id = 6 [ (gogoproto.customname) = "ID" ]; +} + +// PriceFeed defines the object type that will be utilized to monitor how +// frequently validators are voting with price updates across the network. +message PriceFeed { + // UpdateMap represents the relevant moving window of price feed updates. + bytes update_map = 1; + // InclusionMap represents the relevant moving window of blocks that the + // validator has voted on. + bytes inclusion_map = 2; + // Index corresponds to the current index into the bitmap. + uint64 index = 3; + // Validator represents the validator that this SLA corresponds to. + bytes validator = 4; + // CurrencyPair represents the currency pair that this SLA corresponds to. + slinky.types.v1.CurrencyPair currency_pair = 5 + [ (gogoproto.nullable) = false ]; + // MaximumViableWindow represents the maximum number of blocks that can be + // represented by the bit map. + uint64 maximum_viable_window = 6; + // ID corresponds to the SLA ID that this price feed corresponds to. + string id = 7 [ (gogoproto.customname) = "ID" ]; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/sla/v1/query.proto b/dydxjs/packages/dydxjs/proto/slinky/sla/v1/query.proto new file mode 100644 index 00000000..5776f5ed --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/sla/v1/query.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package slinky.sla.v1; + +option go_package = "github.com/skip-mev/connect/v2/x/sla/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "slinky/sla/v1/genesis.proto"; + +// Query is the query service for the x/sla module. +service Query { + // GetAllSLAs returns all SLAs that the module is currently enforcing. + rpc GetAllSLAs(GetAllSLAsRequest) returns (GetAllSLAsResponse) { + option (google.api.http) = { + get : "/slinky/sla/v1/slas" + }; + }; + + // GetPriceFeeds returns all price feeds that the module is currently + // tracking. This request type inputs the SLA ID to query price feeds for. + rpc GetPriceFeeds(GetPriceFeedsRequest) returns (GetPriceFeedsResponse) { + option (google.api.http) = { + get : "/slinky/sla/v1/price_feeds" + }; + }; + + // Params returns the current SLA module parameters. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http) = { + get : "/slinky/sla/v1/params" + }; + }; +} + +// QueryAllSLAsRequest is the request type for the Query/GetAllSLAs RPC method. +message GetAllSLAsRequest {} + +// QueryAllSLAsResponse is the response type for the Query/GetAllSLAs RPC +// method. +message GetAllSLAsResponse { + repeated PriceFeedSLA slas = 1 + [ (gogoproto.nullable) = false, (gogoproto.customname) = "SLAs" ]; +} + +// QueryGetPriceFeedsRequest is the request type for the Query/GetPriceFeeds RPC +// method. +message GetPriceFeedsRequest { + // ID defines the SLA to query price feeds for. + string id = 1 [ (gogoproto.customname) = "ID" ]; +} + +// QueryGetPriceFeedsResponse is the response type for the Query/GetPriceFeeds +// RPC method. +message GetPriceFeedsResponse { + // PriceFeeds defines the price feeds for the given SLA. + repeated PriceFeed price_feeds = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message ParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/sla/v1/tx.proto b/dydxjs/packages/dydxjs/proto/slinky/sla/v1/tx.proto new file mode 100644 index 00000000..bb7e6c0b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/sla/v1/tx.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package slinky.sla.v1; + +import "slinky/sla/v1/genesis.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/skip-mev/connect/v2/x/sla/types"; + +// Msg is the message service for the x/sla module. +service Msg { + option (cosmos.msg.v1.service) = true; + + // AddSLA defines a method for adding a new SLAs to the store. Note, this will + // overwrite any existing SLA with the same ID. + rpc AddSLAs(MsgAddSLAs) returns (MsgAddSLAsResponse); + + // RemoveSLA defines a method for removing existing SLAs from the store. Note, + // this will not panic if the SLA does not exist. + rpc RemoveSLAs(MsgRemoveSLAs) returns (MsgRemoveSLAsResponse); + + // Params defines a method for updating the SLA module parameters. + rpc Params(MsgParams) returns (MsgParamsResponse); +} + +// MsgAddSLAs defines the Msg/AddSLAs request type. It contains the +// SLAs to be added to the store. +message MsgAddSLAs { + option (cosmos.msg.v1.signer) = "from_address"; + + // SLAs defines the SLAs to be added to the store. + repeated PriceFeedSLA slas = 1 + [ (gogoproto.nullable) = false, (gogoproto.customname) = "SLAs" ]; + // Authority defines the authority that is adding the SLAs. + string authority = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgAddSLAsResponse defines the Msg/AddSLAs response type. +message MsgAddSLAsResponse {} + +// MsgRemoveSLAs defines the Msg/RemoveSLAs request type. It contains the +// IDs of the SLAs to be removed from the store. +message MsgRemoveSLAs { + option (cosmos.msg.v1.signer) = "from_address"; + + // IDs defines the IDs of the SLAs to be removed from the store. + repeated string ids = 1 [ (gogoproto.customname) = "IDs" ]; + // Authority defines the authority that is removing the SLAs. + string authority = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgRemoveSLAsResponse defines the Msg/RemoveSLAs response type. +message MsgRemoveSLAsResponse {} + +// MsgParams defines the Msg/Params request type. It contains the +// new parameters for the SLA module. +message MsgParams { + option (cosmos.msg.v1.signer) = "from_address"; + + // Params defines the new parameters for the SLA module. + Params params = 1 [ (gogoproto.nullable) = false ]; + // Authority defines the authority that is updating the SLA module parameters. + string authority = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgParamsResponse defines the Msg/Params response type. +message MsgParamsResponse {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/slinky/types/v1/currency_pair.proto b/dydxjs/packages/dydxjs/proto/slinky/types/v1/currency_pair.proto new file mode 100644 index 00000000..7536cbb0 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/slinky/types/v1/currency_pair.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package slinky.types.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/skip-mev/connect/v2/pkg/types"; + +// CurrencyPair is the standard representation of a pair of assets, where one +// (Base) is priced in terms of the other (Quote) +message CurrencyPair { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + + string Base = 1; + string Quote = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/LICENSE b/dydxjs/packages/dydxjs/proto/tendermint/LICENSE new file mode 100644 index 00000000..eaf92fbf --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/LICENSE @@ -0,0 +1,204 @@ +Tendermint Core +License: Apache2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 All in Bits, Inc + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/tendermint/README.md b/dydxjs/packages/dydxjs/proto/tendermint/README.md new file mode 100644 index 00000000..74fcf8b8 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/README.md @@ -0,0 +1 @@ +# tendermint \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/proto/tendermint/abci/types.proto b/dydxjs/packages/dydxjs/proto/tendermint/abci/types.proto new file mode 100644 index 00000000..d41a5226 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/abci/types.proto @@ -0,0 +1,394 @@ +syntax = "proto3"; +package tendermint.abci; + +option go_package = "github.com/tendermint/tendermint/abci/types"; + +// For more information on gogo.proto, see: +// https://github.com/gogo/protobuf/blob/master/extensions.md +import "tendermint/crypto/proof.proto"; +import "tendermint/types/types.proto"; +import "tendermint/crypto/keys.proto"; +import "tendermint/types/params.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +// This file is copied from http://github.com/tendermint/abci +// NOTE: When using custom types, mind the warnings. +// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues + +//---------------------------------------- +// Request types + +message Request { + oneof value { + RequestEcho echo = 1; + RequestFlush flush = 2; + RequestInfo info = 3; + RequestSetOption set_option = 4; + RequestInitChain init_chain = 5; + RequestQuery query = 6; + RequestBeginBlock begin_block = 7; + RequestCheckTx check_tx = 8; + RequestDeliverTx deliver_tx = 9; + RequestEndBlock end_block = 10; + RequestCommit commit = 11; + RequestListSnapshots list_snapshots = 12; + RequestOfferSnapshot offer_snapshot = 13; + RequestLoadSnapshotChunk load_snapshot_chunk = 14; + RequestApplySnapshotChunk apply_snapshot_chunk = 15; + } +} + +message RequestEcho { + string message = 1; +} + +message RequestFlush {} + +message RequestInfo { + string version = 1; + uint64 block_version = 2; + uint64 p2p_version = 3; +} + +// nondeterministic +message RequestSetOption { + string key = 1; + string value = 2; +} + +message RequestInitChain { + google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2; + ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; +} + +message RequestQuery { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +message RequestBeginBlock { + bytes hash = 1; + tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; + LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; +} + +enum CheckTxType { + NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; + RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; +} + +message RequestCheckTx { + bytes tx = 1; + CheckTxType type = 2; +} + +message RequestDeliverTx { + bytes tx = 1; +} + +message RequestEndBlock { + int64 height = 1; +} + +message RequestCommit {} + +// lists available snapshots +message RequestListSnapshots {} + +// offers a snapshot to the application +message RequestOfferSnapshot { + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height +} + +// loads a snapshot chunk +message RequestLoadSnapshotChunk { + uint64 height = 1; + uint32 format = 2; + uint32 chunk = 3; +} + +// Applies a snapshot chunk +message RequestApplySnapshotChunk { + uint32 index = 1; + bytes chunk = 2; + string sender = 3; +} + +//---------------------------------------- +// Response types + +message Response { + oneof value { + ResponseException exception = 1; + ResponseEcho echo = 2; + ResponseFlush flush = 3; + ResponseInfo info = 4; + ResponseSetOption set_option = 5; + ResponseInitChain init_chain = 6; + ResponseQuery query = 7; + ResponseBeginBlock begin_block = 8; + ResponseCheckTx check_tx = 9; + ResponseDeliverTx deliver_tx = 10; + ResponseEndBlock end_block = 11; + ResponseCommit commit = 12; + ResponseListSnapshots list_snapshots = 13; + ResponseOfferSnapshot offer_snapshot = 14; + ResponseLoadSnapshotChunk load_snapshot_chunk = 15; + ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + } +} + +// nondeterministic +message ResponseException { + string error = 1; +} + +message ResponseEcho { + string message = 1; +} + +message ResponseFlush {} + +message ResponseInfo { + string data = 1; + + string version = 2; + uint64 app_version = 3; + + int64 last_block_height = 4; + bytes last_block_app_hash = 5; +} + +// nondeterministic +message ResponseSetOption { + uint32 code = 1; + // bytes data = 2; + string log = 3; + string info = 4; +} + +message ResponseInitChain { + ConsensusParams consensus_params = 1; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + bytes app_hash = 3; +} + +message ResponseQuery { + uint32 code = 1; + // bytes data = 2; // use "value" instead. + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + tendermint.crypto.ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +message ResponseBeginBlock { + repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCheckTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; +} + +message ResponseDeliverTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; +} + +message ResponseEndBlock { + repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; + ConsensusParams consensus_param_updates = 2; + repeated Event events = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCommit { + // reserve 1 + bytes data = 2; + int64 retain_height = 3; +} + +message ResponseListSnapshots { + repeated Snapshot snapshots = 1; +} + +message ResponseOfferSnapshot { + Result result = 1; + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + } +} + +message ResponseLoadSnapshotChunk { + bytes chunk = 1; +} + +message ResponseApplySnapshotChunk { + Result result = 1; + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + } +} + +//---------------------------------------- +// Misc. + +// ConsensusParams contains all consensus-relevant parameters +// that can be adjusted by the abci app +message ConsensusParams { + BlockParams block = 1; + tendermint.types.EvidenceParams evidence = 2; + tendermint.types.ValidatorParams validator = 3; + tendermint.types.VersionParams version = 4; +} + +// BlockParams contains limits on the block size. +message BlockParams { + // Note: must be greater than 0 + int64 max_bytes = 1; + // Note: must be greater or equal to -1 + int64 max_gas = 2; +} + +message LastCommitInfo { + int32 round = 1; + repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; +} + +// Event allows application developers to attach additional information to +// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. +// Later, transactions may be queried using these events. +message Event { + string type = 1; + repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; +} + +// EventAttribute is a single key-value pair, associated with an event. +message EventAttribute { + bytes key = 1; + bytes value = 2; + bool index = 3; // nondeterministic +} + +// TxResult contains results of executing the transaction. +// +// One usage is indexing transaction results. +message TxResult { + int64 height = 1; + uint32 index = 2; + bytes tx = 3; + ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; +} + +//---------------------------------------- +// Blockchain Types + +// Validator +message Validator { + bytes address = 1; // The first 20 bytes of SHA256(public key) + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; + int64 power = 3; // The voting power +} + +// ValidatorUpdate +message ValidatorUpdate { + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + int64 power = 2; +} + +// VoteInfo +message VoteInfo { + Validator validator = 1 [(gogoproto.nullable) = false]; + bool signed_last_block = 2; +} + +enum EvidenceType { + UNKNOWN = 0; + DUPLICATE_VOTE = 1; + LIGHT_CLIENT_ATTACK = 2; +} + +message Evidence { + EvidenceType type = 1; + // The offending validator + Validator validator = 2 [(gogoproto.nullable) = false]; + // The height when the offense occurred + int64 height = 3; + // The corresponding time where the offense occurred + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // Total voting power of the validator set in case the ABCI application does + // not store historical validators. + // https://github.com/tendermint/tendermint/issues/4581 + int64 total_voting_power = 5; +} + +//---------------------------------------- +// State Sync Types + +message Snapshot { + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata +} + +//---------------------------------------- +// Service Definition + +service ABCIApplication { + rpc Echo(RequestEcho) returns (ResponseEcho); + rpc Flush(RequestFlush) returns (ResponseFlush); + rpc Info(RequestInfo) returns (ResponseInfo); + rpc SetOption(RequestSetOption) returns (ResponseSetOption); + rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); + rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); + rpc Query(RequestQuery) returns (ResponseQuery); + rpc Commit(RequestCommit) returns (ResponseCommit); + rpc InitChain(RequestInitChain) returns (ResponseInitChain); + rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); + rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); + rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); + rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/crypto/keys.proto b/dydxjs/packages/dydxjs/proto/tendermint/crypto/keys.proto new file mode 100644 index 00000000..16fd7adf --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/crypto/keys.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +// PublicKey defines the keys available for use with Tendermint Validators +message PublicKey { + option (gogoproto.compare) = true; + option (gogoproto.equal) = true; + + oneof sum { + bytes ed25519 = 1; + bytes secp256k1 = 2; + } +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/crypto/proof.proto b/dydxjs/packages/dydxjs/proto/tendermint/crypto/proof.proto new file mode 100644 index 00000000..975df768 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/crypto/proof.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +message Proof { + int64 total = 1; + int64 index = 2; + bytes leaf_hash = 3; + repeated bytes aunts = 4; +} + +message ValueOp { + // Encoded in ProofOp.Key. + bytes key = 1; + + // To encode in ProofOp.Data + Proof proof = 2; +} + +message DominoOp { + string key = 1; + string input = 2; + string output = 3; +} + +// ProofOp defines an operation used for calculating Merkle root +// The data could be arbitrary format, providing nessecary data +// for example neighbouring node hash +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/libs/bits/types.proto b/dydxjs/packages/dydxjs/proto/tendermint/libs/bits/types.proto new file mode 100644 index 00000000..3111d113 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/libs/bits/types.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package tendermint.libs.bits; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits"; + +message BitArray { + int64 bits = 1; + repeated uint64 elems = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/p2p/types.proto b/dydxjs/packages/dydxjs/proto/tendermint/p2p/types.proto new file mode 100644 index 00000000..216a6d8d --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/p2p/types.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package tendermint.p2p; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +message ProtocolVersion { + uint64 p2p = 1 [(gogoproto.customname) = "P2P"]; + uint64 block = 2; + uint64 app = 3; +} + +message NodeInfo { + ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false]; + string node_id = 2 [(gogoproto.customname) = "NodeID"]; + string listen_addr = 3; + string network = 4; + string version = 5; + bytes channels = 6; + string moniker = 7; + NodeInfoOther other = 8 [(gogoproto.nullable) = false]; +} + +message NodeInfoOther { + string tx_index = 1; + string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"]; +} + +message PeerInfo { + string id = 1 [(gogoproto.customname) = "ID"]; + repeated PeerAddressInfo address_info = 2; + google.protobuf.Timestamp last_connected = 3 [(gogoproto.stdtime) = true]; +} + +message PeerAddressInfo { + string address = 1; + google.protobuf.Timestamp last_dial_success = 2 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp last_dial_failure = 3 [(gogoproto.stdtime) = true]; + uint32 dial_failures = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/types/block.proto b/dydxjs/packages/dydxjs/proto/tendermint/types/block.proto new file mode 100644 index 00000000..84e9bb15 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/types/block.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; + +message Block { + Header header = 1 [(gogoproto.nullable) = false]; + Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + Commit last_commit = 4; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/types/evidence.proto b/dydxjs/packages/dydxjs/proto/tendermint/types/evidence.proto new file mode 100644 index 00000000..d9548a43 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/types/evidence.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/validator.proto"; + +message Evidence { + oneof sum { + DuplicateVoteEvidence duplicate_vote_evidence = 1; + LightClientAttackEvidence light_client_attack_evidence = 2; + } +} + +// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. +message DuplicateVoteEvidence { + tendermint.types.Vote vote_a = 1; + tendermint.types.Vote vote_b = 2; + int64 total_voting_power = 3; + int64 validator_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. +message LightClientAttackEvidence { + tendermint.types.LightBlock conflicting_block = 1; + int64 common_height = 2; + repeated tendermint.types.Validator byzantine_validators = 3; + int64 total_voting_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +message EvidenceList { + repeated Evidence evidence = 1 [(gogoproto.nullable) = false]; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/types/params.proto b/dydxjs/packages/dydxjs/proto/tendermint/types/params.proto new file mode 100644 index 00000000..70789222 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/types/params.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option (gogoproto.equal_all) = true; + +// ConsensusParams contains consensus critical parameters that determine the +// validity of blocks. +message ConsensusParams { + BlockParams block = 1 [(gogoproto.nullable) = false]; + EvidenceParams evidence = 2 [(gogoproto.nullable) = false]; + ValidatorParams validator = 3 [(gogoproto.nullable) = false]; + VersionParams version = 4 [(gogoproto.nullable) = false]; +} + +// BlockParams contains limits on the block size. +message BlockParams { + // Max block size, in bytes. + // Note: must be greater than 0 + int64 max_bytes = 1; + // Max gas per block. + // Note: must be greater or equal to -1 + int64 max_gas = 2; + // Minimum time increment between consecutive blocks (in milliseconds) If the + // block header timestamp is ahead of the system clock, decrease this value. + // + // Not exposed to the application. + int64 time_iota_ms = 3; +} + +// EvidenceParams determine how we handle evidence of malfeasance. +message EvidenceParams { + // Max age of evidence, in blocks. + // + // The basic formula for calculating this is: MaxAgeDuration / {average block + // time}. + int64 max_age_num_blocks = 1; + + // Max age of evidence, in time. + // + // It should correspond with an app's "unbonding period" or other similar + // mechanism for handling [Nothing-At-Stake + // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + + // This sets the maximum size of total evidence in bytes that can be committed in a single block. + // and should fall comfortably under the max block bytes. + // Default is 1048576 or 1MB + int64 max_bytes = 3; +} + +// ValidatorParams restrict the public key types validators can use. +// NOTE: uses ABCI pubkey naming, not Amino names. +message ValidatorParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + repeated string pub_key_types = 1; +} + +// VersionParams contains the ABCI application version. +message VersionParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + uint64 app_version = 1; +} + +// HashedParams is a subset of ConsensusParams. +// +// It is hashed into the Header.ConsensusHash. +message HashedParams { + int64 block_max_bytes = 1; + int64 block_max_gas = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/types/types.proto b/dydxjs/packages/dydxjs/proto/tendermint/types/types.proto new file mode 100644 index 00000000..57efc33c --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/types/types.proto @@ -0,0 +1,153 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/crypto/proof.proto"; +import "tendermint/version/types.proto"; +import "tendermint/types/validator.proto"; + +// BlockIdFlag indicates which BlcokID the signature is for +enum BlockIDFlag { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; + BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; + BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; + BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; +} + +// SignedMsgType is a type of signed message in the consensus. +enum SignedMsgType { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; + // Votes + SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; + SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; + + // Proposals + SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; +} + +// PartsetHeader +message PartSetHeader { + uint32 total = 1; + bytes hash = 2; +} + +message Part { + uint32 index = 1; + bytes bytes = 2; + tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; +} + +// BlockID +message BlockID { + bytes hash = 1; + PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; +} + +// -------------------------------- + +// Header defines the structure of a Tendermint block header. +message Header { + // basic block info + tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // prev block info + BlockID last_block_id = 5 [(gogoproto.nullable) = false]; + + // hashes of block data + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block +} + +// Data contains the set of transactions included in the block +message Data { + // Txs that will be applied by state @ block.Height+1. + // NOTE: not all txs here are valid. We're just agreeing on the order first. + // This means that block.AppHash does not include these txs. + repeated bytes txs = 1; +} + +// Vote represents a prevote, precommit, or commit vote from validators for +// consensus. +message Vote { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; + bytes signature = 8; +} + +// Commit contains the evidence that a block was committed by a set of validators. +message Commit { + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; +} + +// CommitSig is a part of the Vote included in a Commit. +message CommitSig { + BlockIDFlag block_id_flag = 1; + bytes validator_address = 2; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; +} + +message Proposal { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + int32 pol_round = 4; + BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; +} + +message SignedHeader { + Header header = 1; + Commit commit = 2; +} + +message LightBlock { + SignedHeader signed_header = 1; + tendermint.types.ValidatorSet validator_set = 2; +} + +message BlockMeta { + BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + int64 block_size = 2; + Header header = 3 [(gogoproto.nullable) = false]; + int64 num_txs = 4; +} + +// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. +message TxProof { + bytes root_hash = 1; + bytes data = 2; + tendermint.crypto.Proof proof = 3; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/types/validator.proto b/dydxjs/packages/dydxjs/proto/tendermint/types/validator.proto new file mode 100644 index 00000000..49860b96 --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/types/validator.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/crypto/keys.proto"; + +message ValidatorSet { + repeated Validator validators = 1; + Validator proposer = 2; + int64 total_voting_power = 3; +} + +message Validator { + bytes address = 1; + tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +message SimpleValidator { + tendermint.crypto.PublicKey pub_key = 1; + int64 voting_power = 2; +} diff --git a/dydxjs/packages/dydxjs/proto/tendermint/version/types.proto b/dydxjs/packages/dydxjs/proto/tendermint/version/types.proto new file mode 100644 index 00000000..6061868b --- /dev/null +++ b/dydxjs/packages/dydxjs/proto/tendermint/version/types.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package tendermint.version; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/version"; + +import "gogoproto/gogo.proto"; + +// App includes the protocol and software version for the application. +// This information is included in ResponseInfo. The App.Protocol can be +// updated in ResponseEndBlock. +message App { + uint64 protocol = 1; + string software = 2; +} + +// Consensus captures the consensus rules for processing a block in the blockchain, +// including all blockchain data structures and the rules of the application's +// state transition machine. +message Consensus { + option (gogoproto.equal) = true; + + uint64 block = 1; + uint64 app = 2; +} diff --git a/dydxjs/packages/dydxjs/scripts/aminos.ts b/dydxjs/packages/dydxjs/scripts/aminos.ts new file mode 100644 index 00000000..add86a10 --- /dev/null +++ b/dydxjs/packages/dydxjs/scripts/aminos.ts @@ -0,0 +1,29 @@ +export const AMINO_MAP = { + // PUT YOUR AMINO names here... + // Staking + // '/cosmos.staking.v1beta1.MsgCreateValidator': { + // aminoType: 'cosmos-sdk/MsgCreateValidator' + // }, + // '/cosmos.staking.v1beta1.MsgEditValidator': { + // aminoType: 'cosmos-sdk/MsgEditValidator' + // }, + // '/cosmos.staking.v1beta1.MsgDelegate': { + // aminoType: 'cosmos-sdk/MsgDelegate' + // }, + // '/cosmos.staking.v1beta1.MsgUndelegate': { + // aminoType: 'cosmos-sdk/MsgUndelegate' + // }, + // '/cosmos.staking.v1beta1.MsgBeginRedelegate': { + // aminoType: 'cosmos-sdk/MsgBeginRedelegate' + // }, + // '/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation': { + // aminoType: 'cosmos-sdk/MsgCancelUnbondingDelegation' + // }, + // '/cosmos.staking.v1beta1.MsgUpdateParams': { + // aminoType: 'cosmos-sdk/x/staking/MsgUpdateParams' + // }, + // // IBC + // '/ibc.applications.transfer.v1.MsgTransfer': { + // aminoType: 'cosmos-sdk/MsgTransfer' + // } +}; diff --git a/dydxjs/packages/dydxjs/scripts/codegen.ts b/dydxjs/packages/dydxjs/scripts/codegen.ts new file mode 100644 index 00000000..913eab56 --- /dev/null +++ b/dydxjs/packages/dydxjs/scripts/codegen.ts @@ -0,0 +1,109 @@ +import { TelescopeInput } from '@cosmology/telescope'; +import telescope from '@cosmology/telescope'; +import { join } from 'path'; +import { rimrafSync as rimraf } from 'rimraf'; + +import { AMINO_MAP } from './aminos'; + +const protoDirs: string[] = [join(__dirname, '/../proto')]; +const outPath: string = join(__dirname, '../src'); +rimraf(outPath); + +export const options: TelescopeInput = { + protoDirs, + outPath, + options: { + interfaces: { + enabled: true, + useUnionTypes: true + }, + prototypes: { + enabled: true, + excluded: { + packages: [ + 'ibc.applications.fee.v1', // issue with parsing protos (LCD routes with nested objects in params) + 'cosmos.app.v1alpha1', + 'cosmos.app.v1beta1', + 'cosmos.base.kv.v1beta1', + 'cosmos.base.reflection.v1beta1', + 'cosmos.base.snapshots.v1beta1', + 'cosmos.base.store.v1beta1', + 'cosmos.base.tendermint.v1beta1', + 'cosmos.crisis.v1beta1', + 'cosmos.evidence.v1beta1', + 'cosmos.genutil.v1beta1', + 'cosmos.autocli.v1', + 'cosmos.msg.v1', + 'cosmos.nft.v1beta1', + 'cosmos.capability.v1beta1', + 'cosmos.orm.v1alpha1', + 'cosmos.orm.v1', + 'cosmos.slashing.v1beta1', + 'google.api', + 'ibc.core.port.v1', + 'ibc.core.types.v1' + ] + }, + }, + + bundle: { + enabled: true + }, + + tsDisable: { + files: [], + patterns: [], + disableAll: true + }, + + eslintDisable: { + files: [], + patterns: [], + disableAll: false + }, + + stargateClients: { + enabled: true, + includeCosmosDefaultTypes: true + }, + + aminoEncoding: { + enabled: true, + customTypes: { + useCosmosSDKDec: false + }, + exceptions: { + ...AMINO_MAP + }, + }, + lcdClients: { + enabled: false + }, + rpcClients: { + type: 'tendermint', + enabled: true + }, + + reactQuery: { + enabled: false + }, + + mobx: { + enabled: false + }, + + pinia: { + enabled: false + } + } +}; + + +telescope(options) + .then(() => { + console.log('✨ all done!'); + }) + .catch((e) => { + console.error(e); + process.exit(1); + }); diff --git a/dydxjs/packages/dydxjs/scripts/export_protos.sh b/dydxjs/packages/dydxjs/scripts/export_protos.sh new file mode 100755 index 00000000..36b2660b --- /dev/null +++ b/dydxjs/packages/dydxjs/scripts/export_protos.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +base_dir="packages/dydxjs/proto" + +for dir in dydxprotocol slinky noble-cctp ; do + rm -rf "$base_dir/$dir" + mkdir -p "$base_dir/$dir" + echo "Autogenerated folder, see export_protos.sh" > "$base_dir/$dir/README.md" + + buf export "$base_dir/$dir-src/proto" --output "$base_dir/$dir" +done diff --git a/dydxjs/packages/dydxjs/src/amino/amino.ts b/dydxjs/packages/dydxjs/src/amino/amino.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/amino/amino.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/amino/bundle.ts b/dydxjs/packages/dydxjs/src/amino/bundle.ts new file mode 100644 index 00000000..a1ab4c8c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/amino/bundle.ts @@ -0,0 +1,5 @@ +//@ts-nocheck +import * as _0 from "./amino"; +export const amino = { + ..._0 +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/binary.ts b/dydxjs/packages/dydxjs/src/binary.ts new file mode 100644 index 00000000..5cf7c8c0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/binary.ts @@ -0,0 +1,535 @@ +//@ts-nocheck +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- + +// Code generated by the command line utilities is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +import { utf8Length, utf8Read, utf8Write } from "./utf8"; +import { + int64ToString, + readInt32, + readUInt32, + uInt64ToString, + varint32read, + varint64read, + writeVarint32, + writeVarint64, + int64FromString, + int64Length, + writeFixed32, + writeByte, + zzDecode, + zzEncode, +} from "./varint"; + +export enum WireType { + Varint = 0, + + Fixed64 = 1, + + Bytes = 2, + + Fixed32 = 5, +} + +// Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} + +export class BinaryReader implements IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + + assertBounds(): void { + if (this.pos > this.len) throw new RangeError("premature EOF"); + } + + constructor(buf?: ArrayLike) { + this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0); + this.pos = 0; + this.type = 0; + this.len = this.buf.length; + } + + tag(): [number, WireType, number] { + const tag = this.uint32(), + fieldNo = tag >>> 3, + wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error( + "illegal tag: field no " + fieldNo + " wire type " + wireType + ); + return [fieldNo, wireType, tag]; + } + + skip(length?: number) { + if (typeof length === "number") { + if (this.pos + length > this.len) throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + } + + skipType(wireType: number) { + switch (wireType) { + case WireType.Varint: + this.skip(); + break; + case WireType.Fixed64: + this.skip(8); + break; + case WireType.Bytes: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case WireType.Fixed32: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + } + + uint32(): number { + return varint32read.bind(this)(); + } + + int32(): number { + return this.uint32() | 0; + } + + sint32(): number { + const num = this.uint32(); + return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding + } + + fixed32(): number { + const val = readUInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + sfixed32(): number { + const val = readInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + int64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(int64ToString(lo, hi)); + } + + uint64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(uInt64ToString(lo, hi)); + } + + sint64(): bigint { + let [lo, hi] = varint64read.bind(this)(); + // zig zag + [lo, hi] = zzDecode(lo, hi); + return BigInt(int64ToString(lo, hi)); + } + + fixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(uInt64ToString(lo, hi)); + } + sfixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(int64ToString(lo, hi)); + } + + float(): number { + throw new Error("float not supported"); + } + + double(): number { + throw new Error("double not supported"); + } + + bool(): boolean { + const [lo, hi] = varint64read.bind(this)(); + return lo !== 0 || hi !== 0; + } + + bytes(): Uint8Array { + const len = this.uint32(), + start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + + string(): string { + const bytes = this.bytes(); + return utf8Read(bytes, 0, bytes.length); + } +} + +// Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} + +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} + +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; + len: number; + val: T; + next?: IOp; + + constructor( + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, + len: number, + val: T + ) { + this.fn = fn; + this.len = len; + this.val = val; + } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } +} + +class State { + head: IOp; + tail: IOp; + len: number; + next: State | null; + + constructor(writer: BinaryWriter) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } +} + +export class BinaryWriter implements IBinaryWriter { + len = 0; + head: IOp; + tail: IOp; + states: State | null; + + constructor() { + this.head = new Op(null, 0, 0); + this.tail = this.head; + this.states = null; + } + + static create() { + return new BinaryWriter(); + } + + static alloc(size: number): Uint8Array | number[] { + if (typeof Uint8Array !== "undefined") { + return pool( + (size) => new Uint8Array(size), + Uint8Array.prototype.subarray + )(size); + } else { + return new Array(size); + } + } + + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, + len: number, + val: T + ) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + } + + finish(): Uint8Array { + let head = this.head.next, + pos = 0; + const buf = BinaryWriter.alloc(this.len); + while (head) { + head.proceed(buf, pos); + pos += head.len; + head = head.next; + } + return buf as Uint8Array; + } + + fork(): BinaryWriter { + this.states = new State(this); + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + return this; + } + + reset(): BinaryWriter { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + } + return this; + } + + ldelim(): BinaryWriter { + const head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + } + + tag(fieldNo: number, type: WireType): BinaryWriter { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + + uint32(value: number): BinaryWriter { + this.len += (this.tail = this.tail.next = + new Op( + writeVarint32, + (value = value >>> 0) < 128 + ? 1 + : value < 16384 + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, + value + )).len; + return this; + } + + int32(value: number): BinaryWriter { + return value < 0 + ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec + : this.uint32(value); + } + + sint32(value: number): BinaryWriter { + return this.uint32(((value << 1) ^ (value >> 31)) >>> 0); + } + + int64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + // uint64 is the same with int64 + uint64 = BinaryWriter.prototype.int64; + + sint64(value: string | number | bigint): BinaryWriter { + let { lo, hi } = int64FromString(value.toString()); + // zig zag + [lo, hi] = zzEncode(lo, hi); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + fixed64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi); + } + + // sfixed64 is the same with fixed64 + sfixed64 = BinaryWriter.prototype.fixed64; + + bool(value: boolean): BinaryWriter { + return this._push(writeByte, 1, value ? 1 : 0); + } + + fixed32(value: number): BinaryWriter { + return this._push(writeFixed32, 4, value >>> 0); + } + + // sfixed32 is the same with fixed32 + sfixed32 = BinaryWriter.prototype.fixed32; + + float(value: number): BinaryWriter { + throw new Error("float not supported" + value); + } + + double(value: number): BinaryWriter { + throw new Error("double not supported" + value); + } + + bytes(value: Uint8Array): BinaryWriter { + const len = value.length >>> 0; + if (!len) return this._push(writeByte, 1, 0); + return this.uint32(len)._push(writeBytes, len, value); + } + + string(value: string): BinaryWriter { + const len = utf8Length(value); + return len + ? this.uint32(len)._push(utf8Write, len, value) + : this._push(writeByte, 1, 0); + } +} + +function writeBytes( + val: Uint8Array | number[], + buf: Uint8Array | number[], + pos: number +) { + if (typeof Uint8Array !== "undefined") { + (buf as Uint8Array).set(val, pos); + } else { + for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i]; + } +} + +function pool( + alloc: (size: number) => Uint8Array, + slice: (begin?: number, end?: number) => Uint8Array, + size?: number +): (size: number) => Uint8Array { + const SIZE = size || 8192; + const MAX = SIZE >>> 1; + let slab: Uint8Array | null = null; + let offset = SIZE; + return function pool_alloc(size): Uint8Array { + if (size < 1 || size > MAX) return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + const buf: Uint8Array = slice.call(slab, offset, (offset += size)); + if (offset & 7) + // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +function indexOutOfRange(reader: BinaryReader, writeLength?: number) { + return RangeError( + "index out of range: " + + reader.pos + + " + " + + (writeLength || 1) + + " > " + + reader.len + ); +} diff --git a/dydxjs/packages/dydxjs/src/confio/proofs.ts b/dydxjs/packages/dydxjs/src/confio/proofs.ts new file mode 100644 index 00000000..62d784ab --- /dev/null +++ b/dydxjs/packages/dydxjs/src/confio/proofs.ts @@ -0,0 +1,1965 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../binary"; +import { bytesFromBase64, base64FromBytes } from "../helpers"; +export enum HashOp { + /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ + NO_HASH = 0, + SHA256 = 1, + SHA512 = 2, + KECCAK = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + UNRECOGNIZED = -1, +} +export const HashOpSDKType = HashOp; +export const HashOpAmino = HashOp; +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case "NO_HASH": + return HashOp.NO_HASH; + case 1: + case "SHA256": + return HashOp.SHA256; + case 2: + case "SHA512": + return HashOp.SHA512; + case 3: + case "KECCAK": + return HashOp.KECCAK; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case -1: + case "UNRECOGNIZED": + default: + return HashOp.UNRECOGNIZED; + } +} +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return "NO_HASH"; + case HashOp.SHA256: + return "SHA256"; + case HashOp.SHA512: + return "SHA512"; + case HashOp.KECCAK: + return "KECCAK"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + case HashOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ + FIXED32_BIG = 3, + /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ + FIXED64_BIG = 5, + /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */ + FIXED64_LITTLE = 6, + /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */ + REQUIRE_32_BYTES = 7, + /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1, +} +export const LengthOpSDKType = LengthOp; +export const LengthOpAmino = LengthOp; +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case "NO_PREFIX": + return LengthOp.NO_PREFIX; + case 1: + case "VAR_PROTO": + return LengthOp.VAR_PROTO; + case 2: + case "VAR_RLP": + return LengthOp.VAR_RLP; + case 3: + case "FIXED32_BIG": + return LengthOp.FIXED32_BIG; + case 4: + case "FIXED32_LITTLE": + return LengthOp.FIXED32_LITTLE; + case 5: + case "FIXED64_BIG": + return LengthOp.FIXED64_BIG; + case 6: + case "FIXED64_LITTLE": + return LengthOp.FIXED64_LITTLE; + case 7: + case "REQUIRE_32_BYTES": + return LengthOp.REQUIRE_32_BYTES; + case 8: + case "REQUIRE_64_BYTES": + return LengthOp.REQUIRE_64_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return LengthOp.UNRECOGNIZED; + } +} +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return "NO_PREFIX"; + case LengthOp.VAR_PROTO: + return "VAR_PROTO"; + case LengthOp.VAR_RLP: + return "VAR_RLP"; + case LengthOp.FIXED32_BIG: + return "FIXED32_BIG"; + case LengthOp.FIXED32_LITTLE: + return "FIXED32_LITTLE"; + case LengthOp.FIXED64_BIG: + return "FIXED64_BIG"; + case LengthOp.FIXED64_LITTLE: + return "FIXED64_LITTLE"; + case LengthOp.REQUIRE_32_BYTES: + return "REQUIRE_32_BYTES"; + case LengthOp.REQUIRE_64_BYTES: + return "REQUIRE_64_BYTES"; + case LengthOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + path: InnerOp[]; +} +export interface ExistenceProofProtoMsg { + typeUrl: "/ics23.ExistenceProof"; + value: Uint8Array; +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProofAmino { + key?: string; + value?: string; + leaf?: LeafOpAmino; + path?: InnerOpAmino[]; +} +export interface ExistenceProofAminoMsg { + type: "/ics23.ExistenceProof"; + value: ExistenceProofAmino; +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOpSDKType; + path: InnerOpSDKType[]; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: ExistenceProof; + right?: ExistenceProof; +} +export interface NonExistenceProofProtoMsg { + typeUrl: "/ics23.NonExistenceProof"; + value: Uint8Array; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string; + left?: ExistenceProofAmino; + right?: ExistenceProofAmino; +} +export interface NonExistenceProofAminoMsg { + type: "/ics23.NonExistenceProof"; + value: NonExistenceProofAmino; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofSDKType { + key: Uint8Array; + left?: ExistenceProofSDKType; + right?: ExistenceProofSDKType; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist?: ExistenceProof; + nonexist?: NonExistenceProof; + batch?: BatchProof; + compressed?: CompressedBatchProof; +} +export interface CommitmentProofProtoMsg { + typeUrl: "/ics23.CommitmentProof"; + value: Uint8Array; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProofAmino { + exist?: ExistenceProofAmino; + nonexist?: NonExistenceProofAmino; + batch?: BatchProofAmino; + compressed?: CompressedBatchProofAmino; +} +export interface CommitmentProofAminoMsg { + type: "/ics23.CommitmentProof"; + value: CommitmentProofAmino; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProofSDKType { + exist?: ExistenceProofSDKType; + nonexist?: NonExistenceProofSDKType; + batch?: BatchProofSDKType; + compressed?: CompressedBatchProofSDKType; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp; + prehashKey: HashOp; + prehashValue: HashOp; + length: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix: Uint8Array; +} +export interface LeafOpProtoMsg { + typeUrl: "/ics23.LeafOp"; + value: Uint8Array; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOpAmino { + hash?: HashOp; + prehash_key?: HashOp; + prehash_value?: HashOp; + length?: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix?: string; +} +export interface LeafOpAminoMsg { + type: "/ics23.LeafOp"; + value: LeafOpAmino; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOpSDKType { + hash: HashOp; + prehash_key: HashOp; + prehash_value: HashOp; + length: LengthOp; + prefix: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +export interface InnerOpProtoMsg { + typeUrl: "/ics23.InnerOp"; + value: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOpAmino { + hash?: HashOp; + prefix?: string; + suffix?: string; +} +export interface InnerOpAminoMsg { + type: "/ics23.InnerOp"; + value: InnerOpAmino; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOpSDKType { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpec { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leafSpec?: LeafOp; + innerSpec?: InnerSpec; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; +} +export interface ProofSpecProtoMsg { + typeUrl: "/ics23.ProofSpec"; + value: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecAmino { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leaf_spec?: LeafOpAmino; + inner_spec?: InnerSpecAmino; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + max_depth?: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + min_depth?: number; +} +export interface ProofSpecAminoMsg { + type: "/ics23.ProofSpec"; + value: ProofSpecAmino; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecSDKType { + leaf_spec?: LeafOpSDKType; + inner_spec?: InnerSpecSDKType; + max_depth: number; + min_depth: number; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[]; + childSize: number; + minPrefixLength: number; + maxPrefixLength: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + emptyChild: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} +export interface InnerSpecProtoMsg { + typeUrl: "/ics23.InnerSpec"; + value: Uint8Array; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecAmino { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + child_order?: number[]; + child_size?: number; + min_prefix_length?: number; + max_prefix_length?: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + empty_child?: string; + /** hash is the algorithm that must be used for each InnerOp */ + hash?: HashOp; +} +export interface InnerSpecAminoMsg { + type: "/ics23.InnerSpec"; + value: InnerSpecAmino; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecSDKType { + child_order: number[]; + child_size: number; + min_prefix_length: number; + max_prefix_length: number; + empty_child: Uint8Array; + hash: HashOp; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[]; +} +export interface BatchProofProtoMsg { + typeUrl: "/ics23.BatchProof"; + value: Uint8Array; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofAmino { + entries?: BatchEntryAmino[]; +} +export interface BatchProofAminoMsg { + type: "/ics23.BatchProof"; + value: BatchProofAmino; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofSDKType { + entries: BatchEntrySDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof; + nonexist?: NonExistenceProof; +} +export interface BatchEntryProtoMsg { + typeUrl: "/ics23.BatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntryAmino { + exist?: ExistenceProofAmino; + nonexist?: NonExistenceProofAmino; +} +export interface BatchEntryAminoMsg { + type: "/ics23.BatchEntry"; + value: BatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntrySDKType { + exist?: ExistenceProofSDKType; + nonexist?: NonExistenceProofSDKType; +} +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} +export interface CompressedBatchProofProtoMsg { + typeUrl: "/ics23.CompressedBatchProof"; + value: Uint8Array; +} +export interface CompressedBatchProofAmino { + entries?: CompressedBatchEntryAmino[]; + lookup_inners?: InnerOpAmino[]; +} +export interface CompressedBatchProofAminoMsg { + type: "/ics23.CompressedBatchProof"; + value: CompressedBatchProofAmino; +} +export interface CompressedBatchProofSDKType { + entries: CompressedBatchEntrySDKType[]; + lookup_inners: InnerOpSDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof; + nonexist?: CompressedNonExistenceProof; +} +export interface CompressedBatchEntryProtoMsg { + typeUrl: "/ics23.CompressedBatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntryAmino { + exist?: CompressedExistenceProofAmino; + nonexist?: CompressedNonExistenceProofAmino; +} +export interface CompressedBatchEntryAminoMsg { + type: "/ics23.CompressedBatchEntry"; + value: CompressedBatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntrySDKType { + exist?: CompressedExistenceProofSDKType; + nonexist?: CompressedNonExistenceProofSDKType; +} +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} +export interface CompressedExistenceProofProtoMsg { + typeUrl: "/ics23.CompressedExistenceProof"; + value: Uint8Array; +} +export interface CompressedExistenceProofAmino { + key?: string; + value?: string; + leaf?: LeafOpAmino; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path?: number[]; +} +export interface CompressedExistenceProofAminoMsg { + type: "/ics23.CompressedExistenceProof"; + value: CompressedExistenceProofAmino; +} +export interface CompressedExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOpSDKType; + path: number[]; +} +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; +} +export interface CompressedNonExistenceProofProtoMsg { + typeUrl: "/ics23.CompressedNonExistenceProof"; + value: Uint8Array; +} +export interface CompressedNonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string; + left?: CompressedExistenceProofAmino; + right?: CompressedExistenceProofAmino; +} +export interface CompressedNonExistenceProofAminoMsg { + type: "/ics23.CompressedNonExistenceProof"; + value: CompressedNonExistenceProofAmino; +} +export interface CompressedNonExistenceProofSDKType { + key: Uint8Array; + left?: CompressedExistenceProofSDKType; + right?: CompressedExistenceProofSDKType; +} +function createBaseExistenceProof(): ExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const ExistenceProof = { + typeUrl: "/ics23.ExistenceProof", + encode(message: ExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.path) { + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + message.path.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExistenceProof { + const message = createBaseExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = object.leaf !== undefined && object.leaf !== null ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map(e => InnerOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExistenceProofAmino): ExistenceProof { + const message = createBaseExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => InnerOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExistenceProof): ExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; + if (message.path) { + obj.path = message.path.map(e => e ? InnerOp.toAmino(e) : undefined); + } else { + obj.path = message.path; + } + return obj; + }, + fromAminoMsg(object: ExistenceProofAminoMsg): ExistenceProof { + return ExistenceProof.fromAmino(object.value); + }, + fromProtoMsg(message: ExistenceProofProtoMsg): ExistenceProof { + return ExistenceProof.decode(message.value); + }, + toProto(message: ExistenceProof): Uint8Array { + return ExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: ExistenceProof): ExistenceProofProtoMsg { + return { + typeUrl: "/ics23.ExistenceProof", + value: ExistenceProof.encode(message).finish() + }; + } +}; +function createBaseNonExistenceProof(): NonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const NonExistenceProof = { + typeUrl: "/ics23.NonExistenceProof", + encode(message: NonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = ExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = ExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NonExistenceProof { + const message = createBaseNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = object.left !== undefined && object.left !== null ? ExistenceProof.fromPartial(object.left) : undefined; + message.right = object.right !== undefined && object.right !== null ? ExistenceProof.fromPartial(object.right) : undefined; + return message; + }, + fromAmino(object: NonExistenceProofAmino): NonExistenceProof { + const message = createBaseNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromAmino(object.right); + } + return message; + }, + toAmino(message: NonExistenceProof): NonExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.left = message.left ? ExistenceProof.toAmino(message.left) : undefined; + obj.right = message.right ? ExistenceProof.toAmino(message.right) : undefined; + return obj; + }, + fromAminoMsg(object: NonExistenceProofAminoMsg): NonExistenceProof { + return NonExistenceProof.fromAmino(object.value); + }, + fromProtoMsg(message: NonExistenceProofProtoMsg): NonExistenceProof { + return NonExistenceProof.decode(message.value); + }, + toProto(message: NonExistenceProof): Uint8Array { + return NonExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: NonExistenceProof): NonExistenceProofProtoMsg { + return { + typeUrl: "/ics23.NonExistenceProof", + value: NonExistenceProof.encode(message).finish() + }; + } +}; +function createBaseCommitmentProof(): CommitmentProof { + return { + exist: undefined, + nonexist: undefined, + batch: undefined, + compressed: undefined + }; +} +export const CommitmentProof = { + typeUrl: "/ics23.CommitmentProof", + encode(message: CommitmentProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + if (message.batch !== undefined) { + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); + } + if (message.compressed !== undefined) { + CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitmentProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitmentProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.batch = BatchProof.decode(reader, reader.uint32()); + break; + case 4: + message.compressed = CompressedBatchProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommitmentProof { + const message = createBaseCommitmentProof(); + message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? NonExistenceProof.fromPartial(object.nonexist) : undefined; + message.batch = object.batch !== undefined && object.batch !== null ? BatchProof.fromPartial(object.batch) : undefined; + message.compressed = object.compressed !== undefined && object.compressed !== null ? CompressedBatchProof.fromPartial(object.compressed) : undefined; + return message; + }, + fromAmino(object: CommitmentProofAmino): CommitmentProof { + const message = createBaseCommitmentProof(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromAmino(object.batch); + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromAmino(object.compressed); + } + return message; + }, + toAmino(message: CommitmentProof): CommitmentProofAmino { + const obj: any = {}; + obj.exist = message.exist ? ExistenceProof.toAmino(message.exist) : undefined; + obj.nonexist = message.nonexist ? NonExistenceProof.toAmino(message.nonexist) : undefined; + obj.batch = message.batch ? BatchProof.toAmino(message.batch) : undefined; + obj.compressed = message.compressed ? CompressedBatchProof.toAmino(message.compressed) : undefined; + return obj; + }, + fromAminoMsg(object: CommitmentProofAminoMsg): CommitmentProof { + return CommitmentProof.fromAmino(object.value); + }, + fromProtoMsg(message: CommitmentProofProtoMsg): CommitmentProof { + return CommitmentProof.decode(message.value); + }, + toProto(message: CommitmentProof): Uint8Array { + return CommitmentProof.encode(message).finish(); + }, + toProtoMsg(message: CommitmentProof): CommitmentProofProtoMsg { + return { + typeUrl: "/ics23.CommitmentProof", + value: CommitmentProof.encode(message).finish() + }; + } +}; +function createBaseLeafOp(): LeafOp { + return { + hash: 0, + prehashKey: 0, + prehashValue: 0, + length: 0, + prefix: new Uint8Array() + }; +} +export const LeafOp = { + typeUrl: "/ics23.LeafOp", + encode(message: LeafOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prehashKey !== 0) { + writer.uint32(16).int32(message.prehashKey); + } + if (message.prehashValue !== 0) { + writer.uint32(24).int32(message.prehashValue); + } + if (message.length !== 0) { + writer.uint32(32).int32(message.length); + } + if (message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LeafOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeafOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prehashKey = reader.int32() as any; + break; + case 3: + message.prehashValue = reader.int32() as any; + break; + case 4: + message.length = reader.int32() as any; + break; + case 5: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LeafOp { + const message = createBaseLeafOp(); + message.hash = object.hash ?? 0; + message.prehashKey = object.prehashKey ?? 0; + message.prehashValue = object.prehashValue ?? 0; + message.length = object.length ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: LeafOpAmino): LeafOp { + const message = createBaseLeafOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = object.prehash_key; + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = object.prehash_value; + } + if (object.length !== undefined && object.length !== null) { + message.length = object.length; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; + }, + toAmino(message: LeafOp): LeafOpAmino { + const obj: any = {}; + obj.hash = message.hash === 0 ? undefined : message.hash; + obj.prehash_key = message.prehashKey === 0 ? undefined : message.prehashKey; + obj.prehash_value = message.prehashValue === 0 ? undefined : message.prehashValue; + obj.length = message.length === 0 ? undefined : message.length; + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + return obj; + }, + fromAminoMsg(object: LeafOpAminoMsg): LeafOp { + return LeafOp.fromAmino(object.value); + }, + fromProtoMsg(message: LeafOpProtoMsg): LeafOp { + return LeafOp.decode(message.value); + }, + toProto(message: LeafOp): Uint8Array { + return LeafOp.encode(message).finish(); + }, + toProtoMsg(message: LeafOp): LeafOpProtoMsg { + return { + typeUrl: "/ics23.LeafOp", + value: LeafOp.encode(message).finish() + }; + } +}; +function createBaseInnerOp(): InnerOp { + return { + hash: 0, + prefix: new Uint8Array(), + suffix: new Uint8Array() + }; +} +export const InnerOp = { + typeUrl: "/ics23.InnerOp", + encode(message: InnerOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prefix.length !== 0) { + writer.uint32(18).bytes(message.prefix); + } + if (message.suffix.length !== 0) { + writer.uint32(26).bytes(message.suffix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InnerOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prefix = reader.bytes(); + break; + case 3: + message.suffix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InnerOp { + const message = createBaseInnerOp(); + message.hash = object.hash ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + message.suffix = object.suffix ?? new Uint8Array(); + return message; + }, + fromAmino(object: InnerOpAmino): InnerOp { + const message = createBaseInnerOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; + }, + toAmino(message: InnerOp): InnerOpAmino { + const obj: any = {}; + obj.hash = message.hash === 0 ? undefined : message.hash; + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined; + return obj; + }, + fromAminoMsg(object: InnerOpAminoMsg): InnerOp { + return InnerOp.fromAmino(object.value); + }, + fromProtoMsg(message: InnerOpProtoMsg): InnerOp { + return InnerOp.decode(message.value); + }, + toProto(message: InnerOp): Uint8Array { + return InnerOp.encode(message).finish(); + }, + toProtoMsg(message: InnerOp): InnerOpProtoMsg { + return { + typeUrl: "/ics23.InnerOp", + value: InnerOp.encode(message).finish() + }; + } +}; +function createBaseProofSpec(): ProofSpec { + return { + leafSpec: undefined, + innerSpec: undefined, + maxDepth: 0, + minDepth: 0 + }; +} +export const ProofSpec = { + typeUrl: "/ics23.ProofSpec", + encode(message: ProofSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.leafSpec !== undefined) { + LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); + } + if (message.innerSpec !== undefined) { + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim(); + } + if (message.maxDepth !== 0) { + writer.uint32(24).int32(message.maxDepth); + } + if (message.minDepth !== 0) { + writer.uint32(32).int32(message.minDepth); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leafSpec = LeafOp.decode(reader, reader.uint32()); + break; + case 2: + message.innerSpec = InnerSpec.decode(reader, reader.uint32()); + break; + case 3: + message.maxDepth = reader.int32(); + break; + case 4: + message.minDepth = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProofSpec { + const message = createBaseProofSpec(); + message.leafSpec = object.leafSpec !== undefined && object.leafSpec !== null ? LeafOp.fromPartial(object.leafSpec) : undefined; + message.innerSpec = object.innerSpec !== undefined && object.innerSpec !== null ? InnerSpec.fromPartial(object.innerSpec) : undefined; + message.maxDepth = object.maxDepth ?? 0; + message.minDepth = object.minDepth ?? 0; + return message; + }, + fromAmino(object: ProofSpecAmino): ProofSpec { + const message = createBaseProofSpec(); + if (object.leaf_spec !== undefined && object.leaf_spec !== null) { + message.leafSpec = LeafOp.fromAmino(object.leaf_spec); + } + if (object.inner_spec !== undefined && object.inner_spec !== null) { + message.innerSpec = InnerSpec.fromAmino(object.inner_spec); + } + if (object.max_depth !== undefined && object.max_depth !== null) { + message.maxDepth = object.max_depth; + } + if (object.min_depth !== undefined && object.min_depth !== null) { + message.minDepth = object.min_depth; + } + return message; + }, + toAmino(message: ProofSpec): ProofSpecAmino { + const obj: any = {}; + obj.leaf_spec = message.leafSpec ? LeafOp.toAmino(message.leafSpec) : undefined; + obj.inner_spec = message.innerSpec ? InnerSpec.toAmino(message.innerSpec) : undefined; + obj.max_depth = message.maxDepth === 0 ? undefined : message.maxDepth; + obj.min_depth = message.minDepth === 0 ? undefined : message.minDepth; + return obj; + }, + fromAminoMsg(object: ProofSpecAminoMsg): ProofSpec { + return ProofSpec.fromAmino(object.value); + }, + fromProtoMsg(message: ProofSpecProtoMsg): ProofSpec { + return ProofSpec.decode(message.value); + }, + toProto(message: ProofSpec): Uint8Array { + return ProofSpec.encode(message).finish(); + }, + toProtoMsg(message: ProofSpec): ProofSpecProtoMsg { + return { + typeUrl: "/ics23.ProofSpec", + value: ProofSpec.encode(message).finish() + }; + } +}; +function createBaseInnerSpec(): InnerSpec { + return { + childOrder: [], + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + emptyChild: new Uint8Array(), + hash: 0 + }; +} +export const InnerSpec = { + typeUrl: "/ics23.InnerSpec", + encode(message: InnerSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.childOrder) { + writer.int32(v); + } + writer.ldelim(); + if (message.childSize !== 0) { + writer.uint32(16).int32(message.childSize); + } + if (message.minPrefixLength !== 0) { + writer.uint32(24).int32(message.minPrefixLength); + } + if (message.maxPrefixLength !== 0) { + writer.uint32(32).int32(message.maxPrefixLength); + } + if (message.emptyChild.length !== 0) { + writer.uint32(42).bytes(message.emptyChild); + } + if (message.hash !== 0) { + writer.uint32(48).int32(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InnerSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.childOrder.push(reader.int32()); + } + } else { + message.childOrder.push(reader.int32()); + } + break; + case 2: + message.childSize = reader.int32(); + break; + case 3: + message.minPrefixLength = reader.int32(); + break; + case 4: + message.maxPrefixLength = reader.int32(); + break; + case 5: + message.emptyChild = reader.bytes(); + break; + case 6: + message.hash = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InnerSpec { + const message = createBaseInnerSpec(); + message.childOrder = object.childOrder?.map(e => e) || []; + message.childSize = object.childSize ?? 0; + message.minPrefixLength = object.minPrefixLength ?? 0; + message.maxPrefixLength = object.maxPrefixLength ?? 0; + message.emptyChild = object.emptyChild ?? new Uint8Array(); + message.hash = object.hash ?? 0; + return message; + }, + fromAmino(object: InnerSpecAmino): InnerSpec { + const message = createBaseInnerSpec(); + message.childOrder = object.child_order?.map(e => e) || []; + if (object.child_size !== undefined && object.child_size !== null) { + message.childSize = object.child_size; + } + if (object.min_prefix_length !== undefined && object.min_prefix_length !== null) { + message.minPrefixLength = object.min_prefix_length; + } + if (object.max_prefix_length !== undefined && object.max_prefix_length !== null) { + message.maxPrefixLength = object.max_prefix_length; + } + if (object.empty_child !== undefined && object.empty_child !== null) { + message.emptyChild = bytesFromBase64(object.empty_child); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; + }, + toAmino(message: InnerSpec): InnerSpecAmino { + const obj: any = {}; + if (message.childOrder) { + obj.child_order = message.childOrder.map(e => e); + } else { + obj.child_order = message.childOrder; + } + obj.child_size = message.childSize === 0 ? undefined : message.childSize; + obj.min_prefix_length = message.minPrefixLength === 0 ? undefined : message.minPrefixLength; + obj.max_prefix_length = message.maxPrefixLength === 0 ? undefined : message.maxPrefixLength; + obj.empty_child = message.emptyChild ? base64FromBytes(message.emptyChild) : undefined; + obj.hash = message.hash === 0 ? undefined : message.hash; + return obj; + }, + fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { + return InnerSpec.fromAmino(object.value); + }, + fromProtoMsg(message: InnerSpecProtoMsg): InnerSpec { + return InnerSpec.decode(message.value); + }, + toProto(message: InnerSpec): Uint8Array { + return InnerSpec.encode(message).finish(); + }, + toProtoMsg(message: InnerSpec): InnerSpecProtoMsg { + return { + typeUrl: "/ics23.InnerSpec", + value: InnerSpec.encode(message).finish() + }; + } +}; +function createBaseBatchProof(): BatchProof { + return { + entries: [] + }; +} +export const BatchProof = { + typeUrl: "/ics23.BatchProof", + encode(message: BatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(BatchEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BatchProof { + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchProofAmino): BatchProof { + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchProof): BatchProofAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? BatchEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: BatchProofAminoMsg): BatchProof { + return BatchProof.fromAmino(object.value); + }, + fromProtoMsg(message: BatchProofProtoMsg): BatchProof { + return BatchProof.decode(message.value); + }, + toProto(message: BatchProof): Uint8Array { + return BatchProof.encode(message).finish(); + }, + toProtoMsg(message: BatchProof): BatchProofProtoMsg { + return { + typeUrl: "/ics23.BatchProof", + value: BatchProof.encode(message).finish() + }; + } +}; +function createBaseBatchEntry(): BatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const BatchEntry = { + typeUrl: "/ics23.BatchEntry", + encode(message: BatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BatchEntry { + const message = createBaseBatchEntry(); + message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? NonExistenceProof.fromPartial(object.nonexist) : undefined; + return message; + }, + fromAmino(object: BatchEntryAmino): BatchEntry { + const message = createBaseBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + return message; + }, + toAmino(message: BatchEntry): BatchEntryAmino { + const obj: any = {}; + obj.exist = message.exist ? ExistenceProof.toAmino(message.exist) : undefined; + obj.nonexist = message.nonexist ? NonExistenceProof.toAmino(message.nonexist) : undefined; + return obj; + }, + fromAminoMsg(object: BatchEntryAminoMsg): BatchEntry { + return BatchEntry.fromAmino(object.value); + }, + fromProtoMsg(message: BatchEntryProtoMsg): BatchEntry { + return BatchEntry.decode(message.value); + }, + toProto(message: BatchEntry): Uint8Array { + return BatchEntry.encode(message).finish(); + }, + toProtoMsg(message: BatchEntry): BatchEntryProtoMsg { + return { + typeUrl: "/ics23.BatchEntry", + value: BatchEntry.encode(message).finish() + }; + } +}; +function createBaseCompressedBatchProof(): CompressedBatchProof { + return { + entries: [], + lookupInners: [] + }; +} +export const CompressedBatchProof = { + typeUrl: "/ics23.CompressedBatchProof", + encode(message: CompressedBatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.lookupInners) { + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32())); + break; + case 2: + message.lookupInners.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedBatchProof { + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromPartial(e)) || []; + message.lookupInners = object.lookupInners?.map(e => InnerOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromAmino(e)) || []; + message.lookupInners = object.lookup_inners?.map(e => InnerOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: CompressedBatchProof): CompressedBatchProofAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? CompressedBatchEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + if (message.lookupInners) { + obj.lookup_inners = message.lookupInners.map(e => e ? InnerOp.toAmino(e) : undefined); + } else { + obj.lookup_inners = message.lookupInners; + } + return obj; + }, + fromAminoMsg(object: CompressedBatchProofAminoMsg): CompressedBatchProof { + return CompressedBatchProof.fromAmino(object.value); + }, + fromProtoMsg(message: CompressedBatchProofProtoMsg): CompressedBatchProof { + return CompressedBatchProof.decode(message.value); + }, + toProto(message: CompressedBatchProof): Uint8Array { + return CompressedBatchProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedBatchProof): CompressedBatchProofProtoMsg { + return { + typeUrl: "/ics23.CompressedBatchProof", + value: CompressedBatchProof.encode(message).finish() + }; + } +}; +function createBaseCompressedBatchEntry(): CompressedBatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const CompressedBatchEntry = { + typeUrl: "/ics23.CompressedBatchEntry", + encode(message: CompressedBatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry(); + message.exist = object.exist !== undefined && object.exist !== null ? CompressedExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? CompressedNonExistenceProof.fromPartial(object.nonexist) : undefined; + return message; + }, + fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromAmino(object.nonexist); + } + return message; + }, + toAmino(message: CompressedBatchEntry): CompressedBatchEntryAmino { + const obj: any = {}; + obj.exist = message.exist ? CompressedExistenceProof.toAmino(message.exist) : undefined; + obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toAmino(message.nonexist) : undefined; + return obj; + }, + fromAminoMsg(object: CompressedBatchEntryAminoMsg): CompressedBatchEntry { + return CompressedBatchEntry.fromAmino(object.value); + }, + fromProtoMsg(message: CompressedBatchEntryProtoMsg): CompressedBatchEntry { + return CompressedBatchEntry.decode(message.value); + }, + toProto(message: CompressedBatchEntry): Uint8Array { + return CompressedBatchEntry.encode(message).finish(); + }, + toProtoMsg(message: CompressedBatchEntry): CompressedBatchEntryProtoMsg { + return { + typeUrl: "/ics23.CompressedBatchEntry", + value: CompressedBatchEntry.encode(message).finish() + }; + } +}; +function createBaseCompressedExistenceProof(): CompressedExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const CompressedExistenceProof = { + typeUrl: "/ics23.CompressedExistenceProof", + encode(message: CompressedExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = object.leaf !== undefined && object.leaf !== null ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map(e => e) || []; + return message; + }, + fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => e) || []; + return message; + }, + toAmino(message: CompressedExistenceProof): CompressedExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + return obj; + }, + fromAminoMsg(object: CompressedExistenceProofAminoMsg): CompressedExistenceProof { + return CompressedExistenceProof.fromAmino(object.value); + }, + fromProtoMsg(message: CompressedExistenceProofProtoMsg): CompressedExistenceProof { + return CompressedExistenceProof.decode(message.value); + }, + toProto(message: CompressedExistenceProof): Uint8Array { + return CompressedExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedExistenceProof): CompressedExistenceProofProtoMsg { + return { + typeUrl: "/ics23.CompressedExistenceProof", + value: CompressedExistenceProof.encode(message).finish() + }; + } +}; +function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const CompressedNonExistenceProof = { + typeUrl: "/ics23.CompressedNonExistenceProof", + encode(message: CompressedNonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedNonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = object.left !== undefined && object.left !== null ? CompressedExistenceProof.fromPartial(object.left) : undefined; + message.right = object.right !== undefined && object.right !== null ? CompressedExistenceProof.fromPartial(object.right) : undefined; + return message; + }, + fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromAmino(object.right); + } + return message; + }, + toAmino(message: CompressedNonExistenceProof): CompressedNonExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.left = message.left ? CompressedExistenceProof.toAmino(message.left) : undefined; + obj.right = message.right ? CompressedExistenceProof.toAmino(message.right) : undefined; + return obj; + }, + fromAminoMsg(object: CompressedNonExistenceProofAminoMsg): CompressedNonExistenceProof { + return CompressedNonExistenceProof.fromAmino(object.value); + }, + fromProtoMsg(message: CompressedNonExistenceProofProtoMsg): CompressedNonExistenceProof { + return CompressedNonExistenceProof.decode(message.value); + }, + toProto(message: CompressedNonExistenceProof): Uint8Array { + return CompressedNonExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedNonExistenceProof): CompressedNonExistenceProofProtoMsg { + return { + typeUrl: "/ics23.CompressedNonExistenceProof", + value: CompressedNonExistenceProof.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/app/v1alpha1/module.ts b/dydxjs/packages/dydxjs/src/cosmos/app/v1alpha1/module.ts new file mode 100644 index 00000000..0c31640e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/app/v1alpha1/module.ts @@ -0,0 +1,455 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptor { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. Either go_import must be defined here + * or the go_package option must be defined at the file level to indicate + * to users where to location the module implementation. go_import takes + * precedence over go_package when both are defined. + */ + goImport: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + usePackage: PackageReference[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + canMigrateFrom: MigrateFromInfo[]; +} +export interface ModuleDescriptorProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor"; + value: Uint8Array; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorAmino { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. Either go_import must be defined here + * or the go_package option must be defined at the file level to indicate + * to users where to location the module implementation. go_import takes + * precedence over go_package when both are defined. + */ + go_import?: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + use_package?: PackageReferenceAmino[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + can_migrate_from?: MigrateFromInfoAmino[]; +} +export interface ModuleDescriptorAminoMsg { + type: "cosmos-sdk/ModuleDescriptor"; + value: ModuleDescriptorAmino; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorSDKType { + go_import: string; + use_package: PackageReferenceSDKType[]; + can_migrate_from: MigrateFromInfoSDKType[]; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReference { + /** name is the fully-qualified name of the package. */ + name: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its fields containing the + * test "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision: number; +} +export interface PackageReferenceProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.PackageReference"; + value: Uint8Array; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceAmino { + /** name is the fully-qualified name of the package. */ + name?: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its fields containing the + * test "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision?: number; +} +export interface PackageReferenceAminoMsg { + type: "cosmos-sdk/PackageReference"; + value: PackageReferenceAmino; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceSDKType { + name: string; + revision: number; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfo { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module: string; +} +export interface MigrateFromInfoProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo"; + value: Uint8Array; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoAmino { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module?: string; +} +export interface MigrateFromInfoAminoMsg { + type: "cosmos-sdk/MigrateFromInfo"; + value: MigrateFromInfoAmino; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoSDKType { + module: string; +} +function createBaseModuleDescriptor(): ModuleDescriptor { + return { + goImport: "", + usePackage: [], + canMigrateFrom: [] + }; +} +export const ModuleDescriptor = { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + encode(message: ModuleDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.goImport !== "") { + writer.uint32(10).string(message.goImport); + } + for (const v of message.usePackage) { + PackageReference.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.canMigrateFrom) { + MigrateFromInfo.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.goImport = reader.string(); + break; + case 2: + message.usePackage.push(PackageReference.decode(reader, reader.uint32())); + break; + case 3: + message.canMigrateFrom.push(MigrateFromInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + message.goImport = object.goImport ?? ""; + message.usePackage = object.usePackage?.map(e => PackageReference.fromPartial(e)) || []; + message.canMigrateFrom = object.canMigrateFrom?.map(e => MigrateFromInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleDescriptorAmino): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + if (object.go_import !== undefined && object.go_import !== null) { + message.goImport = object.go_import; + } + message.usePackage = object.use_package?.map(e => PackageReference.fromAmino(e)) || []; + message.canMigrateFrom = object.can_migrate_from?.map(e => MigrateFromInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModuleDescriptor): ModuleDescriptorAmino { + const obj: any = {}; + obj.go_import = message.goImport === "" ? undefined : message.goImport; + if (message.usePackage) { + obj.use_package = message.usePackage.map(e => e ? PackageReference.toAmino(e) : undefined); + } else { + obj.use_package = message.usePackage; + } + if (message.canMigrateFrom) { + obj.can_migrate_from = message.canMigrateFrom.map(e => e ? MigrateFromInfo.toAmino(e) : undefined); + } else { + obj.can_migrate_from = message.canMigrateFrom; + } + return obj; + }, + fromAminoMsg(object: ModuleDescriptorAminoMsg): ModuleDescriptor { + return ModuleDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ModuleDescriptor): ModuleDescriptorAminoMsg { + return { + type: "cosmos-sdk/ModuleDescriptor", + value: ModuleDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleDescriptorProtoMsg): ModuleDescriptor { + return ModuleDescriptor.decode(message.value); + }, + toProto(message: ModuleDescriptor): Uint8Array { + return ModuleDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ModuleDescriptor): ModuleDescriptorProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + value: ModuleDescriptor.encode(message).finish() + }; + } +}; +function createBasePackageReference(): PackageReference { + return { + name: "", + revision: 0 + }; +} +export const PackageReference = { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + encode(message: PackageReference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.revision !== 0) { + writer.uint32(16).uint32(message.revision); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PackageReference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePackageReference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.revision = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PackageReference { + const message = createBasePackageReference(); + message.name = object.name ?? ""; + message.revision = object.revision ?? 0; + return message; + }, + fromAmino(object: PackageReferenceAmino): PackageReference { + const message = createBasePackageReference(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.revision !== undefined && object.revision !== null) { + message.revision = object.revision; + } + return message; + }, + toAmino(message: PackageReference): PackageReferenceAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.revision = message.revision === 0 ? undefined : message.revision; + return obj; + }, + fromAminoMsg(object: PackageReferenceAminoMsg): PackageReference { + return PackageReference.fromAmino(object.value); + }, + toAminoMsg(message: PackageReference): PackageReferenceAminoMsg { + return { + type: "cosmos-sdk/PackageReference", + value: PackageReference.toAmino(message) + }; + }, + fromProtoMsg(message: PackageReferenceProtoMsg): PackageReference { + return PackageReference.decode(message.value); + }, + toProto(message: PackageReference): Uint8Array { + return PackageReference.encode(message).finish(); + }, + toProtoMsg(message: PackageReference): PackageReferenceProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + value: PackageReference.encode(message).finish() + }; + } +}; +function createBaseMigrateFromInfo(): MigrateFromInfo { + return { + module: "" + }; +} +export const MigrateFromInfo = { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + encode(message: MigrateFromInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.module !== "") { + writer.uint32(10).string(message.module); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrateFromInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateFromInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.module = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + message.module = object.module ?? ""; + return message; + }, + fromAmino(object: MigrateFromInfoAmino): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + return message; + }, + toAmino(message: MigrateFromInfo): MigrateFromInfoAmino { + const obj: any = {}; + obj.module = message.module === "" ? undefined : message.module; + return obj; + }, + fromAminoMsg(object: MigrateFromInfoAminoMsg): MigrateFromInfo { + return MigrateFromInfo.fromAmino(object.value); + }, + toAminoMsg(message: MigrateFromInfo): MigrateFromInfoAminoMsg { + return { + type: "cosmos-sdk/MigrateFromInfo", + value: MigrateFromInfo.toAmino(message) + }; + }, + fromProtoMsg(message: MigrateFromInfoProtoMsg): MigrateFromInfo { + return MigrateFromInfo.decode(message.value); + }, + toProto(message: MigrateFromInfo): Uint8Array { + return MigrateFromInfo.encode(message).finish(); + }, + toProtoMsg(message: MigrateFromInfo): MigrateFromInfoProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + value: MigrateFromInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/auth.ts b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 00000000..c66e90b5 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,425 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccount { + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; + address: string; + pubKey?: Any; + accountNumber: bigint; + sequence: bigint; +} +export interface BaseAccountProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount"; + value: Uint8Array; +} +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccountAmino { + address?: string; + pub_key?: AnyAmino; + account_number?: string; + sequence?: string; +} +export interface BaseAccountAminoMsg { + type: "cosmos-sdk/BaseAccount"; + value: BaseAccountAmino; +} +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccountSDKType { + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; + address: string; + pub_key?: AnySDKType; + account_number: bigint; + sequence: bigint; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccount { + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + baseAccount?: BaseAccount; + name: string; + permissions: string[]; +} +export interface ModuleAccountProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount"; + value: Uint8Array; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountAmino { + base_account?: BaseAccountAmino; + name?: string; + permissions?: string[]; +} +export interface ModuleAccountAminoMsg { + type: "cosmos-sdk/ModuleAccount"; + value: ModuleAccountAmino; +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountSDKType { + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + base_account?: BaseAccountSDKType; + name: string; + permissions: string[]; +} +/** Params defines the parameters for the auth module. */ +export interface Params { + maxMemoCharacters: bigint; + txSigLimit: bigint; + txSizeCostPerByte: bigint; + sigVerifyCostEd25519: bigint; + sigVerifyCostSecp256k1: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the auth module. */ +export interface ParamsAmino { + max_memo_characters?: string; + tx_sig_limit?: string; + tx_size_cost_per_byte?: string; + sig_verify_cost_ed25519?: string; + sig_verify_cost_secp256k1?: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the auth module. */ +export interface ParamsSDKType { + max_memo_characters: bigint; + tx_sig_limit: bigint; + tx_size_cost_per_byte: bigint; + sig_verify_cost_ed25519: bigint; + sig_verify_cost_secp256k1: bigint; +} +function createBaseBaseAccount(): BaseAccount { + return { + $typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + address: "", + pubKey: undefined, + accountNumber: BigInt(0), + sequence: BigInt(0) + }; +} +export const BaseAccount = { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + encode(message: BaseAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(32).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.accountNumber = reader.uint64(); + break; + case 4: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BaseAccount { + const message = createBaseBaseAccount(); + message.address = object.address ?? ""; + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BaseAccountAmino): BaseAccount { + const message = createBaseBaseAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: BaseAccount): BaseAccountAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { + return BaseAccount.fromAmino(object.value); + }, + toAminoMsg(message: BaseAccount): BaseAccountAminoMsg { + return { + type: "cosmos-sdk/BaseAccount", + value: BaseAccount.toAmino(message) + }; + }, + fromProtoMsg(message: BaseAccountProtoMsg): BaseAccount { + return BaseAccount.decode(message.value); + }, + toProto(message: BaseAccount): Uint8Array { + return BaseAccount.encode(message).finish(); + }, + toProtoMsg(message: BaseAccount): BaseAccountProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + value: BaseAccount.encode(message).finish() + }; + } +}; +function createBaseModuleAccount(): ModuleAccount { + return { + $typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + baseAccount: undefined, + name: "", + permissions: [] + }; +} +export const ModuleAccount = { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + encode(message: ModuleAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + for (const v of message.permissions) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleAccount { + const message = createBaseModuleAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.name = object.name ?? ""; + message.permissions = object.permissions?.map(e => e) || []; + return message; + }, + fromAmino(object: ModuleAccountAmino): ModuleAccount { + const message = createBaseModuleAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.permissions = object.permissions?.map(e => e) || []; + return message; + }, + toAmino(message: ModuleAccount): ModuleAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + obj.name = message.name === "" ? undefined : message.name; + if (message.permissions) { + obj.permissions = message.permissions.map(e => e); + } else { + obj.permissions = message.permissions; + } + return obj; + }, + fromAminoMsg(object: ModuleAccountAminoMsg): ModuleAccount { + return ModuleAccount.fromAmino(object.value); + }, + toAminoMsg(message: ModuleAccount): ModuleAccountAminoMsg { + return { + type: "cosmos-sdk/ModuleAccount", + value: ModuleAccount.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleAccountProtoMsg): ModuleAccount { + return ModuleAccount.decode(message.value); + }, + toProto(message: ModuleAccount): Uint8Array { + return ModuleAccount.encode(message).finish(); + }, + toProtoMsg(message: ModuleAccount): ModuleAccountProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + value: ModuleAccount.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + maxMemoCharacters: BigInt(0), + txSigLimit: BigInt(0), + txSizeCostPerByte: BigInt(0), + sigVerifyCostEd25519: BigInt(0), + sigVerifyCostSecp256k1: BigInt(0) + }; +} +export const Params = { + typeUrl: "/cosmos.auth.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxMemoCharacters !== BigInt(0)) { + writer.uint32(8).uint64(message.maxMemoCharacters); + } + if (message.txSigLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.txSigLimit); + } + if (message.txSizeCostPerByte !== BigInt(0)) { + writer.uint32(24).uint64(message.txSizeCostPerByte); + } + if (message.sigVerifyCostEd25519 !== BigInt(0)) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519); + } + if (message.sigVerifyCostSecp256k1 !== BigInt(0)) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxMemoCharacters = reader.uint64(); + break; + case 2: + message.txSigLimit = reader.uint64(); + break; + case 3: + message.txSizeCostPerByte = reader.uint64(); + break; + case 4: + message.sigVerifyCostEd25519 = reader.uint64(); + break; + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.maxMemoCharacters = object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null ? BigInt(object.maxMemoCharacters.toString()) : BigInt(0); + message.txSigLimit = object.txSigLimit !== undefined && object.txSigLimit !== null ? BigInt(object.txSigLimit.toString()) : BigInt(0); + message.txSizeCostPerByte = object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null ? BigInt(object.txSizeCostPerByte.toString()) : BigInt(0); + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null ? BigInt(object.sigVerifyCostEd25519.toString()) : BigInt(0); + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null ? BigInt(object.sigVerifyCostSecp256k1.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.max_memo_characters !== undefined && object.max_memo_characters !== null) { + message.maxMemoCharacters = BigInt(object.max_memo_characters); + } + if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { + message.txSigLimit = BigInt(object.tx_sig_limit); + } + if (object.tx_size_cost_per_byte !== undefined && object.tx_size_cost_per_byte !== null) { + message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); + } + if (object.sig_verify_cost_ed25519 !== undefined && object.sig_verify_cost_ed25519 !== null) { + message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); + } + if (object.sig_verify_cost_secp256k1 !== undefined && object.sig_verify_cost_secp256k1 !== null) { + message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.max_memo_characters = message.maxMemoCharacters !== BigInt(0) ? message.maxMemoCharacters.toString() : undefined; + obj.tx_sig_limit = message.txSigLimit !== BigInt(0) ? message.txSigLimit.toString() : undefined; + obj.tx_size_cost_per_byte = message.txSizeCostPerByte !== BigInt(0) ? message.txSizeCostPerByte.toString() : undefined; + obj.sig_verify_cost_ed25519 = message.sigVerifyCostEd25519 !== BigInt(0) ? message.sigVerifyCostEd25519.toString() : undefined; + obj.sig_verify_cost_secp256k1 = message.sigVerifyCostSecp256k1 !== BigInt(0) ? message.sigVerifyCostSecp256k1.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/genesis.ts new file mode 100644 index 00000000..ac99436c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/genesis.ts @@ -0,0 +1,114 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./auth"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the auth module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params: Params; + /** accounts are the accounts present at genesis. */ + accounts: Any[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the auth module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; + /** accounts are the accounts present at genesis. */ + accounts?: AnyAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the auth module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + accounts: AnySDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + accounts: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.auth.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.accounts) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.accounts.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.accounts = object.accounts?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..4a718e18 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/query.rpc.Query.ts @@ -0,0 +1,103 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Accounts returns all the existing accounts + * + * Since: cosmos-sdk 0.43 + */ + accounts(request?: QueryAccountsRequest): Promise; + /** Account returns account details based on address. */ + account(request: QueryAccountRequest): Promise; + /** Params queries all parameters. */ + params(request?: QueryParamsRequest): Promise; + /** ModuleAccounts returns all the existing module accounts. */ + moduleAccounts(request?: QueryModuleAccountsRequest): Promise; + /** Bech32 queries bech32Prefix */ + bech32Prefix(request?: Bech32PrefixRequest): Promise; + /** AddressBytesToString converts Account Address bytes to string */ + addressBytesToString(request: AddressBytesToStringRequest): Promise; + /** AddressStringToBytes converts Address string to bytes */ + addressStringToBytes(request: AddressStringToBytesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.accounts = this.accounts.bind(this); + this.account = this.account.bind(this); + this.params = this.params.bind(this); + this.moduleAccounts = this.moduleAccounts.bind(this); + this.bech32Prefix = this.bech32Prefix.bind(this); + this.addressBytesToString = this.addressBytesToString.bind(this); + this.addressStringToBytes = this.addressStringToBytes.bind(this); + } + accounts(request: QueryAccountsRequest = { + pagination: undefined + }): Promise { + const data = QueryAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data); + return promise.then(data => QueryAccountsResponse.decode(new BinaryReader(data))); + } + account(request: QueryAccountRequest): Promise { + const data = QueryAccountRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); + return promise.then(data => QueryAccountResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + moduleAccounts(request: QueryModuleAccountsRequest = {}): Promise { + const data = QueryModuleAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccounts", data); + return promise.then(data => QueryModuleAccountsResponse.decode(new BinaryReader(data))); + } + bech32Prefix(request: Bech32PrefixRequest = {}): Promise { + const data = Bech32PrefixRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Bech32Prefix", data); + return promise.then(data => Bech32PrefixResponse.decode(new BinaryReader(data))); + } + addressBytesToString(request: AddressBytesToStringRequest): Promise { + const data = AddressBytesToStringRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressBytesToString", data); + return promise.then(data => AddressBytesToStringResponse.decode(new BinaryReader(data))); + } + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + const data = AddressStringToBytesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressStringToBytes", data); + return promise.then(data => AddressStringToBytesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + accounts(request?: QueryAccountsRequest): Promise { + return queryService.accounts(request); + }, + account(request: QueryAccountRequest): Promise { + return queryService.account(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + moduleAccounts(request?: QueryModuleAccountsRequest): Promise { + return queryService.moduleAccounts(request); + }, + bech32Prefix(request?: Bech32PrefixRequest): Promise { + return queryService.bech32Prefix(request); + }, + addressBytesToString(request: AddressBytesToStringRequest): Promise { + return queryService.addressBytesToString(request); + }, + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + return queryService.addressStringToBytes(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/query.ts new file mode 100644 index 00000000..acf5c5b7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/auth/v1beta1/query.ts @@ -0,0 +1,1323 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountSDKType, ModuleAccount, ModuleAccountProtoMsg, ModuleAccountSDKType } from "./auth"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * QueryAccountsRequest is the request type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAccountsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; + value: Uint8Array; +} +/** + * QueryAccountsRequest is the request type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAccountsRequestAminoMsg { + type: "cosmos-sdk/QueryAccountsRequest"; + value: QueryAccountsRequestAmino; +} +/** + * QueryAccountsRequest is the request type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryAccountsResponse is the response type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsResponse { + /** accounts are the existing accounts */ + accounts: (BaseAccount | Any)[] | Any[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAccountsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; + value: Uint8Array; +} +export type QueryAccountsResponseEncoded = Omit & { + /** accounts are the existing accounts */accounts: (BaseAccountProtoMsg | AnyProtoMsg)[]; +}; +/** + * QueryAccountsResponse is the response type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsResponseAmino { + /** accounts are the existing accounts */ + accounts?: AnyAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAccountsResponseAminoMsg { + type: "cosmos-sdk/QueryAccountsResponse"; + value: QueryAccountsResponseAmino; +} +/** + * QueryAccountsResponse is the response type for the Query/Accounts RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryAccountsResponseSDKType { + accounts: (BaseAccountSDKType | AnySDKType)[]; + pagination?: PageResponseSDKType; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequest { + /** address defines the address to query for. */ + address: string; +} +export interface QueryAccountRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest"; + value: Uint8Array; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequestAmino { + /** address defines the address to query for. */ + address?: string; +} +export interface QueryAccountRequestAminoMsg { + type: "cosmos-sdk/QueryAccountRequest"; + value: QueryAccountRequestAmino; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequestSDKType { + address: string; +} +/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */ +export interface QueryModuleAccountsRequest {} +export interface QueryModuleAccountsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest"; + value: Uint8Array; +} +/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */ +export interface QueryModuleAccountsRequestAmino {} +export interface QueryModuleAccountsRequestAminoMsg { + type: "cosmos-sdk/QueryModuleAccountsRequest"; + value: QueryModuleAccountsRequestAmino; +} +/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */ +export interface QueryModuleAccountsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponse { + /** account defines the account of the corresponding address. */ + account?: BaseAccount | Any | undefined; +} +export interface QueryAccountResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse"; + value: Uint8Array; +} +export type QueryAccountResponseEncoded = Omit & { + /** account defines the account of the corresponding address. */account?: BaseAccountProtoMsg | AnyProtoMsg | undefined; +}; +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponseAmino { + /** account defines the account of the corresponding address. */ + account?: AnyAmino; +} +export interface QueryAccountResponseAminoMsg { + type: "cosmos-sdk/QueryAccountResponse"; + value: QueryAccountResponseAmino; +} +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponseSDKType { + account?: BaseAccountSDKType | AnySDKType | undefined; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +export interface QueryModuleAccountsResponse { + accounts: (ModuleAccount | Any)[] | Any[]; +} +export interface QueryModuleAccountsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse"; + value: Uint8Array; +} +export type QueryModuleAccountsResponseEncoded = Omit & { + accounts: (ModuleAccountProtoMsg | AnyProtoMsg)[]; +}; +/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +export interface QueryModuleAccountsResponseAmino { + accounts?: AnyAmino[]; +} +export interface QueryModuleAccountsResponseAminoMsg { + type: "cosmos-sdk/QueryModuleAccountsResponse"; + value: QueryModuleAccountsResponseAmino; +} +/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +export interface QueryModuleAccountsResponseSDKType { + accounts: (ModuleAccountSDKType | AnySDKType)[]; +} +/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */ +export interface Bech32PrefixRequest {} +export interface Bech32PrefixRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest"; + value: Uint8Array; +} +/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */ +export interface Bech32PrefixRequestAmino {} +export interface Bech32PrefixRequestAminoMsg { + type: "cosmos-sdk/Bech32PrefixRequest"; + value: Bech32PrefixRequestAmino; +} +/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */ +export interface Bech32PrefixRequestSDKType {} +/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ +export interface Bech32PrefixResponse { + bech32Prefix: string; +} +export interface Bech32PrefixResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse"; + value: Uint8Array; +} +/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ +export interface Bech32PrefixResponseAmino { + bech32_prefix?: string; +} +export interface Bech32PrefixResponseAminoMsg { + type: "cosmos-sdk/Bech32PrefixResponse"; + value: Bech32PrefixResponseAmino; +} +/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ +export interface Bech32PrefixResponseSDKType { + bech32_prefix: string; +} +/** AddressBytesToStringRequest is the request type for AddressString rpc method */ +export interface AddressBytesToStringRequest { + addressBytes: Uint8Array; +} +export interface AddressBytesToStringRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest"; + value: Uint8Array; +} +/** AddressBytesToStringRequest is the request type for AddressString rpc method */ +export interface AddressBytesToStringRequestAmino { + address_bytes?: string; +} +export interface AddressBytesToStringRequestAminoMsg { + type: "cosmos-sdk/AddressBytesToStringRequest"; + value: AddressBytesToStringRequestAmino; +} +/** AddressBytesToStringRequest is the request type for AddressString rpc method */ +export interface AddressBytesToStringRequestSDKType { + address_bytes: Uint8Array; +} +/** AddressBytesToStringResponse is the response type for AddressString rpc method */ +export interface AddressBytesToStringResponse { + addressString: string; +} +export interface AddressBytesToStringResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse"; + value: Uint8Array; +} +/** AddressBytesToStringResponse is the response type for AddressString rpc method */ +export interface AddressBytesToStringResponseAmino { + address_string?: string; +} +export interface AddressBytesToStringResponseAminoMsg { + type: "cosmos-sdk/AddressBytesToStringResponse"; + value: AddressBytesToStringResponseAmino; +} +/** AddressBytesToStringResponse is the response type for AddressString rpc method */ +export interface AddressBytesToStringResponseSDKType { + address_string: string; +} +/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */ +export interface AddressStringToBytesRequest { + addressString: string; +} +export interface AddressStringToBytesRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest"; + value: Uint8Array; +} +/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */ +export interface AddressStringToBytesRequestAmino { + address_string?: string; +} +export interface AddressStringToBytesRequestAminoMsg { + type: "cosmos-sdk/AddressStringToBytesRequest"; + value: AddressStringToBytesRequestAmino; +} +/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */ +export interface AddressStringToBytesRequestSDKType { + address_string: string; +} +/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */ +export interface AddressStringToBytesResponse { + addressBytes: Uint8Array; +} +export interface AddressStringToBytesResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse"; + value: Uint8Array; +} +/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */ +export interface AddressStringToBytesResponseAmino { + address_bytes?: string; +} +export interface AddressStringToBytesResponseAminoMsg { + type: "cosmos-sdk/AddressStringToBytesResponse"; + value: AddressStringToBytesResponseAmino; +} +/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */ +export interface AddressStringToBytesResponseSDKType { + address_bytes: Uint8Array; +} +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { + pagination: undefined + }; +} +export const QueryAccountsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest", + encode(message: QueryAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountsRequestAmino): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountsRequest): QueryAccountsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountsRequestAminoMsg): QueryAccountsRequest { + return QueryAccountsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountsRequest): QueryAccountsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountsRequest", + value: QueryAccountsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountsRequestProtoMsg): QueryAccountsRequest { + return QueryAccountsRequest.decode(message.value); + }, + toProto(message: QueryAccountsRequest): Uint8Array { + return QueryAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountsRequest): QueryAccountsRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest", + value: QueryAccountsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountsResponse(): QueryAccountsResponse { + return { + accounts: [], + pagination: undefined + }; +} +export const QueryAccountsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", + encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + Any.encode(v! as Any, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(Any.decode(reader, reader.uint32()) as Any); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => Cosmos_authAccountI_FromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? Cosmos_authAccountI_ToAmino(e as Any) : undefined); + } else { + obj.accounts = message.accounts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountsResponseAminoMsg): QueryAccountsResponse { + return QueryAccountsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountsResponse): QueryAccountsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountsResponse", + value: QueryAccountsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountsResponseProtoMsg): QueryAccountsResponse { + return QueryAccountsResponse.decode(message.value); + }, + toProto(message: QueryAccountsResponse): Uint8Array { + return QueryAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountsResponse): QueryAccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", + value: QueryAccountsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountRequest(): QueryAccountRequest { + return { + address: "" + }; +} +export const QueryAccountRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest", + encode(message: QueryAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountRequest { + const message = createBaseQueryAccountRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest { + const message = createBaseQueryAccountRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountRequest): QueryAccountRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountRequestAminoMsg): QueryAccountRequest { + return QueryAccountRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountRequest): QueryAccountRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountRequest", + value: QueryAccountRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountRequestProtoMsg): QueryAccountRequest { + return QueryAccountRequest.decode(message.value); + }, + toProto(message: QueryAccountRequest): Uint8Array { + return QueryAccountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountRequest): QueryAccountRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest", + value: QueryAccountRequest.encode(message).finish() + }; + } +}; +function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { + return {}; +} +export const QueryModuleAccountsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + encode(_: QueryModuleAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, + fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, + toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountsRequestAminoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountsRequestProtoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.decode(message.value); + }, + toProto(message: QueryModuleAccountsRequest): Uint8Array { + return QueryModuleAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountResponse(): QueryAccountResponse { + return { + account: undefined + }; +} +export const QueryAccountResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode(message.account as Any, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = Cosmos_authAccountI_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + message.account = object.account !== undefined && object.account !== null ? Any.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = Cosmos_authAccountI_FromAmino(object.account); + } + return message; + }, + toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { + const obj: any = {}; + obj.account = message.account ? Cosmos_authAccountI_ToAmino(message.account as Any) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse { + return QueryAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountResponse): QueryAccountResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountResponse", + value: QueryAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse { + return QueryAccountResponse.decode(message.value); + }, + toProto(message: QueryAccountResponse): Uint8Array { + return QueryAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountResponse): QueryAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + value: QueryAccountResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { + return { + accounts: [] + }; +} +export const QueryModuleAccountsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + Any.encode(v! as Any, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(Any.decode(reader, reader.uint32()) as Any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => Cosmos_authModuleAccountI_FromAmino(e)) || []; + return message; + }, + toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? Cosmos_authModuleAccountI_ToAmino(e as Any) : undefined); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: QueryModuleAccountsResponseAminoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountsResponseProtoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.decode(message.value); + }, + toProto(message: QueryModuleAccountsResponse): Uint8Array { + return QueryModuleAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.encode(message).finish() + }; + } +}; +function createBaseBech32PrefixRequest(): Bech32PrefixRequest { + return {}; +} +export const Bech32PrefixRequest = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + encode(_: Bech32PrefixRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + fromAmino(_: Bech32PrefixRequestAmino): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + toAmino(_: Bech32PrefixRequest): Bech32PrefixRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Bech32PrefixRequestAminoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixRequest", + value: Bech32PrefixRequest.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixRequestProtoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.decode(message.value); + }, + toProto(message: Bech32PrefixRequest): Uint8Array { + return Bech32PrefixRequest.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + value: Bech32PrefixRequest.encode(message).finish() + }; + } +}; +function createBaseBech32PrefixResponse(): Bech32PrefixResponse { + return { + bech32Prefix: "" + }; +} +export const Bech32PrefixResponse = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + encode(message: Bech32PrefixResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bech32Prefix !== "") { + writer.uint32(10).string(message.bech32Prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bech32Prefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + message.bech32Prefix = object.bech32Prefix ?? ""; + return message; + }, + fromAmino(object: Bech32PrefixResponseAmino): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + if (object.bech32_prefix !== undefined && object.bech32_prefix !== null) { + message.bech32Prefix = object.bech32_prefix; + } + return message; + }, + toAmino(message: Bech32PrefixResponse): Bech32PrefixResponseAmino { + const obj: any = {}; + obj.bech32_prefix = message.bech32Prefix === "" ? undefined : message.bech32Prefix; + return obj; + }, + fromAminoMsg(object: Bech32PrefixResponseAminoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixResponse", + value: Bech32PrefixResponse.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixResponseProtoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.decode(message.value); + }, + toProto(message: Bech32PrefixResponse): Uint8Array { + return Bech32PrefixResponse.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + value: Bech32PrefixResponse.encode(message).finish() + }; + } +}; +function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressBytesToStringRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + encode(message: AddressBytesToStringRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressBytesToStringRequestAmino): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressBytesToStringRequest): AddressBytesToStringRequestAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringRequestAminoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringRequest", + value: AddressBytesToStringRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringRequestProtoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.decode(message.value); + }, + toProto(message: AddressBytesToStringRequest): Uint8Array { + return AddressBytesToStringRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + value: AddressBytesToStringRequest.encode(message).finish() + }; + } +}; +function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse { + return { + addressString: "" + }; +} +export const AddressBytesToStringResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + encode(message: AddressBytesToStringResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressBytesToStringResponseAmino): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressBytesToStringResponse): AddressBytesToStringResponseAmino { + const obj: any = {}; + obj.address_string = message.addressString === "" ? undefined : message.addressString; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringResponseAminoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringResponse", + value: AddressBytesToStringResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringResponseProtoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.decode(message.value); + }, + toProto(message: AddressBytesToStringResponse): Uint8Array { + return AddressBytesToStringResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + value: AddressBytesToStringResponse.encode(message).finish() + }; + } +}; +function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { + return { + addressString: "" + }; +} +export const AddressStringToBytesRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + encode(message: AddressStringToBytesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressStringToBytesRequestAmino): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressStringToBytesRequest): AddressStringToBytesRequestAmino { + const obj: any = {}; + obj.address_string = message.addressString === "" ? undefined : message.addressString; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesRequestAminoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesRequest", + value: AddressStringToBytesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesRequestProtoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.decode(message.value); + }, + toProto(message: AddressStringToBytesRequest): Uint8Array { + return AddressStringToBytesRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + value: AddressStringToBytesRequest.encode(message).finish() + }; + } +}; +function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressStringToBytesResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + encode(message: AddressStringToBytesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressStringToBytesResponseAmino): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressStringToBytesResponse): AddressStringToBytesResponseAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesResponseAminoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesResponse", + value: AddressStringToBytesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesResponseProtoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.decode(message.value); + }, + toProto(message: AddressStringToBytesResponse): Uint8Array { + return AddressStringToBytesResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + value: AddressStringToBytesResponse.encode(message).finish() + }; + } +}; +export const Cosmos_authAccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BaseAccount | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.auth.v1beta1.BaseAccount": + return BaseAccount.decode(data.value); + default: + return data; + } +}; +export const Cosmos_authAccountI_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/BaseAccount": + return Any.fromPartial({ + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + value: BaseAccount.encode(BaseAccount.fromPartial(BaseAccount.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_authAccountI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.auth.v1beta1.BaseAccount": + return { + type: "cosmos-sdk/BaseAccount", + value: BaseAccount.toAmino(BaseAccount.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; +export const Cosmos_authModuleAccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): ModuleAccount | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.auth.v1beta1.ModuleAccount": + return ModuleAccount.decode(data.value); + default: + return data; + } +}; +export const Cosmos_authModuleAccountI_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/ModuleAccount": + return Any.fromPartial({ + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + value: ModuleAccount.encode(ModuleAccount.fromPartial(ModuleAccount.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_authModuleAccountI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.auth.v1beta1.ModuleAccount": + return { + type: "cosmos-sdk/ModuleAccount", + value: ModuleAccount.toAmino(ModuleAccount.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/authz.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/authz.ts new file mode 100644 index 00000000..846d048d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/authz.ts @@ -0,0 +1,556 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { SendAuthorization, SendAuthorizationProtoMsg, SendAuthorizationSDKType } from "../../bank/v1beta1/authz"; +import { StakeAuthorization, StakeAuthorizationProtoMsg, StakeAuthorizationSDKType } from "../../staking/v1beta1/authz"; +import { ContractExecutionAuthorization, ContractExecutionAuthorizationProtoMsg, ContractExecutionAuthorizationSDKType, ContractMigrationAuthorization, ContractMigrationAuthorizationProtoMsg, ContractMigrationAuthorizationSDKType } from "../../../cosmwasm/wasm/v1/authz"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorization { + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg: string; +} +export interface GenericAuthorizationProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization"; + value: Uint8Array; +} +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorizationAmino { + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg?: string; +} +export interface GenericAuthorizationAminoMsg { + type: "cosmos-sdk/GenericAuthorization"; + value: GenericAuthorizationAmino; +} +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorizationSDKType { + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; + msg: string; +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface Grant { + authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | Any | undefined; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ + expiration?: Date; +} +export interface GrantProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.Grant"; + value: Uint8Array; +} +export type GrantEncoded = Omit & { + authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | AnyProtoMsg | undefined; +}; +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface GrantAmino { + authorization?: AnyAmino; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ + expiration?: string; +} +export interface GrantAminoMsg { + type: "cosmos-sdk/Grant"; + value: GrantAmino; +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface GrantSDKType { + authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | ContractExecutionAuthorizationSDKType | ContractMigrationAuthorizationSDKType | AnySDKType | undefined; + expiration?: Date; +} +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorization { + granter: string; + grantee: string; + authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | Any | undefined; + expiration?: Date; +} +export interface GrantAuthorizationProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; + value: Uint8Array; +} +export type GrantAuthorizationEncoded = Omit & { + authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | AnyProtoMsg | undefined; +}; +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorizationAmino { + granter?: string; + grantee?: string; + authorization?: AnyAmino; + expiration?: string; +} +export interface GrantAuthorizationAminoMsg { + type: "cosmos-sdk/GrantAuthorization"; + value: GrantAuthorizationAmino; +} +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorizationSDKType { + granter: string; + grantee: string; + authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | ContractExecutionAuthorizationSDKType | ContractMigrationAuthorizationSDKType | AnySDKType | undefined; + expiration?: Date; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItem { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msgTypeUrls: string[]; +} +export interface GrantQueueItemProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem"; + value: Uint8Array; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemAmino { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msg_type_urls?: string[]; +} +export interface GrantQueueItemAminoMsg { + type: "cosmos-sdk/GrantQueueItem"; + value: GrantQueueItemAmino; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemSDKType { + msg_type_urls: string[]; +} +function createBaseGenericAuthorization(): GenericAuthorization { + return { + $typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + msg: "" + }; +} +export const GenericAuthorization = { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + encode(message: GenericAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msg !== "") { + writer.uint32(10).string(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenericAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenericAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msg = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenericAuthorization { + const message = createBaseGenericAuthorization(); + message.msg = object.msg ?? ""; + return message; + }, + fromAmino(object: GenericAuthorizationAmino): GenericAuthorization { + const message = createBaseGenericAuthorization(); + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } + return message; + }, + toAmino(message: GenericAuthorization): GenericAuthorizationAmino { + const obj: any = {}; + obj.msg = message.msg === "" ? undefined : message.msg; + return obj; + }, + fromAminoMsg(object: GenericAuthorizationAminoMsg): GenericAuthorization { + return GenericAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: GenericAuthorization): GenericAuthorizationAminoMsg { + return { + type: "cosmos-sdk/GenericAuthorization", + value: GenericAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: GenericAuthorizationProtoMsg): GenericAuthorization { + return GenericAuthorization.decode(message.value); + }, + toProto(message: GenericAuthorization): Uint8Array { + return GenericAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GenericAuthorization): GenericAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + value: GenericAuthorization.encode(message).finish() + }; + } +}; +function createBaseGrant(): Grant { + return { + authorization: undefined, + expiration: undefined + }; +} +export const Grant = { + typeUrl: "/cosmos.authz.v1beta1.Grant", + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authorization !== undefined) { + Any.encode(message.authorization as Any, writer.uint32(10).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorization = Cosmos_authzAuthorization_InterfaceDecoder(reader) as Any; + break; + case 2: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Grant { + const message = createBaseGrant(); + message.authorization = object.authorization !== undefined && object.authorization !== null ? Any.fromPartial(object.authorization) : undefined; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: GrantAmino): Grant { + const message = createBaseGrant(); + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = Cosmos_authzAuthorization_FromAmino(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: Grant): GrantAmino { + const obj: any = {}; + obj.authorization = message.authorization ? Cosmos_authzAuthorization_ToAmino(message.authorization as Any) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAminoMsg): Grant { + return Grant.fromAmino(object.value); + }, + toAminoMsg(message: Grant): GrantAminoMsg { + return { + type: "cosmos-sdk/Grant", + value: Grant.toAmino(message) + }; + }, + fromProtoMsg(message: GrantProtoMsg): Grant { + return Grant.decode(message.value); + }, + toProto(message: Grant): Uint8Array { + return Grant.encode(message).finish(); + }, + toProtoMsg(message: Grant): GrantProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.Grant", + value: Grant.encode(message).finish() + }; + } +}; +function createBaseGrantAuthorization(): GrantAuthorization { + return { + granter: "", + grantee: "", + authorization: undefined, + expiration: undefined + }; +} +export const GrantAuthorization = { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization", + encode(message: GrantAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.authorization !== undefined) { + Any.encode(message.authorization as Any, writer.uint32(26).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.authorization = Cosmos_authzAuthorization_InterfaceDecoder(reader) as Any; + break; + case 4: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GrantAuthorization { + const message = createBaseGrantAuthorization(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.authorization = object.authorization !== undefined && object.authorization !== null ? Any.fromPartial(object.authorization) : undefined; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { + const message = createBaseGrantAuthorization(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = Cosmos_authzAuthorization_FromAmino(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: GrantAuthorization): GrantAuthorizationAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.authorization = message.authorization ? Cosmos_authzAuthorization_ToAmino(message.authorization as Any) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { + return GrantAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: GrantAuthorization): GrantAuthorizationAminoMsg { + return { + type: "cosmos-sdk/GrantAuthorization", + value: GrantAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { + return GrantAuthorization.decode(message.value); + }, + toProto(message: GrantAuthorization): Uint8Array { + return GrantAuthorization.encode(message).finish(); + }, + toProtoMsg(message: GrantAuthorization): GrantAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization", + value: GrantAuthorization.encode(message).finish() + }; + } +}; +function createBaseGrantQueueItem(): GrantQueueItem { + return { + msgTypeUrls: [] + }; +} +export const GrantQueueItem = { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + encode(message: GrantQueueItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.msgTypeUrls) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantQueueItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantQueueItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msgTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantQueueItemAmino): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: GrantQueueItem): GrantQueueItemAmino { + const obj: any = {}; + if (message.msgTypeUrls) { + obj.msg_type_urls = message.msgTypeUrls.map(e => e); + } else { + obj.msg_type_urls = message.msgTypeUrls; + } + return obj; + }, + fromAminoMsg(object: GrantQueueItemAminoMsg): GrantQueueItem { + return GrantQueueItem.fromAmino(object.value); + }, + toAminoMsg(message: GrantQueueItem): GrantQueueItemAminoMsg { + return { + type: "cosmos-sdk/GrantQueueItem", + value: GrantQueueItem.toAmino(message) + }; + }, + fromProtoMsg(message: GrantQueueItemProtoMsg): GrantQueueItem { + return GrantQueueItem.decode(message.value); + }, + toProto(message: GrantQueueItem): Uint8Array { + return GrantQueueItem.encode(message).finish(); + }, + toProtoMsg(message: GrantQueueItem): GrantQueueItemProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + value: GrantQueueItem.encode(message).finish() + }; + } +}; +export const Cosmos_authzAuthorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): GenericAuthorization | SendAuthorization | StakeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.authz.v1beta1.GenericAuthorization": + return GenericAuthorization.decode(data.value); + case "/cosmos.bank.v1beta1.SendAuthorization": + return SendAuthorization.decode(data.value); + case "/cosmos.staking.v1beta1.StakeAuthorization": + return StakeAuthorization.decode(data.value); + case "/cosmwasm.wasm.v1.ContractExecutionAuthorization": + return ContractExecutionAuthorization.decode(data.value); + case "/cosmwasm.wasm.v1.ContractMigrationAuthorization": + return ContractMigrationAuthorization.decode(data.value); + default: + return data; + } +}; +export const Cosmos_authzAuthorization_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/GenericAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + value: GenericAuthorization.encode(GenericAuthorization.fromPartial(GenericAuthorization.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/SendAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", + value: SendAuthorization.encode(SendAuthorization.fromPartial(SendAuthorization.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/StakeAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", + value: StakeAuthorization.encode(StakeAuthorization.fromPartial(StakeAuthorization.fromAmino(content.value))).finish() + }); + case "wasm/ContractExecutionAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", + value: ContractExecutionAuthorization.encode(ContractExecutionAuthorization.fromPartial(ContractExecutionAuthorization.fromAmino(content.value))).finish() + }); + case "wasm/ContractMigrationAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", + value: ContractMigrationAuthorization.encode(ContractMigrationAuthorization.fromPartial(ContractMigrationAuthorization.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_authzAuthorization_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.authz.v1beta1.GenericAuthorization": + return { + type: "cosmos-sdk/GenericAuthorization", + value: GenericAuthorization.toAmino(GenericAuthorization.decode(content.value, undefined)) + }; + case "/cosmos.bank.v1beta1.SendAuthorization": + return { + type: "cosmos-sdk/SendAuthorization", + value: SendAuthorization.toAmino(SendAuthorization.decode(content.value, undefined)) + }; + case "/cosmos.staking.v1beta1.StakeAuthorization": + return { + type: "cosmos-sdk/StakeAuthorization", + value: StakeAuthorization.toAmino(StakeAuthorization.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ContractExecutionAuthorization": + return { + type: "wasm/ContractExecutionAuthorization", + value: ContractExecutionAuthorization.toAmino(ContractExecutionAuthorization.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ContractMigrationAuthorization": + return { + type: "wasm/ContractMigrationAuthorization", + value: ContractMigrationAuthorization.toAmino(ContractMigrationAuthorization.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/event.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/event.ts new file mode 100644 index 00000000..b459989a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/event.ts @@ -0,0 +1,252 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** EventGrant is emitted on Msg/Grant */ +export interface EventGrant { + /** Msg type URL for which an autorization is granted */ + msgTypeUrl: string; + /** Granter account address */ + granter: string; + /** Grantee account address */ + grantee: string; +} +export interface EventGrantProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.EventGrant"; + value: Uint8Array; +} +/** EventGrant is emitted on Msg/Grant */ +export interface EventGrantAmino { + /** Msg type URL for which an autorization is granted */ + msg_type_url?: string; + /** Granter account address */ + granter?: string; + /** Grantee account address */ + grantee?: string; +} +export interface EventGrantAminoMsg { + type: "cosmos-sdk/EventGrant"; + value: EventGrantAmino; +} +/** EventGrant is emitted on Msg/Grant */ +export interface EventGrantSDKType { + msg_type_url: string; + granter: string; + grantee: string; +} +/** EventRevoke is emitted on Msg/Revoke */ +export interface EventRevoke { + /** Msg type URL for which an autorization is revoked */ + msgTypeUrl: string; + /** Granter account address */ + granter: string; + /** Grantee account address */ + grantee: string; +} +export interface EventRevokeProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.EventRevoke"; + value: Uint8Array; +} +/** EventRevoke is emitted on Msg/Revoke */ +export interface EventRevokeAmino { + /** Msg type URL for which an autorization is revoked */ + msg_type_url?: string; + /** Granter account address */ + granter?: string; + /** Grantee account address */ + grantee?: string; +} +export interface EventRevokeAminoMsg { + type: "cosmos-sdk/EventRevoke"; + value: EventRevokeAmino; +} +/** EventRevoke is emitted on Msg/Revoke */ +export interface EventRevokeSDKType { + msg_type_url: string; + granter: string; + grantee: string; +} +function createBaseEventGrant(): EventGrant { + return { + msgTypeUrl: "", + granter: "", + grantee: "" + }; +} +export const EventGrant = { + typeUrl: "/cosmos.authz.v1beta1.EventGrant", + encode(message: EventGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgTypeUrl !== "") { + writer.uint32(18).string(message.msgTypeUrl); + } + if (message.granter !== "") { + writer.uint32(26).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(34).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.msgTypeUrl = reader.string(); + break; + case 3: + message.granter = reader.string(); + break; + case 4: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventGrant { + const message = createBaseEventGrant(); + message.msgTypeUrl = object.msgTypeUrl ?? ""; + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: EventGrantAmino): EventGrant { + const message = createBaseEventGrant(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: EventGrant): EventGrantAmino { + const obj: any = {}; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: EventGrantAminoMsg): EventGrant { + return EventGrant.fromAmino(object.value); + }, + toAminoMsg(message: EventGrant): EventGrantAminoMsg { + return { + type: "cosmos-sdk/EventGrant", + value: EventGrant.toAmino(message) + }; + }, + fromProtoMsg(message: EventGrantProtoMsg): EventGrant { + return EventGrant.decode(message.value); + }, + toProto(message: EventGrant): Uint8Array { + return EventGrant.encode(message).finish(); + }, + toProtoMsg(message: EventGrant): EventGrantProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.EventGrant", + value: EventGrant.encode(message).finish() + }; + } +}; +function createBaseEventRevoke(): EventRevoke { + return { + msgTypeUrl: "", + granter: "", + grantee: "" + }; +} +export const EventRevoke = { + typeUrl: "/cosmos.authz.v1beta1.EventRevoke", + encode(message: EventRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgTypeUrl !== "") { + writer.uint32(18).string(message.msgTypeUrl); + } + if (message.granter !== "") { + writer.uint32(26).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(34).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventRevoke(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.msgTypeUrl = reader.string(); + break; + case 3: + message.granter = reader.string(); + break; + case 4: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventRevoke { + const message = createBaseEventRevoke(); + message.msgTypeUrl = object.msgTypeUrl ?? ""; + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: EventRevokeAmino): EventRevoke { + const message = createBaseEventRevoke(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: EventRevoke): EventRevokeAmino { + const obj: any = {}; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: EventRevokeAminoMsg): EventRevoke { + return EventRevoke.fromAmino(object.value); + }, + toAminoMsg(message: EventRevoke): EventRevokeAminoMsg { + return { + type: "cosmos-sdk/EventRevoke", + value: EventRevoke.toAmino(message) + }; + }, + fromProtoMsg(message: EventRevokeProtoMsg): EventRevoke { + return EventRevoke.decode(message.value); + }, + toProto(message: EventRevoke): Uint8Array { + return EventRevoke.encode(message).finish(); + }, + toProtoMsg(message: EventRevoke): EventRevokeProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.EventRevoke", + value: EventRevoke.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/genesis.ts new file mode 100644 index 00000000..f5ca9e5e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/genesis.ts @@ -0,0 +1,94 @@ +//@ts-nocheck +import { GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the authz module's genesis state. */ +export interface GenesisState { + authorization: GrantAuthorization[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the authz module's genesis state. */ +export interface GenesisStateAmino { + authorization?: GrantAuthorizationAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the authz module's genesis state. */ +export interface GenesisStateSDKType { + authorization: GrantAuthorizationSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + authorization: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.authz.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.authorization) { + GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorization.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.authorization = object.authorization?.map(e => GrantAuthorization.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.authorization = object.authorization?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.authorization) { + obj.authorization = message.authorization.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.authorization = message.authorization; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..30d70e94 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/query.rpc.Query.ts @@ -0,0 +1,61 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Returns list of `Authorization`, granted to the grantee by the granter. */ + grants(request: QueryGrantsRequest): Promise; + /** + * GranterGrants returns list of `GrantAuthorization`, granted by granter. + * + * Since: cosmos-sdk 0.46 + */ + granterGrants(request: QueryGranterGrantsRequest): Promise; + /** + * GranteeGrants returns a list of `GrantAuthorization` by grantee. + * + * Since: cosmos-sdk 0.46 + */ + granteeGrants(request: QueryGranteeGrantsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.grants = this.grants.bind(this); + this.granterGrants = this.granterGrants.bind(this); + this.granteeGrants = this.granteeGrants.bind(this); + } + grants(request: QueryGrantsRequest): Promise { + const data = QueryGrantsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "Grants", data); + return promise.then(data => QueryGrantsResponse.decode(new BinaryReader(data))); + } + granterGrants(request: QueryGranterGrantsRequest): Promise { + const data = QueryGranterGrantsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranterGrants", data); + return promise.then(data => QueryGranterGrantsResponse.decode(new BinaryReader(data))); + } + granteeGrants(request: QueryGranteeGrantsRequest): Promise { + const data = QueryGranteeGrantsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranteeGrants", data); + return promise.then(data => QueryGranteeGrantsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + grants(request: QueryGrantsRequest): Promise { + return queryService.grants(request); + }, + granterGrants(request: QueryGranterGrantsRequest): Promise { + return queryService.granterGrants(request); + }, + granteeGrants(request: QueryGranteeGrantsRequest): Promise { + return queryService.granteeGrants(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/query.ts new file mode 100644 index 00000000..f1459d3f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/query.ts @@ -0,0 +1,684 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Grant, GrantAmino, GrantSDKType, GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ +export interface QueryGrantsRequest { + granter: string; + grantee: string; + /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ + msgTypeUrl: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGrantsRequestProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest"; + value: Uint8Array; +} +/** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ +export interface QueryGrantsRequestAmino { + granter?: string; + grantee?: string; + /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ + msg_type_url?: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGrantsRequestAminoMsg { + type: "cosmos-sdk/QueryGrantsRequest"; + value: QueryGrantsRequestAmino; +} +/** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ +export interface QueryGrantsRequestSDKType { + granter: string; + grantee: string; + msg_type_url: string; + pagination?: PageRequestSDKType; +} +/** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ +export interface QueryGrantsResponse { + /** authorizations is a list of grants granted for grantee by granter. */ + grants: Grant[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} +export interface QueryGrantsResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse"; + value: Uint8Array; +} +/** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ +export interface QueryGrantsResponseAmino { + /** authorizations is a list of grants granted for grantee by granter. */ + grants?: GrantAmino[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGrantsResponseAminoMsg { + type: "cosmos-sdk/QueryGrantsResponse"; + value: QueryGrantsResponseAmino; +} +/** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ +export interface QueryGrantsResponseSDKType { + grants: GrantSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ +export interface QueryGranterGrantsRequest { + granter: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGranterGrantsRequestProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest"; + value: Uint8Array; +} +/** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ +export interface QueryGranterGrantsRequestAmino { + granter?: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGranterGrantsRequestAminoMsg { + type: "cosmos-sdk/QueryGranterGrantsRequest"; + value: QueryGranterGrantsRequestAmino; +} +/** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ +export interface QueryGranterGrantsRequestSDKType { + granter: string; + pagination?: PageRequestSDKType; +} +/** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ +export interface QueryGranterGrantsResponse { + /** grants is a list of grants granted by the granter. */ + grants: GrantAuthorization[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} +export interface QueryGranterGrantsResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse"; + value: Uint8Array; +} +/** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ +export interface QueryGranterGrantsResponseAmino { + /** grants is a list of grants granted by the granter. */ + grants?: GrantAuthorizationAmino[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGranterGrantsResponseAminoMsg { + type: "cosmos-sdk/QueryGranterGrantsResponse"; + value: QueryGranterGrantsResponseAmino; +} +/** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ +export interface QueryGranterGrantsResponseSDKType { + grants: GrantAuthorizationSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ +export interface QueryGranteeGrantsRequest { + grantee: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGranteeGrantsRequestProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest"; + value: Uint8Array; +} +/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ +export interface QueryGranteeGrantsRequestAmino { + grantee?: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGranteeGrantsRequestAminoMsg { + type: "cosmos-sdk/QueryGranteeGrantsRequest"; + value: QueryGranteeGrantsRequestAmino; +} +/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ +export interface QueryGranteeGrantsRequestSDKType { + grantee: string; + pagination?: PageRequestSDKType; +} +/** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ +export interface QueryGranteeGrantsResponse { + /** grants is a list of grants granted to the grantee. */ + grants: GrantAuthorization[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} +export interface QueryGranteeGrantsResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse"; + value: Uint8Array; +} +/** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ +export interface QueryGranteeGrantsResponseAmino { + /** grants is a list of grants granted to the grantee. */ + grants?: GrantAuthorizationAmino[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGranteeGrantsResponseAminoMsg { + type: "cosmos-sdk/QueryGranteeGrantsResponse"; + value: QueryGranteeGrantsResponseAmino; +} +/** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ +export interface QueryGranteeGrantsResponseSDKType { + grants: GrantAuthorizationSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryGrantsRequest(): QueryGrantsRequest { + return { + granter: "", + grantee: "", + msgTypeUrl: "", + pagination: undefined + }; +} +export const QueryGrantsRequest = { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest", + encode(message: QueryGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.msgTypeUrl !== "") { + writer.uint32(26).string(message.msgTypeUrl); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.msgTypeUrl = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGrantsRequest { + const message = createBaseQueryGrantsRequest(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.msgTypeUrl = object.msgTypeUrl ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGrantsRequestAmino): QueryGrantsRequest { + const message = createBaseQueryGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGrantsRequest): QueryGrantsRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGrantsRequestAminoMsg): QueryGrantsRequest { + return QueryGrantsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGrantsRequest): QueryGrantsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGrantsRequest", + value: QueryGrantsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGrantsRequestProtoMsg): QueryGrantsRequest { + return QueryGrantsRequest.decode(message.value); + }, + toProto(message: QueryGrantsRequest): Uint8Array { + return QueryGrantsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantsRequest): QueryGrantsRequestProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest", + value: QueryGrantsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGrantsResponse(): QueryGrantsResponse { + return { + grants: [], + pagination: undefined + }; +} +export const QueryGrantsResponse = { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse", + encode(message: QueryGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGrantsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(Grant.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGrantsResponse { + const message = createBaseQueryGrantsResponse(); + message.grants = object.grants?.map(e => Grant.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGrantsResponseAmino): QueryGrantsResponse { + const message = createBaseQueryGrantsResponse(); + message.grants = object.grants?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGrantsResponse): QueryGrantsResponseAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? Grant.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGrantsResponseAminoMsg): QueryGrantsResponse { + return QueryGrantsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGrantsResponse): QueryGrantsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGrantsResponse", + value: QueryGrantsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGrantsResponseProtoMsg): QueryGrantsResponse { + return QueryGrantsResponse.decode(message.value); + }, + toProto(message: QueryGrantsResponse): Uint8Array { + return QueryGrantsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGrantsResponse): QueryGrantsResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse", + value: QueryGrantsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGranterGrantsRequest(): QueryGranterGrantsRequest { + return { + granter: "", + pagination: undefined + }; +} +export const QueryGranterGrantsRequest = { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest", + encode(message: QueryGranterGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGranterGrantsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGranterGrantsRequest { + const message = createBaseQueryGranterGrantsRequest(); + message.granter = object.granter ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGranterGrantsRequestAmino): QueryGranterGrantsRequest { + const message = createBaseQueryGranterGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGranterGrantsRequestAminoMsg): QueryGranterGrantsRequest { + return QueryGranterGrantsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGranterGrantsRequest", + value: QueryGranterGrantsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGranterGrantsRequestProtoMsg): QueryGranterGrantsRequest { + return QueryGranterGrantsRequest.decode(message.value); + }, + toProto(message: QueryGranterGrantsRequest): Uint8Array { + return QueryGranterGrantsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest", + value: QueryGranterGrantsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGranterGrantsResponse(): QueryGranterGrantsResponse { + return { + grants: [], + pagination: undefined + }; +} +export const QueryGranterGrantsResponse = { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse", + encode(message: QueryGranterGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGranterGrantsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGranterGrantsResponse { + const message = createBaseQueryGranterGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGranterGrantsResponseAmino): QueryGranterGrantsResponse { + const message = createBaseQueryGranterGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGranterGrantsResponseAminoMsg): QueryGranterGrantsResponse { + return QueryGranterGrantsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGranterGrantsResponse", + value: QueryGranterGrantsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGranterGrantsResponseProtoMsg): QueryGranterGrantsResponse { + return QueryGranterGrantsResponse.decode(message.value); + }, + toProto(message: QueryGranterGrantsResponse): Uint8Array { + return QueryGranterGrantsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse", + value: QueryGranterGrantsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGranteeGrantsRequest(): QueryGranteeGrantsRequest { + return { + grantee: "", + pagination: undefined + }; +} +export const QueryGranteeGrantsRequest = { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest", + encode(message: QueryGranteeGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGranteeGrantsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGranteeGrantsRequest { + const message = createBaseQueryGranteeGrantsRequest(); + message.grantee = object.grantee ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGranteeGrantsRequestAmino): QueryGranteeGrantsRequest { + const message = createBaseQueryGranteeGrantsRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGranteeGrantsRequestAminoMsg): QueryGranteeGrantsRequest { + return QueryGranteeGrantsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGranteeGrantsRequest", + value: QueryGranteeGrantsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGranteeGrantsRequestProtoMsg): QueryGranteeGrantsRequest { + return QueryGranteeGrantsRequest.decode(message.value); + }, + toProto(message: QueryGranteeGrantsRequest): Uint8Array { + return QueryGranteeGrantsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest", + value: QueryGranteeGrantsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGranteeGrantsResponse(): QueryGranteeGrantsResponse { + return { + grants: [], + pagination: undefined + }; +} +export const QueryGranteeGrantsResponse = { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse", + encode(message: QueryGranteeGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGranteeGrantsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(GrantAuthorization.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGranteeGrantsResponse { + const message = createBaseQueryGranteeGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGranteeGrantsResponseAmino): QueryGranteeGrantsResponse { + const message = createBaseQueryGranteeGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGranteeGrantsResponseAminoMsg): QueryGranteeGrantsResponse { + return QueryGranteeGrantsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGranteeGrantsResponse", + value: QueryGranteeGrantsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGranteeGrantsResponseProtoMsg): QueryGranteeGrantsResponse { + return QueryGranteeGrantsResponse.decode(message.value); + }, + toProto(message: QueryGranteeGrantsResponse): Uint8Array { + return QueryGranteeGrantsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse", + value: QueryGranteeGrantsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.amino.ts new file mode 100644 index 00000000..dce86d05 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export const AminoConverter = { + "/cosmos.authz.v1beta1.MsgGrant": { + aminoType: "cosmos-sdk/MsgGrant", + toAmino: MsgGrant.toAmino, + fromAmino: MsgGrant.fromAmino + }, + "/cosmos.authz.v1beta1.MsgExec": { + aminoType: "cosmos-sdk/MsgExec", + toAmino: MsgExec.toAmino, + fromAmino: MsgExec.fromAmino + }, + "/cosmos.authz.v1beta1.MsgRevoke": { + aminoType: "cosmos-sdk/MsgRevoke", + toAmino: MsgRevoke.toAmino, + fromAmino: MsgRevoke.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.registry.ts new file mode 100644 index 00000000..bdcdde87 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.authz.v1beta1.MsgGrant", MsgGrant], ["/cosmos.authz.v1beta1.MsgExec", MsgExec], ["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.encode(value).finish() + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.encode(value).finish() + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.encode(value).finish() + }; + } + }, + withTypeUrl: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value + }; + } + }, + fromPartial: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.fromPartial(value) + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.fromPartial(value) + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..d06c05f6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,49 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgGrant, MsgGrantResponse, MsgExec, MsgExecResponse, MsgRevoke, MsgRevokeResponse } from "./tx"; +/** Msg defines the authz Msg service. */ +export interface Msg { + /** + * Grant grants the provided authorization to the grantee on the granter's + * account with the provided expiration time. If there is already a grant + * for the given (granter, grantee, Authorization) triple, then the grant + * will be overwritten. + */ + grant(request: MsgGrant): Promise; + /** + * Exec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ + exec(request: MsgExec): Promise; + /** + * Revoke revokes any authorization corresponding to the provided method name on the + * granter's account that has been granted to the grantee. + */ + revoke(request: MsgRevoke): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.grant = this.grant.bind(this); + this.exec = this.exec.bind(this); + this.revoke = this.revoke.bind(this); + } + grant(request: MsgGrant): Promise { + const data = MsgGrant.encode(request).finish(); + const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Grant", data); + return promise.then(data => MsgGrantResponse.decode(new BinaryReader(data))); + } + exec(request: MsgExec): Promise { + const data = MsgExec.encode(request).finish(); + const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Exec", data); + return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); + } + revoke(request: MsgRevoke): Promise { + const data = MsgRevoke.encode(request).finish(); + const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data); + return promise.then(data => MsgRevokeResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.ts new file mode 100644 index 00000000..728812f0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/authz/v1beta1/tx.ts @@ -0,0 +1,725 @@ +//@ts-nocheck +import { Grant, GrantAmino, GrantSDKType, GenericAuthorization } from "./authz"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { SendAuthorization } from "../../bank/v1beta1/authz"; +import { StakeAuthorization } from "../../staking/v1beta1/authz"; +import { ContractExecutionAuthorization, ContractMigrationAuthorization } from "../../../cosmwasm/wasm/v1/authz"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrant { + granter: string; + grantee: string; + grant: Grant; +} +export interface MsgGrantProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant"; + value: Uint8Array; +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantAmino { + granter?: string; + grantee?: string; + grant?: GrantAmino; +} +export interface MsgGrantAminoMsg { + type: "cosmos-sdk/MsgGrant"; + value: MsgGrantAmino; +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantSDKType { + granter: string; + grantee: string; + grant: GrantSDKType; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponse { + results: Uint8Array[]; +} +export interface MsgExecResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; + value: Uint8Array; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseAmino { + results?: string[]; +} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseSDKType { + results: Uint8Array[]; +} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExec { + grantee: string; + /** + * Authorization Msg requests to execute. Each msg must implement Authorization interface + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: (Any)[] | Any[]; +} +export interface MsgExecProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExec"; + value: Uint8Array; +} +export type MsgExecEncoded = Omit & { + /** + * Authorization Msg requests to execute. Each msg must implement Authorization interface + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: (AnyProtoMsg)[]; +}; +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExecAmino { + grantee?: string; + /** + * Authorization Msg requests to execute. Each msg must implement Authorization interface + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs?: AnyAmino[]; +} +export interface MsgExecAminoMsg { + type: "cosmos-sdk/MsgExec"; + value: MsgExecAmino; +} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExecSDKType { + grantee: string; + msgs: (AnySDKType)[]; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponse {} +export interface MsgGrantResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; + value: Uint8Array; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseAmino {} +export interface MsgGrantResponseAminoMsg { + type: "cosmos-sdk/MsgGrantResponse"; + value: MsgGrantResponseAmino; +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseSDKType {} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevoke { + granter: string; + grantee: string; + msgTypeUrl: string; +} +export interface MsgRevokeProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke"; + value: Uint8Array; +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeAmino { + granter?: string; + grantee?: string; + msg_type_url?: string; +} +export interface MsgRevokeAminoMsg { + type: "cosmos-sdk/MsgRevoke"; + value: MsgRevokeAmino; +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeSDKType { + granter: string; + grantee: string; + msg_type_url: string; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponse {} +export interface MsgRevokeResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse"; + value: Uint8Array; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseAmino {} +export interface MsgRevokeResponseAminoMsg { + type: "cosmos-sdk/MsgRevokeResponse"; + value: MsgRevokeResponseAmino; +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseSDKType {} +function createBaseMsgGrant(): MsgGrant { + return { + granter: "", + grantee: "", + grant: Grant.fromPartial({}) + }; +} +export const MsgGrant = { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + encode(message: MsgGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.grant !== undefined) { + Grant.encode(message.grant, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.grant = Grant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgGrant { + const message = createBaseMsgGrant(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.grant = object.grant !== undefined && object.grant !== null ? Grant.fromPartial(object.grant) : undefined; + return message; + }, + fromAmino(object: MsgGrantAmino): MsgGrant { + const message = createBaseMsgGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.grant !== undefined && object.grant !== null) { + message.grant = Grant.fromAmino(object.grant); + } + return message; + }, + toAmino(message: MsgGrant): MsgGrantAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.grant = message.grant ? Grant.toAmino(message.grant) : undefined; + return obj; + }, + fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { + return MsgGrant.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrant): MsgGrantAminoMsg { + return { + type: "cosmos-sdk/MsgGrant", + value: MsgGrant.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantProtoMsg): MsgGrant { + return MsgGrant.decode(message.value); + }, + toProto(message: MsgGrant): Uint8Array { + return MsgGrant.encode(message).finish(); + }, + toProtoMsg(message: MsgGrant): MsgGrantProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.encode(message).finish() + }; + } +}; +function createBaseMsgExecResponse(): MsgExecResponse { + return { + results: [] + }; +} +export const MsgExecResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.results) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.results.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgExecResponseAmino): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MsgExecResponse): MsgExecResponseAmino { + const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => base64FromBytes(e)); + } else { + obj.results = message.results; + } + return obj; + }, + fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { + return MsgExecResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { + return { + type: "cosmos-sdk/MsgExecResponse", + value: MsgExecResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { + return MsgExecResponse.decode(message.value); + }, + toProto(message: MsgExecResponse): Uint8Array { + return MsgExecResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + value: MsgExecResponse.encode(message).finish() + }; + } +}; +function createBaseMsgExec(): MsgExec { + return { + grantee: "", + msgs: [] + }; +} +export const MsgExec = { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + for (const v of message.msgs) { + Any.encode(v! as Any, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.msgs.push(Any.decode(reader, reader.uint32()) as Any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExec { + const message = createBaseMsgExec(); + message.grantee = object.grantee ?? ""; + message.msgs = object.msgs?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgExecAmino): MsgExec { + const message = createBaseMsgExec(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + message.msgs = object.msgs?.map(e => Sdk_MsgcosmosauthzAuthorization_FromAmino(e)) || []; + return message; + }, + toAmino(message: MsgExec): MsgExecAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? Sdk_MsgcosmosauthzAuthorization_ToAmino(e as Any) : undefined); + } else { + obj.msgs = message.msgs; + } + return obj; + }, + fromAminoMsg(object: MsgExecAminoMsg): MsgExec { + return MsgExec.fromAmino(object.value); + }, + toAminoMsg(message: MsgExec): MsgExecAminoMsg { + return { + type: "cosmos-sdk/MsgExec", + value: MsgExec.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecProtoMsg): MsgExec { + return MsgExec.decode(message.value); + }, + toProto(message: MsgExec): Uint8Array { + return MsgExec.encode(message).finish(); + }, + toProtoMsg(message: MsgExec): MsgExecProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.encode(message).finish() + }; + } +}; +function createBaseMsgGrantResponse(): MsgGrantResponse { + return {}; +} +export const MsgGrantResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); + return message; + }, + fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); + return message; + }, + toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { + return MsgGrantResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantResponse", + value: MsgGrantResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse { + return MsgGrantResponse.decode(message.value); + }, + toProto(message: MsgGrantResponse): Uint8Array { + return MsgGrantResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + value: MsgGrantResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRevoke(): MsgRevoke { + return { + granter: "", + grantee: "", + msgTypeUrl: "" + }; +} +export const MsgRevoke = { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + encode(message: MsgRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.msgTypeUrl !== "") { + writer.uint32(26).string(message.msgTypeUrl); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevoke(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.msgTypeUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRevoke { + const message = createBaseMsgRevoke(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.msgTypeUrl = object.msgTypeUrl ?? ""; + return message; + }, + fromAmino(object: MsgRevokeAmino): MsgRevoke { + const message = createBaseMsgRevoke(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; + }, + toAmino(message: MsgRevoke): MsgRevokeAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + return obj; + }, + fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { + return MsgRevoke.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevoke): MsgRevokeAminoMsg { + return { + type: "cosmos-sdk/MsgRevoke", + value: MsgRevoke.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeProtoMsg): MsgRevoke { + return MsgRevoke.decode(message.value); + }, + toProto(message: MsgRevoke): Uint8Array { + return MsgRevoke.encode(message).finish(); + }, + toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.encode(message).finish() + }; + } +}; +function createBaseMsgRevokeResponse(): MsgRevokeResponse { + return {}; +} +export const MsgRevokeResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse(); + return message; + }, + fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse(); + return message; + }, + toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { + return MsgRevokeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeResponse): MsgRevokeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeResponse", + value: MsgRevokeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeResponseProtoMsg): MsgRevokeResponse { + return MsgRevokeResponse.decode(message.value); + }, + toProto(message: MsgRevokeResponse): Uint8Array { + return MsgRevokeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + value: MsgRevokeResponse.encode(message).finish() + }; + } +}; +export const Sdk_Msg_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + default: + return data; + } +}; +export const Sdk_Msg_FromAmino = (content: AnyAmino): Any => { + return Any.fromAmino(content); +}; +export const Sdk_Msg_ToAmino = (content: Any) => { + return Any.toAmino(content); +}; +export const Cosmos_authzAuthorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): GenericAuthorization | SendAuthorization | StakeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.authz.v1beta1.GenericAuthorization": + return GenericAuthorization.decode(data.value); + case "/cosmos.bank.v1beta1.SendAuthorization": + return SendAuthorization.decode(data.value); + case "/cosmos.staking.v1beta1.StakeAuthorization": + return StakeAuthorization.decode(data.value); + case "/cosmwasm.wasm.v1.ContractExecutionAuthorization": + return ContractExecutionAuthorization.decode(data.value); + case "/cosmwasm.wasm.v1.ContractMigrationAuthorization": + return ContractMigrationAuthorization.decode(data.value); + default: + return data; + } +}; +export const Cosmos_authzAuthorization_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/GenericAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + value: GenericAuthorization.encode(GenericAuthorization.fromPartial(GenericAuthorization.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/SendAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", + value: SendAuthorization.encode(SendAuthorization.fromPartial(SendAuthorization.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/StakeAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", + value: StakeAuthorization.encode(StakeAuthorization.fromPartial(StakeAuthorization.fromAmino(content.value))).finish() + }); + case "wasm/ContractExecutionAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", + value: ContractExecutionAuthorization.encode(ContractExecutionAuthorization.fromPartial(ContractExecutionAuthorization.fromAmino(content.value))).finish() + }); + case "wasm/ContractMigrationAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", + value: ContractMigrationAuthorization.encode(ContractMigrationAuthorization.fromPartial(ContractMigrationAuthorization.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_authzAuthorization_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.authz.v1beta1.GenericAuthorization": + return { + type: "cosmos-sdk/GenericAuthorization", + value: GenericAuthorization.toAmino(GenericAuthorization.decode(content.value, undefined)) + }; + case "/cosmos.bank.v1beta1.SendAuthorization": + return { + type: "cosmos-sdk/SendAuthorization", + value: SendAuthorization.toAmino(SendAuthorization.decode(content.value, undefined)) + }; + case "/cosmos.staking.v1beta1.StakeAuthorization": + return { + type: "cosmos-sdk/StakeAuthorization", + value: StakeAuthorization.toAmino(StakeAuthorization.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ContractExecutionAuthorization": + return { + type: "wasm/ContractExecutionAuthorization", + value: ContractExecutionAuthorization.toAmino(ContractExecutionAuthorization.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ContractMigrationAuthorization": + return { + type: "wasm/ContractMigrationAuthorization", + value: ContractMigrationAuthorization.toAmino(ContractMigrationAuthorization.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/authz.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/authz.ts new file mode 100644 index 00000000..2ec7fcb5 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/authz.ts @@ -0,0 +1,112 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorization { + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; + spendLimit: Coin[]; +} +export interface SendAuthorizationProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.SendAuthorization"; + value: Uint8Array; +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorizationAmino { + spend_limit?: CoinAmino[]; +} +export interface SendAuthorizationAminoMsg { + type: "cosmos-sdk/SendAuthorization"; + value: SendAuthorizationAmino; +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorizationSDKType { + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; + spend_limit: CoinSDKType[]; +} +function createBaseSendAuthorization(): SendAuthorization { + return { + $typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", + spendLimit: [] + }; +} +export const SendAuthorization = { + typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", + encode(message: SendAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.spendLimit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spendLimit.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SendAuthorization { + const message = createBaseSendAuthorization(); + message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SendAuthorizationAmino): SendAuthorization { + const message = createBaseSendAuthorization(); + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: SendAuthorization): SendAuthorizationAmino { + const obj: any = {}; + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.spend_limit = message.spendLimit; + } + return obj; + }, + fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization { + return SendAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: SendAuthorization): SendAuthorizationAminoMsg { + return { + type: "cosmos-sdk/SendAuthorization", + value: SendAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: SendAuthorizationProtoMsg): SendAuthorization { + return SendAuthorization.decode(message.value); + }, + toProto(message: SendAuthorization): Uint8Array { + return SendAuthorization.encode(message).finish(); + }, + toProtoMsg(message: SendAuthorization): SendAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", + value: SendAuthorization.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/bank.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 00000000..da93ef76 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,952 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the bank module. */ +export interface Params { + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the bank module. */ +export interface ParamsAmino { + send_enabled?: SendEnabledAmino[]; + default_send_enabled?: boolean; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the bank module. */ +export interface ParamsSDKType { + send_enabled: SendEnabledSDKType[]; + default_send_enabled: boolean; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} +export interface SendEnabledProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled"; + value: Uint8Array; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledAmino { + denom?: string; + enabled?: boolean; +} +export interface SendEnabledAminoMsg { + type: "cosmos-sdk/SendEnabled"; + value: SendEnabledAmino; +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledSDKType { + denom: string; + enabled: boolean; +} +/** Input models transaction input. */ +export interface Input { + address: string; + coins: Coin[]; +} +export interface InputProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Input"; + value: Uint8Array; +} +/** Input models transaction input. */ +export interface InputAmino { + address?: string; + coins?: CoinAmino[]; +} +export interface InputAminoMsg { + type: "cosmos-sdk/Input"; + value: InputAmino; +} +/** Input models transaction input. */ +export interface InputSDKType { + address: string; + coins: CoinSDKType[]; +} +/** Output models transaction outputs. */ +export interface Output { + address: string; + coins: Coin[]; +} +export interface OutputProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Output"; + value: Uint8Array; +} +/** Output models transaction outputs. */ +export interface OutputAmino { + address?: string; + coins?: CoinAmino[]; +} +export interface OutputAminoMsg { + type: "cosmos-sdk/Output"; + value: OutputAmino; +} +/** Output models transaction outputs. */ +export interface OutputSDKType { + address: string; + coins: CoinSDKType[]; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface Supply { + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; + total: Coin[]; +} +export interface SupplyProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Supply"; + value: Uint8Array; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplyAmino { + total?: CoinAmino[]; +} +export interface SupplyAminoMsg { + type: "cosmos-sdk/Supply"; + value: SupplyAmino; +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplySDKType { + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; + total: CoinSDKType[]; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 10^exponent base_denom + * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + * exponent = 6, thus: 1 atom = 10^6 uatom). + */ + exponent: number; + /** aliases is a list of string aliases for the given denom */ + aliases: string[]; +} +export interface DenomUnitProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit"; + value: Uint8Array; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitAmino { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom?: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 10^exponent base_denom + * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + * exponent = 6, thus: 1 atom = 10^6 uatom). + */ + exponent?: number; + /** aliases is a list of string aliases for the given denom */ + aliases?: string[]; +} +export interface DenomUnitAminoMsg { + type: "cosmos-sdk/DenomUnit"; + value: DenomUnitAmino; +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitSDKType { + denom: string; + exponent: number; + aliases: string[]; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denomUnits: DenomUnit[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * Since: cosmos-sdk 0.43 + */ + symbol: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uriHash: string; +} +export interface MetadataProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Metadata"; + value: Uint8Array; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataAmino { + description?: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denom_units?: DenomUnitAmino[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base?: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display?: string; + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + name?: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + * + * Since: cosmos-sdk 0.43 + */ + symbol?: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri?: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri_hash?: string; +} +export interface MetadataAminoMsg { + type: "cosmos-sdk/Metadata"; + value: MetadataAmino; +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataSDKType { + description: string; + denom_units: DenomUnitSDKType[]; + base: string; + display: string; + name: string; + symbol: string; + uri: string; + uri_hash: string; +} +function createBaseParams(): Params { + return { + sendEnabled: [], + defaultSendEnabled: false + }; +} +export const Params = { + typeUrl: "/cosmos.bank.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.defaultSendEnabled = object.defaultSendEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.default_send_enabled !== undefined && object.default_send_enabled !== null) { + message.defaultSendEnabled = object.default_send_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = message.sendEnabled; + } + obj.default_send_enabled = message.defaultSendEnabled === false ? undefined : message.defaultSendEnabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseSendEnabled(): SendEnabled { + return { + denom: "", + enabled: false + }; +} +export const SendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + encode(message: SendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.enabled === true) { + writer.uint32(16).bool(message.enabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SendEnabled { + const message = createBaseSendEnabled(); + message.denom = object.denom ?? ""; + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino(object: SendEnabledAmino): SendEnabled { + const message = createBaseSendEnabled(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino(message: SendEnabled): SendEnabledAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.enabled = message.enabled === false ? undefined : message.enabled; + return obj; + }, + fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled { + return SendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: SendEnabled): SendEnabledAminoMsg { + return { + type: "cosmos-sdk/SendEnabled", + value: SendEnabled.toAmino(message) + }; + }, + fromProtoMsg(message: SendEnabledProtoMsg): SendEnabled { + return SendEnabled.decode(message.value); + }, + toProto(message: SendEnabled): Uint8Array { + return SendEnabled.encode(message).finish(); + }, + toProtoMsg(message: SendEnabled): SendEnabledProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + value: SendEnabled.encode(message).finish() + }; + } +}; +function createBaseInput(): Input { + return { + address: "", + coins: [] + }; +} +export const Input = { + typeUrl: "/cosmos.bank.v1beta1.Input", + encode(message: Input, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Input { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Input { + const message = createBaseInput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InputAmino): Input { + const message = createBaseInput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Input): InputAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: InputAminoMsg): Input { + return Input.fromAmino(object.value); + }, + toAminoMsg(message: Input): InputAminoMsg { + return { + type: "cosmos-sdk/Input", + value: Input.toAmino(message) + }; + }, + fromProtoMsg(message: InputProtoMsg): Input { + return Input.decode(message.value); + }, + toProto(message: Input): Uint8Array { + return Input.encode(message).finish(); + }, + toProtoMsg(message: Input): InputProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Input", + value: Input.encode(message).finish() + }; + } +}; +function createBaseOutput(): Output { + return { + address: "", + coins: [] + }; +} +export const Output = { + typeUrl: "/cosmos.bank.v1beta1.Output", + encode(message: Output, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Output { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Output { + const message = createBaseOutput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OutputAmino): Output { + const message = createBaseOutput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Output): OutputAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: OutputAminoMsg): Output { + return Output.fromAmino(object.value); + }, + toAminoMsg(message: Output): OutputAminoMsg { + return { + type: "cosmos-sdk/Output", + value: Output.toAmino(message) + }; + }, + fromProtoMsg(message: OutputProtoMsg): Output { + return Output.decode(message.value); + }, + toProto(message: Output): Uint8Array { + return Output.encode(message).finish(); + }, + toProtoMsg(message: Output): OutputProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Output", + value: Output.encode(message).finish() + }; + } +}; +function createBaseSupply(): Supply { + return { + $typeUrl: "/cosmos.bank.v1beta1.Supply", + total: [] + }; +} +export const Supply = { + typeUrl: "/cosmos.bank.v1beta1.Supply", + encode(message: Supply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.total) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSupply(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Supply { + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SupplyAmino): Supply { + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Supply): SupplyAmino { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total = message.total; + } + return obj; + }, + fromAminoMsg(object: SupplyAminoMsg): Supply { + return Supply.fromAmino(object.value); + }, + toAminoMsg(message: Supply): SupplyAminoMsg { + return { + type: "cosmos-sdk/Supply", + value: Supply.toAmino(message) + }; + }, + fromProtoMsg(message: SupplyProtoMsg): Supply { + return Supply.decode(message.value); + }, + toProto(message: Supply): Uint8Array { + return Supply.encode(message).finish(); + }, + toProtoMsg(message: Supply): SupplyProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Supply", + value: Supply.encode(message).finish() + }; + } +}; +function createBaseDenomUnit(): DenomUnit { + return { + denom: "", + exponent: 0, + aliases: [] + }; +} +export const DenomUnit = { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + encode(message: DenomUnit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.exponent !== 0) { + writer.uint32(16).uint32(message.exponent); + } + for (const v of message.aliases) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomUnit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomUnit { + const message = createBaseDenomUnit(); + message.denom = object.denom ?? ""; + message.exponent = object.exponent ?? 0; + message.aliases = object.aliases?.map(e => e) || []; + return message; + }, + fromAmino(object: DenomUnitAmino): DenomUnit { + const message = createBaseDenomUnit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + message.aliases = object.aliases?.map(e => e) || []; + return message; + }, + toAmino(message: DenomUnit): DenomUnitAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + if (message.aliases) { + obj.aliases = message.aliases.map(e => e); + } else { + obj.aliases = message.aliases; + } + return obj; + }, + fromAminoMsg(object: DenomUnitAminoMsg): DenomUnit { + return DenomUnit.fromAmino(object.value); + }, + toAminoMsg(message: DenomUnit): DenomUnitAminoMsg { + return { + type: "cosmos-sdk/DenomUnit", + value: DenomUnit.toAmino(message) + }; + }, + fromProtoMsg(message: DenomUnitProtoMsg): DenomUnit { + return DenomUnit.decode(message.value); + }, + toProto(message: DenomUnit): Uint8Array { + return DenomUnit.encode(message).finish(); + }, + toProtoMsg(message: DenomUnit): DenomUnitProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + value: DenomUnit.encode(message).finish() + }; + } +}; +function createBaseMetadata(): Metadata { + return { + description: "", + denomUnits: [], + base: "", + display: "", + name: "", + symbol: "", + uri: "", + uriHash: "" + }; +} +export const Metadata = { + typeUrl: "/cosmos.bank.v1beta1.Metadata", + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.display !== "") { + writer.uint32(34).string(message.display); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(50).string(message.symbol); + } + if (message.uri !== "") { + writer.uint32(58).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(66).string(message.uriHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.symbol = reader.string(); + break; + case 7: + message.uri = reader.string(); + break; + case 8: + message.uriHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Metadata { + const message = createBaseMetadata(); + message.description = object.description ?? ""; + message.denomUnits = object.denomUnits?.map(e => DenomUnit.fromPartial(e)) || []; + message.base = object.base ?? ""; + message.display = object.display ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; + return message; + }, + fromAmino(object: MetadataAmino): Metadata { + const message = createBaseMetadata(); + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomUnits = object.denom_units?.map(e => DenomUnit.fromAmino(e)) || []; + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + return message; + }, + toAmino(message: Metadata): MetadataAmino { + const obj: any = {}; + obj.description = message.description === "" ? undefined : message.description; + if (message.denomUnits) { + obj.denom_units = message.denomUnits.map(e => e ? DenomUnit.toAmino(e) : undefined); + } else { + obj.denom_units = message.denomUnits; + } + obj.base = message.base === "" ? undefined : message.base; + obj.display = message.display === "" ? undefined : message.display; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.uri = message.uri === "" ? undefined : message.uri; + obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash; + return obj; + }, + fromAminoMsg(object: MetadataAminoMsg): Metadata { + return Metadata.fromAmino(object.value); + }, + toAminoMsg(message: Metadata): MetadataAminoMsg { + return { + type: "cosmos-sdk/Metadata", + value: Metadata.toAmino(message) + }; + }, + fromProtoMsg(message: MetadataProtoMsg): Metadata { + return Metadata.decode(message.value); + }, + toProto(message: Metadata): Uint8Array { + return Metadata.encode(message).finish(); + }, + toProtoMsg(message: Metadata): MetadataProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Metadata", + value: Metadata.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/genesis.ts new file mode 100644 index 00000000..dfdcd06f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/genesis.ts @@ -0,0 +1,277 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the bank module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params: Params; + /** balances is an array containing the balances of all the accounts. */ + balances: Balance[]; + /** + * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + */ + supply: Coin[]; + /** denom_metadata defines the metadata of the differents coins. */ + denomMetadata: Metadata[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the bank module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; + /** balances is an array containing the balances of all the accounts. */ + balances?: BalanceAmino[]; + /** + * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + */ + supply?: CoinAmino[]; + /** denom_metadata defines the metadata of the differents coins. */ + denom_metadata?: MetadataAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the bank module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + balances: BalanceSDKType[]; + supply: CoinSDKType[]; + denom_metadata: MetadataSDKType[]; +} +/** + * Balance defines an account address and balance pair used in the bank module's + * genesis state. + */ +export interface Balance { + /** address is the address of the balance holder. */ + address: string; + /** coins defines the different coins this balance holds. */ + coins: Coin[]; +} +export interface BalanceProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.Balance"; + value: Uint8Array; +} +/** + * Balance defines an account address and balance pair used in the bank module's + * genesis state. + */ +export interface BalanceAmino { + /** address is the address of the balance holder. */ + address?: string; + /** coins defines the different coins this balance holds. */ + coins?: CoinAmino[]; +} +export interface BalanceAminoMsg { + type: "cosmos-sdk/Balance"; + value: BalanceAmino; +} +/** + * Balance defines an account address and balance pair used in the bank module's + * genesis state. + */ +export interface BalanceSDKType { + address: string; + coins: CoinSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + balances: [], + supply: [], + denomMetadata: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.bank.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.balances) { + Balance.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.supply) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.denomMetadata) { + Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.balances.push(Balance.decode(reader, reader.uint32())); + break; + case 3: + message.supply.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.denomMetadata.push(Metadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.balances = object.balances?.map(e => Balance.fromPartial(e)) || []; + message.supply = object.supply?.map(e => Coin.fromPartial(e)) || []; + message.denomMetadata = object.denomMetadata?.map(e => Metadata.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + message.denomMetadata = object.denom_metadata?.map(e => Metadata.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + if (message.supply) { + obj.supply = message.supply.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.supply = message.supply; + } + if (message.denomMetadata) { + obj.denom_metadata = message.denomMetadata.map(e => e ? Metadata.toAmino(e) : undefined); + } else { + obj.denom_metadata = message.denomMetadata; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseBalance(): Balance { + return { + address: "", + coins: [] + }; +} +export const Balance = { + typeUrl: "/cosmos.bank.v1beta1.Balance", + encode(message: Balance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Balance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Balance { + const message = createBaseBalance(); + message.address = object.address ?? ""; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BalanceAmino): Balance { + const message = createBaseBalance(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Balance): BalanceAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = message.coins; + } + return obj; + }, + fromAminoMsg(object: BalanceAminoMsg): Balance { + return Balance.fromAmino(object.value); + }, + toAminoMsg(message: Balance): BalanceAminoMsg { + return { + type: "cosmos-sdk/Balance", + value: Balance.toAmino(message) + }; + }, + fromProtoMsg(message: BalanceProtoMsg): Balance { + return Balance.decode(message.value); + }, + toProto(message: Balance): Uint8Array { + return Balance.encode(message).finish(); + }, + toProtoMsg(message: Balance): BalanceProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.Balance", + value: Balance.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..41cef39d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/query.rpc.Query.ts @@ -0,0 +1,132 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Balance queries the balance of a single coin for a single account. */ + balance(request: QueryBalanceRequest): Promise; + /** AllBalances queries the balance of all coins for a single account. */ + allBalances(request: QueryAllBalancesRequest): Promise; + /** + * SpendableBalances queries the spenable balance of all coins for a single + * account. + */ + spendableBalances(request: QuerySpendableBalancesRequest): Promise; + /** TotalSupply queries the total supply of all coins. */ + totalSupply(request?: QueryTotalSupplyRequest): Promise; + /** SupplyOf queries the supply of a single coin. */ + supplyOf(request: QuerySupplyOfRequest): Promise; + /** Params queries the parameters of x/bank module. */ + params(request?: QueryParamsRequest): Promise; + /** DenomsMetadata queries the client metadata of a given coin denomination. */ + denomMetadata(request: QueryDenomMetadataRequest): Promise; + /** + * DenomsMetadata queries the client metadata for all registered coin + * denominations. + */ + denomsMetadata(request?: QueryDenomsMetadataRequest): Promise; + /** + * DenomOwners queries for all account addresses that own a particular token + * denomination. + */ + denomOwners(request: QueryDenomOwnersRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.balance = this.balance.bind(this); + this.allBalances = this.allBalances.bind(this); + this.spendableBalances = this.spendableBalances.bind(this); + this.totalSupply = this.totalSupply.bind(this); + this.supplyOf = this.supplyOf.bind(this); + this.params = this.params.bind(this); + this.denomMetadata = this.denomMetadata.bind(this); + this.denomsMetadata = this.denomsMetadata.bind(this); + this.denomOwners = this.denomOwners.bind(this); + } + balance(request: QueryBalanceRequest): Promise { + const data = QueryBalanceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data); + return promise.then(data => QueryBalanceResponse.decode(new BinaryReader(data))); + } + allBalances(request: QueryAllBalancesRequest): Promise { + const data = QueryAllBalancesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); + return promise.then(data => QueryAllBalancesResponse.decode(new BinaryReader(data))); + } + spendableBalances(request: QuerySpendableBalancesRequest): Promise { + const data = QuerySpendableBalancesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalances", data); + return promise.then(data => QuerySpendableBalancesResponse.decode(new BinaryReader(data))); + } + totalSupply(request: QueryTotalSupplyRequest = { + pagination: undefined + }): Promise { + const data = QueryTotalSupplyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data); + return promise.then(data => QueryTotalSupplyResponse.decode(new BinaryReader(data))); + } + supplyOf(request: QuerySupplyOfRequest): Promise { + const data = QuerySupplyOfRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data); + return promise.then(data => QuerySupplyOfResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + denomMetadata(request: QueryDenomMetadataRequest): Promise { + const data = QueryDenomMetadataRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data); + return promise.then(data => QueryDenomMetadataResponse.decode(new BinaryReader(data))); + } + denomsMetadata(request: QueryDenomsMetadataRequest = { + pagination: undefined + }): Promise { + const data = QueryDenomsMetadataRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); + return promise.then(data => QueryDenomsMetadataResponse.decode(new BinaryReader(data))); + } + denomOwners(request: QueryDenomOwnersRequest): Promise { + const data = QueryDenomOwnersRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwners", data); + return promise.then(data => QueryDenomOwnersResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + balance(request: QueryBalanceRequest): Promise { + return queryService.balance(request); + }, + allBalances(request: QueryAllBalancesRequest): Promise { + return queryService.allBalances(request); + }, + spendableBalances(request: QuerySpendableBalancesRequest): Promise { + return queryService.spendableBalances(request); + }, + totalSupply(request?: QueryTotalSupplyRequest): Promise { + return queryService.totalSupply(request); + }, + supplyOf(request: QuerySupplyOfRequest): Promise { + return queryService.supplyOf(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + denomMetadata(request: QueryDenomMetadataRequest): Promise { + return queryService.denomMetadata(request); + }, + denomsMetadata(request?: QueryDenomsMetadataRequest): Promise { + return queryService.denomsMetadata(request); + }, + denomOwners(request: QueryDenomOwnersRequest): Promise { + return queryService.denomOwners(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/query.ts new file mode 100644 index 00000000..6bf49c7a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/query.ts @@ -0,0 +1,1992 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QueryBalanceRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest"; + value: Uint8Array; +} +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequestAmino { + /** address is the address to query balances for. */ + address?: string; + /** denom is the coin denom to query balances for. */ + denom?: string; +} +export interface QueryBalanceRequestAminoMsg { + type: "cosmos-sdk/QueryBalanceRequest"; + value: QueryBalanceRequestAmino; +} +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequestSDKType { + address: string; + denom: string; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponse { + /** balance is the balance of the coin. */ + balance?: Coin; +} +export interface QueryBalanceResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; + value: Uint8Array; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponseAmino { + /** balance is the balance of the coin. */ + balance?: CoinAmino; +} +export interface QueryBalanceResponseAminoMsg { + type: "cosmos-sdk/QueryBalanceResponse"; + value: QueryBalanceResponseAmino; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponseSDKType { + balance?: CoinSDKType; +} +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequest { + /** address is the address to query balances for. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAllBalancesRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest"; + value: Uint8Array; +} +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequestAmino { + /** address is the address to query balances for. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAllBalancesRequestAminoMsg { + type: "cosmos-sdk/QueryAllBalancesRequest"; + value: QueryAllBalancesRequestAmino; +} +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponse { + /** balances is the balances of all the coins. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAllBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; + value: Uint8Array; +} +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponseAmino { + /** balances is the balances of all the coins. */ + balances?: CoinAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllBalancesResponseAminoMsg { + type: "cosmos-sdk/QueryAllBalancesResponse"; + value: QueryAllBalancesResponseAmino; +} +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponseSDKType { + balances: CoinSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + */ +export interface QuerySpendableBalancesRequest { + /** address is the address to query spendable balances for. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QuerySpendableBalancesRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; + value: Uint8Array; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + */ +export interface QuerySpendableBalancesRequestAmino { + /** address is the address to query spendable balances for. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QuerySpendableBalancesRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesRequest"; + value: QuerySpendableBalancesRequestAmino; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + */ +export interface QuerySpendableBalancesRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + */ +export interface QuerySpendableBalancesResponse { + /** balances is the spendable balances of all the coins. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QuerySpendableBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; + value: Uint8Array; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + */ +export interface QuerySpendableBalancesResponseAmino { + /** balances is the spendable balances of all the coins. */ + balances?: CoinAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QuerySpendableBalancesResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesResponse"; + value: QuerySpendableBalancesResponseAmino; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + */ +export interface QuerySpendableBalancesResponseSDKType { + balances: CoinSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequest { + /** + * pagination defines an optional pagination for the request. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageRequest; +} +export interface QueryTotalSupplyRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; + value: Uint8Array; +} +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequestAmino { + /** + * pagination defines an optional pagination for the request. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageRequestAmino; +} +export interface QueryTotalSupplyRequestAminoMsg { + type: "cosmos-sdk/QueryTotalSupplyRequest"; + value: QueryTotalSupplyRequestAmino; +} +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponse { + /** supply is the supply of the coins */ + supply: Coin[]; + /** + * pagination defines the pagination in the response. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageResponse; +} +export interface QueryTotalSupplyResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; + value: Uint8Array; +} +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponseAmino { + /** supply is the supply of the coins */ + supply?: CoinAmino[]; + /** + * pagination defines the pagination in the response. + * + * Since: cosmos-sdk 0.43 + */ + pagination?: PageResponseAmino; +} +export interface QueryTotalSupplyResponseAminoMsg { + type: "cosmos-sdk/QueryTotalSupplyResponse"; + value: QueryTotalSupplyResponseAmino; +} +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponseSDKType { + supply: CoinSDKType[]; + pagination?: PageResponseSDKType; +} +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequest { + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySupplyOfRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest"; + value: Uint8Array; +} +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequestAmino { + /** denom is the coin denom to query balances for. */ + denom?: string; +} +export interface QuerySupplyOfRequestAminoMsg { + type: "cosmos-sdk/QuerySupplyOfRequest"; + value: QuerySupplyOfRequestAmino; +} +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequestSDKType { + denom: string; +} +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponse { + /** amount is the supply of the coin. */ + amount: Coin; +} +export interface QuerySupplyOfResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse"; + value: Uint8Array; +} +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponseAmino { + /** amount is the supply of the coin. */ + amount?: CoinAmino; +} +export interface QuerySupplyOfResponseAminoMsg { + type: "cosmos-sdk/QuerySupplyOfResponse"; + value: QuerySupplyOfResponseAmino; +} +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponseSDKType { + amount: CoinSDKType; +} +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse defines the response type for querying x/bank parameters. */ +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse defines the response type for querying x/bank parameters. */ +export interface QueryParamsResponseAmino { + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse defines the response type for querying x/bank parameters. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDenomsMetadataRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; + value: Uint8Array; +} +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDenomsMetadataRequestAminoMsg { + type: "cosmos-sdk/QueryDenomsMetadataRequest"; + value: QueryDenomsMetadataRequestAmino; +} +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponse { + /** metadata provides the client information for all the registered tokens. */ + metadatas: Metadata[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomsMetadataResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; + value: Uint8Array; +} +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponseAmino { + /** metadata provides the client information for all the registered tokens. */ + metadatas?: MetadataAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomsMetadataResponseAminoMsg { + type: "cosmos-sdk/QueryDenomsMetadataResponse"; + value: QueryDenomsMetadataResponseAmino; +} +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponseSDKType { + metadatas: MetadataSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequest { + /** denom is the coin denom to query the metadata for. */ + denom: string; +} +export interface QueryDenomMetadataRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest"; + value: Uint8Array; +} +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequestAmino { + /** denom is the coin denom to query the metadata for. */ + denom?: string; +} +export interface QueryDenomMetadataRequestAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataRequest"; + value: QueryDenomMetadataRequestAmino; +} +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequestSDKType { + denom: string; +} +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponse { + /** metadata describes and provides all the client information for the requested token. */ + metadata: Metadata; +} +export interface QueryDenomMetadataResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse"; + value: Uint8Array; +} +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponseAmino { + /** metadata describes and provides all the client information for the requested token. */ + metadata?: MetadataAmino; +} +export interface QueryDenomMetadataResponseAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataResponse"; + value: QueryDenomMetadataResponseAmino; +} +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponseSDKType { + metadata: MetadataSDKType; +} +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequest { + /** denom defines the coin denomination to query all account holders for. */ + denom: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDenomOwnersRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest"; + value: Uint8Array; +} +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestAmino { + /** denom defines the coin denomination to query all account holders for. */ + denom?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDenomOwnersRequestAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersRequest"; + value: QueryDenomOwnersRequestAmino; +} +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestSDKType { + denom: string; + pagination?: PageRequestSDKType; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + */ +export interface DenomOwner { + /** address defines the address that owns a particular denomination. */ + address: string; + /** balance is the balance of the denominated coin for an account. */ + balance: Coin; +} +export interface DenomOwnerProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner"; + value: Uint8Array; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + */ +export interface DenomOwnerAmino { + /** address defines the address that owns a particular denomination. */ + address?: string; + /** balance is the balance of the denominated coin for an account. */ + balance?: CoinAmino; +} +export interface DenomOwnerAminoMsg { + type: "cosmos-sdk/DenomOwner"; + value: DenomOwnerAmino; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + */ +export interface DenomOwnerSDKType { + address: string; + balance: CoinSDKType; +} +/** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ +export interface QueryDenomOwnersResponse { + denomOwners: DenomOwner[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomOwnersResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse"; + value: Uint8Array; +} +/** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ +export interface QueryDenomOwnersResponseAmino { + denom_owners?: DenomOwnerAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomOwnersResponseAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersResponse"; + value: QueryDenomOwnersResponseAmino; +} +/** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ +export interface QueryDenomOwnersResponseSDKType { + denom_owners: DenomOwnerSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryBalanceRequest(): QueryBalanceRequest { + return { + address: "", + denom: "" + }; +} +export const QueryBalanceRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryBalanceRequestAminoMsg): QueryBalanceRequest { + return QueryBalanceRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryBalanceRequest): QueryBalanceRequestAminoMsg { + return { + type: "cosmos-sdk/QueryBalanceRequest", + value: QueryBalanceRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBalanceRequestProtoMsg): QueryBalanceRequest { + return QueryBalanceRequest.decode(message.value); + }, + toProto(message: QueryBalanceRequest): Uint8Array { + return QueryBalanceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceRequest): QueryBalanceRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", + value: QueryBalanceRequest.encode(message).finish() + }; + } +}; +function createBaseQueryBalanceResponse(): QueryBalanceResponse { + return { + balance: undefined + }; +} +export const QueryBalanceResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { + const obj: any = {}; + obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + return obj; + }, + fromAminoMsg(object: QueryBalanceResponseAminoMsg): QueryBalanceResponse { + return QueryBalanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryBalanceResponse): QueryBalanceResponseAminoMsg { + return { + type: "cosmos-sdk/QueryBalanceResponse", + value: QueryBalanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBalanceResponseProtoMsg): QueryBalanceResponse { + return QueryBalanceResponse.decode(message.value); + }, + toProto(message: QueryBalanceResponse): Uint8Array { + return QueryBalanceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceResponse): QueryBalanceResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", + value: QueryBalanceResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryAllBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + encode(message: QueryAllBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBalancesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllBalancesRequest { + const message = createBaseQueryAllBalancesRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllBalancesRequestAmino): QueryAllBalancesRequest { + const message = createBaseQueryAllBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllBalancesRequest): QueryAllBalancesRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllBalancesRequestAminoMsg): QueryAllBalancesRequest { + return QueryAllBalancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllBalancesRequest): QueryAllBalancesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllBalancesRequest", + value: QueryAllBalancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllBalancesRequestProtoMsg): QueryAllBalancesRequest { + return QueryAllBalancesRequest.decode(message.value); + }, + toProto(message: QueryAllBalancesRequest): Uint8Array { + return QueryAllBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllBalancesRequest): QueryAllBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + value: QueryAllBalancesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QueryAllBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + encode(message: QueryAllBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllBalancesResponseAminoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllBalancesResponse", + value: QueryAllBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllBalancesResponseProtoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.decode(message.value); + }, + toProto(message: QueryAllBalancesResponse): Uint8Array { + return QueryAllBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + value: QueryAllBalancesResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { + return { + address: "", + pagination: undefined + }; +} +export const QuerySpendableBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + encode(message: QuerySpendableBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalancesRequestAmino): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesRequestAminoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesRequestProtoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalancesRequest): Uint8Array { + return QuerySpendableBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QuerySpendableBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + encode(message: QuerySpendableBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalancesResponseAmino): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = message.balances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesResponseAminoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesResponseProtoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.decode(message.value); + }, + toProto(message: QuerySpendableBalancesResponse): Uint8Array { + return QuerySpendableBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { + return { + pagination: undefined + }; +} +export const QueryTotalSupplyRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + encode(message: QueryTotalSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalSupplyRequestAminoMsg): QueryTotalSupplyRequest { + return QueryTotalSupplyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTotalSupplyRequest", + value: QueryTotalSupplyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalSupplyRequestProtoMsg): QueryTotalSupplyRequest { + return QueryTotalSupplyRequest.decode(message.value); + }, + toProto(message: QueryTotalSupplyRequest): Uint8Array { + return QueryTotalSupplyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + value: QueryTotalSupplyRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { + return { + supply: [], + pagination: undefined + }; +} +export const QueryTotalSupplyResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + encode(message: QueryTotalSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.supply) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.supply.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTotalSupplyResponseAmino): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAmino { + const obj: any = {}; + if (message.supply) { + obj.supply = message.supply.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.supply = message.supply; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalSupplyResponseAminoMsg): QueryTotalSupplyResponse { + return QueryTotalSupplyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTotalSupplyResponse", + value: QueryTotalSupplyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalSupplyResponseProtoMsg): QueryTotalSupplyResponse { + return QueryTotalSupplyResponse.decode(message.value); + }, + toProto(message: QueryTotalSupplyResponse): Uint8Array { + return QueryTotalSupplyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + value: QueryTotalSupplyResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { + return { + denom: "" + }; +} +export const QuerySupplyOfRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + encode(message: QuerySupplyOfRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyOfRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QuerySupplyOfRequestAmino): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QuerySupplyOfRequest): QuerySupplyOfRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QuerySupplyOfRequestAminoMsg): QuerySupplyOfRequest { + return QuerySupplyOfRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyOfRequest): QuerySupplyOfRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyOfRequest", + value: QuerySupplyOfRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyOfRequestProtoMsg): QuerySupplyOfRequest { + return QuerySupplyOfRequest.decode(message.value); + }, + toProto(message: QuerySupplyOfRequest): Uint8Array { + return QuerySupplyOfRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyOfRequest): QuerySupplyOfRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + value: QuerySupplyOfRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QuerySupplyOfResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + encode(message: QuerySupplyOfResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyOfResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QuerySupplyOfResponseAmino): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySupplyOfResponseAminoMsg): QuerySupplyOfResponse { + return QuerySupplyOfResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyOfResponse): QuerySupplyOfResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyOfResponse", + value: QuerySupplyOfResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyOfResponseProtoMsg): QuerySupplyOfResponse { + return QuerySupplyOfResponse.decode(message.value); + }, + toProto(message: QuerySupplyOfResponse): Uint8Array { + return QuerySupplyOfResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyOfResponse): QuerySupplyOfResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + value: QuerySupplyOfResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { + return { + pagination: undefined + }; +} +export const QueryDenomsMetadataRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + encode(message: QueryDenomsMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomsMetadataRequestAmino): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomsMetadataRequestAminoMsg): QueryDenomsMetadataRequest { + return QueryDenomsMetadataRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomsMetadataRequest", + value: QueryDenomsMetadataRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsMetadataRequestProtoMsg): QueryDenomsMetadataRequest { + return QueryDenomsMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomsMetadataRequest): Uint8Array { + return QueryDenomsMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + value: QueryDenomsMetadataRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { + return { + metadatas: [], + pagination: undefined + }; +} +export const QueryDenomsMetadataResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + encode(message: QueryDenomsMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.metadatas) { + Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadatas.push(Metadata.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomsMetadataResponseAmino): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAmino { + const obj: any = {}; + if (message.metadatas) { + obj.metadatas = message.metadatas.map(e => e ? Metadata.toAmino(e) : undefined); + } else { + obj.metadatas = message.metadatas; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomsMetadataResponseAminoMsg): QueryDenomsMetadataResponse { + return QueryDenomsMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomsMetadataResponse", + value: QueryDenomsMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsMetadataResponseProtoMsg): QueryDenomsMetadataResponse { + return QueryDenomsMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomsMetadataResponse): Uint8Array { + return QueryDenomsMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + value: QueryDenomsMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { + return { + denom: "" + }; +} +export const QueryDenomMetadataRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + encode(message: QueryDenomMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomMetadataRequestAmino): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataRequestAminoMsg): QueryDenomMetadataRequest { + return QueryDenomMetadataRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataRequest", + value: QueryDenomMetadataRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataRequestProtoMsg): QueryDenomMetadataRequest { + return QueryDenomMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomMetadataRequest): Uint8Array { + return QueryDenomMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + value: QueryDenomMetadataRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { + return { + metadata: Metadata.fromPartial({}) + }; +} +export const QueryDenomMetadataResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + encode(message: QueryDenomMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: QueryDenomMetadataResponseAmino): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAmino { + const obj: any = {}; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataResponseAminoMsg): QueryDenomMetadataResponse { + return QueryDenomMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataResponse", + value: QueryDenomMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataResponseProtoMsg): QueryDenomMetadataResponse { + return QueryDenomMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomMetadataResponse): Uint8Array { + return QueryDenomMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + value: QueryDenomMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { + return { + denom: "", + pagination: undefined + }; +} +export const QueryDenomOwnersRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + encode(message: QueryDenomOwnersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); + message.denom = object.denom ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersRequestAmino): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersRequestAminoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersRequestProtoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.decode(message.value); + }, + toProto(message: QueryDenomOwnersRequest): Uint8Array { + return QueryDenomOwnersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.encode(message).finish() + }; + } +}; +function createBaseDenomOwner(): DenomOwner { + return { + address: "", + balance: Coin.fromPartial({}) + }; +} +export const DenomOwner = { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + encode(message: DenomOwner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomOwner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomOwner { + const message = createBaseDenomOwner(); + message.address = object.address ?? ""; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: DenomOwnerAmino): DenomOwner { + const message = createBaseDenomOwner(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: DenomOwner): DenomOwnerAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + return obj; + }, + fromAminoMsg(object: DenomOwnerAminoMsg): DenomOwner { + return DenomOwner.fromAmino(object.value); + }, + toAminoMsg(message: DenomOwner): DenomOwnerAminoMsg { + return { + type: "cosmos-sdk/DenomOwner", + value: DenomOwner.toAmino(message) + }; + }, + fromProtoMsg(message: DenomOwnerProtoMsg): DenomOwner { + return DenomOwner.decode(message.value); + }, + toProto(message: DenomOwner): Uint8Array { + return DenomOwner.encode(message).finish(); + }, + toProtoMsg(message: DenomOwner): DenomOwnerProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + value: DenomOwner.encode(message).finish() + }; + } +}; +function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + encode(message: QueryDenomOwnersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomOwners) { + DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomOwners.push(DenomOwner.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denomOwners?.map(e => DenomOwner.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersResponseAmino): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denom_owners?.map(e => DenomOwner.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAmino { + const obj: any = {}; + if (message.denomOwners) { + obj.denom_owners = message.denomOwners.map(e => e ? DenomOwner.toAmino(e) : undefined); + } else { + obj.denom_owners = message.denomOwners; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersResponseAminoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersResponseProtoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.decode(message.value); + }, + toProto(message: QueryDenomOwnersResponse): Uint8Array { + return QueryDenomOwnersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.amino.ts new file mode 100644 index 00000000..340a07fc --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgSend, MsgMultiSend } from "./tx"; +export const AminoConverter = { + "/cosmos.bank.v1beta1.MsgSend": { + aminoType: "cosmos-sdk/MsgSend", + toAmino: MsgSend.toAmino, + fromAmino: MsgSend.fromAmino + }, + "/cosmos.bank.v1beta1.MsgMultiSend": { + aminoType: "cosmos-sdk/MsgMultiSend", + toAmino: MsgMultiSend.toAmino, + fromAmino: MsgMultiSend.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.registry.ts new file mode 100644 index 00000000..716f9d0d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSend, MsgMultiSend } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.encode(value).finish() + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.encode(value).finish() + }; + } + }, + withTypeUrl: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value + }; + } + }, + fromPartial: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.fromPartial(value) + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..31fc997d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse } from "./tx"; +/** Msg defines the bank Msg service. */ +export interface Msg { + /** Send defines a method for sending coins from one account to another account. */ + send(request: MsgSend): Promise; + /** MultiSend defines a method for sending coins from some accounts to other accounts. */ + multiSend(request: MsgMultiSend): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.send = this.send.bind(this); + this.multiSend = this.multiSend.bind(this); + } + send(request: MsgSend): Promise { + const data = MsgSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); + return promise.then(data => MsgSendResponse.decode(new BinaryReader(data))); + } + multiSend(request: MsgMultiSend): Promise { + const data = MsgMultiSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); + return promise.then(data => MsgMultiSendResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 00000000..6349f1de --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,373 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType } from "./bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +export interface MsgSendProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSend"; + value: Uint8Array; +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendAmino { + from_address?: string; + to_address?: string; + amount?: CoinAmino[]; +} +export interface MsgSendAminoMsg { + type: "cosmos-sdk/MsgSend"; + value: MsgSendAmino; +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} +export interface MsgSendResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse"; + value: Uint8Array; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseAmino {} +export interface MsgSendResponseAminoMsg { + type: "cosmos-sdk/MsgSendResponse"; + value: MsgSendResponseAmino; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseSDKType {} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSend { + inputs: Input[]; + outputs: Output[]; +} +export interface MsgMultiSendProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend"; + value: Uint8Array; +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendAmino { + inputs?: InputAmino[]; + outputs?: OutputAmino[]; +} +export interface MsgMultiSendAminoMsg { + type: "cosmos-sdk/MsgMultiSend"; + value: MsgMultiSendAmino; +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendSDKType { + inputs: InputSDKType[]; + outputs: OutputSDKType[]; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponse {} +export interface MsgMultiSendResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse"; + value: Uint8Array; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseAmino {} +export interface MsgMultiSendResponseAminoMsg { + type: "cosmos-sdk/MsgMultiSendResponse"; + value: MsgMultiSendResponseAmino; +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseSDKType {} +function createBaseMsgSend(): MsgSend { + return { + fromAddress: "", + toAddress: "", + amount: [] + }; +} +export const MsgSend = { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSend { + const message = createBaseMsgSend(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSendAmino): MsgSend { + const message = createBaseMsgSend(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgSend): MsgSendAmino { + const obj: any = {}; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgSendAminoMsg): MsgSend { + return MsgSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgSend): MsgSendAminoMsg { + return { + type: "cosmos-sdk/MsgSend", + value: MsgSend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendProtoMsg): MsgSend { + return MsgSend.decode(message.value); + }, + toProto(message: MsgSend): Uint8Array { + return MsgSend.encode(message).finish(); + }, + toProtoMsg(message: MsgSend): MsgSendProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.encode(message).finish() + }; + } +}; +function createBaseMsgSendResponse(): MsgSendResponse { + return {}; +} +export const MsgSendResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse", + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSendResponse { + const message = createBaseMsgSendResponse(); + return message; + }, + fromAmino(_: MsgSendResponseAmino): MsgSendResponse { + const message = createBaseMsgSendResponse(); + return message; + }, + toAmino(_: MsgSendResponse): MsgSendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSendResponseAminoMsg): MsgSendResponse { + return MsgSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSendResponse): MsgSendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSendResponse", + value: MsgSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendResponseProtoMsg): MsgSendResponse { + return MsgSendResponse.decode(message.value); + }, + toProto(message: MsgSendResponse): Uint8Array { + return MsgSendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendResponse): MsgSendResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse", + value: MsgSendResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMultiSend(): MsgMultiSend { + return { + inputs: [], + outputs: [] + }; +} +export const MsgMultiSend = { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + encode(message: MsgMultiSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.inputs) { + Input.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())); + break; + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromPartial(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgMultiSendAmino): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromAmino(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgMultiSend): MsgMultiSendAmino { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map(e => e ? Input.toAmino(e) : undefined); + } else { + obj.inputs = message.inputs; + } + if (message.outputs) { + obj.outputs = message.outputs.map(e => e ? Output.toAmino(e) : undefined); + } else { + obj.outputs = message.outputs; + } + return obj; + }, + fromAminoMsg(object: MsgMultiSendAminoMsg): MsgMultiSend { + return MsgMultiSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSend): MsgMultiSendAminoMsg { + return { + type: "cosmos-sdk/MsgMultiSend", + value: MsgMultiSend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMultiSendProtoMsg): MsgMultiSend { + return MsgMultiSend.decode(message.value); + }, + toProto(message: MsgMultiSend): Uint8Array { + return MsgMultiSend.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSend): MsgMultiSendProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.encode(message).finish() + }; + } +}; +function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { + return {}; +} +export const MsgMultiSendResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + encode(_: MsgMultiSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, + toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMultiSendResponseAminoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgMultiSendResponse", + value: MsgMultiSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMultiSendResponseProtoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.decode(message.value); + }, + toProto(message: MsgMultiSendResponse): Uint8Array { + return MsgMultiSendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + value: MsgMultiSendResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/base/abci/v1beta1/abci.ts b/dydxjs/packages/dydxjs/src/cosmos/base/abci/v1beta1/abci.ts new file mode 100644 index 00000000..cef6bf01 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/base/abci/v1beta1/abci.ts @@ -0,0 +1,1518 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Event, EventAmino, EventSDKType } from "../../../../tendermint/abci/types"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponse { + /** The block height */ + height: bigint; + /** The transaction hash. */ + txhash: string; + /** Namespace for the Code */ + codespace: string; + /** Response code. */ + code: number; + /** Result bytes, if any. */ + data: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + rawLog: string; + /** The output of the application's logger (typed). May be non-deterministic. */ + logs: ABCIMessageLog[]; + /** Additional information. May be non-deterministic. */ + info: string; + /** Amount of gas requested for transaction. */ + gasWanted: bigint; + /** Amount of gas consumed by transaction. */ + gasUsed: bigint; + /** The request transaction bytes. */ + tx?: Any; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp: string; + /** + * Events defines all the events emitted by processing a transaction. Note, + * these events include those emitted by processing all the messages and those + * emitted from the ante handler. Whereas Logs contains the events, with + * additional metadata, emitted only by processing the messages. + * + * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + */ + events: Event[]; +} +export interface TxResponseProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse"; + value: Uint8Array; +} +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponseAmino { + /** The block height */ + height?: string; + /** The transaction hash. */ + txhash?: string; + /** Namespace for the Code */ + codespace?: string; + /** Response code. */ + code?: number; + /** Result bytes, if any. */ + data?: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + raw_log?: string; + /** The output of the application's logger (typed). May be non-deterministic. */ + logs?: ABCIMessageLogAmino[]; + /** Additional information. May be non-deterministic. */ + info?: string; + /** Amount of gas requested for transaction. */ + gas_wanted?: string; + /** Amount of gas consumed by transaction. */ + gas_used?: string; + /** The request transaction bytes. */ + tx?: AnyAmino; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp?: string; + /** + * Events defines all the events emitted by processing a transaction. Note, + * these events include those emitted by processing all the messages and those + * emitted from the ante handler. Whereas Logs contains the events, with + * additional metadata, emitted only by processing the messages. + * + * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + */ + events?: EventAmino[]; +} +export interface TxResponseAminoMsg { + type: "cosmos-sdk/TxResponse"; + value: TxResponseAmino; +} +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponseSDKType { + height: bigint; + txhash: string; + codespace: string; + code: number; + data: string; + raw_log: string; + logs: ABCIMessageLogSDKType[]; + info: string; + gas_wanted: bigint; + gas_used: bigint; + tx?: AnySDKType; + timestamp: string; + events: EventSDKType[]; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLog { + msgIndex: number; + log: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events: StringEvent[]; +} +export interface ABCIMessageLogProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog"; + value: Uint8Array; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLogAmino { + msg_index: number; + log?: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events?: StringEventAmino[]; +} +export interface ABCIMessageLogAminoMsg { + type: "cosmos-sdk/ABCIMessageLog"; + value: ABCIMessageLogAmino; +} +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLogSDKType { + msg_index: number; + log: string; + events: StringEventSDKType[]; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEvent { + type: string; + attributes: Attribute[]; +} +export interface StringEventProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent"; + value: Uint8Array; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEventAmino { + type?: string; + attributes?: AttributeAmino[]; +} +export interface StringEventAminoMsg { + type: "cosmos-sdk/StringEvent"; + value: StringEventAmino; +} +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEventSDKType { + type: string; + attributes: AttributeSDKType[]; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface Attribute { + key: string; + value: string; +} +export interface AttributeProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute"; + value: Uint8Array; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface AttributeAmino { + key?: string; + value?: string; +} +export interface AttributeAminoMsg { + type: "cosmos-sdk/Attribute"; + value: AttributeAmino; +} +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface AttributeSDKType { + key: string; + value: string; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfo { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gasWanted: bigint; + /** GasUsed is the amount of gas actually consumed. */ + gasUsed: bigint; +} +export interface GasInfoProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo"; + value: Uint8Array; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfoAmino { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gas_wanted?: string; + /** GasUsed is the amount of gas actually consumed. */ + gas_used?: string; +} +export interface GasInfoAminoMsg { + type: "cosmos-sdk/GasInfo"; + value: GasInfoAmino; +} +/** GasInfo defines tx execution gas context. */ +export interface GasInfoSDKType { + gas_wanted: bigint; + gas_used: bigint; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +export interface Result { + /** + * Data is any data returned from message or handler execution. It MUST be + * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. + */ + /** @deprecated */ + data: Uint8Array; + /** Log contains the log information from message or handler execution. */ + log: string; + /** + * Events contains a slice of Event objects that were emitted during message + * or handler execution. + */ + events: Event[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; +} +export interface ResultProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.Result"; + value: Uint8Array; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +export interface ResultAmino { + /** + * Data is any data returned from message or handler execution. It MUST be + * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. + */ + /** @deprecated */ + data?: string; + /** Log contains the log information from message or handler execution. */ + log?: string; + /** + * Events contains a slice of Event objects that were emitted during message + * or handler execution. + */ + events?: EventAmino[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; +} +export interface ResultAminoMsg { + type: "cosmos-sdk/Result"; + value: ResultAmino; +} +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +export interface ResultSDKType { + /** @deprecated */ + data: Uint8Array; + log: string; + events: EventSDKType[]; + msg_responses: AnySDKType[]; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponse { + gasInfo: GasInfo; + result?: Result; +} +export interface SimulationResponseProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; + value: Uint8Array; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponseAmino { + gas_info?: GasInfoAmino; + result?: ResultAmino; +} +export interface SimulationResponseAminoMsg { + type: "cosmos-sdk/SimulationResponse"; + value: SimulationResponseAmino; +} +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponseSDKType { + gas_info: GasInfoSDKType; + result?: ResultSDKType; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgData { + msgType: string; + data: Uint8Array; +} +export interface MsgDataProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData"; + value: Uint8Array; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgDataAmino { + msg_type?: string; + data?: string; +} +export interface MsgDataAminoMsg { + type: "cosmos-sdk/MsgData"; + value: MsgDataAmino; +} +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +/** @deprecated */ +export interface MsgDataSDKType { + msg_type: string; + data: Uint8Array; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * for each message. + */ +export interface TxMsgData { + /** data field is deprecated and not populated. */ + /** @deprecated */ + data: MsgData[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; +} +export interface TxMsgDataProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData"; + value: Uint8Array; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * for each message. + */ +export interface TxMsgDataAmino { + /** data field is deprecated and not populated. */ + /** @deprecated */ + data?: MsgDataAmino[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; +} +export interface TxMsgDataAminoMsg { + type: "cosmos-sdk/TxMsgData"; + value: TxMsgDataAmino; +} +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * for each message. + */ +export interface TxMsgDataSDKType { + /** @deprecated */ + data: MsgDataSDKType[]; + msg_responses: AnySDKType[]; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResult { + /** Count of all txs */ + totalCount: bigint; + /** Count of txs in current page */ + count: bigint; + /** Index of current page, start from 1 */ + pageNumber: bigint; + /** Count of total pages */ + pageTotal: bigint; + /** Max count txs per page */ + limit: bigint; + /** List of txs in current page */ + txs: TxResponse[]; +} +export interface SearchTxsResultProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult"; + value: Uint8Array; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResultAmino { + /** Count of all txs */ + total_count?: string; + /** Count of txs in current page */ + count?: string; + /** Index of current page, start from 1 */ + page_number?: string; + /** Count of total pages */ + page_total?: string; + /** Max count txs per page */ + limit?: string; + /** List of txs in current page */ + txs?: TxResponseAmino[]; +} +export interface SearchTxsResultAminoMsg { + type: "cosmos-sdk/SearchTxsResult"; + value: SearchTxsResultAmino; +} +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResultSDKType { + total_count: bigint; + count: bigint; + page_number: bigint; + page_total: bigint; + limit: bigint; + txs: TxResponseSDKType[]; +} +function createBaseTxResponse(): TxResponse { + return { + height: BigInt(0), + txhash: "", + codespace: "", + code: 0, + data: "", + rawLog: "", + logs: [], + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + tx: undefined, + timestamp: "", + events: [] + }; +} +export const TxResponse = { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + encode(message: TxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.txhash !== "") { + writer.uint32(18).string(message.txhash); + } + if (message.codespace !== "") { + writer.uint32(26).string(message.codespace); + } + if (message.code !== 0) { + writer.uint32(32).uint32(message.code); + } + if (message.data !== "") { + writer.uint32(42).string(message.data); + } + if (message.rawLog !== "") { + writer.uint32(50).string(message.rawLog); + } + for (const v of message.logs) { + ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.info !== "") { + writer.uint32(66).string(message.info); + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(72).int64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(80).int64(message.gasUsed); + } + if (message.tx !== undefined) { + Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); + } + if (message.timestamp !== "") { + writer.uint32(98).string(message.timestamp); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.txhash = reader.string(); + break; + case 3: + message.codespace = reader.string(); + break; + case 4: + message.code = reader.uint32(); + break; + case 5: + message.data = reader.string(); + break; + case 6: + message.rawLog = reader.string(); + break; + case 7: + message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); + break; + case 8: + message.info = reader.string(); + break; + case 9: + message.gasWanted = reader.int64(); + break; + case 10: + message.gasUsed = reader.int64(); + break; + case 11: + message.tx = Any.decode(reader, reader.uint32()); + break; + case 12: + message.timestamp = reader.string(); + break; + case 13: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxResponse { + const message = createBaseTxResponse(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.txhash = object.txhash ?? ""; + message.codespace = object.codespace ?? ""; + message.code = object.code ?? 0; + message.data = object.data ?? ""; + message.rawLog = object.rawLog ?? ""; + message.logs = object.logs?.map(e => ABCIMessageLog.fromPartial(e)) || []; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); + message.tx = object.tx !== undefined && object.tx !== null ? Any.fromPartial(object.tx) : undefined; + message.timestamp = object.timestamp ?? ""; + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxResponseAmino): TxResponse { + const message = createBaseTxResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.raw_log !== undefined && object.raw_log !== null) { + message.rawLog = object.raw_log; + } + message.logs = object.logs?.map(e => ABCIMessageLog.fromAmino(e)) || []; + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromAmino(object.tx); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxResponse): TxResponseAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.txhash = message.txhash === "" ? undefined : message.txhash; + obj.codespace = message.codespace === "" ? undefined : message.codespace; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data === "" ? undefined : message.data; + obj.raw_log = message.rawLog === "" ? undefined : message.rawLog; + if (message.logs) { + obj.logs = message.logs.map(e => e ? ABCIMessageLog.toAmino(e) : undefined); + } else { + obj.logs = message.logs; + } + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; + obj.tx = message.tx ? Any.toAmino(message.tx) : undefined; + obj.timestamp = message.timestamp === "" ? undefined : message.timestamp; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: TxResponseAminoMsg): TxResponse { + return TxResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxResponse): TxResponseAminoMsg { + return { + type: "cosmos-sdk/TxResponse", + value: TxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxResponseProtoMsg): TxResponse { + return TxResponse.decode(message.value); + }, + toProto(message: TxResponse): Uint8Array { + return TxResponse.encode(message).finish(); + }, + toProtoMsg(message: TxResponse): TxResponseProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + value: TxResponse.encode(message).finish() + }; + } +}; +function createBaseABCIMessageLog(): ABCIMessageLog { + return { + msgIndex: 0, + log: "", + events: [] + }; +} +export const ABCIMessageLog = { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + encode(message: ABCIMessageLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgIndex !== 0) { + writer.uint32(8).uint32(message.msgIndex); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + for (const v of message.events) { + StringEvent.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ABCIMessageLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIMessageLog(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgIndex = reader.uint32(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(StringEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ABCIMessageLog { + const message = createBaseABCIMessageLog(); + message.msgIndex = object.msgIndex ?? 0; + message.log = object.log ?? ""; + message.events = object.events?.map(e => StringEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ABCIMessageLogAmino): ABCIMessageLog { + const message = createBaseABCIMessageLog(); + if (object.msg_index !== undefined && object.msg_index !== null) { + message.msgIndex = object.msg_index; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => StringEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { + const obj: any = {}; + obj.msg_index = message.msgIndex ?? 0; + obj.log = message.log === "" ? undefined : message.log; + if (message.events) { + obj.events = message.events.map(e => e ? StringEvent.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: ABCIMessageLogAminoMsg): ABCIMessageLog { + return ABCIMessageLog.fromAmino(object.value); + }, + toAminoMsg(message: ABCIMessageLog): ABCIMessageLogAminoMsg { + return { + type: "cosmos-sdk/ABCIMessageLog", + value: ABCIMessageLog.toAmino(message) + }; + }, + fromProtoMsg(message: ABCIMessageLogProtoMsg): ABCIMessageLog { + return ABCIMessageLog.decode(message.value); + }, + toProto(message: ABCIMessageLog): Uint8Array { + return ABCIMessageLog.encode(message).finish(); + }, + toProtoMsg(message: ABCIMessageLog): ABCIMessageLogProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + value: ABCIMessageLog.encode(message).finish() + }; + } +}; +function createBaseStringEvent(): StringEvent { + return { + type: "", + attributes: [] + }; +} +export const StringEvent = { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + encode(message: StringEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StringEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(Attribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StringEvent { + const message = createBaseStringEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map(e => Attribute.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StringEventAmino): StringEvent { + const message = createBaseStringEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => Attribute.fromAmino(e)) || []; + return message; + }, + toAmino(message: StringEvent): StringEventAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? Attribute.toAmino(e) : undefined); + } else { + obj.attributes = message.attributes; + } + return obj; + }, + fromAminoMsg(object: StringEventAminoMsg): StringEvent { + return StringEvent.fromAmino(object.value); + }, + toAminoMsg(message: StringEvent): StringEventAminoMsg { + return { + type: "cosmos-sdk/StringEvent", + value: StringEvent.toAmino(message) + }; + }, + fromProtoMsg(message: StringEventProtoMsg): StringEvent { + return StringEvent.decode(message.value); + }, + toProto(message: StringEvent): Uint8Array { + return StringEvent.encode(message).finish(); + }, + toProtoMsg(message: StringEvent): StringEventProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + value: StringEvent.encode(message).finish() + }; + } +}; +function createBaseAttribute(): Attribute { + return { + key: "", + value: "" + }; +} +export const Attribute = { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + encode(message: Attribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Attribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Attribute { + const message = createBaseAttribute(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: AttributeAmino): Attribute { + const message = createBaseAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: Attribute): AttributeAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: AttributeAminoMsg): Attribute { + return Attribute.fromAmino(object.value); + }, + toAminoMsg(message: Attribute): AttributeAminoMsg { + return { + type: "cosmos-sdk/Attribute", + value: Attribute.toAmino(message) + }; + }, + fromProtoMsg(message: AttributeProtoMsg): Attribute { + return Attribute.decode(message.value); + }, + toProto(message: Attribute): Uint8Array { + return Attribute.encode(message).finish(); + }, + toProtoMsg(message: Attribute): AttributeProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + value: Attribute.encode(message).finish() + }; + } +}; +function createBaseGasInfo(): GasInfo { + return { + gasWanted: BigInt(0), + gasUsed: BigInt(0) + }; +} +export const GasInfo = { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + encode(message: GasInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasWanted !== BigInt(0)) { + writer.uint32(8).uint64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(16).uint64(message.gasUsed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GasInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasWanted = reader.uint64(); + break; + case 2: + message.gasUsed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GasInfo { + const message = createBaseGasInfo(); + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GasInfoAmino): GasInfo { + const message = createBaseGasInfo(); + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + return message; + }, + toAmino(message: GasInfo): GasInfoAmino { + const obj: any = {}; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GasInfoAminoMsg): GasInfo { + return GasInfo.fromAmino(object.value); + }, + toAminoMsg(message: GasInfo): GasInfoAminoMsg { + return { + type: "cosmos-sdk/GasInfo", + value: GasInfo.toAmino(message) + }; + }, + fromProtoMsg(message: GasInfoProtoMsg): GasInfo { + return GasInfo.decode(message.value); + }, + toProto(message: GasInfo): Uint8Array { + return GasInfo.encode(message).finish(); + }, + toProtoMsg(message: GasInfo): GasInfoProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + value: GasInfo.encode(message).finish() + }; + } +}; +function createBaseResult(): Result { + return { + data: new Uint8Array(), + log: "", + events: [], + msgResponses: [] + }; +} +export const Result = { + typeUrl: "/cosmos.base.abci.v1beta1.Result", + encode(message: Result, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Result { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 4: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Result { + const message = createBaseResult(); + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ResultAmino): Result { + const message = createBaseResult(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: Result): ResultAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = message.msgResponses; + } + return obj; + }, + fromAminoMsg(object: ResultAminoMsg): Result { + return Result.fromAmino(object.value); + }, + toAminoMsg(message: Result): ResultAminoMsg { + return { + type: "cosmos-sdk/Result", + value: Result.toAmino(message) + }; + }, + fromProtoMsg(message: ResultProtoMsg): Result { + return Result.decode(message.value); + }, + toProto(message: Result): Uint8Array { + return Result.encode(message).finish(); + }, + toProtoMsg(message: Result): ResultProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.Result", + value: Result.encode(message).finish() + }; + } +}; +function createBaseSimulationResponse(): SimulationResponse { + return { + gasInfo: GasInfo.fromPartial({}), + result: undefined + }; +} +export const SimulationResponse = { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + encode(message: SimulationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SimulationResponse { + const message = createBaseSimulationResponse(); + message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; + message.result = object.result !== undefined && object.result !== null ? Result.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: SimulationResponseAmino): SimulationResponse { + const message = createBaseSimulationResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; + }, + toAmino(message: SimulationResponse): SimulationResponseAmino { + const obj: any = {}; + obj.gas_info = message.gasInfo ? GasInfo.toAmino(message.gasInfo) : undefined; + obj.result = message.result ? Result.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: SimulationResponseAminoMsg): SimulationResponse { + return SimulationResponse.fromAmino(object.value); + }, + toAminoMsg(message: SimulationResponse): SimulationResponseAminoMsg { + return { + type: "cosmos-sdk/SimulationResponse", + value: SimulationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SimulationResponseProtoMsg): SimulationResponse { + return SimulationResponse.decode(message.value); + }, + toProto(message: SimulationResponse): Uint8Array { + return SimulationResponse.encode(message).finish(); + }, + toProtoMsg(message: SimulationResponse): SimulationResponseProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + value: SimulationResponse.encode(message).finish() + }; + } +}; +function createBaseMsgData(): MsgData { + return { + msgType: "", + data: new Uint8Array() + }; +} +export const MsgData = { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + encode(message: MsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgType !== "") { + writer.uint32(10).string(message.msgType); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgType = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgData { + const message = createBaseMsgData(); + message.msgType = object.msgType ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgDataAmino): MsgData { + const message = createBaseMsgData(); + if (object.msg_type !== undefined && object.msg_type !== null) { + message.msgType = object.msg_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgData): MsgDataAmino { + const obj: any = {}; + obj.msg_type = message.msgType === "" ? undefined : message.msgType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDataAminoMsg): MsgData { + return MsgData.fromAmino(object.value); + }, + toAminoMsg(message: MsgData): MsgDataAminoMsg { + return { + type: "cosmos-sdk/MsgData", + value: MsgData.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDataProtoMsg): MsgData { + return MsgData.decode(message.value); + }, + toProto(message: MsgData): Uint8Array { + return MsgData.encode(message).finish(); + }, + toProtoMsg(message: MsgData): MsgDataProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + value: MsgData.encode(message).finish() + }; + } +}; +function createBaseTxMsgData(): TxMsgData { + return { + data: [], + msgResponses: [] + }; +} +export const TxMsgData = { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + encode(message: TxMsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.data) { + MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxMsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxMsgData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data.push(MsgData.decode(reader, reader.uint32())); + break; + case 2: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxMsgData { + const message = createBaseTxMsgData(); + message.data = object.data?.map(e => MsgData.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxMsgDataAmino): TxMsgData { + const message = createBaseTxMsgData(); + message.data = object.data?.map(e => MsgData.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxMsgData): TxMsgDataAmino { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? MsgData.toAmino(e) : undefined); + } else { + obj.data = message.data; + } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = message.msgResponses; + } + return obj; + }, + fromAminoMsg(object: TxMsgDataAminoMsg): TxMsgData { + return TxMsgData.fromAmino(object.value); + }, + toAminoMsg(message: TxMsgData): TxMsgDataAminoMsg { + return { + type: "cosmos-sdk/TxMsgData", + value: TxMsgData.toAmino(message) + }; + }, + fromProtoMsg(message: TxMsgDataProtoMsg): TxMsgData { + return TxMsgData.decode(message.value); + }, + toProto(message: TxMsgData): Uint8Array { + return TxMsgData.encode(message).finish(); + }, + toProtoMsg(message: TxMsgData): TxMsgDataProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + value: TxMsgData.encode(message).finish() + }; + } +}; +function createBaseSearchTxsResult(): SearchTxsResult { + return { + totalCount: BigInt(0), + count: BigInt(0), + pageNumber: BigInt(0), + pageTotal: BigInt(0), + limit: BigInt(0), + txs: [] + }; +} +export const SearchTxsResult = { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + encode(message: SearchTxsResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalCount !== BigInt(0)) { + writer.uint32(8).uint64(message.totalCount); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).uint64(message.count); + } + if (message.pageNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.pageNumber); + } + if (message.pageTotal !== BigInt(0)) { + writer.uint32(32).uint64(message.pageTotal); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).uint64(message.limit); + } + for (const v of message.txs) { + TxResponse.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SearchTxsResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSearchTxsResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCount = reader.uint64(); + break; + case 2: + message.count = reader.uint64(); + break; + case 3: + message.pageNumber = reader.uint64(); + break; + case 4: + message.pageTotal = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; + case 6: + message.txs.push(TxResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SearchTxsResult { + const message = createBaseSearchTxsResult(); + message.totalCount = object.totalCount !== undefined && object.totalCount !== null ? BigInt(object.totalCount.toString()) : BigInt(0); + message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0); + message.pageNumber = object.pageNumber !== undefined && object.pageNumber !== null ? BigInt(object.pageNumber.toString()) : BigInt(0); + message.pageTotal = object.pageTotal !== undefined && object.pageTotal !== null ? BigInt(object.pageTotal.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.txs = object.txs?.map(e => TxResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SearchTxsResultAmino): SearchTxsResult { + const message = createBaseSearchTxsResult(); + if (object.total_count !== undefined && object.total_count !== null) { + message.totalCount = BigInt(object.total_count); + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + if (object.page_number !== undefined && object.page_number !== null) { + message.pageNumber = BigInt(object.page_number); + } + if (object.page_total !== undefined && object.page_total !== null) { + message.pageTotal = BigInt(object.page_total); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + message.txs = object.txs?.map(e => TxResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: SearchTxsResult): SearchTxsResultAmino { + const obj: any = {}; + obj.total_count = message.totalCount !== BigInt(0) ? message.totalCount.toString() : undefined; + obj.count = message.count !== BigInt(0) ? message.count.toString() : undefined; + obj.page_number = message.pageNumber !== BigInt(0) ? message.pageNumber.toString() : undefined; + obj.page_total = message.pageTotal !== BigInt(0) ? message.pageTotal.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; + if (message.txs) { + obj.txs = message.txs.map(e => e ? TxResponse.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + return obj; + }, + fromAminoMsg(object: SearchTxsResultAminoMsg): SearchTxsResult { + return SearchTxsResult.fromAmino(object.value); + }, + toAminoMsg(message: SearchTxsResult): SearchTxsResultAminoMsg { + return { + type: "cosmos-sdk/SearchTxsResult", + value: SearchTxsResult.toAmino(message) + }; + }, + fromProtoMsg(message: SearchTxsResultProtoMsg): SearchTxsResult { + return SearchTxsResult.decode(message.value); + }, + toProto(message: SearchTxsResult): Uint8Array { + return SearchTxsResult.encode(message).finish(); + }, + toProtoMsg(message: SearchTxsResult): SearchTxsResultProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + value: SearchTxsResult.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/base/query/v1beta1/pagination.ts b/dydxjs/packages/dydxjs/src/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..7428fe06 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,372 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: Uint8Array; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: bigint; + /** + * limit is the total number of results to be returned in the result page. + * If left empty it will default to a value to be set by each app. + */ + limit: bigint; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + countTotal: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} +export interface PageRequestProtoMsg { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest"; + value: Uint8Array; +} +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequestAmino { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key?: string; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset?: string; + /** + * limit is the total number of results to be returned in the result page. + * If left empty it will default to a value to be set by each app. + */ + limit?: string; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + count_total?: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse?: boolean; +} +export interface PageRequestAminoMsg { + type: "cosmos-sdk/PageRequest"; + value: PageRequestAmino; +} +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequestSDKType { + key: Uint8Array; + offset: bigint; + limit: bigint; + count_total: boolean; + reverse: boolean; +} +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently. It will be empty if + * there are no more results. + */ + nextKey: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: bigint; +} +export interface PageResponseProtoMsg { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse"; + value: Uint8Array; +} +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponseAmino { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently. It will be empty if + * there are no more results. + */ + next_key?: string; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total?: string; +} +export interface PageResponseAminoMsg { + type: "cosmos-sdk/PageResponse"; + value: PageResponseAmino; +} +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponseSDKType { + next_key: Uint8Array; + total: bigint; +} +function createBasePageRequest(): PageRequest { + return { + key: new Uint8Array(), + offset: BigInt(0), + limit: BigInt(0), + countTotal: false, + reverse: false + }; +} +export const PageRequest = { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + encode(message: PageRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== BigInt(0)) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== BigInt(0)) { + writer.uint32(24).uint64(message.limit); + } + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.countTotal = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset !== undefined && object.offset !== null ? BigInt(object.offset.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, + fromAmino(object: PageRequestAmino): PageRequest { + const message = createBasePageRequest(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = BigInt(object.offset); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.count_total !== undefined && object.count_total !== null) { + message.countTotal = object.count_total; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } + return message; + }, + toAmino(message: PageRequest): PageRequestAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.offset = message.offset !== BigInt(0) ? message.offset.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; + obj.count_total = message.countTotal === false ? undefined : message.countTotal; + obj.reverse = message.reverse === false ? undefined : message.reverse; + return obj; + }, + fromAminoMsg(object: PageRequestAminoMsg): PageRequest { + return PageRequest.fromAmino(object.value); + }, + toAminoMsg(message: PageRequest): PageRequestAminoMsg { + return { + type: "cosmos-sdk/PageRequest", + value: PageRequest.toAmino(message) + }; + }, + fromProtoMsg(message: PageRequestProtoMsg): PageRequest { + return PageRequest.decode(message.value); + }, + toProto(message: PageRequest): Uint8Array { + return PageRequest.encode(message).finish(); + }, + toProtoMsg(message: PageRequest): PageRequestProtoMsg { + return { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + value: PageRequest.encode(message).finish() + }; + } +}; +function createBasePageResponse(): PageResponse { + return { + nextKey: new Uint8Array(), + total: BigInt(0) + }; +} +export const PageResponse = { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + encode(message: PageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextKey.length !== 0) { + writer.uint32(10).bytes(message.nextKey); + } + if (message.total !== BigInt(0)) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PageResponseAmino): PageResponse { + const message = createBasePageResponse(); + if (object.next_key !== undefined && object.next_key !== null) { + message.nextKey = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; + }, + toAmino(message: PageResponse): PageResponseAmino { + const obj: any = {}; + obj.next_key = message.nextKey ? base64FromBytes(message.nextKey) : undefined; + obj.total = message.total !== BigInt(0) ? message.total.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PageResponseAminoMsg): PageResponse { + return PageResponse.fromAmino(object.value); + }, + toAminoMsg(message: PageResponse): PageResponseAminoMsg { + return { + type: "cosmos-sdk/PageResponse", + value: PageResponse.toAmino(message) + }; + }, + fromProtoMsg(message: PageResponseProtoMsg): PageResponse { + return PageResponse.decode(message.value); + }, + toProto(message: PageResponse): Uint8Array { + return PageResponse.encode(message).finish(); + }, + toProtoMsg(message: PageResponse): PageResponseProtoMsg { + return { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + value: PageResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/base/reflection/v2alpha1/reflection.ts b/dydxjs/packages/dydxjs/src/cosmos/base/reflection/v2alpha1/reflection.ts new file mode 100644 index 00000000..85b1d03e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/base/reflection/v2alpha1/reflection.ts @@ -0,0 +1,2614 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** AppDescriptor describes a cosmos-sdk based application */ +export interface AppDescriptor { + /** + * AuthnDescriptor provides information on how to authenticate transactions on the application + * NOTE: experimental and subject to change in future releases. + */ + authn?: AuthnDescriptor; + /** chain provides the chain descriptor */ + chain?: ChainDescriptor; + /** codec provides metadata information regarding codec related types */ + codec?: CodecDescriptor; + /** configuration provides metadata information regarding the sdk.Config type */ + configuration?: ConfigurationDescriptor; + /** query_services provides metadata information regarding the available queriable endpoints */ + queryServices?: QueryServicesDescriptor; + /** tx provides metadata information regarding how to send transactions to the given application */ + tx?: TxDescriptor; +} +export interface AppDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor"; + value: Uint8Array; +} +/** AppDescriptor describes a cosmos-sdk based application */ +export interface AppDescriptorAmino { + /** + * AuthnDescriptor provides information on how to authenticate transactions on the application + * NOTE: experimental and subject to change in future releases. + */ + authn?: AuthnDescriptorAmino; + /** chain provides the chain descriptor */ + chain?: ChainDescriptorAmino; + /** codec provides metadata information regarding codec related types */ + codec?: CodecDescriptorAmino; + /** configuration provides metadata information regarding the sdk.Config type */ + configuration?: ConfigurationDescriptorAmino; + /** query_services provides metadata information regarding the available queriable endpoints */ + query_services?: QueryServicesDescriptorAmino; + /** tx provides metadata information regarding how to send transactions to the given application */ + tx?: TxDescriptorAmino; +} +export interface AppDescriptorAminoMsg { + type: "cosmos-sdk/AppDescriptor"; + value: AppDescriptorAmino; +} +/** AppDescriptor describes a cosmos-sdk based application */ +export interface AppDescriptorSDKType { + authn?: AuthnDescriptorSDKType; + chain?: ChainDescriptorSDKType; + codec?: CodecDescriptorSDKType; + configuration?: ConfigurationDescriptorSDKType; + query_services?: QueryServicesDescriptorSDKType; + tx?: TxDescriptorSDKType; +} +/** TxDescriptor describes the accepted transaction type */ +export interface TxDescriptor { + /** + * fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + * it is not meant to support polymorphism of transaction types, it is supposed to be used by + * reflection clients to understand if they can handle a specific transaction type in an application. + */ + fullname: string; + /** msgs lists the accepted application messages (sdk.Msg) */ + msgs: MsgDescriptor[]; +} +export interface TxDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.TxDescriptor"; + value: Uint8Array; +} +/** TxDescriptor describes the accepted transaction type */ +export interface TxDescriptorAmino { + /** + * fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + * it is not meant to support polymorphism of transaction types, it is supposed to be used by + * reflection clients to understand if they can handle a specific transaction type in an application. + */ + fullname?: string; + /** msgs lists the accepted application messages (sdk.Msg) */ + msgs?: MsgDescriptorAmino[]; +} +export interface TxDescriptorAminoMsg { + type: "cosmos-sdk/TxDescriptor"; + value: TxDescriptorAmino; +} +/** TxDescriptor describes the accepted transaction type */ +export interface TxDescriptorSDKType { + fullname: string; + msgs: MsgDescriptorSDKType[]; +} +/** + * AuthnDescriptor provides information on how to sign transactions without relying + * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures + */ +export interface AuthnDescriptor { + /** sign_modes defines the supported signature algorithm */ + signModes: SigningModeDescriptor[]; +} +export interface AuthnDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.AuthnDescriptor"; + value: Uint8Array; +} +/** + * AuthnDescriptor provides information on how to sign transactions without relying + * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures + */ +export interface AuthnDescriptorAmino { + /** sign_modes defines the supported signature algorithm */ + sign_modes?: SigningModeDescriptorAmino[]; +} +export interface AuthnDescriptorAminoMsg { + type: "cosmos-sdk/AuthnDescriptor"; + value: AuthnDescriptorAmino; +} +/** + * AuthnDescriptor provides information on how to sign transactions without relying + * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures + */ +export interface AuthnDescriptorSDKType { + sign_modes: SigningModeDescriptorSDKType[]; +} +/** + * SigningModeDescriptor provides information on a signing flow of the application + * NOTE(fdymylja): here we could go as far as providing an entire flow on how + * to sign a message given a SigningModeDescriptor, but it's better to think about + * this another time + */ +export interface SigningModeDescriptor { + /** name defines the unique name of the signing mode */ + name: string; + /** number is the unique int32 identifier for the sign_mode enum */ + number: number; + /** + * authn_info_provider_method_fullname defines the fullname of the method to call to get + * the metadata required to authenticate using the provided sign_modes + */ + authnInfoProviderMethodFullname: string; +} +export interface SigningModeDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor"; + value: Uint8Array; +} +/** + * SigningModeDescriptor provides information on a signing flow of the application + * NOTE(fdymylja): here we could go as far as providing an entire flow on how + * to sign a message given a SigningModeDescriptor, but it's better to think about + * this another time + */ +export interface SigningModeDescriptorAmino { + /** name defines the unique name of the signing mode */ + name?: string; + /** number is the unique int32 identifier for the sign_mode enum */ + number?: number; + /** + * authn_info_provider_method_fullname defines the fullname of the method to call to get + * the metadata required to authenticate using the provided sign_modes + */ + authn_info_provider_method_fullname?: string; +} +export interface SigningModeDescriptorAminoMsg { + type: "cosmos-sdk/SigningModeDescriptor"; + value: SigningModeDescriptorAmino; +} +/** + * SigningModeDescriptor provides information on a signing flow of the application + * NOTE(fdymylja): here we could go as far as providing an entire flow on how + * to sign a message given a SigningModeDescriptor, but it's better to think about + * this another time + */ +export interface SigningModeDescriptorSDKType { + name: string; + number: number; + authn_info_provider_method_fullname: string; +} +/** ChainDescriptor describes chain information of the application */ +export interface ChainDescriptor { + /** id is the chain id */ + id: string; +} +export interface ChainDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.ChainDescriptor"; + value: Uint8Array; +} +/** ChainDescriptor describes chain information of the application */ +export interface ChainDescriptorAmino { + /** id is the chain id */ + id?: string; +} +export interface ChainDescriptorAminoMsg { + type: "cosmos-sdk/ChainDescriptor"; + value: ChainDescriptorAmino; +} +/** ChainDescriptor describes chain information of the application */ +export interface ChainDescriptorSDKType { + id: string; +} +/** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ +export interface CodecDescriptor { + /** interfaces is a list of the registerted interfaces descriptors */ + interfaces: InterfaceDescriptor[]; +} +export interface CodecDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.CodecDescriptor"; + value: Uint8Array; +} +/** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ +export interface CodecDescriptorAmino { + /** interfaces is a list of the registerted interfaces descriptors */ + interfaces?: InterfaceDescriptorAmino[]; +} +export interface CodecDescriptorAminoMsg { + type: "cosmos-sdk/CodecDescriptor"; + value: CodecDescriptorAmino; +} +/** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ +export interface CodecDescriptorSDKType { + interfaces: InterfaceDescriptorSDKType[]; +} +/** InterfaceDescriptor describes the implementation of an interface */ +export interface InterfaceDescriptor { + /** fullname is the name of the interface */ + fullname: string; + /** + * interface_accepting_messages contains information regarding the proto messages which contain the interface as + * google.protobuf.Any field + */ + interfaceAcceptingMessages: InterfaceAcceptingMessageDescriptor[]; + /** interface_implementers is a list of the descriptors of the interface implementers */ + interfaceImplementers: InterfaceImplementerDescriptor[]; +} +export interface InterfaceDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor"; + value: Uint8Array; +} +/** InterfaceDescriptor describes the implementation of an interface */ +export interface InterfaceDescriptorAmino { + /** fullname is the name of the interface */ + fullname?: string; + /** + * interface_accepting_messages contains information regarding the proto messages which contain the interface as + * google.protobuf.Any field + */ + interface_accepting_messages?: InterfaceAcceptingMessageDescriptorAmino[]; + /** interface_implementers is a list of the descriptors of the interface implementers */ + interface_implementers?: InterfaceImplementerDescriptorAmino[]; +} +export interface InterfaceDescriptorAminoMsg { + type: "cosmos-sdk/InterfaceDescriptor"; + value: InterfaceDescriptorAmino; +} +/** InterfaceDescriptor describes the implementation of an interface */ +export interface InterfaceDescriptorSDKType { + fullname: string; + interface_accepting_messages: InterfaceAcceptingMessageDescriptorSDKType[]; + interface_implementers: InterfaceImplementerDescriptorSDKType[]; +} +/** InterfaceImplementerDescriptor describes an interface implementer */ +export interface InterfaceImplementerDescriptor { + /** fullname is the protobuf queryable name of the interface implementer */ + fullname: string; + /** + * type_url defines the type URL used when marshalling the type as any + * this is required so we can provide type safe google.protobuf.Any marshalling and + * unmarshalling, making sure that we don't accept just 'any' type + * in our interface fields + */ + typeUrl: string; +} +export interface InterfaceImplementerDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor"; + value: Uint8Array; +} +/** InterfaceImplementerDescriptor describes an interface implementer */ +export interface InterfaceImplementerDescriptorAmino { + /** fullname is the protobuf queryable name of the interface implementer */ + fullname?: string; + /** + * type_url defines the type URL used when marshalling the type as any + * this is required so we can provide type safe google.protobuf.Any marshalling and + * unmarshalling, making sure that we don't accept just 'any' type + * in our interface fields + */ + type_url?: string; +} +export interface InterfaceImplementerDescriptorAminoMsg { + type: "cosmos-sdk/InterfaceImplementerDescriptor"; + value: InterfaceImplementerDescriptorAmino; +} +/** InterfaceImplementerDescriptor describes an interface implementer */ +export interface InterfaceImplementerDescriptorSDKType { + fullname: string; + type_url: string; +} +/** + * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains + * an interface represented as a google.protobuf.Any + */ +export interface InterfaceAcceptingMessageDescriptor { + /** fullname is the protobuf fullname of the type containing the interface */ + fullname: string; + /** + * field_descriptor_names is a list of the protobuf name (not fullname) of the field + * which contains the interface as google.protobuf.Any (the interface is the same, but + * it can be in multiple fields of the same proto message) + */ + fieldDescriptorNames: string[]; +} +export interface InterfaceAcceptingMessageDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor"; + value: Uint8Array; +} +/** + * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains + * an interface represented as a google.protobuf.Any + */ +export interface InterfaceAcceptingMessageDescriptorAmino { + /** fullname is the protobuf fullname of the type containing the interface */ + fullname?: string; + /** + * field_descriptor_names is a list of the protobuf name (not fullname) of the field + * which contains the interface as google.protobuf.Any (the interface is the same, but + * it can be in multiple fields of the same proto message) + */ + field_descriptor_names?: string[]; +} +export interface InterfaceAcceptingMessageDescriptorAminoMsg { + type: "cosmos-sdk/InterfaceAcceptingMessageDescriptor"; + value: InterfaceAcceptingMessageDescriptorAmino; +} +/** + * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains + * an interface represented as a google.protobuf.Any + */ +export interface InterfaceAcceptingMessageDescriptorSDKType { + fullname: string; + field_descriptor_names: string[]; +} +/** ConfigurationDescriptor contains metadata information on the sdk.Config */ +export interface ConfigurationDescriptor { + /** bech32_account_address_prefix is the account address prefix */ + bech32AccountAddressPrefix: string; +} +export interface ConfigurationDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor"; + value: Uint8Array; +} +/** ConfigurationDescriptor contains metadata information on the sdk.Config */ +export interface ConfigurationDescriptorAmino { + /** bech32_account_address_prefix is the account address prefix */ + bech32_account_address_prefix?: string; +} +export interface ConfigurationDescriptorAminoMsg { + type: "cosmos-sdk/ConfigurationDescriptor"; + value: ConfigurationDescriptorAmino; +} +/** ConfigurationDescriptor contains metadata information on the sdk.Config */ +export interface ConfigurationDescriptorSDKType { + bech32_account_address_prefix: string; +} +/** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ +export interface MsgDescriptor { + /** msg_type_url contains the TypeURL of a sdk.Msg. */ + msgTypeUrl: string; +} +export interface MsgDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.MsgDescriptor"; + value: Uint8Array; +} +/** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ +export interface MsgDescriptorAmino { + /** msg_type_url contains the TypeURL of a sdk.Msg. */ + msg_type_url?: string; +} +export interface MsgDescriptorAminoMsg { + type: "cosmos-sdk/MsgDescriptor"; + value: MsgDescriptorAmino; +} +/** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ +export interface MsgDescriptorSDKType { + msg_type_url: string; +} +/** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorRequest {} +export interface GetAuthnDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest"; + value: Uint8Array; +} +/** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorRequestAmino {} +export interface GetAuthnDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetAuthnDescriptorRequest"; + value: GetAuthnDescriptorRequestAmino; +} +/** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorRequestSDKType {} +/** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorResponse { + /** authn describes how to authenticate to the application when sending transactions */ + authn?: AuthnDescriptor; +} +export interface GetAuthnDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse"; + value: Uint8Array; +} +/** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorResponseAmino { + /** authn describes how to authenticate to the application when sending transactions */ + authn?: AuthnDescriptorAmino; +} +export interface GetAuthnDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetAuthnDescriptorResponse"; + value: GetAuthnDescriptorResponseAmino; +} +/** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ +export interface GetAuthnDescriptorResponseSDKType { + authn?: AuthnDescriptorSDKType; +} +/** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ +export interface GetChainDescriptorRequest {} +export interface GetChainDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest"; + value: Uint8Array; +} +/** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ +export interface GetChainDescriptorRequestAmino {} +export interface GetChainDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetChainDescriptorRequest"; + value: GetChainDescriptorRequestAmino; +} +/** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ +export interface GetChainDescriptorRequestSDKType {} +/** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ +export interface GetChainDescriptorResponse { + /** chain describes application chain information */ + chain?: ChainDescriptor; +} +export interface GetChainDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse"; + value: Uint8Array; +} +/** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ +export interface GetChainDescriptorResponseAmino { + /** chain describes application chain information */ + chain?: ChainDescriptorAmino; +} +export interface GetChainDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetChainDescriptorResponse"; + value: GetChainDescriptorResponseAmino; +} +/** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ +export interface GetChainDescriptorResponseSDKType { + chain?: ChainDescriptorSDKType; +} +/** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorRequest {} +export interface GetCodecDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest"; + value: Uint8Array; +} +/** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorRequestAmino {} +export interface GetCodecDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetCodecDescriptorRequest"; + value: GetCodecDescriptorRequestAmino; +} +/** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorRequestSDKType {} +/** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorResponse { + /** codec describes the application codec such as registered interfaces and implementations */ + codec?: CodecDescriptor; +} +export interface GetCodecDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse"; + value: Uint8Array; +} +/** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorResponseAmino { + /** codec describes the application codec such as registered interfaces and implementations */ + codec?: CodecDescriptorAmino; +} +export interface GetCodecDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetCodecDescriptorResponse"; + value: GetCodecDescriptorResponseAmino; +} +/** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ +export interface GetCodecDescriptorResponseSDKType { + codec?: CodecDescriptorSDKType; +} +/** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorRequest {} +export interface GetConfigurationDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest"; + value: Uint8Array; +} +/** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorRequestAmino {} +export interface GetConfigurationDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetConfigurationDescriptorRequest"; + value: GetConfigurationDescriptorRequestAmino; +} +/** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorRequestSDKType {} +/** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorResponse { + /** config describes the application's sdk.Config */ + config?: ConfigurationDescriptor; +} +export interface GetConfigurationDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse"; + value: Uint8Array; +} +/** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorResponseAmino { + /** config describes the application's sdk.Config */ + config?: ConfigurationDescriptorAmino; +} +export interface GetConfigurationDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetConfigurationDescriptorResponse"; + value: GetConfigurationDescriptorResponseAmino; +} +/** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ +export interface GetConfigurationDescriptorResponseSDKType { + config?: ConfigurationDescriptorSDKType; +} +/** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorRequest {} +export interface GetQueryServicesDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest"; + value: Uint8Array; +} +/** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorRequestAmino {} +export interface GetQueryServicesDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetQueryServicesDescriptorRequest"; + value: GetQueryServicesDescriptorRequestAmino; +} +/** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorRequestSDKType {} +/** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorResponse { + /** queries provides information on the available queryable services */ + queries?: QueryServicesDescriptor; +} +export interface GetQueryServicesDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse"; + value: Uint8Array; +} +/** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorResponseAmino { + /** queries provides information on the available queryable services */ + queries?: QueryServicesDescriptorAmino; +} +export interface GetQueryServicesDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetQueryServicesDescriptorResponse"; + value: GetQueryServicesDescriptorResponseAmino; +} +/** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ +export interface GetQueryServicesDescriptorResponseSDKType { + queries?: QueryServicesDescriptorSDKType; +} +/** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ +export interface GetTxDescriptorRequest {} +export interface GetTxDescriptorRequestProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest"; + value: Uint8Array; +} +/** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ +export interface GetTxDescriptorRequestAmino {} +export interface GetTxDescriptorRequestAminoMsg { + type: "cosmos-sdk/GetTxDescriptorRequest"; + value: GetTxDescriptorRequestAmino; +} +/** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ +export interface GetTxDescriptorRequestSDKType {} +/** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ +export interface GetTxDescriptorResponse { + /** + * tx provides information on msgs that can be forwarded to the application + * alongside the accepted transaction protobuf type + */ + tx?: TxDescriptor; +} +export interface GetTxDescriptorResponseProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse"; + value: Uint8Array; +} +/** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ +export interface GetTxDescriptorResponseAmino { + /** + * tx provides information on msgs that can be forwarded to the application + * alongside the accepted transaction protobuf type + */ + tx?: TxDescriptorAmino; +} +export interface GetTxDescriptorResponseAminoMsg { + type: "cosmos-sdk/GetTxDescriptorResponse"; + value: GetTxDescriptorResponseAmino; +} +/** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ +export interface GetTxDescriptorResponseSDKType { + tx?: TxDescriptorSDKType; +} +/** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ +export interface QueryServicesDescriptor { + /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ + queryServices: QueryServiceDescriptor[]; +} +export interface QueryServicesDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor"; + value: Uint8Array; +} +/** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ +export interface QueryServicesDescriptorAmino { + /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ + query_services?: QueryServiceDescriptorAmino[]; +} +export interface QueryServicesDescriptorAminoMsg { + type: "cosmos-sdk/QueryServicesDescriptor"; + value: QueryServicesDescriptorAmino; +} +/** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ +export interface QueryServicesDescriptorSDKType { + query_services: QueryServiceDescriptorSDKType[]; +} +/** QueryServiceDescriptor describes a cosmos-sdk queryable service */ +export interface QueryServiceDescriptor { + /** fullname is the protobuf fullname of the service descriptor */ + fullname: string; + /** is_module describes if this service is actually exposed by an application's module */ + isModule: boolean; + /** methods provides a list of query service methods */ + methods: QueryMethodDescriptor[]; +} +export interface QueryServiceDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor"; + value: Uint8Array; +} +/** QueryServiceDescriptor describes a cosmos-sdk queryable service */ +export interface QueryServiceDescriptorAmino { + /** fullname is the protobuf fullname of the service descriptor */ + fullname?: string; + /** is_module describes if this service is actually exposed by an application's module */ + is_module?: boolean; + /** methods provides a list of query service methods */ + methods?: QueryMethodDescriptorAmino[]; +} +export interface QueryServiceDescriptorAminoMsg { + type: "cosmos-sdk/QueryServiceDescriptor"; + value: QueryServiceDescriptorAmino; +} +/** QueryServiceDescriptor describes a cosmos-sdk queryable service */ +export interface QueryServiceDescriptorSDKType { + fullname: string; + is_module: boolean; + methods: QueryMethodDescriptorSDKType[]; +} +/** + * QueryMethodDescriptor describes a queryable method of a query service + * no other info is provided beside method name and tendermint queryable path + * because it would be redundant with the grpc reflection service + */ +export interface QueryMethodDescriptor { + /** name is the protobuf name (not fullname) of the method */ + name: string; + /** + * full_query_path is the path that can be used to query + * this method via tendermint abci.Query + */ + fullQueryPath: string; +} +export interface QueryMethodDescriptorProtoMsg { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor"; + value: Uint8Array; +} +/** + * QueryMethodDescriptor describes a queryable method of a query service + * no other info is provided beside method name and tendermint queryable path + * because it would be redundant with the grpc reflection service + */ +export interface QueryMethodDescriptorAmino { + /** name is the protobuf name (not fullname) of the method */ + name?: string; + /** + * full_query_path is the path that can be used to query + * this method via tendermint abci.Query + */ + full_query_path?: string; +} +export interface QueryMethodDescriptorAminoMsg { + type: "cosmos-sdk/QueryMethodDescriptor"; + value: QueryMethodDescriptorAmino; +} +/** + * QueryMethodDescriptor describes a queryable method of a query service + * no other info is provided beside method name and tendermint queryable path + * because it would be redundant with the grpc reflection service + */ +export interface QueryMethodDescriptorSDKType { + name: string; + full_query_path: string; +} +function createBaseAppDescriptor(): AppDescriptor { + return { + authn: undefined, + chain: undefined, + codec: undefined, + configuration: undefined, + queryServices: undefined, + tx: undefined + }; +} +export const AppDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor", + encode(message: AppDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authn !== undefined) { + AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); + } + if (message.chain !== undefined) { + ChainDescriptor.encode(message.chain, writer.uint32(18).fork()).ldelim(); + } + if (message.codec !== undefined) { + CodecDescriptor.encode(message.codec, writer.uint32(26).fork()).ldelim(); + } + if (message.configuration !== undefined) { + ConfigurationDescriptor.encode(message.configuration, writer.uint32(34).fork()).ldelim(); + } + if (message.queryServices !== undefined) { + QueryServicesDescriptor.encode(message.queryServices, writer.uint32(42).fork()).ldelim(); + } + if (message.tx !== undefined) { + TxDescriptor.encode(message.tx, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AppDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAppDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authn = AuthnDescriptor.decode(reader, reader.uint32()); + break; + case 2: + message.chain = ChainDescriptor.decode(reader, reader.uint32()); + break; + case 3: + message.codec = CodecDescriptor.decode(reader, reader.uint32()); + break; + case 4: + message.configuration = ConfigurationDescriptor.decode(reader, reader.uint32()); + break; + case 5: + message.queryServices = QueryServicesDescriptor.decode(reader, reader.uint32()); + break; + case 6: + message.tx = TxDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AppDescriptor { + const message = createBaseAppDescriptor(); + message.authn = object.authn !== undefined && object.authn !== null ? AuthnDescriptor.fromPartial(object.authn) : undefined; + message.chain = object.chain !== undefined && object.chain !== null ? ChainDescriptor.fromPartial(object.chain) : undefined; + message.codec = object.codec !== undefined && object.codec !== null ? CodecDescriptor.fromPartial(object.codec) : undefined; + message.configuration = object.configuration !== undefined && object.configuration !== null ? ConfigurationDescriptor.fromPartial(object.configuration) : undefined; + message.queryServices = object.queryServices !== undefined && object.queryServices !== null ? QueryServicesDescriptor.fromPartial(object.queryServices) : undefined; + message.tx = object.tx !== undefined && object.tx !== null ? TxDescriptor.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: AppDescriptorAmino): AppDescriptor { + const message = createBaseAppDescriptor(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + if (object.configuration !== undefined && object.configuration !== null) { + message.configuration = ConfigurationDescriptor.fromAmino(object.configuration); + } + if (object.query_services !== undefined && object.query_services !== null) { + message.queryServices = QueryServicesDescriptor.fromAmino(object.query_services); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; + }, + toAmino(message: AppDescriptor): AppDescriptorAmino { + const obj: any = {}; + obj.authn = message.authn ? AuthnDescriptor.toAmino(message.authn) : undefined; + obj.chain = message.chain ? ChainDescriptor.toAmino(message.chain) : undefined; + obj.codec = message.codec ? CodecDescriptor.toAmino(message.codec) : undefined; + obj.configuration = message.configuration ? ConfigurationDescriptor.toAmino(message.configuration) : undefined; + obj.query_services = message.queryServices ? QueryServicesDescriptor.toAmino(message.queryServices) : undefined; + obj.tx = message.tx ? TxDescriptor.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: AppDescriptorAminoMsg): AppDescriptor { + return AppDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: AppDescriptor): AppDescriptorAminoMsg { + return { + type: "cosmos-sdk/AppDescriptor", + value: AppDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: AppDescriptorProtoMsg): AppDescriptor { + return AppDescriptor.decode(message.value); + }, + toProto(message: AppDescriptor): Uint8Array { + return AppDescriptor.encode(message).finish(); + }, + toProtoMsg(message: AppDescriptor): AppDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor", + value: AppDescriptor.encode(message).finish() + }; + } +}; +function createBaseTxDescriptor(): TxDescriptor { + return { + fullname: "", + msgs: [] + }; +} +export const TxDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.TxDescriptor", + encode(message: TxDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fullname !== "") { + writer.uint32(10).string(message.fullname); + } + for (const v of message.msgs) { + MsgDescriptor.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullname = reader.string(); + break; + case 2: + message.msgs.push(MsgDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDescriptor { + const message = createBaseTxDescriptor(); + message.fullname = object.fullname ?? ""; + message.msgs = object.msgs?.map(e => MsgDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxDescriptorAmino): TxDescriptor { + const message = createBaseTxDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.msgs = object.msgs?.map(e => MsgDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxDescriptor): TxDescriptorAmino { + const obj: any = {}; + obj.fullname = message.fullname === "" ? undefined : message.fullname; + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? MsgDescriptor.toAmino(e) : undefined); + } else { + obj.msgs = message.msgs; + } + return obj; + }, + fromAminoMsg(object: TxDescriptorAminoMsg): TxDescriptor { + return TxDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: TxDescriptor): TxDescriptorAminoMsg { + return { + type: "cosmos-sdk/TxDescriptor", + value: TxDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: TxDescriptorProtoMsg): TxDescriptor { + return TxDescriptor.decode(message.value); + }, + toProto(message: TxDescriptor): Uint8Array { + return TxDescriptor.encode(message).finish(); + }, + toProtoMsg(message: TxDescriptor): TxDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.TxDescriptor", + value: TxDescriptor.encode(message).finish() + }; + } +}; +function createBaseAuthnDescriptor(): AuthnDescriptor { + return { + signModes: [] + }; +} +export const AuthnDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.AuthnDescriptor", + encode(message: AuthnDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signModes) { + SigningModeDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuthnDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthnDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signModes.push(SigningModeDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AuthnDescriptor { + const message = createBaseAuthnDescriptor(); + message.signModes = object.signModes?.map(e => SigningModeDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AuthnDescriptorAmino): AuthnDescriptor { + const message = createBaseAuthnDescriptor(); + message.signModes = object.sign_modes?.map(e => SigningModeDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: AuthnDescriptor): AuthnDescriptorAmino { + const obj: any = {}; + if (message.signModes) { + obj.sign_modes = message.signModes.map(e => e ? SigningModeDescriptor.toAmino(e) : undefined); + } else { + obj.sign_modes = message.signModes; + } + return obj; + }, + fromAminoMsg(object: AuthnDescriptorAminoMsg): AuthnDescriptor { + return AuthnDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: AuthnDescriptor): AuthnDescriptorAminoMsg { + return { + type: "cosmos-sdk/AuthnDescriptor", + value: AuthnDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: AuthnDescriptorProtoMsg): AuthnDescriptor { + return AuthnDescriptor.decode(message.value); + }, + toProto(message: AuthnDescriptor): Uint8Array { + return AuthnDescriptor.encode(message).finish(); + }, + toProtoMsg(message: AuthnDescriptor): AuthnDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.AuthnDescriptor", + value: AuthnDescriptor.encode(message).finish() + }; + } +}; +function createBaseSigningModeDescriptor(): SigningModeDescriptor { + return { + name: "", + number: 0, + authnInfoProviderMethodFullname: "" + }; +} +export const SigningModeDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor", + encode(message: SigningModeDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.authnInfoProviderMethodFullname !== "") { + writer.uint32(26).string(message.authnInfoProviderMethodFullname); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SigningModeDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSigningModeDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.authnInfoProviderMethodFullname = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SigningModeDescriptor { + const message = createBaseSigningModeDescriptor(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.authnInfoProviderMethodFullname = object.authnInfoProviderMethodFullname ?? ""; + return message; + }, + fromAmino(object: SigningModeDescriptorAmino): SigningModeDescriptor { + const message = createBaseSigningModeDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.authn_info_provider_method_fullname !== undefined && object.authn_info_provider_method_fullname !== null) { + message.authnInfoProviderMethodFullname = object.authn_info_provider_method_fullname; + } + return message; + }, + toAmino(message: SigningModeDescriptor): SigningModeDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.authn_info_provider_method_fullname = message.authnInfoProviderMethodFullname === "" ? undefined : message.authnInfoProviderMethodFullname; + return obj; + }, + fromAminoMsg(object: SigningModeDescriptorAminoMsg): SigningModeDescriptor { + return SigningModeDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: SigningModeDescriptor): SigningModeDescriptorAminoMsg { + return { + type: "cosmos-sdk/SigningModeDescriptor", + value: SigningModeDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: SigningModeDescriptorProtoMsg): SigningModeDescriptor { + return SigningModeDescriptor.decode(message.value); + }, + toProto(message: SigningModeDescriptor): Uint8Array { + return SigningModeDescriptor.encode(message).finish(); + }, + toProtoMsg(message: SigningModeDescriptor): SigningModeDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor", + value: SigningModeDescriptor.encode(message).finish() + }; + } +}; +function createBaseChainDescriptor(): ChainDescriptor { + return { + id: "" + }; +} +export const ChainDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.ChainDescriptor", + encode(message: ChainDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ChainDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChainDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ChainDescriptor { + const message = createBaseChainDescriptor(); + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: ChainDescriptorAmino): ChainDescriptor { + const message = createBaseChainDescriptor(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: ChainDescriptor): ChainDescriptorAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: ChainDescriptorAminoMsg): ChainDescriptor { + return ChainDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ChainDescriptor): ChainDescriptorAminoMsg { + return { + type: "cosmos-sdk/ChainDescriptor", + value: ChainDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ChainDescriptorProtoMsg): ChainDescriptor { + return ChainDescriptor.decode(message.value); + }, + toProto(message: ChainDescriptor): Uint8Array { + return ChainDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ChainDescriptor): ChainDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.ChainDescriptor", + value: ChainDescriptor.encode(message).finish() + }; + } +}; +function createBaseCodecDescriptor(): CodecDescriptor { + return { + interfaces: [] + }; +} +export const CodecDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.CodecDescriptor", + encode(message: CodecDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.interfaces) { + InterfaceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodecDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodecDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interfaces.push(InterfaceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CodecDescriptor { + const message = createBaseCodecDescriptor(); + message.interfaces = object.interfaces?.map(e => InterfaceDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CodecDescriptorAmino): CodecDescriptor { + const message = createBaseCodecDescriptor(); + message.interfaces = object.interfaces?.map(e => InterfaceDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: CodecDescriptor): CodecDescriptorAmino { + const obj: any = {}; + if (message.interfaces) { + obj.interfaces = message.interfaces.map(e => e ? InterfaceDescriptor.toAmino(e) : undefined); + } else { + obj.interfaces = message.interfaces; + } + return obj; + }, + fromAminoMsg(object: CodecDescriptorAminoMsg): CodecDescriptor { + return CodecDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: CodecDescriptor): CodecDescriptorAminoMsg { + return { + type: "cosmos-sdk/CodecDescriptor", + value: CodecDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: CodecDescriptorProtoMsg): CodecDescriptor { + return CodecDescriptor.decode(message.value); + }, + toProto(message: CodecDescriptor): Uint8Array { + return CodecDescriptor.encode(message).finish(); + }, + toProtoMsg(message: CodecDescriptor): CodecDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.CodecDescriptor", + value: CodecDescriptor.encode(message).finish() + }; + } +}; +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { + fullname: "", + interfaceAcceptingMessages: [], + interfaceImplementers: [] + }; +} +export const InterfaceDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor", + encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fullname !== "") { + writer.uint32(10).string(message.fullname); + } + for (const v of message.interfaceAcceptingMessages) { + InterfaceAcceptingMessageDescriptor.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.interfaceImplementers) { + InterfaceImplementerDescriptor.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullname = reader.string(); + break; + case 2: + message.interfaceAcceptingMessages.push(InterfaceAcceptingMessageDescriptor.decode(reader, reader.uint32())); + break; + case 3: + message.interfaceImplementers.push(InterfaceImplementerDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.fullname = object.fullname ?? ""; + message.interfaceAcceptingMessages = object.interfaceAcceptingMessages?.map(e => InterfaceAcceptingMessageDescriptor.fromPartial(e)) || []; + message.interfaceImplementers = object.interfaceImplementers?.map(e => InterfaceImplementerDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.interfaceAcceptingMessages = object.interface_accepting_messages?.map(e => InterfaceAcceptingMessageDescriptor.fromAmino(e)) || []; + message.interfaceImplementers = object.interface_implementers?.map(e => InterfaceImplementerDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { + const obj: any = {}; + obj.fullname = message.fullname === "" ? undefined : message.fullname; + if (message.interfaceAcceptingMessages) { + obj.interface_accepting_messages = message.interfaceAcceptingMessages.map(e => e ? InterfaceAcceptingMessageDescriptor.toAmino(e) : undefined); + } else { + obj.interface_accepting_messages = message.interfaceAcceptingMessages; + } + if (message.interfaceImplementers) { + obj.interface_implementers = message.interfaceImplementers.map(e => e ? InterfaceImplementerDescriptor.toAmino(e) : undefined); + } else { + obj.interface_implementers = message.interfaceImplementers; + } + return obj; + }, + fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { + return InterfaceDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: InterfaceDescriptor): InterfaceDescriptorAminoMsg { + return { + type: "cosmos-sdk/InterfaceDescriptor", + value: InterfaceDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: InterfaceDescriptorProtoMsg): InterfaceDescriptor { + return InterfaceDescriptor.decode(message.value); + }, + toProto(message: InterfaceDescriptor): Uint8Array { + return InterfaceDescriptor.encode(message).finish(); + }, + toProtoMsg(message: InterfaceDescriptor): InterfaceDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor", + value: InterfaceDescriptor.encode(message).finish() + }; + } +}; +function createBaseInterfaceImplementerDescriptor(): InterfaceImplementerDescriptor { + return { + fullname: "", + typeUrl: "" + }; +} +export const InterfaceImplementerDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", + encode(message: InterfaceImplementerDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fullname !== "") { + writer.uint32(10).string(message.fullname); + } + if (message.typeUrl !== "") { + writer.uint32(18).string(message.typeUrl); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceImplementerDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceImplementerDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullname = reader.string(); + break; + case 2: + message.typeUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InterfaceImplementerDescriptor { + const message = createBaseInterfaceImplementerDescriptor(); + message.fullname = object.fullname ?? ""; + message.typeUrl = object.typeUrl ?? ""; + return message; + }, + fromAmino(object: InterfaceImplementerDescriptorAmino): InterfaceImplementerDescriptor { + const message = createBaseInterfaceImplementerDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.type_url !== undefined && object.type_url !== null) { + message.typeUrl = object.type_url; + } + return message; + }, + toAmino(message: InterfaceImplementerDescriptor): InterfaceImplementerDescriptorAmino { + const obj: any = {}; + obj.fullname = message.fullname === "" ? undefined : message.fullname; + obj.type_url = message.typeUrl === "" ? undefined : message.typeUrl; + return obj; + }, + fromAminoMsg(object: InterfaceImplementerDescriptorAminoMsg): InterfaceImplementerDescriptor { + return InterfaceImplementerDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: InterfaceImplementerDescriptor): InterfaceImplementerDescriptorAminoMsg { + return { + type: "cosmos-sdk/InterfaceImplementerDescriptor", + value: InterfaceImplementerDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: InterfaceImplementerDescriptorProtoMsg): InterfaceImplementerDescriptor { + return InterfaceImplementerDescriptor.decode(message.value); + }, + toProto(message: InterfaceImplementerDescriptor): Uint8Array { + return InterfaceImplementerDescriptor.encode(message).finish(); + }, + toProtoMsg(message: InterfaceImplementerDescriptor): InterfaceImplementerDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", + value: InterfaceImplementerDescriptor.encode(message).finish() + }; + } +}; +function createBaseInterfaceAcceptingMessageDescriptor(): InterfaceAcceptingMessageDescriptor { + return { + fullname: "", + fieldDescriptorNames: [] + }; +} +export const InterfaceAcceptingMessageDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", + encode(message: InterfaceAcceptingMessageDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fullname !== "") { + writer.uint32(10).string(message.fullname); + } + for (const v of message.fieldDescriptorNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceAcceptingMessageDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceAcceptingMessageDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullname = reader.string(); + break; + case 2: + message.fieldDescriptorNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InterfaceAcceptingMessageDescriptor { + const message = createBaseInterfaceAcceptingMessageDescriptor(); + message.fullname = object.fullname ?? ""; + message.fieldDescriptorNames = object.fieldDescriptorNames?.map(e => e) || []; + return message; + }, + fromAmino(object: InterfaceAcceptingMessageDescriptorAmino): InterfaceAcceptingMessageDescriptor { + const message = createBaseInterfaceAcceptingMessageDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.fieldDescriptorNames = object.field_descriptor_names?.map(e => e) || []; + return message; + }, + toAmino(message: InterfaceAcceptingMessageDescriptor): InterfaceAcceptingMessageDescriptorAmino { + const obj: any = {}; + obj.fullname = message.fullname === "" ? undefined : message.fullname; + if (message.fieldDescriptorNames) { + obj.field_descriptor_names = message.fieldDescriptorNames.map(e => e); + } else { + obj.field_descriptor_names = message.fieldDescriptorNames; + } + return obj; + }, + fromAminoMsg(object: InterfaceAcceptingMessageDescriptorAminoMsg): InterfaceAcceptingMessageDescriptor { + return InterfaceAcceptingMessageDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: InterfaceAcceptingMessageDescriptor): InterfaceAcceptingMessageDescriptorAminoMsg { + return { + type: "cosmos-sdk/InterfaceAcceptingMessageDescriptor", + value: InterfaceAcceptingMessageDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: InterfaceAcceptingMessageDescriptorProtoMsg): InterfaceAcceptingMessageDescriptor { + return InterfaceAcceptingMessageDescriptor.decode(message.value); + }, + toProto(message: InterfaceAcceptingMessageDescriptor): Uint8Array { + return InterfaceAcceptingMessageDescriptor.encode(message).finish(); + }, + toProtoMsg(message: InterfaceAcceptingMessageDescriptor): InterfaceAcceptingMessageDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", + value: InterfaceAcceptingMessageDescriptor.encode(message).finish() + }; + } +}; +function createBaseConfigurationDescriptor(): ConfigurationDescriptor { + return { + bech32AccountAddressPrefix: "" + }; +} +export const ConfigurationDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor", + encode(message: ConfigurationDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bech32AccountAddressPrefix !== "") { + writer.uint32(10).string(message.bech32AccountAddressPrefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConfigurationDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfigurationDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bech32AccountAddressPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConfigurationDescriptor { + const message = createBaseConfigurationDescriptor(); + message.bech32AccountAddressPrefix = object.bech32AccountAddressPrefix ?? ""; + return message; + }, + fromAmino(object: ConfigurationDescriptorAmino): ConfigurationDescriptor { + const message = createBaseConfigurationDescriptor(); + if (object.bech32_account_address_prefix !== undefined && object.bech32_account_address_prefix !== null) { + message.bech32AccountAddressPrefix = object.bech32_account_address_prefix; + } + return message; + }, + toAmino(message: ConfigurationDescriptor): ConfigurationDescriptorAmino { + const obj: any = {}; + obj.bech32_account_address_prefix = message.bech32AccountAddressPrefix === "" ? undefined : message.bech32AccountAddressPrefix; + return obj; + }, + fromAminoMsg(object: ConfigurationDescriptorAminoMsg): ConfigurationDescriptor { + return ConfigurationDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ConfigurationDescriptor): ConfigurationDescriptorAminoMsg { + return { + type: "cosmos-sdk/ConfigurationDescriptor", + value: ConfigurationDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ConfigurationDescriptorProtoMsg): ConfigurationDescriptor { + return ConfigurationDescriptor.decode(message.value); + }, + toProto(message: ConfigurationDescriptor): Uint8Array { + return ConfigurationDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ConfigurationDescriptor): ConfigurationDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor", + value: ConfigurationDescriptor.encode(message).finish() + }; + } +}; +function createBaseMsgDescriptor(): MsgDescriptor { + return { + msgTypeUrl: "" + }; +} +export const MsgDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.MsgDescriptor", + encode(message: MsgDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgTypeUrl !== "") { + writer.uint32(10).string(message.msgTypeUrl); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgTypeUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDescriptor { + const message = createBaseMsgDescriptor(); + message.msgTypeUrl = object.msgTypeUrl ?? ""; + return message; + }, + fromAmino(object: MsgDescriptorAmino): MsgDescriptor { + const message = createBaseMsgDescriptor(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; + }, + toAmino(message: MsgDescriptor): MsgDescriptorAmino { + const obj: any = {}; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + return obj; + }, + fromAminoMsg(object: MsgDescriptorAminoMsg): MsgDescriptor { + return MsgDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: MsgDescriptor): MsgDescriptorAminoMsg { + return { + type: "cosmos-sdk/MsgDescriptor", + value: MsgDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDescriptorProtoMsg): MsgDescriptor { + return MsgDescriptor.decode(message.value); + }, + toProto(message: MsgDescriptor): Uint8Array { + return MsgDescriptor.encode(message).finish(); + }, + toProtoMsg(message: MsgDescriptor): MsgDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.MsgDescriptor", + value: MsgDescriptor.encode(message).finish() + }; + } +}; +function createBaseGetAuthnDescriptorRequest(): GetAuthnDescriptorRequest { + return {}; +} +export const GetAuthnDescriptorRequest = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest", + encode(_: GetAuthnDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAuthnDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthnDescriptorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetAuthnDescriptorRequest { + const message = createBaseGetAuthnDescriptorRequest(); + return message; + }, + fromAmino(_: GetAuthnDescriptorRequestAmino): GetAuthnDescriptorRequest { + const message = createBaseGetAuthnDescriptorRequest(); + return message; + }, + toAmino(_: GetAuthnDescriptorRequest): GetAuthnDescriptorRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetAuthnDescriptorRequestAminoMsg): GetAuthnDescriptorRequest { + return GetAuthnDescriptorRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetAuthnDescriptorRequest): GetAuthnDescriptorRequestAminoMsg { + return { + type: "cosmos-sdk/GetAuthnDescriptorRequest", + value: GetAuthnDescriptorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetAuthnDescriptorRequestProtoMsg): GetAuthnDescriptorRequest { + return GetAuthnDescriptorRequest.decode(message.value); + }, + toProto(message: GetAuthnDescriptorRequest): Uint8Array { + return GetAuthnDescriptorRequest.encode(message).finish(); + }, + toProtoMsg(message: GetAuthnDescriptorRequest): GetAuthnDescriptorRequestProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest", + value: GetAuthnDescriptorRequest.encode(message).finish() + }; + } +}; +function createBaseGetAuthnDescriptorResponse(): GetAuthnDescriptorResponse { + return { + authn: undefined + }; +} +export const GetAuthnDescriptorResponse = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse", + encode(message: GetAuthnDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authn !== undefined) { + AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAuthnDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthnDescriptorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authn = AuthnDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAuthnDescriptorResponse { + const message = createBaseGetAuthnDescriptorResponse(); + message.authn = object.authn !== undefined && object.authn !== null ? AuthnDescriptor.fromPartial(object.authn) : undefined; + return message; + }, + fromAmino(object: GetAuthnDescriptorResponseAmino): GetAuthnDescriptorResponse { + const message = createBaseGetAuthnDescriptorResponse(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + return message; + }, + toAmino(message: GetAuthnDescriptorResponse): GetAuthnDescriptorResponseAmino { + const obj: any = {}; + obj.authn = message.authn ? AuthnDescriptor.toAmino(message.authn) : undefined; + return obj; + }, + fromAminoMsg(object: GetAuthnDescriptorResponseAminoMsg): GetAuthnDescriptorResponse { + return GetAuthnDescriptorResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetAuthnDescriptorResponse): GetAuthnDescriptorResponseAminoMsg { + return { + type: "cosmos-sdk/GetAuthnDescriptorResponse", + value: GetAuthnDescriptorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetAuthnDescriptorResponseProtoMsg): GetAuthnDescriptorResponse { + return GetAuthnDescriptorResponse.decode(message.value); + }, + toProto(message: GetAuthnDescriptorResponse): Uint8Array { + return GetAuthnDescriptorResponse.encode(message).finish(); + }, + toProtoMsg(message: GetAuthnDescriptorResponse): GetAuthnDescriptorResponseProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse", + value: GetAuthnDescriptorResponse.encode(message).finish() + }; + } +}; +function createBaseGetChainDescriptorRequest(): GetChainDescriptorRequest { + return {}; +} +export const GetChainDescriptorRequest = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest", + encode(_: GetChainDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetChainDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetChainDescriptorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetChainDescriptorRequest { + const message = createBaseGetChainDescriptorRequest(); + return message; + }, + fromAmino(_: GetChainDescriptorRequestAmino): GetChainDescriptorRequest { + const message = createBaseGetChainDescriptorRequest(); + return message; + }, + toAmino(_: GetChainDescriptorRequest): GetChainDescriptorRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetChainDescriptorRequestAminoMsg): GetChainDescriptorRequest { + return GetChainDescriptorRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetChainDescriptorRequest): GetChainDescriptorRequestAminoMsg { + return { + type: "cosmos-sdk/GetChainDescriptorRequest", + value: GetChainDescriptorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetChainDescriptorRequestProtoMsg): GetChainDescriptorRequest { + return GetChainDescriptorRequest.decode(message.value); + }, + toProto(message: GetChainDescriptorRequest): Uint8Array { + return GetChainDescriptorRequest.encode(message).finish(); + }, + toProtoMsg(message: GetChainDescriptorRequest): GetChainDescriptorRequestProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest", + value: GetChainDescriptorRequest.encode(message).finish() + }; + } +}; +function createBaseGetChainDescriptorResponse(): GetChainDescriptorResponse { + return { + chain: undefined + }; +} +export const GetChainDescriptorResponse = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse", + encode(message: GetChainDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chain !== undefined) { + ChainDescriptor.encode(message.chain, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetChainDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetChainDescriptorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chain = ChainDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetChainDescriptorResponse { + const message = createBaseGetChainDescriptorResponse(); + message.chain = object.chain !== undefined && object.chain !== null ? ChainDescriptor.fromPartial(object.chain) : undefined; + return message; + }, + fromAmino(object: GetChainDescriptorResponseAmino): GetChainDescriptorResponse { + const message = createBaseGetChainDescriptorResponse(); + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + return message; + }, + toAmino(message: GetChainDescriptorResponse): GetChainDescriptorResponseAmino { + const obj: any = {}; + obj.chain = message.chain ? ChainDescriptor.toAmino(message.chain) : undefined; + return obj; + }, + fromAminoMsg(object: GetChainDescriptorResponseAminoMsg): GetChainDescriptorResponse { + return GetChainDescriptorResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetChainDescriptorResponse): GetChainDescriptorResponseAminoMsg { + return { + type: "cosmos-sdk/GetChainDescriptorResponse", + value: GetChainDescriptorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetChainDescriptorResponseProtoMsg): GetChainDescriptorResponse { + return GetChainDescriptorResponse.decode(message.value); + }, + toProto(message: GetChainDescriptorResponse): Uint8Array { + return GetChainDescriptorResponse.encode(message).finish(); + }, + toProtoMsg(message: GetChainDescriptorResponse): GetChainDescriptorResponseProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse", + value: GetChainDescriptorResponse.encode(message).finish() + }; + } +}; +function createBaseGetCodecDescriptorRequest(): GetCodecDescriptorRequest { + return {}; +} +export const GetCodecDescriptorRequest = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest", + encode(_: GetCodecDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetCodecDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetCodecDescriptorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetCodecDescriptorRequest { + const message = createBaseGetCodecDescriptorRequest(); + return message; + }, + fromAmino(_: GetCodecDescriptorRequestAmino): GetCodecDescriptorRequest { + const message = createBaseGetCodecDescriptorRequest(); + return message; + }, + toAmino(_: GetCodecDescriptorRequest): GetCodecDescriptorRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetCodecDescriptorRequestAminoMsg): GetCodecDescriptorRequest { + return GetCodecDescriptorRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetCodecDescriptorRequest): GetCodecDescriptorRequestAminoMsg { + return { + type: "cosmos-sdk/GetCodecDescriptorRequest", + value: GetCodecDescriptorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetCodecDescriptorRequestProtoMsg): GetCodecDescriptorRequest { + return GetCodecDescriptorRequest.decode(message.value); + }, + toProto(message: GetCodecDescriptorRequest): Uint8Array { + return GetCodecDescriptorRequest.encode(message).finish(); + }, + toProtoMsg(message: GetCodecDescriptorRequest): GetCodecDescriptorRequestProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest", + value: GetCodecDescriptorRequest.encode(message).finish() + }; + } +}; +function createBaseGetCodecDescriptorResponse(): GetCodecDescriptorResponse { + return { + codec: undefined + }; +} +export const GetCodecDescriptorResponse = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse", + encode(message: GetCodecDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codec !== undefined) { + CodecDescriptor.encode(message.codec, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetCodecDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetCodecDescriptorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codec = CodecDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetCodecDescriptorResponse { + const message = createBaseGetCodecDescriptorResponse(); + message.codec = object.codec !== undefined && object.codec !== null ? CodecDescriptor.fromPartial(object.codec) : undefined; + return message; + }, + fromAmino(object: GetCodecDescriptorResponseAmino): GetCodecDescriptorResponse { + const message = createBaseGetCodecDescriptorResponse(); + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + return message; + }, + toAmino(message: GetCodecDescriptorResponse): GetCodecDescriptorResponseAmino { + const obj: any = {}; + obj.codec = message.codec ? CodecDescriptor.toAmino(message.codec) : undefined; + return obj; + }, + fromAminoMsg(object: GetCodecDescriptorResponseAminoMsg): GetCodecDescriptorResponse { + return GetCodecDescriptorResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetCodecDescriptorResponse): GetCodecDescriptorResponseAminoMsg { + return { + type: "cosmos-sdk/GetCodecDescriptorResponse", + value: GetCodecDescriptorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetCodecDescriptorResponseProtoMsg): GetCodecDescriptorResponse { + return GetCodecDescriptorResponse.decode(message.value); + }, + toProto(message: GetCodecDescriptorResponse): Uint8Array { + return GetCodecDescriptorResponse.encode(message).finish(); + }, + toProtoMsg(message: GetCodecDescriptorResponse): GetCodecDescriptorResponseProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse", + value: GetCodecDescriptorResponse.encode(message).finish() + }; + } +}; +function createBaseGetConfigurationDescriptorRequest(): GetConfigurationDescriptorRequest { + return {}; +} +export const GetConfigurationDescriptorRequest = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest", + encode(_: GetConfigurationDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetConfigurationDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetConfigurationDescriptorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetConfigurationDescriptorRequest { + const message = createBaseGetConfigurationDescriptorRequest(); + return message; + }, + fromAmino(_: GetConfigurationDescriptorRequestAmino): GetConfigurationDescriptorRequest { + const message = createBaseGetConfigurationDescriptorRequest(); + return message; + }, + toAmino(_: GetConfigurationDescriptorRequest): GetConfigurationDescriptorRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetConfigurationDescriptorRequestAminoMsg): GetConfigurationDescriptorRequest { + return GetConfigurationDescriptorRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetConfigurationDescriptorRequest): GetConfigurationDescriptorRequestAminoMsg { + return { + type: "cosmos-sdk/GetConfigurationDescriptorRequest", + value: GetConfigurationDescriptorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetConfigurationDescriptorRequestProtoMsg): GetConfigurationDescriptorRequest { + return GetConfigurationDescriptorRequest.decode(message.value); + }, + toProto(message: GetConfigurationDescriptorRequest): Uint8Array { + return GetConfigurationDescriptorRequest.encode(message).finish(); + }, + toProtoMsg(message: GetConfigurationDescriptorRequest): GetConfigurationDescriptorRequestProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest", + value: GetConfigurationDescriptorRequest.encode(message).finish() + }; + } +}; +function createBaseGetConfigurationDescriptorResponse(): GetConfigurationDescriptorResponse { + return { + config: undefined + }; +} +export const GetConfigurationDescriptorResponse = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse", + encode(message: GetConfigurationDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.config !== undefined) { + ConfigurationDescriptor.encode(message.config, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetConfigurationDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetConfigurationDescriptorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = ConfigurationDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetConfigurationDescriptorResponse { + const message = createBaseGetConfigurationDescriptorResponse(); + message.config = object.config !== undefined && object.config !== null ? ConfigurationDescriptor.fromPartial(object.config) : undefined; + return message; + }, + fromAmino(object: GetConfigurationDescriptorResponseAmino): GetConfigurationDescriptorResponse { + const message = createBaseGetConfigurationDescriptorResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = ConfigurationDescriptor.fromAmino(object.config); + } + return message; + }, + toAmino(message: GetConfigurationDescriptorResponse): GetConfigurationDescriptorResponseAmino { + const obj: any = {}; + obj.config = message.config ? ConfigurationDescriptor.toAmino(message.config) : undefined; + return obj; + }, + fromAminoMsg(object: GetConfigurationDescriptorResponseAminoMsg): GetConfigurationDescriptorResponse { + return GetConfigurationDescriptorResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetConfigurationDescriptorResponse): GetConfigurationDescriptorResponseAminoMsg { + return { + type: "cosmos-sdk/GetConfigurationDescriptorResponse", + value: GetConfigurationDescriptorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetConfigurationDescriptorResponseProtoMsg): GetConfigurationDescriptorResponse { + return GetConfigurationDescriptorResponse.decode(message.value); + }, + toProto(message: GetConfigurationDescriptorResponse): Uint8Array { + return GetConfigurationDescriptorResponse.encode(message).finish(); + }, + toProtoMsg(message: GetConfigurationDescriptorResponse): GetConfigurationDescriptorResponseProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse", + value: GetConfigurationDescriptorResponse.encode(message).finish() + }; + } +}; +function createBaseGetQueryServicesDescriptorRequest(): GetQueryServicesDescriptorRequest { + return {}; +} +export const GetQueryServicesDescriptorRequest = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest", + encode(_: GetQueryServicesDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetQueryServicesDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetQueryServicesDescriptorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetQueryServicesDescriptorRequest { + const message = createBaseGetQueryServicesDescriptorRequest(); + return message; + }, + fromAmino(_: GetQueryServicesDescriptorRequestAmino): GetQueryServicesDescriptorRequest { + const message = createBaseGetQueryServicesDescriptorRequest(); + return message; + }, + toAmino(_: GetQueryServicesDescriptorRequest): GetQueryServicesDescriptorRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetQueryServicesDescriptorRequestAminoMsg): GetQueryServicesDescriptorRequest { + return GetQueryServicesDescriptorRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetQueryServicesDescriptorRequest): GetQueryServicesDescriptorRequestAminoMsg { + return { + type: "cosmos-sdk/GetQueryServicesDescriptorRequest", + value: GetQueryServicesDescriptorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetQueryServicesDescriptorRequestProtoMsg): GetQueryServicesDescriptorRequest { + return GetQueryServicesDescriptorRequest.decode(message.value); + }, + toProto(message: GetQueryServicesDescriptorRequest): Uint8Array { + return GetQueryServicesDescriptorRequest.encode(message).finish(); + }, + toProtoMsg(message: GetQueryServicesDescriptorRequest): GetQueryServicesDescriptorRequestProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest", + value: GetQueryServicesDescriptorRequest.encode(message).finish() + }; + } +}; +function createBaseGetQueryServicesDescriptorResponse(): GetQueryServicesDescriptorResponse { + return { + queries: undefined + }; +} +export const GetQueryServicesDescriptorResponse = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse", + encode(message: GetQueryServicesDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.queries !== undefined) { + QueryServicesDescriptor.encode(message.queries, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetQueryServicesDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetQueryServicesDescriptorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queries = QueryServicesDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetQueryServicesDescriptorResponse { + const message = createBaseGetQueryServicesDescriptorResponse(); + message.queries = object.queries !== undefined && object.queries !== null ? QueryServicesDescriptor.fromPartial(object.queries) : undefined; + return message; + }, + fromAmino(object: GetQueryServicesDescriptorResponseAmino): GetQueryServicesDescriptorResponse { + const message = createBaseGetQueryServicesDescriptorResponse(); + if (object.queries !== undefined && object.queries !== null) { + message.queries = QueryServicesDescriptor.fromAmino(object.queries); + } + return message; + }, + toAmino(message: GetQueryServicesDescriptorResponse): GetQueryServicesDescriptorResponseAmino { + const obj: any = {}; + obj.queries = message.queries ? QueryServicesDescriptor.toAmino(message.queries) : undefined; + return obj; + }, + fromAminoMsg(object: GetQueryServicesDescriptorResponseAminoMsg): GetQueryServicesDescriptorResponse { + return GetQueryServicesDescriptorResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetQueryServicesDescriptorResponse): GetQueryServicesDescriptorResponseAminoMsg { + return { + type: "cosmos-sdk/GetQueryServicesDescriptorResponse", + value: GetQueryServicesDescriptorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetQueryServicesDescriptorResponseProtoMsg): GetQueryServicesDescriptorResponse { + return GetQueryServicesDescriptorResponse.decode(message.value); + }, + toProto(message: GetQueryServicesDescriptorResponse): Uint8Array { + return GetQueryServicesDescriptorResponse.encode(message).finish(); + }, + toProtoMsg(message: GetQueryServicesDescriptorResponse): GetQueryServicesDescriptorResponseProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse", + value: GetQueryServicesDescriptorResponse.encode(message).finish() + }; + } +}; +function createBaseGetTxDescriptorRequest(): GetTxDescriptorRequest { + return {}; +} +export const GetTxDescriptorRequest = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest", + encode(_: GetTxDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxDescriptorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetTxDescriptorRequest { + const message = createBaseGetTxDescriptorRequest(); + return message; + }, + fromAmino(_: GetTxDescriptorRequestAmino): GetTxDescriptorRequest { + const message = createBaseGetTxDescriptorRequest(); + return message; + }, + toAmino(_: GetTxDescriptorRequest): GetTxDescriptorRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetTxDescriptorRequestAminoMsg): GetTxDescriptorRequest { + return GetTxDescriptorRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetTxDescriptorRequest): GetTxDescriptorRequestAminoMsg { + return { + type: "cosmos-sdk/GetTxDescriptorRequest", + value: GetTxDescriptorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxDescriptorRequestProtoMsg): GetTxDescriptorRequest { + return GetTxDescriptorRequest.decode(message.value); + }, + toProto(message: GetTxDescriptorRequest): Uint8Array { + return GetTxDescriptorRequest.encode(message).finish(); + }, + toProtoMsg(message: GetTxDescriptorRequest): GetTxDescriptorRequestProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest", + value: GetTxDescriptorRequest.encode(message).finish() + }; + } +}; +function createBaseGetTxDescriptorResponse(): GetTxDescriptorResponse { + return { + tx: undefined + }; +} +export const GetTxDescriptorResponse = { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse", + encode(message: GetTxDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + TxDescriptor.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxDescriptorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = TxDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetTxDescriptorResponse { + const message = createBaseGetTxDescriptorResponse(); + message.tx = object.tx !== undefined && object.tx !== null ? TxDescriptor.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: GetTxDescriptorResponseAmino): GetTxDescriptorResponse { + const message = createBaseGetTxDescriptorResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; + }, + toAmino(message: GetTxDescriptorResponse): GetTxDescriptorResponseAmino { + const obj: any = {}; + obj.tx = message.tx ? TxDescriptor.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: GetTxDescriptorResponseAminoMsg): GetTxDescriptorResponse { + return GetTxDescriptorResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetTxDescriptorResponse): GetTxDescriptorResponseAminoMsg { + return { + type: "cosmos-sdk/GetTxDescriptorResponse", + value: GetTxDescriptorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxDescriptorResponseProtoMsg): GetTxDescriptorResponse { + return GetTxDescriptorResponse.decode(message.value); + }, + toProto(message: GetTxDescriptorResponse): Uint8Array { + return GetTxDescriptorResponse.encode(message).finish(); + }, + toProtoMsg(message: GetTxDescriptorResponse): GetTxDescriptorResponseProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse", + value: GetTxDescriptorResponse.encode(message).finish() + }; + } +}; +function createBaseQueryServicesDescriptor(): QueryServicesDescriptor { + return { + queryServices: [] + }; +} +export const QueryServicesDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor", + encode(message: QueryServicesDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.queryServices) { + QueryServiceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryServicesDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryServicesDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queryServices.push(QueryServiceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryServicesDescriptor { + const message = createBaseQueryServicesDescriptor(); + message.queryServices = object.queryServices?.map(e => QueryServiceDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryServicesDescriptorAmino): QueryServicesDescriptor { + const message = createBaseQueryServicesDescriptor(); + message.queryServices = object.query_services?.map(e => QueryServiceDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryServicesDescriptor): QueryServicesDescriptorAmino { + const obj: any = {}; + if (message.queryServices) { + obj.query_services = message.queryServices.map(e => e ? QueryServiceDescriptor.toAmino(e) : undefined); + } else { + obj.query_services = message.queryServices; + } + return obj; + }, + fromAminoMsg(object: QueryServicesDescriptorAminoMsg): QueryServicesDescriptor { + return QueryServicesDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: QueryServicesDescriptor): QueryServicesDescriptorAminoMsg { + return { + type: "cosmos-sdk/QueryServicesDescriptor", + value: QueryServicesDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: QueryServicesDescriptorProtoMsg): QueryServicesDescriptor { + return QueryServicesDescriptor.decode(message.value); + }, + toProto(message: QueryServicesDescriptor): Uint8Array { + return QueryServicesDescriptor.encode(message).finish(); + }, + toProtoMsg(message: QueryServicesDescriptor): QueryServicesDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor", + value: QueryServicesDescriptor.encode(message).finish() + }; + } +}; +function createBaseQueryServiceDescriptor(): QueryServiceDescriptor { + return { + fullname: "", + isModule: false, + methods: [] + }; +} +export const QueryServiceDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor", + encode(message: QueryServiceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fullname !== "") { + writer.uint32(10).string(message.fullname); + } + if (message.isModule === true) { + writer.uint32(16).bool(message.isModule); + } + for (const v of message.methods) { + QueryMethodDescriptor.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryServiceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryServiceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullname = reader.string(); + break; + case 2: + message.isModule = reader.bool(); + break; + case 3: + message.methods.push(QueryMethodDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryServiceDescriptor { + const message = createBaseQueryServiceDescriptor(); + message.fullname = object.fullname ?? ""; + message.isModule = object.isModule ?? false; + message.methods = object.methods?.map(e => QueryMethodDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryServiceDescriptorAmino): QueryServiceDescriptor { + const message = createBaseQueryServiceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.is_module !== undefined && object.is_module !== null) { + message.isModule = object.is_module; + } + message.methods = object.methods?.map(e => QueryMethodDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryServiceDescriptor): QueryServiceDescriptorAmino { + const obj: any = {}; + obj.fullname = message.fullname === "" ? undefined : message.fullname; + obj.is_module = message.isModule === false ? undefined : message.isModule; + if (message.methods) { + obj.methods = message.methods.map(e => e ? QueryMethodDescriptor.toAmino(e) : undefined); + } else { + obj.methods = message.methods; + } + return obj; + }, + fromAminoMsg(object: QueryServiceDescriptorAminoMsg): QueryServiceDescriptor { + return QueryServiceDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: QueryServiceDescriptor): QueryServiceDescriptorAminoMsg { + return { + type: "cosmos-sdk/QueryServiceDescriptor", + value: QueryServiceDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: QueryServiceDescriptorProtoMsg): QueryServiceDescriptor { + return QueryServiceDescriptor.decode(message.value); + }, + toProto(message: QueryServiceDescriptor): Uint8Array { + return QueryServiceDescriptor.encode(message).finish(); + }, + toProtoMsg(message: QueryServiceDescriptor): QueryServiceDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor", + value: QueryServiceDescriptor.encode(message).finish() + }; + } +}; +function createBaseQueryMethodDescriptor(): QueryMethodDescriptor { + return { + name: "", + fullQueryPath: "" + }; +} +export const QueryMethodDescriptor = { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor", + encode(message: QueryMethodDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.fullQueryPath !== "") { + writer.uint32(18).string(message.fullQueryPath); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMethodDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMethodDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.fullQueryPath = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMethodDescriptor { + const message = createBaseQueryMethodDescriptor(); + message.name = object.name ?? ""; + message.fullQueryPath = object.fullQueryPath ?? ""; + return message; + }, + fromAmino(object: QueryMethodDescriptorAmino): QueryMethodDescriptor { + const message = createBaseQueryMethodDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.full_query_path !== undefined && object.full_query_path !== null) { + message.fullQueryPath = object.full_query_path; + } + return message; + }, + toAmino(message: QueryMethodDescriptor): QueryMethodDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.full_query_path = message.fullQueryPath === "" ? undefined : message.fullQueryPath; + return obj; + }, + fromAminoMsg(object: QueryMethodDescriptorAminoMsg): QueryMethodDescriptor { + return QueryMethodDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: QueryMethodDescriptor): QueryMethodDescriptorAminoMsg { + return { + type: "cosmos-sdk/QueryMethodDescriptor", + value: QueryMethodDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: QueryMethodDescriptorProtoMsg): QueryMethodDescriptor { + return QueryMethodDescriptor.decode(message.value); + }, + toProto(message: QueryMethodDescriptor): Uint8Array { + return QueryMethodDescriptor.encode(message).finish(); + }, + toProtoMsg(message: QueryMethodDescriptor): QueryMethodDescriptorProtoMsg { + return { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor", + value: QueryMethodDescriptor.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/base/v1beta1/coin.ts b/dydxjs/packages/dydxjs/src/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..60a45d97 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,418 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} +export interface CoinProtoMsg { + typeUrl: "/cosmos.base.v1beta1.Coin"; + value: Uint8Array; +} +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface CoinAmino { + denom?: string; + amount?: string; +} +export interface CoinAminoMsg { + type: "cosmos-sdk/Coin"; + value: CoinAmino; +} +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface CoinSDKType { + denom: string; + amount: string; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} +export interface DecCoinProtoMsg { + typeUrl: "/cosmos.base.v1beta1.DecCoin"; + value: Uint8Array; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinAmino { + denom?: string; + amount?: string; +} +export interface DecCoinAminoMsg { + type: "cosmos-sdk/DecCoin"; + value: DecCoinAmino; +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinSDKType { + denom: string; + amount: string; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + int: string; +} +export interface IntProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.IntProto"; + value: Uint8Array; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoAmino { + int?: string; +} +export interface IntProtoAminoMsg { + type: "cosmos-sdk/IntProto"; + value: IntProtoAmino; +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoSDKType { + int: string; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + dec: string; +} +export interface DecProtoProtoMsg { + typeUrl: "/cosmos.base.v1beta1.DecProto"; + value: Uint8Array; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoAmino { + dec?: string; +} +export interface DecProtoAminoMsg { + type: "cosmos-sdk/DecProto"; + value: DecProtoAmino; +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoSDKType { + dec: string; +} +function createBaseCoin(): Coin { + return { + denom: "", + amount: "" + }; +} +export const Coin = { + typeUrl: "/cosmos.base.v1beta1.Coin", + encode(message: Coin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Coin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: CoinAmino): Coin { + const message = createBaseCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: Coin): CoinAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: CoinAminoMsg): Coin { + return Coin.fromAmino(object.value); + }, + toAminoMsg(message: Coin): CoinAminoMsg { + return { + type: "cosmos-sdk/Coin", + value: Coin.toAmino(message) + }; + }, + fromProtoMsg(message: CoinProtoMsg): Coin { + return Coin.decode(message.value); + }, + toProto(message: Coin): Uint8Array { + return Coin.encode(message).finish(); + }, + toProtoMsg(message: Coin): CoinProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.Coin", + value: Coin.encode(message).finish() + }; + } +}; +function createBaseDecCoin(): DecCoin { + return { + denom: "", + amount: "" + }; +} +export const DecCoin = { + typeUrl: "/cosmos.base.v1beta1.DecCoin", + encode(message: DecCoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecCoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: DecCoinAmino): DecCoin { + const message = createBaseDecCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: DecCoin): DecCoinAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: DecCoinAminoMsg): DecCoin { + return DecCoin.fromAmino(object.value); + }, + toAminoMsg(message: DecCoin): DecCoinAminoMsg { + return { + type: "cosmos-sdk/DecCoin", + value: DecCoin.toAmino(message) + }; + }, + fromProtoMsg(message: DecCoinProtoMsg): DecCoin { + return DecCoin.decode(message.value); + }, + toProto(message: DecCoin): Uint8Array { + return DecCoin.encode(message).finish(); + }, + toProtoMsg(message: DecCoin): DecCoinProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.DecCoin", + value: DecCoin.encode(message).finish() + }; + } +}; +function createBaseIntProto(): IntProto { + return { + int: "" + }; +} +export const IntProto = { + typeUrl: "/cosmos.base.v1beta1.IntProto", + encode(message: IntProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.int !== "") { + writer.uint32(10).string(message.int); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IntProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; + return message; + }, + fromAmino(object: IntProtoAmino): IntProto { + const message = createBaseIntProto(); + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } + return message; + }, + toAmino(message: IntProto): IntProtoAmino { + const obj: any = {}; + obj.int = message.int === "" ? undefined : message.int; + return obj; + }, + fromAminoMsg(object: IntProtoAminoMsg): IntProto { + return IntProto.fromAmino(object.value); + }, + toAminoMsg(message: IntProto): IntProtoAminoMsg { + return { + type: "cosmos-sdk/IntProto", + value: IntProto.toAmino(message) + }; + }, + fromProtoMsg(message: IntProtoProtoMsg): IntProto { + return IntProto.decode(message.value); + }, + toProto(message: IntProto): Uint8Array { + return IntProto.encode(message).finish(); + }, + toProtoMsg(message: IntProto): IntProtoProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.IntProto", + value: IntProto.encode(message).finish() + }; + } +}; +function createBaseDecProto(): DecProto { + return { + dec: "" + }; +} +export const DecProto = { + typeUrl: "/cosmos.base.v1beta1.DecProto", + encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.dec !== "") { + writer.uint32(10).string(message.dec); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; + return message; + }, + fromAmino(object: DecProtoAmino): DecProto { + const message = createBaseDecProto(); + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } + return message; + }, + toAmino(message: DecProto): DecProtoAmino { + const obj: any = {}; + obj.dec = message.dec === "" ? undefined : message.dec; + return obj; + }, + fromAminoMsg(object: DecProtoAminoMsg): DecProto { + return DecProto.fromAmino(object.value); + }, + toAminoMsg(message: DecProto): DecProtoAminoMsg { + return { + type: "cosmos-sdk/DecProto", + value: DecProto.toAmino(message) + }; + }, + fromProtoMsg(message: DecProtoProtoMsg): DecProto { + return DecProto.decode(message.value); + }, + toProto(message: DecProto): Uint8Array { + return DecProto.encode(message).finish(); + }, + toProtoMsg(message: DecProto): DecProtoProtoMsg { + return { + typeUrl: "/cosmos.base.v1beta1.DecProto", + value: DecProto.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/bundle.ts b/dydxjs/packages/dydxjs/src/cosmos/bundle.ts new file mode 100644 index 00000000..995be6d1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/bundle.ts @@ -0,0 +1,311 @@ +//@ts-nocheck +import * as _3 from "./auth/v1beta1/auth"; +import * as _4 from "./auth/v1beta1/genesis"; +import * as _5 from "./auth/v1beta1/query"; +import * as _6 from "./authz/v1beta1/authz"; +import * as _7 from "./authz/v1beta1/event"; +import * as _8 from "./authz/v1beta1/genesis"; +import * as _9 from "./authz/v1beta1/query"; +import * as _10 from "./authz/v1beta1/tx"; +import * as _11 from "./bank/v1beta1/authz"; +import * as _12 from "./bank/v1beta1/bank"; +import * as _13 from "./bank/v1beta1/genesis"; +import * as _14 from "./bank/v1beta1/query"; +import * as _15 from "./bank/v1beta1/tx"; +import * as _16 from "./base/abci/v1beta1/abci"; +import * as _17 from "./base/query/v1beta1/pagination"; +import * as _18 from "./base/reflection/v2alpha1/reflection"; +import * as _19 from "./base/v1beta1/coin"; +import * as _20 from "./crypto/ed25519/keys"; +import * as _21 from "./crypto/hd/v1/hd"; +import * as _22 from "./crypto/keyring/v1/record"; +import * as _23 from "./crypto/multisig/keys"; +import * as _24 from "./crypto/secp256k1/keys"; +import * as _25 from "./crypto/secp256r1/keys"; +import * as _26 from "./distribution/v1beta1/distribution"; +import * as _27 from "./distribution/v1beta1/genesis"; +import * as _28 from "./distribution/v1beta1/query"; +import * as _29 from "./distribution/v1beta1/tx"; +import * as _30 from "./feegrant/v1beta1/feegrant"; +import * as _31 from "./feegrant/v1beta1/genesis"; +import * as _32 from "./feegrant/v1beta1/query"; +import * as _33 from "./feegrant/v1beta1/tx"; +import * as _34 from "./gov/v1/genesis"; +import * as _35 from "./gov/v1/gov"; +import * as _36 from "./gov/v1/query"; +import * as _37 from "./gov/v1/tx"; +import * as _38 from "./gov/v1beta1/genesis"; +import * as _39 from "./gov/v1beta1/gov"; +import * as _40 from "./gov/v1beta1/query"; +import * as _41 from "./gov/v1beta1/tx"; +import * as _42 from "./group/v1/events"; +import * as _43 from "./group/v1/genesis"; +import * as _44 from "./group/v1/query"; +import * as _45 from "./group/v1/tx"; +import * as _46 from "./group/v1/types"; +import * as _47 from "./mint/v1beta1/genesis"; +import * as _48 from "./mint/v1beta1/mint"; +import * as _49 from "./mint/v1beta1/query"; +import * as _50 from "./params/v1beta1/params"; +import * as _51 from "./params/v1beta1/query"; +import * as _52 from "./staking/v1beta1/authz"; +import * as _53 from "./staking/v1beta1/genesis"; +import * as _54 from "./staking/v1beta1/query"; +import * as _55 from "./staking/v1beta1/staking"; +import * as _56 from "./staking/v1beta1/tx"; +import * as _57 from "./tx/signing/v1beta1/signing"; +import * as _58 from "./tx/v1beta1/service"; +import * as _59 from "./tx/v1beta1/tx"; +import * as _60 from "./upgrade/v1beta1/query"; +import * as _61 from "./upgrade/v1beta1/tx"; +import * as _62 from "./upgrade/v1beta1/upgrade"; +import * as _63 from "./vesting/v1beta1/tx"; +import * as _64 from "./vesting/v1beta1/vesting"; +import * as _256 from "./authz/v1beta1/tx.amino"; +import * as _257 from "./bank/v1beta1/tx.amino"; +import * as _258 from "./distribution/v1beta1/tx.amino"; +import * as _259 from "./feegrant/v1beta1/tx.amino"; +import * as _260 from "./gov/v1/tx.amino"; +import * as _261 from "./gov/v1beta1/tx.amino"; +import * as _262 from "./group/v1/tx.amino"; +import * as _263 from "./staking/v1beta1/tx.amino"; +import * as _264 from "./upgrade/v1beta1/tx.amino"; +import * as _265 from "./vesting/v1beta1/tx.amino"; +import * as _266 from "./authz/v1beta1/tx.registry"; +import * as _267 from "./bank/v1beta1/tx.registry"; +import * as _268 from "./distribution/v1beta1/tx.registry"; +import * as _269 from "./feegrant/v1beta1/tx.registry"; +import * as _270 from "./gov/v1/tx.registry"; +import * as _271 from "./gov/v1beta1/tx.registry"; +import * as _272 from "./group/v1/tx.registry"; +import * as _273 from "./staking/v1beta1/tx.registry"; +import * as _274 from "./upgrade/v1beta1/tx.registry"; +import * as _275 from "./vesting/v1beta1/tx.registry"; +import * as _276 from "./auth/v1beta1/query.rpc.Query"; +import * as _277 from "./authz/v1beta1/query.rpc.Query"; +import * as _278 from "./bank/v1beta1/query.rpc.Query"; +import * as _279 from "./distribution/v1beta1/query.rpc.Query"; +import * as _280 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _281 from "./gov/v1/query.rpc.Query"; +import * as _282 from "./gov/v1beta1/query.rpc.Query"; +import * as _283 from "./group/v1/query.rpc.Query"; +import * as _284 from "./mint/v1beta1/query.rpc.Query"; +import * as _285 from "./params/v1beta1/query.rpc.Query"; +import * as _286 from "./staking/v1beta1/query.rpc.Query"; +import * as _287 from "./tx/v1beta1/service.rpc.Service"; +import * as _288 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _289 from "./authz/v1beta1/tx.rpc.msg"; +import * as _290 from "./bank/v1beta1/tx.rpc.msg"; +import * as _291 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _292 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _293 from "./gov/v1/tx.rpc.msg"; +import * as _294 from "./gov/v1beta1/tx.rpc.msg"; +import * as _295 from "./group/v1/tx.rpc.msg"; +import * as _296 from "./staking/v1beta1/tx.rpc.msg"; +import * as _297 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _298 from "./vesting/v1beta1/tx.rpc.msg"; +import * as _407 from "./rpc.query"; +import * as _408 from "./rpc.tx"; +export namespace cosmos { + export namespace auth { + export const v1beta1 = { + ..._3, + ..._4, + ..._5, + ..._276 + }; + } + export namespace authz { + export const v1beta1 = { + ..._6, + ..._7, + ..._8, + ..._9, + ..._10, + ..._256, + ..._266, + ..._277, + ..._289 + }; + } + export namespace bank { + export const v1beta1 = { + ..._11, + ..._12, + ..._13, + ..._14, + ..._15, + ..._257, + ..._267, + ..._278, + ..._290 + }; + } + export namespace base { + export namespace abci { + export const v1beta1 = { + ..._16 + }; + } + export namespace query { + export const v1beta1 = { + ..._17 + }; + } + export namespace reflection { + export const v2alpha1 = { + ..._18 + }; + } + export const v1beta1 = { + ..._19 + }; + } + export namespace crypto { + export const ed25519 = { + ..._20 + }; + export namespace hd { + export const v1 = { + ..._21 + }; + } + export namespace keyring { + export const v1 = { + ..._22 + }; + } + export const multisig = { + ..._23 + }; + export const secp256k1 = { + ..._24 + }; + export const secp256r1 = { + ..._25 + }; + } + export namespace distribution { + export const v1beta1 = { + ..._26, + ..._27, + ..._28, + ..._29, + ..._258, + ..._268, + ..._279, + ..._291 + }; + } + export namespace feegrant { + export const v1beta1 = { + ..._30, + ..._31, + ..._32, + ..._33, + ..._259, + ..._269, + ..._280, + ..._292 + }; + } + export namespace gov { + export const v1 = { + ..._34, + ..._35, + ..._36, + ..._37, + ..._260, + ..._270, + ..._281, + ..._293 + }; + export const v1beta1 = { + ..._38, + ..._39, + ..._40, + ..._41, + ..._261, + ..._271, + ..._282, + ..._294 + }; + } + export namespace group { + export const v1 = { + ..._42, + ..._43, + ..._44, + ..._45, + ..._46, + ..._262, + ..._272, + ..._283, + ..._295 + }; + } + export namespace mint { + export const v1beta1 = { + ..._47, + ..._48, + ..._49, + ..._284 + }; + } + export namespace params { + export const v1beta1 = { + ..._50, + ..._51, + ..._285 + }; + } + export namespace staking { + export const v1beta1 = { + ..._52, + ..._53, + ..._54, + ..._55, + ..._56, + ..._263, + ..._273, + ..._286, + ..._296 + }; + } + export namespace tx { + export namespace signing { + export const v1beta1 = { + ..._57 + }; + } + export const v1beta1 = { + ..._58, + ..._59, + ..._287 + }; + } + export namespace upgrade { + export const v1beta1 = { + ..._60, + ..._61, + ..._62, + ..._264, + ..._274, + ..._288, + ..._297 + }; + } + export namespace vesting { + export const v1beta1 = { + ..._63, + ..._64, + ..._265, + ..._275, + ..._298 + }; + } + export const ClientFactory = { + ..._407, + ..._408 + }; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/client.ts b/dydxjs/packages/dydxjs/src/cosmos/client.ts new file mode 100644 index 00000000..b92d21b2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/client.ts @@ -0,0 +1,67 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; +import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; +import * as cosmosDistributionV1beta1TxRegistry from "./distribution/v1beta1/tx.registry"; +import * as cosmosFeegrantV1beta1TxRegistry from "./feegrant/v1beta1/tx.registry"; +import * as cosmosGovV1TxRegistry from "./gov/v1/tx.registry"; +import * as cosmosGovV1beta1TxRegistry from "./gov/v1beta1/tx.registry"; +import * as cosmosGroupV1TxRegistry from "./group/v1/tx.registry"; +import * as cosmosStakingV1beta1TxRegistry from "./staking/v1beta1/tx.registry"; +import * as cosmosUpgradeV1beta1TxRegistry from "./upgrade/v1beta1/tx.registry"; +import * as cosmosVestingV1beta1TxRegistry from "./vesting/v1beta1/tx.registry"; +import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; +import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; +import * as cosmosDistributionV1beta1TxAmino from "./distribution/v1beta1/tx.amino"; +import * as cosmosFeegrantV1beta1TxAmino from "./feegrant/v1beta1/tx.amino"; +import * as cosmosGovV1TxAmino from "./gov/v1/tx.amino"; +import * as cosmosGovV1beta1TxAmino from "./gov/v1beta1/tx.amino"; +import * as cosmosGroupV1TxAmino from "./group/v1/tx.amino"; +import * as cosmosStakingV1beta1TxAmino from "./staking/v1beta1/tx.amino"; +import * as cosmosUpgradeV1beta1TxAmino from "./upgrade/v1beta1/tx.amino"; +import * as cosmosVestingV1beta1TxAmino from "./vesting/v1beta1/tx.amino"; +export const cosmosAminoConverters = { + ...cosmosAuthzV1beta1TxAmino.AminoConverter, + ...cosmosBankV1beta1TxAmino.AminoConverter, + ...cosmosDistributionV1beta1TxAmino.AminoConverter, + ...cosmosFeegrantV1beta1TxAmino.AminoConverter, + ...cosmosGovV1TxAmino.AminoConverter, + ...cosmosGovV1beta1TxAmino.AminoConverter, + ...cosmosGroupV1TxAmino.AminoConverter, + ...cosmosStakingV1beta1TxAmino.AminoConverter, + ...cosmosUpgradeV1beta1TxAmino.AminoConverter, + ...cosmosVestingV1beta1TxAmino.AminoConverter +}; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosGroupV1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry, ...cosmosVestingV1beta1TxRegistry.registry]; +export const getSigningCosmosClientOptions = (): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...cosmosProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...cosmosAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningCosmosClient = async ({ + rpcEndpoint, + signer +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +}) => { + const { + registry, + aminoTypes + } = getSigningCosmosClientOptions(); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/crypto/ed25519/keys.ts b/dydxjs/packages/dydxjs/src/cosmos/crypto/ed25519/keys.ts new file mode 100644 index 00000000..02e83618 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/crypto/ed25519/keys.ts @@ -0,0 +1,208 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * ADR-28. Nevertheless, you will like to use ed25519 in app user level + * then you must create a new proto message and follow ADR-28 for Address construction. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.ed25519.PubKey"; + value: Uint8Array; +} +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * ADR-28. Nevertheless, you will like to use ed25519 in app user level + * then you must create a new proto message and follow ADR-28 for Address construction. + */ +export interface PubKeyAmino { + key?: string; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * ADR-28. Nevertheless, you will like to use ed25519 in app user level + * then you must create a new proto message and follow ADR-28 for Address construction. + */ +export interface PubKeySDKType { + key: Uint8Array; +} +/** + * Deprecated: PrivKey defines a ed25519 private key. + * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. + */ +export interface PrivKey { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.ed25519.PrivKey"; + value: Uint8Array; +} +/** + * Deprecated: PrivKey defines a ed25519 private key. + * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. + */ +export interface PrivKeyAmino { + key?: string; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +/** + * Deprecated: PrivKey defines a ed25519 private key. + * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. + */ +export interface PrivKeySDKType { + key: Uint8Array; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.ed25519.PubKey", + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "cosmos-sdk/PubKey", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.ed25519.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.ed25519.PrivKey", + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "cosmos-sdk/PrivKey", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.ed25519.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/crypto/hd/v1/hd.ts b/dydxjs/packages/dydxjs/src/cosmos/crypto/hd/v1/hd.ts new file mode 100644 index 00000000..e8fccaca --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/crypto/hd/v1/hd.ts @@ -0,0 +1,167 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44Params { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose: number; + /** coin_type is a constant that improves privacy */ + coinType: number; + /** account splits the key space into independent user identities */ + account: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change: boolean; + /** address_index is used as child index in BIP32 derivation */ + addressIndex: number; +} +export interface BIP44ParamsProtoMsg { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params"; + value: Uint8Array; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsAmino { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose?: number; + /** coin_type is a constant that improves privacy */ + coin_type?: number; + /** account splits the key space into independent user identities */ + account?: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change?: boolean; + /** address_index is used as child index in BIP32 derivation */ + address_index?: number; +} +export interface BIP44ParamsAminoMsg { + type: "cosmos-sdk/BIP44Params"; + value: BIP44ParamsAmino; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsSDKType { + purpose: number; + coin_type: number; + account: number; + change: boolean; + address_index: number; +} +function createBaseBIP44Params(): BIP44Params { + return { + purpose: 0, + coinType: 0, + account: 0, + change: false, + addressIndex: 0 + }; +} +export const BIP44Params = { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + encode(message: BIP44Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.purpose !== 0) { + writer.uint32(8).uint32(message.purpose); + } + if (message.coinType !== 0) { + writer.uint32(16).uint32(message.coinType); + } + if (message.account !== 0) { + writer.uint32(24).uint32(message.account); + } + if (message.change === true) { + writer.uint32(32).bool(message.change); + } + if (message.addressIndex !== 0) { + writer.uint32(40).uint32(message.addressIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BIP44Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBIP44Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purpose = reader.uint32(); + break; + case 2: + message.coinType = reader.uint32(); + break; + case 3: + message.account = reader.uint32(); + break; + case 4: + message.change = reader.bool(); + break; + case 5: + message.addressIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BIP44Params { + const message = createBaseBIP44Params(); + message.purpose = object.purpose ?? 0; + message.coinType = object.coinType ?? 0; + message.account = object.account ?? 0; + message.change = object.change ?? false; + message.addressIndex = object.addressIndex ?? 0; + return message; + }, + fromAmino(object: BIP44ParamsAmino): BIP44Params { + const message = createBaseBIP44Params(); + if (object.purpose !== undefined && object.purpose !== null) { + message.purpose = object.purpose; + } + if (object.coin_type !== undefined && object.coin_type !== null) { + message.coinType = object.coin_type; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.change !== undefined && object.change !== null) { + message.change = object.change; + } + if (object.address_index !== undefined && object.address_index !== null) { + message.addressIndex = object.address_index; + } + return message; + }, + toAmino(message: BIP44Params): BIP44ParamsAmino { + const obj: any = {}; + obj.purpose = message.purpose === 0 ? undefined : message.purpose; + obj.coin_type = message.coinType === 0 ? undefined : message.coinType; + obj.account = message.account === 0 ? undefined : message.account; + obj.change = message.change === false ? undefined : message.change; + obj.address_index = message.addressIndex === 0 ? undefined : message.addressIndex; + return obj; + }, + fromAminoMsg(object: BIP44ParamsAminoMsg): BIP44Params { + return BIP44Params.fromAmino(object.value); + }, + toAminoMsg(message: BIP44Params): BIP44ParamsAminoMsg { + return { + type: "cosmos-sdk/BIP44Params", + value: BIP44Params.toAmino(message) + }; + }, + fromProtoMsg(message: BIP44ParamsProtoMsg): BIP44Params { + return BIP44Params.decode(message.value); + }, + toProto(message: BIP44Params): Uint8Array { + return BIP44Params.encode(message).finish(); + }, + toProtoMsg(message: BIP44Params): BIP44ParamsProtoMsg { + return { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + value: BIP44Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/crypto/keyring/v1/record.ts b/dydxjs/packages/dydxjs/src/cosmos/crypto/keyring/v1/record.ts new file mode 100644 index 00000000..0024a615 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/crypto/keyring/v1/record.ts @@ -0,0 +1,522 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BIP44Params, BIP44ParamsAmino, BIP44ParamsSDKType } from "../../hd/v1/hd"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Record is used for representing a key in the keyring. */ +export interface Record { + /** name represents a name of Record */ + name: string; + /** pub_key represents a public key in any format */ + pubKey?: Any; + /** local stores the public information about a locally stored key */ + local?: Record_Local; + /** ledger stores the public information about a Ledger key */ + ledger?: Record_Ledger; + /** Multi does not store any information. */ + multi?: Record_Multi; + /** Offline does not store any information. */ + offline?: Record_Offline; +} +export interface RecordProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Record"; + value: Uint8Array; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordAmino { + /** name represents a name of Record */ + name?: string; + /** pub_key represents a public key in any format */ + pub_key?: AnyAmino; + /** local stores the public information about a locally stored key */ + local?: Record_LocalAmino; + /** ledger stores the public information about a Ledger key */ + ledger?: Record_LedgerAmino; + /** Multi does not store any information. */ + multi?: Record_MultiAmino; + /** Offline does not store any information. */ + offline?: Record_OfflineAmino; +} +export interface RecordAminoMsg { + type: "cosmos-sdk/Record"; + value: RecordAmino; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordSDKType { + name: string; + pub_key?: AnySDKType; + local?: Record_LocalSDKType; + ledger?: Record_LedgerSDKType; + multi?: Record_MultiSDKType; + offline?: Record_OfflineSDKType; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_Local { + privKey?: Any; + privKeyType: string; +} +export interface Record_LocalProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Local"; + value: Uint8Array; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalAmino { + priv_key?: AnyAmino; + priv_key_type?: string; +} +export interface Record_LocalAminoMsg { + type: "cosmos-sdk/Local"; + value: Record_LocalAmino; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalSDKType { + priv_key?: AnySDKType; + priv_key_type: string; +} +/** Ledger item */ +export interface Record_Ledger { + path?: BIP44Params; +} +export interface Record_LedgerProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger"; + value: Uint8Array; +} +/** Ledger item */ +export interface Record_LedgerAmino { + path?: BIP44ParamsAmino; +} +export interface Record_LedgerAminoMsg { + type: "cosmos-sdk/Ledger"; + value: Record_LedgerAmino; +} +/** Ledger item */ +export interface Record_LedgerSDKType { + path?: BIP44ParamsSDKType; +} +/** Multi item */ +export interface Record_Multi {} +export interface Record_MultiProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Multi"; + value: Uint8Array; +} +/** Multi item */ +export interface Record_MultiAmino {} +export interface Record_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: Record_MultiAmino; +} +/** Multi item */ +export interface Record_MultiSDKType {} +/** Offline item */ +export interface Record_Offline {} +export interface Record_OfflineProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Offline"; + value: Uint8Array; +} +/** Offline item */ +export interface Record_OfflineAmino {} +export interface Record_OfflineAminoMsg { + type: "cosmos-sdk/Offline"; + value: Record_OfflineAmino; +} +/** Offline item */ +export interface Record_OfflineSDKType {} +function createBaseRecord(): Record { + return { + name: "", + pubKey: undefined, + local: undefined, + ledger: undefined, + multi: undefined, + offline: undefined + }; +} +export const Record = { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + encode(message: Record, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.local !== undefined) { + Record_Local.encode(message.local, writer.uint32(26).fork()).ldelim(); + } + if (message.ledger !== undefined) { + Record_Ledger.encode(message.ledger, writer.uint32(34).fork()).ldelim(); + } + if (message.multi !== undefined) { + Record_Multi.encode(message.multi, writer.uint32(42).fork()).ldelim(); + } + if (message.offline !== undefined) { + Record_Offline.encode(message.offline, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.local = Record_Local.decode(reader, reader.uint32()); + break; + case 4: + message.ledger = Record_Ledger.decode(reader, reader.uint32()); + break; + case 5: + message.multi = Record_Multi.decode(reader, reader.uint32()); + break; + case 6: + message.offline = Record_Offline.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record { + const message = createBaseRecord(); + message.name = object.name ?? ""; + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; + message.local = object.local !== undefined && object.local !== null ? Record_Local.fromPartial(object.local) : undefined; + message.ledger = object.ledger !== undefined && object.ledger !== null ? Record_Ledger.fromPartial(object.ledger) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? Record_Multi.fromPartial(object.multi) : undefined; + message.offline = object.offline !== undefined && object.offline !== null ? Record_Offline.fromPartial(object.offline) : undefined; + return message; + }, + fromAmino(object: RecordAmino): Record { + const message = createBaseRecord(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.local !== undefined && object.local !== null) { + message.local = Record_Local.fromAmino(object.local); + } + if (object.ledger !== undefined && object.ledger !== null) { + message.ledger = Record_Ledger.fromAmino(object.ledger); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = Record_Multi.fromAmino(object.multi); + } + if (object.offline !== undefined && object.offline !== null) { + message.offline = Record_Offline.fromAmino(object.offline); + } + return message; + }, + toAmino(message: Record): RecordAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.local = message.local ? Record_Local.toAmino(message.local) : undefined; + obj.ledger = message.ledger ? Record_Ledger.toAmino(message.ledger) : undefined; + obj.multi = message.multi ? Record_Multi.toAmino(message.multi) : undefined; + obj.offline = message.offline ? Record_Offline.toAmino(message.offline) : undefined; + return obj; + }, + fromAminoMsg(object: RecordAminoMsg): Record { + return Record.fromAmino(object.value); + }, + toAminoMsg(message: Record): RecordAminoMsg { + return { + type: "cosmos-sdk/Record", + value: Record.toAmino(message) + }; + }, + fromProtoMsg(message: RecordProtoMsg): Record { + return Record.decode(message.value); + }, + toProto(message: Record): Uint8Array { + return Record.encode(message).finish(); + }, + toProtoMsg(message: Record): RecordProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + value: Record.encode(message).finish() + }; + } +}; +function createBaseRecord_Local(): Record_Local { + return { + privKey: undefined, + privKeyType: "" + }; +} +export const Record_Local = { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + encode(message: Record_Local, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.privKey !== undefined) { + Any.encode(message.privKey, writer.uint32(10).fork()).ldelim(); + } + if (message.privKeyType !== "") { + writer.uint32(18).string(message.privKeyType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Local { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Local(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.privKeyType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record_Local { + const message = createBaseRecord_Local(); + message.privKey = object.privKey !== undefined && object.privKey !== null ? Any.fromPartial(object.privKey) : undefined; + message.privKeyType = object.privKeyType ?? ""; + return message; + }, + fromAmino(object: Record_LocalAmino): Record_Local { + const message = createBaseRecord_Local(); + if (object.priv_key !== undefined && object.priv_key !== null) { + message.privKey = Any.fromAmino(object.priv_key); + } + if (object.priv_key_type !== undefined && object.priv_key_type !== null) { + message.privKeyType = object.priv_key_type; + } + return message; + }, + toAmino(message: Record_Local): Record_LocalAmino { + const obj: any = {}; + obj.priv_key = message.privKey ? Any.toAmino(message.privKey) : undefined; + obj.priv_key_type = message.privKeyType === "" ? undefined : message.privKeyType; + return obj; + }, + fromAminoMsg(object: Record_LocalAminoMsg): Record_Local { + return Record_Local.fromAmino(object.value); + }, + toAminoMsg(message: Record_Local): Record_LocalAminoMsg { + return { + type: "cosmos-sdk/Local", + value: Record_Local.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LocalProtoMsg): Record_Local { + return Record_Local.decode(message.value); + }, + toProto(message: Record_Local): Uint8Array { + return Record_Local.encode(message).finish(); + }, + toProtoMsg(message: Record_Local): Record_LocalProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + value: Record_Local.encode(message).finish() + }; + } +}; +function createBaseRecord_Ledger(): Record_Ledger { + return { + path: undefined + }; +} +export const Record_Ledger = { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + encode(message: Record_Ledger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path !== undefined) { + BIP44Params.encode(message.path, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Ledger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Ledger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = BIP44Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record_Ledger { + const message = createBaseRecord_Ledger(); + message.path = object.path !== undefined && object.path !== null ? BIP44Params.fromPartial(object.path) : undefined; + return message; + }, + fromAmino(object: Record_LedgerAmino): Record_Ledger { + const message = createBaseRecord_Ledger(); + if (object.path !== undefined && object.path !== null) { + message.path = BIP44Params.fromAmino(object.path); + } + return message; + }, + toAmino(message: Record_Ledger): Record_LedgerAmino { + const obj: any = {}; + obj.path = message.path ? BIP44Params.toAmino(message.path) : undefined; + return obj; + }, + fromAminoMsg(object: Record_LedgerAminoMsg): Record_Ledger { + return Record_Ledger.fromAmino(object.value); + }, + toAminoMsg(message: Record_Ledger): Record_LedgerAminoMsg { + return { + type: "cosmos-sdk/Ledger", + value: Record_Ledger.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LedgerProtoMsg): Record_Ledger { + return Record_Ledger.decode(message.value); + }, + toProto(message: Record_Ledger): Uint8Array { + return Record_Ledger.encode(message).finish(); + }, + toProtoMsg(message: Record_Ledger): Record_LedgerProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + value: Record_Ledger.encode(message).finish() + }; + } +}; +function createBaseRecord_Multi(): Record_Multi { + return {}; +} +export const Record_Multi = { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + encode(_: Record_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + fromAmino(_: Record_MultiAmino): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + toAmino(_: Record_Multi): Record_MultiAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_MultiAminoMsg): Record_Multi { + return Record_Multi.fromAmino(object.value); + }, + toAminoMsg(message: Record_Multi): Record_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: Record_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: Record_MultiProtoMsg): Record_Multi { + return Record_Multi.decode(message.value); + }, + toProto(message: Record_Multi): Uint8Array { + return Record_Multi.encode(message).finish(); + }, + toProtoMsg(message: Record_Multi): Record_MultiProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + value: Record_Multi.encode(message).finish() + }; + } +}; +function createBaseRecord_Offline(): Record_Offline { + return {}; +} +export const Record_Offline = { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + encode(_: Record_Offline, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Offline { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Offline(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + fromAmino(_: Record_OfflineAmino): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + toAmino(_: Record_Offline): Record_OfflineAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_OfflineAminoMsg): Record_Offline { + return Record_Offline.fromAmino(object.value); + }, + toAminoMsg(message: Record_Offline): Record_OfflineAminoMsg { + return { + type: "cosmos-sdk/Offline", + value: Record_Offline.toAmino(message) + }; + }, + fromProtoMsg(message: Record_OfflineProtoMsg): Record_Offline { + return Record_Offline.decode(message.value); + }, + toProto(message: Record_Offline): Uint8Array { + return Record_Offline.encode(message).finish(); + }, + toProtoMsg(message: Record_Offline): Record_OfflineProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + value: Record_Offline.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/crypto/multisig/keys.ts b/dydxjs/packages/dydxjs/src/cosmos/crypto/multisig/keys.ts new file mode 100644 index 00000000..eddecd00 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/crypto/multisig/keys.ts @@ -0,0 +1,121 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * LegacyAminoPubKey specifies a public key type + * which nests multiple public keys and a threshold, + * it uses legacy amino address rules. + */ +export interface LegacyAminoPubKey { + threshold: number; + publicKeys: Any[]; +} +export interface LegacyAminoPubKeyProtoMsg { + typeUrl: "/cosmos.crypto.multisig.LegacyAminoPubKey"; + value: Uint8Array; +} +/** + * LegacyAminoPubKey specifies a public key type + * which nests multiple public keys and a threshold, + * it uses legacy amino address rules. + */ +export interface LegacyAminoPubKeyAmino { + threshold?: number; + public_keys?: AnyAmino[]; +} +export interface LegacyAminoPubKeyAminoMsg { + type: "cosmos-sdk/LegacyAminoPubKey"; + value: LegacyAminoPubKeyAmino; +} +/** + * LegacyAminoPubKey specifies a public key type + * which nests multiple public keys and a threshold, + * it uses legacy amino address rules. + */ +export interface LegacyAminoPubKeySDKType { + threshold: number; + public_keys: AnySDKType[]; +} +function createBaseLegacyAminoPubKey(): LegacyAminoPubKey { + return { + threshold: 0, + publicKeys: [] + }; +} +export const LegacyAminoPubKey = { + typeUrl: "/cosmos.crypto.multisig.LegacyAminoPubKey", + encode(message: LegacyAminoPubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.threshold !== 0) { + writer.uint32(8).uint32(message.threshold); + } + for (const v of message.publicKeys) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LegacyAminoPubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLegacyAminoPubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threshold = reader.uint32(); + break; + case 2: + message.publicKeys.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LegacyAminoPubKey { + const message = createBaseLegacyAminoPubKey(); + message.threshold = object.threshold ?? 0; + message.publicKeys = object.publicKeys?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LegacyAminoPubKeyAmino): LegacyAminoPubKey { + const message = createBaseLegacyAminoPubKey(); + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + message.publicKeys = object.public_keys?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: LegacyAminoPubKey): LegacyAminoPubKeyAmino { + const obj: any = {}; + obj.threshold = message.threshold === 0 ? undefined : message.threshold; + if (message.publicKeys) { + obj.public_keys = message.publicKeys.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.public_keys = message.publicKeys; + } + return obj; + }, + fromAminoMsg(object: LegacyAminoPubKeyAminoMsg): LegacyAminoPubKey { + return LegacyAminoPubKey.fromAmino(object.value); + }, + toAminoMsg(message: LegacyAminoPubKey): LegacyAminoPubKeyAminoMsg { + return { + type: "cosmos-sdk/LegacyAminoPubKey", + value: LegacyAminoPubKey.toAmino(message) + }; + }, + fromProtoMsg(message: LegacyAminoPubKeyProtoMsg): LegacyAminoPubKey { + return LegacyAminoPubKey.decode(message.value); + }, + toProto(message: LegacyAminoPubKey): Uint8Array { + return LegacyAminoPubKey.encode(message).finish(); + }, + toProtoMsg(message: LegacyAminoPubKey): LegacyAminoPubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.multisig.LegacyAminoPubKey", + value: LegacyAminoPubKey.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/dydxjs/packages/dydxjs/src/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 00000000..d9247070 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,225 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignature { + signatures: Uint8Array[]; +} +export interface MultiSignatureProtoMsg { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature"; + value: Uint8Array; +} +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignatureAmino { + signatures?: string[]; +} +export interface MultiSignatureAminoMsg { + type: "cosmos-sdk/MultiSignature"; + value: MultiSignatureAmino; +} +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignatureSDKType { + signatures: Uint8Array[]; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArray { + extraBitsStored: number; + elems: Uint8Array; +} +export interface CompactBitArrayProtoMsg { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray"; + value: Uint8Array; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArrayAmino { + extra_bits_stored?: number; + elems?: string; +} +export interface CompactBitArrayAminoMsg { + type: "cosmos-sdk/CompactBitArray"; + value: CompactBitArrayAmino; +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArraySDKType { + extra_bits_stored: number; + elems: Uint8Array; +} +function createBaseMultiSignature(): MultiSignature { + return { + signatures: [] + }; +} +export const MultiSignature = { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + encode(message: MultiSignature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signatures) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MultiSignature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMultiSignature(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MultiSignature { + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: MultiSignatureAmino): MultiSignature { + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MultiSignature): MultiSignatureAmino { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: MultiSignatureAminoMsg): MultiSignature { + return MultiSignature.fromAmino(object.value); + }, + toAminoMsg(message: MultiSignature): MultiSignatureAminoMsg { + return { + type: "cosmos-sdk/MultiSignature", + value: MultiSignature.toAmino(message) + }; + }, + fromProtoMsg(message: MultiSignatureProtoMsg): MultiSignature { + return MultiSignature.decode(message.value); + }, + toProto(message: MultiSignature): Uint8Array { + return MultiSignature.encode(message).finish(); + }, + toProtoMsg(message: MultiSignature): MultiSignatureProtoMsg { + return { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + value: MultiSignature.encode(message).finish() + }; + } +}; +function createBaseCompactBitArray(): CompactBitArray { + return { + extraBitsStored: 0, + elems: new Uint8Array() + }; +} +export const CompactBitArray = { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + encode(message: CompactBitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.extraBitsStored !== 0) { + writer.uint32(8).uint32(message.extraBitsStored); + } + if (message.elems.length !== 0) { + writer.uint32(18).bytes(message.elems); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompactBitArray { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompactBitArray(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompactBitArray { + const message = createBaseCompactBitArray(); + message.extraBitsStored = object.extraBitsStored ?? 0; + message.elems = object.elems ?? new Uint8Array(); + return message; + }, + fromAmino(object: CompactBitArrayAmino): CompactBitArray { + const message = createBaseCompactBitArray(); + if (object.extra_bits_stored !== undefined && object.extra_bits_stored !== null) { + message.extraBitsStored = object.extra_bits_stored; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; + }, + toAmino(message: CompactBitArray): CompactBitArrayAmino { + const obj: any = {}; + obj.extra_bits_stored = message.extraBitsStored === 0 ? undefined : message.extraBitsStored; + obj.elems = message.elems ? base64FromBytes(message.elems) : undefined; + return obj; + }, + fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { + return CompactBitArray.fromAmino(object.value); + }, + toAminoMsg(message: CompactBitArray): CompactBitArrayAminoMsg { + return { + type: "cosmos-sdk/CompactBitArray", + value: CompactBitArray.toAmino(message) + }; + }, + fromProtoMsg(message: CompactBitArrayProtoMsg): CompactBitArray { + return CompactBitArray.decode(message.value); + }, + toProto(message: CompactBitArray): Uint8Array { + return CompactBitArray.encode(message).finish(); + }, + toProtoMsg(message: CompactBitArray): CompactBitArrayProtoMsg { + return { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + value: CompactBitArray.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/crypto/secp256k1/keys.ts b/dydxjs/packages/dydxjs/src/cosmos/crypto/secp256k1/keys.ts new file mode 100644 index 00000000..f5b13ae4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/crypto/secp256k1/keys.ts @@ -0,0 +1,199 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKey { + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256k1.PubKey"; + value: Uint8Array; +} +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKeyAmino { + key?: string; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKeySDKType { + key: Uint8Array; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKey { + key: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey"; + value: Uint8Array; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKeyAmino { + key?: string; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKeySDKType { + key: Uint8Array; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "cosmos-sdk/PubKey", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +function createBasePrivKey(): PrivKey { + return { + key: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PrivKey { + const message = createBasePrivKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "cosmos-sdk/PrivKey", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/crypto/secp256r1/keys.ts b/dydxjs/packages/dydxjs/src/cosmos/crypto/secp256r1/keys.ts new file mode 100644 index 00000000..87ebef2b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/crypto/secp256r1/keys.ts @@ -0,0 +1,191 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKey { + /** + * Point on secp256r1 curve in a compressed representation as specified in section + * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + */ + key: Uint8Array; +} +export interface PubKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256r1.PubKey"; + value: Uint8Array; +} +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKeyAmino { + /** + * Point on secp256r1 curve in a compressed representation as specified in section + * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + */ + key?: string; +} +export interface PubKeyAminoMsg { + type: "cosmos-sdk/PubKey"; + value: PubKeyAmino; +} +/** PubKey defines a secp256r1 ECDSA public key. */ +export interface PubKeySDKType { + key: Uint8Array; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKey { + /** secret number serialized using big-endian encoding */ + secret: Uint8Array; +} +export interface PrivKeyProtoMsg { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey"; + value: Uint8Array; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKeyAmino { + /** secret number serialized using big-endian encoding */ + secret?: string; +} +export interface PrivKeyAminoMsg { + type: "cosmos-sdk/PrivKey"; + value: PrivKeyAmino; +} +/** PrivKey defines a secp256r1 ECDSA private key. */ +export interface PrivKeySDKType { + secret: Uint8Array; +} +function createBasePubKey(): PubKey { + return { + key: new Uint8Array() + }; +} +export const PubKey = { + typeUrl: "/cosmos.crypto.secp256r1.PubKey", + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePubKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PubKey { + const message = createBasePubKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: PubKeyAmino): PubKey { + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: PubKey): PubKeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: PubKeyAminoMsg): PubKey { + return PubKey.fromAmino(object.value); + }, + toAminoMsg(message: PubKey): PubKeyAminoMsg { + return { + type: "cosmos-sdk/PubKey", + value: PubKey.toAmino(message) + }; + }, + fromProtoMsg(message: PubKeyProtoMsg): PubKey { + return PubKey.decode(message.value); + }, + toProto(message: PubKey): Uint8Array { + return PubKey.encode(message).finish(); + }, + toProtoMsg(message: PubKey): PubKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256r1.PubKey", + value: PubKey.encode(message).finish() + }; + } +}; +function createBasePrivKey(): PrivKey { + return { + secret: new Uint8Array() + }; +} +export const PrivKey = { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.secret.length !== 0) { + writer.uint32(10).bytes(message.secret); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrivKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.secret = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PrivKey { + const message = createBasePrivKey(); + message.secret = object.secret ?? new Uint8Array(); + return message; + }, + fromAmino(object: PrivKeyAmino): PrivKey { + const message = createBasePrivKey(); + if (object.secret !== undefined && object.secret !== null) { + message.secret = bytesFromBase64(object.secret); + } + return message; + }, + toAmino(message: PrivKey): PrivKeyAmino { + const obj: any = {}; + obj.secret = message.secret ? base64FromBytes(message.secret) : undefined; + return obj; + }, + fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { + return PrivKey.fromAmino(object.value); + }, + toAminoMsg(message: PrivKey): PrivKeyAminoMsg { + return { + type: "cosmos-sdk/PrivKey", + value: PrivKey.toAmino(message) + }; + }, + fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { + return PrivKey.decode(message.value); + }, + toProto(message: PrivKey): Uint8Array { + return PrivKey.encode(message).finish(); + }, + toProtoMsg(message: PrivKey): PrivKeyProtoMsg { + return { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + value: PrivKey.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/distribution.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/distribution.ts new file mode 100644 index 00000000..c49d55b6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/distribution.ts @@ -0,0 +1,1469 @@ +//@ts-nocheck +import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** Params defines the set of params for the distribution module. */ +export interface Params { + communityTax: string; + baseProposerReward: string; + bonusProposerReward: string; + withdrawAddrEnabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the set of params for the distribution module. */ +export interface ParamsAmino { + community_tax?: string; + base_proposer_reward?: string; + bonus_proposer_reward?: string; + withdraw_addr_enabled?: boolean; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of params for the distribution module. */ +export interface ParamsSDKType { + community_tax: string; + base_proposer_reward: string; + bonus_proposer_reward: string; + withdraw_addr_enabled: boolean; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewards { + cumulativeRewardRatio: DecCoin[]; + referenceCount: number; +} +export interface ValidatorHistoricalRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards"; + value: Uint8Array; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewardsAmino { + cumulative_reward_ratio?: DecCoinAmino[]; + reference_count?: number; +} +export interface ValidatorHistoricalRewardsAminoMsg { + type: "cosmos-sdk/ValidatorHistoricalRewards"; + value: ValidatorHistoricalRewardsAmino; +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewardsSDKType { + cumulative_reward_ratio: DecCoinSDKType[]; + reference_count: number; +} +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewards { + rewards: DecCoin[]; + period: bigint; +} +export interface ValidatorCurrentRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards"; + value: Uint8Array; +} +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewardsAmino { + rewards?: DecCoinAmino[]; + period?: string; +} +export interface ValidatorCurrentRewardsAminoMsg { + type: "cosmos-sdk/ValidatorCurrentRewards"; + value: ValidatorCurrentRewardsAmino; +} +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewardsSDKType { + rewards: DecCoinSDKType[]; + period: bigint; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommission { + commission: DecCoin[]; +} +export interface ValidatorAccumulatedCommissionProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"; + value: Uint8Array; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommissionAmino { + commission?: DecCoinAmino[]; +} +export interface ValidatorAccumulatedCommissionAminoMsg { + type: "cosmos-sdk/ValidatorAccumulatedCommission"; + value: ValidatorAccumulatedCommissionAmino; +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommissionSDKType { + commission: DecCoinSDKType[]; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewards { + rewards: DecCoin[]; +} +export interface ValidatorOutstandingRewardsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards"; + value: Uint8Array; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewardsAmino { + rewards?: DecCoinAmino[]; +} +export interface ValidatorOutstandingRewardsAminoMsg { + type: "cosmos-sdk/ValidatorOutstandingRewards"; + value: ValidatorOutstandingRewardsAmino; +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewardsSDKType { + rewards: DecCoinSDKType[]; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEvent { + validatorPeriod: bigint; + fraction: string; +} +export interface ValidatorSlashEventProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent"; + value: Uint8Array; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEventAmino { + validator_period?: string; + fraction?: string; +} +export interface ValidatorSlashEventAminoMsg { + type: "cosmos-sdk/ValidatorSlashEvent"; + value: ValidatorSlashEventAmino; +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEventSDKType { + validator_period: bigint; + fraction: string; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEvents { + validatorSlashEvents: ValidatorSlashEvent[]; +} +export interface ValidatorSlashEventsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents"; + value: Uint8Array; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEventsAmino { + validator_slash_events?: ValidatorSlashEventAmino[]; +} +export interface ValidatorSlashEventsAminoMsg { + type: "cosmos-sdk/ValidatorSlashEvents"; + value: ValidatorSlashEventsAmino; +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEventsSDKType { + validator_slash_events: ValidatorSlashEventSDKType[]; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePool { + communityPool: DecCoin[]; +} +export interface FeePoolProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.FeePool"; + value: Uint8Array; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePoolAmino { + community_pool?: DecCoinAmino[]; +} +export interface FeePoolAminoMsg { + type: "cosmos-sdk/FeePool"; + value: FeePoolAmino; +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePoolSDKType { + community_pool: DecCoinSDKType[]; +} +/** + * CommunityPoolSpendProposal details a proposal for use of community funds, + * together with how many coins are proposed to be spent, and to which + * recipient account. + */ +export interface CommunityPoolSpendProposal { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; + title: string; + description: string; + recipient: string; + amount: Coin[]; +} +export interface CommunityPoolSpendProposalProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; + value: Uint8Array; +} +/** + * CommunityPoolSpendProposal details a proposal for use of community funds, + * together with how many coins are proposed to be spent, and to which + * recipient account. + */ +export interface CommunityPoolSpendProposalAmino { + title?: string; + description?: string; + recipient?: string; + amount?: CoinAmino[]; +} +export interface CommunityPoolSpendProposalAminoMsg { + type: "cosmos-sdk/CommunityPoolSpendProposal"; + value: CommunityPoolSpendProposalAmino; +} +/** + * CommunityPoolSpendProposal details a proposal for use of community funds, + * together with how many coins are proposed to be spent, and to which + * recipient account. + */ +export interface CommunityPoolSpendProposalSDKType { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; + title: string; + description: string; + recipient: string; + amount: CoinSDKType[]; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfo { + previousPeriod: bigint; + stake: string; + height: bigint; +} +export interface DelegatorStartingInfoProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo"; + value: Uint8Array; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfoAmino { + previous_period?: string; + stake?: string; + height: string; +} +export interface DelegatorStartingInfoAminoMsg { + type: "cosmos-sdk/DelegatorStartingInfo"; + value: DelegatorStartingInfoAmino; +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfoSDKType { + previous_period: bigint; + stake: string; + height: bigint; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorReward { + validatorAddress: string; + reward: DecCoin[]; +} +export interface DelegationDelegatorRewardProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward"; + value: Uint8Array; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorRewardAmino { + validator_address?: string; + reward?: DecCoinAmino[]; +} +export interface DelegationDelegatorRewardAminoMsg { + type: "cosmos-sdk/DelegationDelegatorReward"; + value: DelegationDelegatorRewardAmino; +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorRewardSDKType { + validator_address: string; + reward: DecCoinSDKType[]; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDeposit { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} +export interface CommunityPoolSpendProposalWithDepositProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; + value: Uint8Array; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDepositAmino { + title?: string; + description?: string; + recipient?: string; + amount?: string; + deposit?: string; +} +export interface CommunityPoolSpendProposalWithDepositAminoMsg { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit"; + value: CommunityPoolSpendProposalWithDepositAmino; +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDepositSDKType { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} +function createBaseParams(): Params { + return { + communityTax: "", + baseProposerReward: "", + bonusProposerReward: "", + withdrawAddrEnabled: false + }; +} +export const Params = { + typeUrl: "/cosmos.distribution.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.communityTax !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.communityTax, 18).atomics); + } + if (message.baseProposerReward !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.baseProposerReward, 18).atomics); + } + if (message.bonusProposerReward !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.bonusProposerReward, 18).atomics); + } + if (message.withdrawAddrEnabled === true) { + writer.uint32(32).bool(message.withdrawAddrEnabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityTax = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.baseProposerReward = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.bonusProposerReward = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.withdrawAddrEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.communityTax = object.communityTax ?? ""; + message.baseProposerReward = object.baseProposerReward ?? ""; + message.bonusProposerReward = object.bonusProposerReward ?? ""; + message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.community_tax !== undefined && object.community_tax !== null) { + message.communityTax = object.community_tax; + } + if (object.base_proposer_reward !== undefined && object.base_proposer_reward !== null) { + message.baseProposerReward = object.base_proposer_reward; + } + if (object.bonus_proposer_reward !== undefined && object.bonus_proposer_reward !== null) { + message.bonusProposerReward = object.bonus_proposer_reward; + } + if (object.withdraw_addr_enabled !== undefined && object.withdraw_addr_enabled !== null) { + message.withdrawAddrEnabled = object.withdraw_addr_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.community_tax = message.communityTax === "" ? undefined : message.communityTax; + obj.base_proposer_reward = message.baseProposerReward === "" ? undefined : message.baseProposerReward; + obj.bonus_proposer_reward = message.bonusProposerReward === "" ? undefined : message.bonusProposerReward; + obj.withdraw_addr_enabled = message.withdrawAddrEnabled === false ? undefined : message.withdrawAddrEnabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { + return { + cumulativeRewardRatio: [], + referenceCount: 0 + }; +} +export const ValidatorHistoricalRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + encode(message: ValidatorHistoricalRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.cumulativeRewardRatio) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.referenceCount !== 0) { + writer.uint32(16).uint32(message.referenceCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorHistoricalRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cumulativeRewardRatio.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.referenceCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulativeRewardRatio?.map(e => DecCoin.fromPartial(e)) || []; + message.referenceCount = object.referenceCount ?? 0; + return message; + }, + fromAmino(object: ValidatorHistoricalRewardsAmino): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulative_reward_ratio?.map(e => DecCoin.fromAmino(e)) || []; + if (object.reference_count !== undefined && object.reference_count !== null) { + message.referenceCount = object.reference_count; + } + return message; + }, + toAmino(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAmino { + const obj: any = {}; + if (message.cumulativeRewardRatio) { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio; + } + obj.reference_count = message.referenceCount === 0 ? undefined : message.referenceCount; + return obj; + }, + fromAminoMsg(object: ValidatorHistoricalRewardsAminoMsg): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorHistoricalRewards", + value: ValidatorHistoricalRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorHistoricalRewardsProtoMsg): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.decode(message.value); + }, + toProto(message: ValidatorHistoricalRewards): Uint8Array { + return ValidatorHistoricalRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + value: ValidatorHistoricalRewards.encode(message).finish() + }; + } +}; +function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { + return { + rewards: [], + period: BigInt(0) + }; +} +export const ValidatorCurrentRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + encode(message: ValidatorCurrentRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.period !== BigInt(0)) { + writer.uint32(16).uint64(message.period); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorCurrentRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.period = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + return message; + }, + toAmino(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorCurrentRewardsAminoMsg): ValidatorCurrentRewards { + return ValidatorCurrentRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorCurrentRewards", + value: ValidatorCurrentRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorCurrentRewardsProtoMsg): ValidatorCurrentRewards { + return ValidatorCurrentRewards.decode(message.value); + }, + toProto(message: ValidatorCurrentRewards): Uint8Array { + return ValidatorCurrentRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorCurrentRewards): ValidatorCurrentRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + value: ValidatorCurrentRewards.encode(message).finish() + }; + } +}; +function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommission { + return { + commission: [] + }; +} +export const ValidatorAccumulatedCommission = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + encode(message: ValidatorAccumulatedCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorAccumulatedCommission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorAccumulatedCommissionAmino): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAmino { + const obj: any = {}; + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.commission = message.commission; + } + return obj; + }, + fromAminoMsg(object: ValidatorAccumulatedCommissionAminoMsg): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAminoMsg { + return { + type: "cosmos-sdk/ValidatorAccumulatedCommission", + value: ValidatorAccumulatedCommission.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorAccumulatedCommissionProtoMsg): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.decode(message.value); + }, + toProto(message: ValidatorAccumulatedCommission): Uint8Array { + return ValidatorAccumulatedCommission.encode(message).finish(); + }, + toProtoMsg(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + value: ValidatorAccumulatedCommission.encode(message).finish() + }; + } +}; +function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { + return { + rewards: [] + }; +} +export const ValidatorOutstandingRewards = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + encode(message: ValidatorOutstandingRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorOutstandingRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorOutstandingRewardsAmino): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + return obj; + }, + fromAminoMsg(object: ValidatorOutstandingRewardsAminoMsg): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAminoMsg { + return { + type: "cosmos-sdk/ValidatorOutstandingRewards", + value: ValidatorOutstandingRewards.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorOutstandingRewardsProtoMsg): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.decode(message.value); + }, + toProto(message: ValidatorOutstandingRewards): Uint8Array { + return ValidatorOutstandingRewards.encode(message).finish(); + }, + toProtoMsg(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + value: ValidatorOutstandingRewards.encode(message).finish() + }; + } +}; +function createBaseValidatorSlashEvent(): ValidatorSlashEvent { + return { + validatorPeriod: BigInt(0), + fraction: "" + }; +} +export const ValidatorSlashEvent = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + encode(message: ValidatorSlashEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorPeriod !== BigInt(0)) { + writer.uint32(8).uint64(message.validatorPeriod); + } + if (message.fraction !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.fraction, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSlashEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorPeriod = reader.uint64(); + break; + case 2: + message.fraction = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent(); + message.validatorPeriod = object.validatorPeriod !== undefined && object.validatorPeriod !== null ? BigInt(object.validatorPeriod.toString()) : BigInt(0); + message.fraction = object.fraction ?? ""; + return message; + }, + fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent(); + if (object.validator_period !== undefined && object.validator_period !== null) { + message.validatorPeriod = BigInt(object.validator_period); + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = object.fraction; + } + return message; + }, + toAmino(message: ValidatorSlashEvent): ValidatorSlashEventAmino { + const obj: any = {}; + obj.validator_period = message.validatorPeriod !== BigInt(0) ? message.validatorPeriod.toString() : undefined; + obj.fraction = message.fraction === "" ? undefined : message.fraction; + return obj; + }, + fromAminoMsg(object: ValidatorSlashEventAminoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorSlashEvent): ValidatorSlashEventAminoMsg { + return { + type: "cosmos-sdk/ValidatorSlashEvent", + value: ValidatorSlashEvent.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorSlashEventProtoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.decode(message.value); + }, + toProto(message: ValidatorSlashEvent): Uint8Array { + return ValidatorSlashEvent.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSlashEvent): ValidatorSlashEventProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + value: ValidatorSlashEvent.encode(message).finish() + }; + } +}; +function createBaseValidatorSlashEvents(): ValidatorSlashEvents { + return { + validatorSlashEvents: [] + }; +} +export const ValidatorSlashEvents = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + encode(message: ValidatorSlashEvents, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validatorSlashEvents) { + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvents { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSlashEvents(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorSlashEvents.push(ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validatorSlashEvents?.map(e => ValidatorSlashEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { + const obj: any = {}; + if (message.validatorSlashEvents) { + obj.validator_slash_events = message.validatorSlashEvents.map(e => e ? ValidatorSlashEvent.toAmino(e) : undefined); + } else { + obj.validator_slash_events = message.validatorSlashEvents; + } + return obj; + }, + fromAminoMsg(object: ValidatorSlashEventsAminoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsAminoMsg { + return { + type: "cosmos-sdk/ValidatorSlashEvents", + value: ValidatorSlashEvents.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorSlashEventsProtoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.decode(message.value); + }, + toProto(message: ValidatorSlashEvents): Uint8Array { + return ValidatorSlashEvents.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + value: ValidatorSlashEvents.encode(message).finish() + }; + } +}; +function createBaseFeePool(): FeePool { + return { + communityPool: [] + }; +} +export const FeePool = { + typeUrl: "/cosmos.distribution.v1beta1.FeePool", + encode(message: FeePool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.communityPool) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeePool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityPool.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FeePool { + const message = createBaseFeePool(); + message.communityPool = object.communityPool?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FeePoolAmino): FeePool { + const message = createBaseFeePool(); + message.communityPool = object.community_pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: FeePool): FeePoolAmino { + const obj: any = {}; + if (message.communityPool) { + obj.community_pool = message.communityPool.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.community_pool = message.communityPool; + } + return obj; + }, + fromAminoMsg(object: FeePoolAminoMsg): FeePool { + return FeePool.fromAmino(object.value); + }, + toAminoMsg(message: FeePool): FeePoolAminoMsg { + return { + type: "cosmos-sdk/FeePool", + value: FeePool.toAmino(message) + }; + }, + fromProtoMsg(message: FeePoolProtoMsg): FeePool { + return FeePool.decode(message.value); + }, + toProto(message: FeePool): Uint8Array { + return FeePool.encode(message).finish(); + }, + toProtoMsg(message: FeePool): FeePoolProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.FeePool", + value: FeePool.encode(message).finish() + }; + } +}; +function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { + return { + $typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + title: "", + description: "", + recipient: "", + amount: [] + }; +} +export const CommunityPoolSpendProposal = { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + encode(message: CommunityPoolSpendProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommunityPoolSpendProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + case 4: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CommunityPoolSpendProposalAmino): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: CommunityPoolSpendProposalAminoMsg): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.fromAmino(object.value); + }, + toAminoMsg(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAminoMsg { + return { + type: "cosmos-sdk/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CommunityPoolSpendProposalProtoMsg): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.decode(message.value); + }, + toProto(message: CommunityPoolSpendProposal): Uint8Array { + return CommunityPoolSpendProposal.encode(message).finish(); + }, + toProtoMsg(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(message).finish() + }; + } +}; +function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { + return { + previousPeriod: BigInt(0), + stake: "", + height: BigInt(0) + }; +} +export const DelegatorStartingInfo = { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + encode(message: DelegatorStartingInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.previousPeriod !== BigInt(0)) { + writer.uint32(8).uint64(message.previousPeriod); + } + if (message.stake !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.stake, 18).atomics); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegatorStartingInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousPeriod = reader.uint64(); + break; + case 2: + message.stake = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.height = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo(); + message.previousPeriod = object.previousPeriod !== undefined && object.previousPeriod !== null ? BigInt(object.previousPeriod.toString()) : BigInt(0); + message.stake = object.stake ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo(); + if (object.previous_period !== undefined && object.previous_period !== null) { + message.previousPeriod = BigInt(object.previous_period); + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = object.stake; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { + const obj: any = {}; + obj.previous_period = message.previousPeriod !== BigInt(0) ? message.previousPeriod.toString() : undefined; + obj.stake = message.stake === "" ? undefined : message.stake; + obj.height = message.height ? message.height.toString() : "0"; + return obj; + }, + fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.fromAmino(object.value); + }, + toAminoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoAminoMsg { + return { + type: "cosmos-sdk/DelegatorStartingInfo", + value: DelegatorStartingInfo.toAmino(message) + }; + }, + fromProtoMsg(message: DelegatorStartingInfoProtoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.decode(message.value); + }, + toProto(message: DelegatorStartingInfo): Uint8Array { + return DelegatorStartingInfo.encode(message).finish(); + }, + toProtoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + value: DelegatorStartingInfo.encode(message).finish() + }; + } +}; +function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { + return { + validatorAddress: "", + reward: [] + }; +} +export const DelegationDelegatorReward = { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + encode(message: DelegationDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + for (const v of message.reward) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegationDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegationDelegatorReward(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.reward.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward(); + message.validatorAddress = object.validatorAddress ?? ""; + message.reward = object.reward?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.reward = object.reward?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: DelegationDelegatorReward): DelegationDelegatorRewardAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.reward) { + obj.reward = message.reward.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.reward = message.reward; + } + return obj; + }, + fromAminoMsg(object: DelegationDelegatorRewardAminoMsg): DelegationDelegatorReward { + return DelegationDelegatorReward.fromAmino(object.value); + }, + toAminoMsg(message: DelegationDelegatorReward): DelegationDelegatorRewardAminoMsg { + return { + type: "cosmos-sdk/DelegationDelegatorReward", + value: DelegationDelegatorReward.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationDelegatorRewardProtoMsg): DelegationDelegatorReward { + return DelegationDelegatorReward.decode(message.value); + }, + toProto(message: DelegationDelegatorReward): Uint8Array { + return DelegationDelegatorReward.encode(message).finish(); + }, + toProtoMsg(message: DelegationDelegatorReward): DelegationDelegatorRewardProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + value: DelegationDelegatorReward.encode(message).finish() + }; + } +}; +function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { + return { + $typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + title: "", + description: "", + recipient: "", + amount: "", + deposit: "" + }; +} +export const CommunityPoolSpendProposalWithDeposit = { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + encode(message: CommunityPoolSpendProposalWithDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.deposit !== "") { + writer.uint32(42).string(message.deposit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.deposit = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommunityPoolSpendProposalWithDeposit { + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount ?? ""; + message.deposit = object.deposit ?? ""; + return message; + }, + fromAmino(object: CommunityPoolSpendProposalWithDepositAmino): CommunityPoolSpendProposalWithDeposit { + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = object.deposit; + } + return message; + }, + toAmino(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.deposit = message.deposit === "" ? undefined : message.deposit; + return obj; + }, + fromAminoMsg(object: CommunityPoolSpendProposalWithDepositAminoMsg): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.fromAmino(object.value); + }, + toAminoMsg(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAminoMsg { + return { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(message) + }; + }, + fromProtoMsg(message: CommunityPoolSpendProposalWithDepositProtoMsg): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.decode(message.value); + }, + toProto(message: CommunityPoolSpendProposalWithDeposit): Uint8Array { + return CommunityPoolSpendProposalWithDeposit.encode(message).finish(); + }, + toProtoMsg(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/genesis.ts new file mode 100644 index 00000000..b98a03b0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/genesis.ts @@ -0,0 +1,1118 @@ +//@ts-nocheck +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../base/v1beta1/coin"; +import { ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorHistoricalRewards, ValidatorHistoricalRewardsAmino, ValidatorHistoricalRewardsSDKType, ValidatorCurrentRewards, ValidatorCurrentRewardsAmino, ValidatorCurrentRewardsSDKType, DelegatorStartingInfo, DelegatorStartingInfoAmino, DelegatorStartingInfoSDKType, ValidatorSlashEvent, ValidatorSlashEventAmino, ValidatorSlashEventSDKType, Params, ParamsAmino, ParamsSDKType, FeePool, FeePoolAmino, FeePoolSDKType } from "./distribution"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * DelegatorWithdrawInfo is the address for where distributions rewards are + * withdrawn to by default this struct is only used at genesis to feed in + * default withdraw addresses. + */ +export interface DelegatorWithdrawInfo { + /** delegator_address is the address of the delegator. */ + delegatorAddress: string; + /** withdraw_address is the address to withdraw the delegation rewards to. */ + withdrawAddress: string; +} +export interface DelegatorWithdrawInfoProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorWithdrawInfo"; + value: Uint8Array; +} +/** + * DelegatorWithdrawInfo is the address for where distributions rewards are + * withdrawn to by default this struct is only used at genesis to feed in + * default withdraw addresses. + */ +export interface DelegatorWithdrawInfoAmino { + /** delegator_address is the address of the delegator. */ + delegator_address?: string; + /** withdraw_address is the address to withdraw the delegation rewards to. */ + withdraw_address?: string; +} +export interface DelegatorWithdrawInfoAminoMsg { + type: "cosmos-sdk/DelegatorWithdrawInfo"; + value: DelegatorWithdrawInfoAmino; +} +/** + * DelegatorWithdrawInfo is the address for where distributions rewards are + * withdrawn to by default this struct is only used at genesis to feed in + * default withdraw addresses. + */ +export interface DelegatorWithdrawInfoSDKType { + delegator_address: string; + withdraw_address: string; +} +/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ +export interface ValidatorOutstandingRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** outstanding_rewards represents the oustanding rewards of a validator. */ + outstandingRewards: DecCoin[]; +} +export interface ValidatorOutstandingRewardsRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord"; + value: Uint8Array; +} +/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ +export interface ValidatorOutstandingRewardsRecordAmino { + /** validator_address is the address of the validator. */ + validator_address?: string; + /** outstanding_rewards represents the oustanding rewards of a validator. */ + outstanding_rewards?: DecCoinAmino[]; +} +export interface ValidatorOutstandingRewardsRecordAminoMsg { + type: "cosmos-sdk/ValidatorOutstandingRewardsRecord"; + value: ValidatorOutstandingRewardsRecordAmino; +} +/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ +export interface ValidatorOutstandingRewardsRecordSDKType { + validator_address: string; + outstanding_rewards: DecCoinSDKType[]; +} +/** + * ValidatorAccumulatedCommissionRecord is used for import / export via genesis + * json. + */ +export interface ValidatorAccumulatedCommissionRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** accumulated is the accumulated commission of a validator. */ + accumulated: ValidatorAccumulatedCommission; +} +export interface ValidatorAccumulatedCommissionRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord"; + value: Uint8Array; +} +/** + * ValidatorAccumulatedCommissionRecord is used for import / export via genesis + * json. + */ +export interface ValidatorAccumulatedCommissionRecordAmino { + /** validator_address is the address of the validator. */ + validator_address?: string; + /** accumulated is the accumulated commission of a validator. */ + accumulated?: ValidatorAccumulatedCommissionAmino; +} +export interface ValidatorAccumulatedCommissionRecordAminoMsg { + type: "cosmos-sdk/ValidatorAccumulatedCommissionRecord"; + value: ValidatorAccumulatedCommissionRecordAmino; +} +/** + * ValidatorAccumulatedCommissionRecord is used for import / export via genesis + * json. + */ +export interface ValidatorAccumulatedCommissionRecordSDKType { + validator_address: string; + accumulated: ValidatorAccumulatedCommissionSDKType; +} +/** + * ValidatorHistoricalRewardsRecord is used for import / export via genesis + * json. + */ +export interface ValidatorHistoricalRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** period defines the period the historical rewards apply to. */ + period: bigint; + /** rewards defines the historical rewards of a validator. */ + rewards: ValidatorHistoricalRewards; +} +export interface ValidatorHistoricalRewardsRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord"; + value: Uint8Array; +} +/** + * ValidatorHistoricalRewardsRecord is used for import / export via genesis + * json. + */ +export interface ValidatorHistoricalRewardsRecordAmino { + /** validator_address is the address of the validator. */ + validator_address?: string; + /** period defines the period the historical rewards apply to. */ + period?: string; + /** rewards defines the historical rewards of a validator. */ + rewards?: ValidatorHistoricalRewardsAmino; +} +export interface ValidatorHistoricalRewardsRecordAminoMsg { + type: "cosmos-sdk/ValidatorHistoricalRewardsRecord"; + value: ValidatorHistoricalRewardsRecordAmino; +} +/** + * ValidatorHistoricalRewardsRecord is used for import / export via genesis + * json. + */ +export interface ValidatorHistoricalRewardsRecordSDKType { + validator_address: string; + period: bigint; + rewards: ValidatorHistoricalRewardsSDKType; +} +/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ +export interface ValidatorCurrentRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** rewards defines the current rewards of a validator. */ + rewards: ValidatorCurrentRewards; +} +export interface ValidatorCurrentRewardsRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord"; + value: Uint8Array; +} +/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ +export interface ValidatorCurrentRewardsRecordAmino { + /** validator_address is the address of the validator. */ + validator_address?: string; + /** rewards defines the current rewards of a validator. */ + rewards?: ValidatorCurrentRewardsAmino; +} +export interface ValidatorCurrentRewardsRecordAminoMsg { + type: "cosmos-sdk/ValidatorCurrentRewardsRecord"; + value: ValidatorCurrentRewardsRecordAmino; +} +/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ +export interface ValidatorCurrentRewardsRecordSDKType { + validator_address: string; + rewards: ValidatorCurrentRewardsSDKType; +} +/** DelegatorStartingInfoRecord used for import / export via genesis json. */ +export interface DelegatorStartingInfoRecord { + /** delegator_address is the address of the delegator. */ + delegatorAddress: string; + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** starting_info defines the starting info of a delegator. */ + startingInfo: DelegatorStartingInfo; +} +export interface DelegatorStartingInfoRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfoRecord"; + value: Uint8Array; +} +/** DelegatorStartingInfoRecord used for import / export via genesis json. */ +export interface DelegatorStartingInfoRecordAmino { + /** delegator_address is the address of the delegator. */ + delegator_address?: string; + /** validator_address is the address of the validator. */ + validator_address?: string; + /** starting_info defines the starting info of a delegator. */ + starting_info?: DelegatorStartingInfoAmino; +} +export interface DelegatorStartingInfoRecordAminoMsg { + type: "cosmos-sdk/DelegatorStartingInfoRecord"; + value: DelegatorStartingInfoRecordAmino; +} +/** DelegatorStartingInfoRecord used for import / export via genesis json. */ +export interface DelegatorStartingInfoRecordSDKType { + delegator_address: string; + validator_address: string; + starting_info: DelegatorStartingInfoSDKType; +} +/** ValidatorSlashEventRecord is used for import / export via genesis json. */ +export interface ValidatorSlashEventRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** height defines the block height at which the slash event occured. */ + height: bigint; + /** period is the period of the slash event. */ + period: bigint; + /** validator_slash_event describes the slash event. */ + validatorSlashEvent: ValidatorSlashEvent; +} +export interface ValidatorSlashEventRecordProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEventRecord"; + value: Uint8Array; +} +/** ValidatorSlashEventRecord is used for import / export via genesis json. */ +export interface ValidatorSlashEventRecordAmino { + /** validator_address is the address of the validator. */ + validator_address?: string; + /** height defines the block height at which the slash event occured. */ + height?: string; + /** period is the period of the slash event. */ + period?: string; + /** validator_slash_event describes the slash event. */ + validator_slash_event?: ValidatorSlashEventAmino; +} +export interface ValidatorSlashEventRecordAminoMsg { + type: "cosmos-sdk/ValidatorSlashEventRecord"; + value: ValidatorSlashEventRecordAmino; +} +/** ValidatorSlashEventRecord is used for import / export via genesis json. */ +export interface ValidatorSlashEventRecordSDKType { + validator_address: string; + height: bigint; + period: bigint; + validator_slash_event: ValidatorSlashEventSDKType; +} +/** GenesisState defines the distribution module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params: Params; + /** fee_pool defines the fee pool at genesis. */ + feePool: FeePool; + /** fee_pool defines the delegator withdraw infos at genesis. */ + delegatorWithdrawInfos: DelegatorWithdrawInfo[]; + /** fee_pool defines the previous proposer at genesis. */ + previousProposer: string; + /** fee_pool defines the outstanding rewards of all validators at genesis. */ + outstandingRewards: ValidatorOutstandingRewardsRecord[]; + /** fee_pool defines the accumulated commisions of all validators at genesis. */ + validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; + /** fee_pool defines the historical rewards of all validators at genesis. */ + validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; + /** fee_pool defines the current rewards of all validators at genesis. */ + validatorCurrentRewards: ValidatorCurrentRewardsRecord[]; + /** fee_pool defines the delegator starting infos at genesis. */ + delegatorStartingInfos: DelegatorStartingInfoRecord[]; + /** fee_pool defines the validator slash events at genesis. */ + validatorSlashEvents: ValidatorSlashEventRecord[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the distribution module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; + /** fee_pool defines the fee pool at genesis. */ + fee_pool?: FeePoolAmino; + /** fee_pool defines the delegator withdraw infos at genesis. */ + delegator_withdraw_infos?: DelegatorWithdrawInfoAmino[]; + /** fee_pool defines the previous proposer at genesis. */ + previous_proposer?: string; + /** fee_pool defines the outstanding rewards of all validators at genesis. */ + outstanding_rewards?: ValidatorOutstandingRewardsRecordAmino[]; + /** fee_pool defines the accumulated commisions of all validators at genesis. */ + validator_accumulated_commissions?: ValidatorAccumulatedCommissionRecordAmino[]; + /** fee_pool defines the historical rewards of all validators at genesis. */ + validator_historical_rewards?: ValidatorHistoricalRewardsRecordAmino[]; + /** fee_pool defines the current rewards of all validators at genesis. */ + validator_current_rewards?: ValidatorCurrentRewardsRecordAmino[]; + /** fee_pool defines the delegator starting infos at genesis. */ + delegator_starting_infos?: DelegatorStartingInfoRecordAmino[]; + /** fee_pool defines the validator slash events at genesis. */ + validator_slash_events?: ValidatorSlashEventRecordAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the distribution module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + fee_pool: FeePoolSDKType; + delegator_withdraw_infos: DelegatorWithdrawInfoSDKType[]; + previous_proposer: string; + outstanding_rewards: ValidatorOutstandingRewardsRecordSDKType[]; + validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordSDKType[]; + validator_historical_rewards: ValidatorHistoricalRewardsRecordSDKType[]; + validator_current_rewards: ValidatorCurrentRewardsRecordSDKType[]; + delegator_starting_infos: DelegatorStartingInfoRecordSDKType[]; + validator_slash_events: ValidatorSlashEventRecordSDKType[]; +} +function createBaseDelegatorWithdrawInfo(): DelegatorWithdrawInfo { + return { + delegatorAddress: "", + withdrawAddress: "" + }; +} +export const DelegatorWithdrawInfo = { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorWithdrawInfo", + encode(message: DelegatorWithdrawInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorWithdrawInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegatorWithdrawInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelegatorWithdrawInfo { + const message = createBaseDelegatorWithdrawInfo(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.withdrawAddress = object.withdrawAddress ?? ""; + return message; + }, + fromAmino(object: DelegatorWithdrawInfoAmino): DelegatorWithdrawInfo { + const message = createBaseDelegatorWithdrawInfo(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; + }, + toAmino(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; + return obj; + }, + fromAminoMsg(object: DelegatorWithdrawInfoAminoMsg): DelegatorWithdrawInfo { + return DelegatorWithdrawInfo.fromAmino(object.value); + }, + toAminoMsg(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoAminoMsg { + return { + type: "cosmos-sdk/DelegatorWithdrawInfo", + value: DelegatorWithdrawInfo.toAmino(message) + }; + }, + fromProtoMsg(message: DelegatorWithdrawInfoProtoMsg): DelegatorWithdrawInfo { + return DelegatorWithdrawInfo.decode(message.value); + }, + toProto(message: DelegatorWithdrawInfo): Uint8Array { + return DelegatorWithdrawInfo.encode(message).finish(); + }, + toProtoMsg(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorWithdrawInfo", + value: DelegatorWithdrawInfo.encode(message).finish() + }; + } +}; +function createBaseValidatorOutstandingRewardsRecord(): ValidatorOutstandingRewardsRecord { + return { + validatorAddress: "", + outstandingRewards: [] + }; +} +export const ValidatorOutstandingRewardsRecord = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", + encode(message: ValidatorOutstandingRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + for (const v of message.outstandingRewards) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorOutstandingRewardsRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.outstandingRewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorOutstandingRewardsRecord { + const message = createBaseValidatorOutstandingRewardsRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.outstandingRewards = object.outstandingRewards?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorOutstandingRewardsRecordAmino): ValidatorOutstandingRewardsRecord { + const message = createBaseValidatorOutstandingRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorOutstandingRewardsRecord): ValidatorOutstandingRewardsRecordAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.outstandingRewards) { + obj.outstanding_rewards = message.outstandingRewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.outstanding_rewards = message.outstandingRewards; + } + return obj; + }, + fromAminoMsg(object: ValidatorOutstandingRewardsRecordAminoMsg): ValidatorOutstandingRewardsRecord { + return ValidatorOutstandingRewardsRecord.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorOutstandingRewardsRecord): ValidatorOutstandingRewardsRecordAminoMsg { + return { + type: "cosmos-sdk/ValidatorOutstandingRewardsRecord", + value: ValidatorOutstandingRewardsRecord.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorOutstandingRewardsRecordProtoMsg): ValidatorOutstandingRewardsRecord { + return ValidatorOutstandingRewardsRecord.decode(message.value); + }, + toProto(message: ValidatorOutstandingRewardsRecord): Uint8Array { + return ValidatorOutstandingRewardsRecord.encode(message).finish(); + }, + toProtoMsg(message: ValidatorOutstandingRewardsRecord): ValidatorOutstandingRewardsRecordProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", + value: ValidatorOutstandingRewardsRecord.encode(message).finish() + }; + } +}; +function createBaseValidatorAccumulatedCommissionRecord(): ValidatorAccumulatedCommissionRecord { + return { + validatorAddress: "", + accumulated: ValidatorAccumulatedCommission.fromPartial({}) + }; +} +export const ValidatorAccumulatedCommissionRecord = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", + encode(message: ValidatorAccumulatedCommissionRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.accumulated !== undefined) { + ValidatorAccumulatedCommission.encode(message.accumulated, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorAccumulatedCommissionRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.accumulated = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorAccumulatedCommissionRecord { + const message = createBaseValidatorAccumulatedCommissionRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.accumulated = object.accumulated !== undefined && object.accumulated !== null ? ValidatorAccumulatedCommission.fromPartial(object.accumulated) : undefined; + return message; + }, + fromAmino(object: ValidatorAccumulatedCommissionRecordAmino): ValidatorAccumulatedCommissionRecord { + const message = createBaseValidatorAccumulatedCommissionRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.accumulated !== undefined && object.accumulated !== null) { + message.accumulated = ValidatorAccumulatedCommission.fromAmino(object.accumulated); + } + return message; + }, + toAmino(message: ValidatorAccumulatedCommissionRecord): ValidatorAccumulatedCommissionRecordAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAccumulatedCommissionRecordAminoMsg): ValidatorAccumulatedCommissionRecord { + return ValidatorAccumulatedCommissionRecord.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorAccumulatedCommissionRecord): ValidatorAccumulatedCommissionRecordAminoMsg { + return { + type: "cosmos-sdk/ValidatorAccumulatedCommissionRecord", + value: ValidatorAccumulatedCommissionRecord.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorAccumulatedCommissionRecordProtoMsg): ValidatorAccumulatedCommissionRecord { + return ValidatorAccumulatedCommissionRecord.decode(message.value); + }, + toProto(message: ValidatorAccumulatedCommissionRecord): Uint8Array { + return ValidatorAccumulatedCommissionRecord.encode(message).finish(); + }, + toProtoMsg(message: ValidatorAccumulatedCommissionRecord): ValidatorAccumulatedCommissionRecordProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", + value: ValidatorAccumulatedCommissionRecord.encode(message).finish() + }; + } +}; +function createBaseValidatorHistoricalRewardsRecord(): ValidatorHistoricalRewardsRecord { + return { + validatorAddress: "", + period: BigInt(0), + rewards: ValidatorHistoricalRewards.fromPartial({}) + }; +} +export const ValidatorHistoricalRewardsRecord = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord", + encode(message: ValidatorHistoricalRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.period !== BigInt(0)) { + writer.uint32(16).uint64(message.period); + } + if (message.rewards !== undefined) { + ValidatorHistoricalRewards.encode(message.rewards, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorHistoricalRewardsRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.period = reader.uint64(); + break; + case 3: + message.rewards = ValidatorHistoricalRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorHistoricalRewardsRecord { + const message = createBaseValidatorHistoricalRewardsRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); + message.rewards = object.rewards !== undefined && object.rewards !== null ? ValidatorHistoricalRewards.fromPartial(object.rewards) : undefined; + return message; + }, + fromAmino(object: ValidatorHistoricalRewardsRecordAmino): ValidatorHistoricalRewardsRecord { + const message = createBaseValidatorHistoricalRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorHistoricalRewards.fromAmino(object.rewards); + } + return message; + }, + toAmino(message: ValidatorHistoricalRewardsRecord): ValidatorHistoricalRewardsRecordAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; + obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorHistoricalRewardsRecordAminoMsg): ValidatorHistoricalRewardsRecord { + return ValidatorHistoricalRewardsRecord.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorHistoricalRewardsRecord): ValidatorHistoricalRewardsRecordAminoMsg { + return { + type: "cosmos-sdk/ValidatorHistoricalRewardsRecord", + value: ValidatorHistoricalRewardsRecord.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorHistoricalRewardsRecordProtoMsg): ValidatorHistoricalRewardsRecord { + return ValidatorHistoricalRewardsRecord.decode(message.value); + }, + toProto(message: ValidatorHistoricalRewardsRecord): Uint8Array { + return ValidatorHistoricalRewardsRecord.encode(message).finish(); + }, + toProtoMsg(message: ValidatorHistoricalRewardsRecord): ValidatorHistoricalRewardsRecordProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord", + value: ValidatorHistoricalRewardsRecord.encode(message).finish() + }; + } +}; +function createBaseValidatorCurrentRewardsRecord(): ValidatorCurrentRewardsRecord { + return { + validatorAddress: "", + rewards: ValidatorCurrentRewards.fromPartial({}) + }; +} +export const ValidatorCurrentRewardsRecord = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord", + encode(message: ValidatorCurrentRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.rewards !== undefined) { + ValidatorCurrentRewards.encode(message.rewards, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorCurrentRewardsRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.rewards = ValidatorCurrentRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorCurrentRewardsRecord { + const message = createBaseValidatorCurrentRewardsRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.rewards = object.rewards !== undefined && object.rewards !== null ? ValidatorCurrentRewards.fromPartial(object.rewards) : undefined; + return message; + }, + fromAmino(object: ValidatorCurrentRewardsRecordAmino): ValidatorCurrentRewardsRecord { + const message = createBaseValidatorCurrentRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorCurrentRewards.fromAmino(object.rewards); + } + return message; + }, + toAmino(message: ValidatorCurrentRewardsRecord): ValidatorCurrentRewardsRecordAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorCurrentRewardsRecordAminoMsg): ValidatorCurrentRewardsRecord { + return ValidatorCurrentRewardsRecord.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorCurrentRewardsRecord): ValidatorCurrentRewardsRecordAminoMsg { + return { + type: "cosmos-sdk/ValidatorCurrentRewardsRecord", + value: ValidatorCurrentRewardsRecord.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorCurrentRewardsRecordProtoMsg): ValidatorCurrentRewardsRecord { + return ValidatorCurrentRewardsRecord.decode(message.value); + }, + toProto(message: ValidatorCurrentRewardsRecord): Uint8Array { + return ValidatorCurrentRewardsRecord.encode(message).finish(); + }, + toProtoMsg(message: ValidatorCurrentRewardsRecord): ValidatorCurrentRewardsRecordProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord", + value: ValidatorCurrentRewardsRecord.encode(message).finish() + }; + } +}; +function createBaseDelegatorStartingInfoRecord(): DelegatorStartingInfoRecord { + return { + delegatorAddress: "", + validatorAddress: "", + startingInfo: DelegatorStartingInfo.fromPartial({}) + }; +} +export const DelegatorStartingInfoRecord = { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfoRecord", + encode(message: DelegatorStartingInfoRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.startingInfo !== undefined) { + DelegatorStartingInfo.encode(message.startingInfo, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfoRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegatorStartingInfoRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.startingInfo = DelegatorStartingInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelegatorStartingInfoRecord { + const message = createBaseDelegatorStartingInfoRecord(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.startingInfo = object.startingInfo !== undefined && object.startingInfo !== null ? DelegatorStartingInfo.fromPartial(object.startingInfo) : undefined; + return message; + }, + fromAmino(object: DelegatorStartingInfoRecordAmino): DelegatorStartingInfoRecord { + const message = createBaseDelegatorStartingInfoRecord(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_info !== undefined && object.starting_info !== null) { + message.startingInfo = DelegatorStartingInfo.fromAmino(object.starting_info); + } + return message; + }, + toAmino(message: DelegatorStartingInfoRecord): DelegatorStartingInfoRecordAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : undefined; + return obj; + }, + fromAminoMsg(object: DelegatorStartingInfoRecordAminoMsg): DelegatorStartingInfoRecord { + return DelegatorStartingInfoRecord.fromAmino(object.value); + }, + toAminoMsg(message: DelegatorStartingInfoRecord): DelegatorStartingInfoRecordAminoMsg { + return { + type: "cosmos-sdk/DelegatorStartingInfoRecord", + value: DelegatorStartingInfoRecord.toAmino(message) + }; + }, + fromProtoMsg(message: DelegatorStartingInfoRecordProtoMsg): DelegatorStartingInfoRecord { + return DelegatorStartingInfoRecord.decode(message.value); + }, + toProto(message: DelegatorStartingInfoRecord): Uint8Array { + return DelegatorStartingInfoRecord.encode(message).finish(); + }, + toProtoMsg(message: DelegatorStartingInfoRecord): DelegatorStartingInfoRecordProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfoRecord", + value: DelegatorStartingInfoRecord.encode(message).finish() + }; + } +}; +function createBaseValidatorSlashEventRecord(): ValidatorSlashEventRecord { + return { + validatorAddress: "", + height: BigInt(0), + period: BigInt(0), + validatorSlashEvent: ValidatorSlashEvent.fromPartial({}) + }; +} +export const ValidatorSlashEventRecord = { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEventRecord", + encode(message: ValidatorSlashEventRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).uint64(message.height); + } + if (message.period !== BigInt(0)) { + writer.uint32(24).uint64(message.period); + } + if (message.validatorSlashEvent !== undefined) { + ValidatorSlashEvent.encode(message.validatorSlashEvent, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEventRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSlashEventRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.height = reader.uint64(); + break; + case 3: + message.period = reader.uint64(); + break; + case 4: + message.validatorSlashEvent = ValidatorSlashEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorSlashEventRecord { + const message = createBaseValidatorSlashEventRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); + message.validatorSlashEvent = object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null ? ValidatorSlashEvent.fromPartial(object.validatorSlashEvent) : undefined; + return message; + }, + fromAmino(object: ValidatorSlashEventRecordAmino): ValidatorSlashEventRecord { + const message = createBaseValidatorSlashEventRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.validator_slash_event !== undefined && object.validator_slash_event !== null) { + message.validatorSlashEvent = ValidatorSlashEvent.fromAmino(object.validator_slash_event); + } + return message; + }, + toAmino(message: ValidatorSlashEventRecord): ValidatorSlashEventRecordAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; + obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorSlashEventRecordAminoMsg): ValidatorSlashEventRecord { + return ValidatorSlashEventRecord.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorSlashEventRecord): ValidatorSlashEventRecordAminoMsg { + return { + type: "cosmos-sdk/ValidatorSlashEventRecord", + value: ValidatorSlashEventRecord.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorSlashEventRecordProtoMsg): ValidatorSlashEventRecord { + return ValidatorSlashEventRecord.decode(message.value); + }, + toProto(message: ValidatorSlashEventRecord): Uint8Array { + return ValidatorSlashEventRecord.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSlashEventRecord): ValidatorSlashEventRecordProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEventRecord", + value: ValidatorSlashEventRecord.encode(message).finish() + }; + } +}; +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + feePool: FeePool.fromPartial({}), + delegatorWithdrawInfos: [], + previousProposer: "", + outstandingRewards: [], + validatorAccumulatedCommissions: [], + validatorHistoricalRewards: [], + validatorCurrentRewards: [], + delegatorStartingInfos: [], + validatorSlashEvents: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.distribution.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.feePool !== undefined) { + FeePool.encode(message.feePool, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.delegatorWithdrawInfos) { + DelegatorWithdrawInfo.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.previousProposer !== "") { + writer.uint32(34).string(message.previousProposer); + } + for (const v of message.outstandingRewards) { + ValidatorOutstandingRewardsRecord.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.validatorAccumulatedCommissions) { + ValidatorAccumulatedCommissionRecord.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.validatorHistoricalRewards) { + ValidatorHistoricalRewardsRecord.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.validatorCurrentRewards) { + ValidatorCurrentRewardsRecord.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.delegatorStartingInfos) { + DelegatorStartingInfoRecord.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.validatorSlashEvents) { + ValidatorSlashEventRecord.encode(v!, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.feePool = FeePool.decode(reader, reader.uint32()); + break; + case 3: + message.delegatorWithdrawInfos.push(DelegatorWithdrawInfo.decode(reader, reader.uint32())); + break; + case 4: + message.previousProposer = reader.string(); + break; + case 5: + message.outstandingRewards.push(ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32())); + break; + case 6: + message.validatorAccumulatedCommissions.push(ValidatorAccumulatedCommissionRecord.decode(reader, reader.uint32())); + break; + case 7: + message.validatorHistoricalRewards.push(ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32())); + break; + case 8: + message.validatorCurrentRewards.push(ValidatorCurrentRewardsRecord.decode(reader, reader.uint32())); + break; + case 9: + message.delegatorStartingInfos.push(DelegatorStartingInfoRecord.decode(reader, reader.uint32())); + break; + case 10: + message.validatorSlashEvents.push(ValidatorSlashEventRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.feePool = object.feePool !== undefined && object.feePool !== null ? FeePool.fromPartial(object.feePool) : undefined; + message.delegatorWithdrawInfos = object.delegatorWithdrawInfos?.map(e => DelegatorWithdrawInfo.fromPartial(e)) || []; + message.previousProposer = object.previousProposer ?? ""; + message.outstandingRewards = object.outstandingRewards?.map(e => ValidatorOutstandingRewardsRecord.fromPartial(e)) || []; + message.validatorAccumulatedCommissions = object.validatorAccumulatedCommissions?.map(e => ValidatorAccumulatedCommissionRecord.fromPartial(e)) || []; + message.validatorHistoricalRewards = object.validatorHistoricalRewards?.map(e => ValidatorHistoricalRewardsRecord.fromPartial(e)) || []; + message.validatorCurrentRewards = object.validatorCurrentRewards?.map(e => ValidatorCurrentRewardsRecord.fromPartial(e)) || []; + message.delegatorStartingInfos = object.delegatorStartingInfos?.map(e => DelegatorStartingInfoRecord.fromPartial(e)) || []; + message.validatorSlashEvents = object.validatorSlashEvents?.map(e => ValidatorSlashEventRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.fee_pool !== undefined && object.fee_pool !== null) { + message.feePool = FeePool.fromAmino(object.fee_pool); + } + message.delegatorWithdrawInfos = object.delegator_withdraw_infos?.map(e => DelegatorWithdrawInfo.fromAmino(e)) || []; + if (object.previous_proposer !== undefined && object.previous_proposer !== null) { + message.previousProposer = object.previous_proposer; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => ValidatorOutstandingRewardsRecord.fromAmino(e)) || []; + message.validatorAccumulatedCommissions = object.validator_accumulated_commissions?.map(e => ValidatorAccumulatedCommissionRecord.fromAmino(e)) || []; + message.validatorHistoricalRewards = object.validator_historical_rewards?.map(e => ValidatorHistoricalRewardsRecord.fromAmino(e)) || []; + message.validatorCurrentRewards = object.validator_current_rewards?.map(e => ValidatorCurrentRewardsRecord.fromAmino(e)) || []; + message.delegatorStartingInfos = object.delegator_starting_infos?.map(e => DelegatorStartingInfoRecord.fromAmino(e)) || []; + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEventRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.fee_pool = message.feePool ? FeePool.toAmino(message.feePool) : undefined; + if (message.delegatorWithdrawInfos) { + obj.delegator_withdraw_infos = message.delegatorWithdrawInfos.map(e => e ? DelegatorWithdrawInfo.toAmino(e) : undefined); + } else { + obj.delegator_withdraw_infos = message.delegatorWithdrawInfos; + } + obj.previous_proposer = message.previousProposer === "" ? undefined : message.previousProposer; + if (message.outstandingRewards) { + obj.outstanding_rewards = message.outstandingRewards.map(e => e ? ValidatorOutstandingRewardsRecord.toAmino(e) : undefined); + } else { + obj.outstanding_rewards = message.outstandingRewards; + } + if (message.validatorAccumulatedCommissions) { + obj.validator_accumulated_commissions = message.validatorAccumulatedCommissions.map(e => e ? ValidatorAccumulatedCommissionRecord.toAmino(e) : undefined); + } else { + obj.validator_accumulated_commissions = message.validatorAccumulatedCommissions; + } + if (message.validatorHistoricalRewards) { + obj.validator_historical_rewards = message.validatorHistoricalRewards.map(e => e ? ValidatorHistoricalRewardsRecord.toAmino(e) : undefined); + } else { + obj.validator_historical_rewards = message.validatorHistoricalRewards; + } + if (message.validatorCurrentRewards) { + obj.validator_current_rewards = message.validatorCurrentRewards.map(e => e ? ValidatorCurrentRewardsRecord.toAmino(e) : undefined); + } else { + obj.validator_current_rewards = message.validatorCurrentRewards; + } + if (message.delegatorStartingInfos) { + obj.delegator_starting_infos = message.delegatorStartingInfos.map(e => e ? DelegatorStartingInfoRecord.toAmino(e) : undefined); + } else { + obj.delegator_starting_infos = message.delegatorStartingInfos; + } + if (message.validatorSlashEvents) { + obj.validator_slash_events = message.validatorSlashEvents.map(e => e ? ValidatorSlashEventRecord.toAmino(e) : undefined); + } else { + obj.validator_slash_events = message.validatorSlashEvents; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..6ff5c4c2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/query.rpc.Query.ts @@ -0,0 +1,122 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; +/** Query defines the gRPC querier service for distribution module. */ +export interface Query { + /** Params queries params of the distribution module. */ + params(request?: QueryParamsRequest): Promise; + /** ValidatorOutstandingRewards queries rewards of a validator address. */ + validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise; + /** ValidatorCommission queries accumulated commission for a validator. */ + validatorCommission(request: QueryValidatorCommissionRequest): Promise; + /** ValidatorSlashes queries slash events of a validator. */ + validatorSlashes(request: QueryValidatorSlashesRequest): Promise; + /** DelegationRewards queries the total rewards accrued by a delegation. */ + delegationRewards(request: QueryDelegationRewardsRequest): Promise; + /** + * DelegationTotalRewards queries the total rewards accrued by a each + * validator. + */ + delegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise; + /** DelegatorValidators queries the validators of a delegator. */ + delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ + delegatorWithdrawAddress(request: QueryDelegatorWithdrawAddressRequest): Promise; + /** CommunityPool queries the community pool coins. */ + communityPool(request?: QueryCommunityPoolRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.validatorOutstandingRewards = this.validatorOutstandingRewards.bind(this); + this.validatorCommission = this.validatorCommission.bind(this); + this.validatorSlashes = this.validatorSlashes.bind(this); + this.delegationRewards = this.delegationRewards.bind(this); + this.delegationTotalRewards = this.delegationTotalRewards.bind(this); + this.delegatorValidators = this.delegatorValidators.bind(this); + this.delegatorWithdrawAddress = this.delegatorWithdrawAddress.bind(this); + this.communityPool = this.communityPool.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { + const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorOutstandingRewards", data); + return promise.then(data => QueryValidatorOutstandingRewardsResponse.decode(new BinaryReader(data))); + } + validatorCommission(request: QueryValidatorCommissionRequest): Promise { + const data = QueryValidatorCommissionRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorCommission", data); + return promise.then(data => QueryValidatorCommissionResponse.decode(new BinaryReader(data))); + } + validatorSlashes(request: QueryValidatorSlashesRequest): Promise { + const data = QueryValidatorSlashesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorSlashes", data); + return promise.then(data => QueryValidatorSlashesResponse.decode(new BinaryReader(data))); + } + delegationRewards(request: QueryDelegationRewardsRequest): Promise { + const data = QueryDelegationRewardsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationRewards", data); + return promise.then(data => QueryDelegationRewardsResponse.decode(new BinaryReader(data))); + } + delegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise { + const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationTotalRewards", data); + return promise.then(data => QueryDelegationTotalRewardsResponse.decode(new BinaryReader(data))); + } + delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { + const data = QueryDelegatorValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorValidators", data); + return promise.then(data => QueryDelegatorValidatorsResponse.decode(new BinaryReader(data))); + } + delegatorWithdrawAddress(request: QueryDelegatorWithdrawAddressRequest): Promise { + const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorWithdrawAddress", data); + return promise.then(data => QueryDelegatorWithdrawAddressResponse.decode(new BinaryReader(data))); + } + communityPool(request: QueryCommunityPoolRequest = {}): Promise { + const data = QueryCommunityPoolRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "CommunityPool", data); + return promise.then(data => QueryCommunityPoolResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { + return queryService.validatorOutstandingRewards(request); + }, + validatorCommission(request: QueryValidatorCommissionRequest): Promise { + return queryService.validatorCommission(request); + }, + validatorSlashes(request: QueryValidatorSlashesRequest): Promise { + return queryService.validatorSlashes(request); + }, + delegationRewards(request: QueryDelegationRewardsRequest): Promise { + return queryService.delegationRewards(request); + }, + delegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise { + return queryService.delegationTotalRewards(request); + }, + delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { + return queryService.delegatorValidators(request); + }, + delegatorWithdrawAddress(request: QueryDelegatorWithdrawAddressRequest): Promise { + return queryService.delegatorWithdrawAddress(request); + }, + communityPool(request?: QueryCommunityPoolRequest): Promise { + return queryService.communityPool(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/query.ts new file mode 100644 index 00000000..cc887847 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/query.ts @@ -0,0 +1,1857 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Params, ParamsAmino, ParamsSDKType, ValidatorOutstandingRewards, ValidatorOutstandingRewardsAmino, ValidatorOutstandingRewardsSDKType, ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorSlashEvent, ValidatorSlashEventAmino, ValidatorSlashEventSDKType, DelegationDelegatorReward, DelegationDelegatorRewardAmino, DelegationDelegatorRewardSDKType } from "./distribution"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** + * QueryValidatorOutstandingRewardsRequest is the request type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +export interface QueryValidatorOutstandingRewardsRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest"; + value: Uint8Array; +} +/** + * QueryValidatorOutstandingRewardsRequest is the request type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsRequestAmino { + /** validator_address defines the validator address to query for. */ + validator_address?: string; +} +export interface QueryValidatorOutstandingRewardsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorOutstandingRewardsRequest"; + value: QueryValidatorOutstandingRewardsRequestAmino; +} +/** + * QueryValidatorOutstandingRewardsRequest is the request type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsRequestSDKType { + validator_address: string; +} +/** + * QueryValidatorOutstandingRewardsResponse is the response type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsResponse { + rewards: ValidatorOutstandingRewards; +} +export interface QueryValidatorOutstandingRewardsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse"; + value: Uint8Array; +} +/** + * QueryValidatorOutstandingRewardsResponse is the response type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsResponseAmino { + rewards?: ValidatorOutstandingRewardsAmino; +} +export interface QueryValidatorOutstandingRewardsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorOutstandingRewardsResponse"; + value: QueryValidatorOutstandingRewardsResponseAmino; +} +/** + * QueryValidatorOutstandingRewardsResponse is the response type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsResponseSDKType { + rewards: ValidatorOutstandingRewardsSDKType; +} +/** + * QueryValidatorCommissionRequest is the request type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +export interface QueryValidatorCommissionRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest"; + value: Uint8Array; +} +/** + * QueryValidatorCommissionRequest is the request type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionRequestAmino { + /** validator_address defines the validator address to query for. */ + validator_address?: string; +} +export interface QueryValidatorCommissionRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorCommissionRequest"; + value: QueryValidatorCommissionRequestAmino; +} +/** + * QueryValidatorCommissionRequest is the request type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionRequestSDKType { + validator_address: string; +} +/** + * QueryValidatorCommissionResponse is the response type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionResponse { + /** commission defines the commision the validator received. */ + commission: ValidatorAccumulatedCommission; +} +export interface QueryValidatorCommissionResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse"; + value: Uint8Array; +} +/** + * QueryValidatorCommissionResponse is the response type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionResponseAmino { + /** commission defines the commision the validator received. */ + commission?: ValidatorAccumulatedCommissionAmino; +} +export interface QueryValidatorCommissionResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorCommissionResponse"; + value: QueryValidatorCommissionResponseAmino; +} +/** + * QueryValidatorCommissionResponse is the response type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionResponseSDKType { + commission: ValidatorAccumulatedCommissionSDKType; +} +/** + * QueryValidatorSlashesRequest is the request type for the + * Query/ValidatorSlashes RPC method + */ +export interface QueryValidatorSlashesRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; + /** starting_height defines the optional starting height to query the slashes. */ + startingHeight: bigint; + /** starting_height defines the optional ending height to query the slashes. */ + endingHeight: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorSlashesRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest"; + value: Uint8Array; +} +/** + * QueryValidatorSlashesRequest is the request type for the + * Query/ValidatorSlashes RPC method + */ +export interface QueryValidatorSlashesRequestAmino { + /** validator_address defines the validator address to query for. */ + validator_address?: string; + /** starting_height defines the optional starting height to query the slashes. */ + starting_height?: string; + /** starting_height defines the optional ending height to query the slashes. */ + ending_height?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorSlashesRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorSlashesRequest"; + value: QueryValidatorSlashesRequestAmino; +} +/** + * QueryValidatorSlashesRequest is the request type for the + * Query/ValidatorSlashes RPC method + */ +export interface QueryValidatorSlashesRequestSDKType { + validator_address: string; + starting_height: bigint; + ending_height: bigint; + pagination?: PageRequestSDKType; +} +/** + * QueryValidatorSlashesResponse is the response type for the + * Query/ValidatorSlashes RPC method. + */ +export interface QueryValidatorSlashesResponse { + /** slashes defines the slashes the validator received. */ + slashes: ValidatorSlashEvent[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorSlashesResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse"; + value: Uint8Array; +} +/** + * QueryValidatorSlashesResponse is the response type for the + * Query/ValidatorSlashes RPC method. + */ +export interface QueryValidatorSlashesResponseAmino { + /** slashes defines the slashes the validator received. */ + slashes?: ValidatorSlashEventAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorSlashesResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorSlashesResponse"; + value: QueryValidatorSlashesResponseAmino; +} +/** + * QueryValidatorSlashesResponse is the response type for the + * Query/ValidatorSlashes RPC method. + */ +export interface QueryValidatorSlashesResponseSDKType { + slashes: ValidatorSlashEventSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryDelegationRewardsRequest is the request type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +export interface QueryDelegationRewardsRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest"; + value: Uint8Array; +} +/** + * QueryDelegationRewardsRequest is the request type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsRequestAmino { + /** delegator_address defines the delegator address to query for. */ + delegator_address?: string; + /** validator_address defines the validator address to query for. */ + validator_address?: string; +} +export interface QueryDelegationRewardsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegationRewardsRequest"; + value: QueryDelegationRewardsRequestAmino; +} +/** + * QueryDelegationRewardsRequest is the request type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsRequestSDKType { + delegator_address: string; + validator_address: string; +} +/** + * QueryDelegationRewardsResponse is the response type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsResponse { + /** rewards defines the rewards accrued by a delegation. */ + rewards: DecCoin[]; +} +export interface QueryDelegationRewardsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse"; + value: Uint8Array; +} +/** + * QueryDelegationRewardsResponse is the response type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsResponseAmino { + /** rewards defines the rewards accrued by a delegation. */ + rewards?: DecCoinAmino[]; +} +export interface QueryDelegationRewardsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegationRewardsResponse"; + value: QueryDelegationRewardsResponseAmino; +} +/** + * QueryDelegationRewardsResponse is the response type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsResponseSDKType { + rewards: DecCoinSDKType[]; +} +/** + * QueryDelegationTotalRewardsRequest is the request type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} +export interface QueryDelegationTotalRewardsRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest"; + value: Uint8Array; +} +/** + * QueryDelegationTotalRewardsRequest is the request type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsRequestAmino { + /** delegator_address defines the delegator address to query for. */ + delegator_address?: string; +} +export interface QueryDelegationTotalRewardsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegationTotalRewardsRequest"; + value: QueryDelegationTotalRewardsRequestAmino; +} +/** + * QueryDelegationTotalRewardsRequest is the request type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsRequestSDKType { + delegator_address: string; +} +/** + * QueryDelegationTotalRewardsResponse is the response type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsResponse { + /** rewards defines all the rewards accrued by a delegator. */ + rewards: DelegationDelegatorReward[]; + /** total defines the sum of all the rewards. */ + total: DecCoin[]; +} +export interface QueryDelegationTotalRewardsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse"; + value: Uint8Array; +} +/** + * QueryDelegationTotalRewardsResponse is the response type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsResponseAmino { + /** rewards defines all the rewards accrued by a delegator. */ + rewards?: DelegationDelegatorRewardAmino[]; + /** total defines the sum of all the rewards. */ + total?: DecCoinAmino[]; +} +export interface QueryDelegationTotalRewardsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegationTotalRewardsResponse"; + value: QueryDelegationTotalRewardsResponseAmino; +} +/** + * QueryDelegationTotalRewardsResponse is the response type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsResponseSDKType { + rewards: DelegationDelegatorRewardSDKType[]; + total: DecCoinSDKType[]; +} +/** + * QueryDelegatorValidatorsRequest is the request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} +export interface QueryDelegatorValidatorsRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsRequest is the request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequestAmino { + /** delegator_address defines the delegator address to query for. */ + delegator_address?: string; +} +export interface QueryDelegatorValidatorsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest"; + value: QueryDelegatorValidatorsRequestAmino; +} +/** + * QueryDelegatorValidatorsRequest is the request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequestSDKType { + delegator_address: string; +} +/** + * QueryDelegatorValidatorsResponse is the response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the validators a delegator is delegating for. */ + validators: string[]; +} +export interface QueryDelegatorValidatorsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsResponse is the response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponseAmino { + /** validators defines the validators a delegator is delegating for. */ + validators?: string[]; +} +export interface QueryDelegatorValidatorsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse"; + value: QueryDelegatorValidatorsResponseAmino; +} +/** + * QueryDelegatorValidatorsResponse is the response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponseSDKType { + validators: string[]; +} +/** + * QueryDelegatorWithdrawAddressRequest is the request type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} +export interface QueryDelegatorWithdrawAddressRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorWithdrawAddressRequest is the request type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressRequestAmino { + /** delegator_address defines the delegator address to query for. */ + delegator_address?: string; +} +export interface QueryDelegatorWithdrawAddressRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorWithdrawAddressRequest"; + value: QueryDelegatorWithdrawAddressRequestAmino; +} +/** + * QueryDelegatorWithdrawAddressRequest is the request type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressRequestSDKType { + delegator_address: string; +} +/** + * QueryDelegatorWithdrawAddressResponse is the response type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressResponse { + /** withdraw_address defines the delegator address to query for. */ + withdrawAddress: string; +} +export interface QueryDelegatorWithdrawAddressResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorWithdrawAddressResponse is the response type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressResponseAmino { + /** withdraw_address defines the delegator address to query for. */ + withdraw_address?: string; +} +export interface QueryDelegatorWithdrawAddressResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorWithdrawAddressResponse"; + value: QueryDelegatorWithdrawAddressResponseAmino; +} +/** + * QueryDelegatorWithdrawAddressResponse is the response type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressResponseSDKType { + withdraw_address: string; +} +/** + * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC + * method. + */ +export interface QueryCommunityPoolRequest {} +export interface QueryCommunityPoolRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolRequest"; + value: Uint8Array; +} +/** + * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC + * method. + */ +export interface QueryCommunityPoolRequestAmino {} +export interface QueryCommunityPoolRequestAminoMsg { + type: "cosmos-sdk/QueryCommunityPoolRequest"; + value: QueryCommunityPoolRequestAmino; +} +/** + * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC + * method. + */ +export interface QueryCommunityPoolRequestSDKType {} +/** + * QueryCommunityPoolResponse is the response type for the Query/CommunityPool + * RPC method. + */ +export interface QueryCommunityPoolResponse { + /** pool defines community pool's coins. */ + pool: DecCoin[]; +} +export interface QueryCommunityPoolResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolResponse"; + value: Uint8Array; +} +/** + * QueryCommunityPoolResponse is the response type for the Query/CommunityPool + * RPC method. + */ +export interface QueryCommunityPoolResponseAmino { + /** pool defines community pool's coins. */ + pool?: DecCoinAmino[]; +} +export interface QueryCommunityPoolResponseAminoMsg { + type: "cosmos-sdk/QueryCommunityPoolResponse"; + value: QueryCommunityPoolResponseAmino; +} +/** + * QueryCommunityPoolResponse is the response type for the Query/CommunityPool + * RPC method. + */ +export interface QueryCommunityPoolResponseSDKType { + pool: DecCoinSDKType[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOutstandingRewardsRequest { + return { + validatorAddress: "" + }; +} +export const QueryValidatorOutstandingRewardsRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", + encode(message: QueryValidatorOutstandingRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorOutstandingRewardsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorOutstandingRewardsRequest { + const message = createBaseQueryValidatorOutstandingRewardsRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryValidatorOutstandingRewardsRequestAmino): QueryValidatorOutstandingRewardsRequest { + const message = createBaseQueryValidatorOutstandingRewardsRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryValidatorOutstandingRewardsRequest): QueryValidatorOutstandingRewardsRequestAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryValidatorOutstandingRewardsRequestAminoMsg): QueryValidatorOutstandingRewardsRequest { + return QueryValidatorOutstandingRewardsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorOutstandingRewardsRequest): QueryValidatorOutstandingRewardsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorOutstandingRewardsRequest", + value: QueryValidatorOutstandingRewardsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorOutstandingRewardsRequestProtoMsg): QueryValidatorOutstandingRewardsRequest { + return QueryValidatorOutstandingRewardsRequest.decode(message.value); + }, + toProto(message: QueryValidatorOutstandingRewardsRequest): Uint8Array { + return QueryValidatorOutstandingRewardsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorOutstandingRewardsRequest): QueryValidatorOutstandingRewardsRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", + value: QueryValidatorOutstandingRewardsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorOutstandingRewardsResponse(): QueryValidatorOutstandingRewardsResponse { + return { + rewards: ValidatorOutstandingRewards.fromPartial({}) + }; +} +export const QueryValidatorOutstandingRewardsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse", + encode(message: QueryValidatorOutstandingRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewards !== undefined) { + ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorOutstandingRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards = ValidatorOutstandingRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorOutstandingRewardsResponse { + const message = createBaseQueryValidatorOutstandingRewardsResponse(); + message.rewards = object.rewards !== undefined && object.rewards !== null ? ValidatorOutstandingRewards.fromPartial(object.rewards) : undefined; + return message; + }, + fromAmino(object: QueryValidatorOutstandingRewardsResponseAmino): QueryValidatorOutstandingRewardsResponse { + const message = createBaseQueryValidatorOutstandingRewardsResponse(); + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorOutstandingRewards.fromAmino(object.rewards); + } + return message; + }, + toAmino(message: QueryValidatorOutstandingRewardsResponse): QueryValidatorOutstandingRewardsResponseAmino { + const obj: any = {}; + obj.rewards = message.rewards ? ValidatorOutstandingRewards.toAmino(message.rewards) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorOutstandingRewardsResponseAminoMsg): QueryValidatorOutstandingRewardsResponse { + return QueryValidatorOutstandingRewardsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorOutstandingRewardsResponse): QueryValidatorOutstandingRewardsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorOutstandingRewardsResponse", + value: QueryValidatorOutstandingRewardsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorOutstandingRewardsResponseProtoMsg): QueryValidatorOutstandingRewardsResponse { + return QueryValidatorOutstandingRewardsResponse.decode(message.value); + }, + toProto(message: QueryValidatorOutstandingRewardsResponse): Uint8Array { + return QueryValidatorOutstandingRewardsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorOutstandingRewardsResponse): QueryValidatorOutstandingRewardsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse", + value: QueryValidatorOutstandingRewardsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorCommissionRequest(): QueryValidatorCommissionRequest { + return { + validatorAddress: "" + }; +} +export const QueryValidatorCommissionRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest", + encode(message: QueryValidatorCommissionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorCommissionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorCommissionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorCommissionRequest { + const message = createBaseQueryValidatorCommissionRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryValidatorCommissionRequestAmino): QueryValidatorCommissionRequest { + const message = createBaseQueryValidatorCommissionRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryValidatorCommissionRequest): QueryValidatorCommissionRequestAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryValidatorCommissionRequestAminoMsg): QueryValidatorCommissionRequest { + return QueryValidatorCommissionRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorCommissionRequest): QueryValidatorCommissionRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorCommissionRequest", + value: QueryValidatorCommissionRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorCommissionRequestProtoMsg): QueryValidatorCommissionRequest { + return QueryValidatorCommissionRequest.decode(message.value); + }, + toProto(message: QueryValidatorCommissionRequest): Uint8Array { + return QueryValidatorCommissionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorCommissionRequest): QueryValidatorCommissionRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest", + value: QueryValidatorCommissionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorCommissionResponse(): QueryValidatorCommissionResponse { + return { + commission: ValidatorAccumulatedCommission.fromPartial({}) + }; +} +export const QueryValidatorCommissionResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse", + encode(message: QueryValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.commission !== undefined) { + ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorCommissionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorCommissionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commission = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorCommissionResponse { + const message = createBaseQueryValidatorCommissionResponse(); + message.commission = object.commission !== undefined && object.commission !== null ? ValidatorAccumulatedCommission.fromPartial(object.commission) : undefined; + return message; + }, + fromAmino(object: QueryValidatorCommissionResponseAmino): QueryValidatorCommissionResponse { + const message = createBaseQueryValidatorCommissionResponse(); + if (object.commission !== undefined && object.commission !== null) { + message.commission = ValidatorAccumulatedCommission.fromAmino(object.commission); + } + return message; + }, + toAmino(message: QueryValidatorCommissionResponse): QueryValidatorCommissionResponseAmino { + const obj: any = {}; + obj.commission = message.commission ? ValidatorAccumulatedCommission.toAmino(message.commission) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorCommissionResponseAminoMsg): QueryValidatorCommissionResponse { + return QueryValidatorCommissionResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorCommissionResponse): QueryValidatorCommissionResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorCommissionResponse", + value: QueryValidatorCommissionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorCommissionResponseProtoMsg): QueryValidatorCommissionResponse { + return QueryValidatorCommissionResponse.decode(message.value); + }, + toProto(message: QueryValidatorCommissionResponse): Uint8Array { + return QueryValidatorCommissionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorCommissionResponse): QueryValidatorCommissionResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse", + value: QueryValidatorCommissionResponse.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorSlashesRequest(): QueryValidatorSlashesRequest { + return { + validatorAddress: "", + startingHeight: BigInt(0), + endingHeight: BigInt(0), + pagination: undefined + }; +} +export const QueryValidatorSlashesRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest", + encode(message: QueryValidatorSlashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.startingHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.startingHeight); + } + if (message.endingHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.endingHeight); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorSlashesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorSlashesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.startingHeight = reader.uint64(); + break; + case 3: + message.endingHeight = reader.uint64(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorSlashesRequest { + const message = createBaseQueryValidatorSlashesRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + message.startingHeight = object.startingHeight !== undefined && object.startingHeight !== null ? BigInt(object.startingHeight.toString()) : BigInt(0); + message.endingHeight = object.endingHeight !== undefined && object.endingHeight !== null ? BigInt(object.endingHeight.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorSlashesRequestAmino): QueryValidatorSlashesRequest { + const message = createBaseQueryValidatorSlashesRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_height !== undefined && object.starting_height !== null) { + message.startingHeight = BigInt(object.starting_height); + } + if (object.ending_height !== undefined && object.ending_height !== null) { + message.endingHeight = BigInt(object.ending_height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorSlashesRequest): QueryValidatorSlashesRequestAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.starting_height = message.startingHeight !== BigInt(0) ? message.startingHeight.toString() : undefined; + obj.ending_height = message.endingHeight !== BigInt(0) ? message.endingHeight.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorSlashesRequestAminoMsg): QueryValidatorSlashesRequest { + return QueryValidatorSlashesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorSlashesRequest): QueryValidatorSlashesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorSlashesRequest", + value: QueryValidatorSlashesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorSlashesRequestProtoMsg): QueryValidatorSlashesRequest { + return QueryValidatorSlashesRequest.decode(message.value); + }, + toProto(message: QueryValidatorSlashesRequest): Uint8Array { + return QueryValidatorSlashesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorSlashesRequest): QueryValidatorSlashesRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest", + value: QueryValidatorSlashesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorSlashesResponse(): QueryValidatorSlashesResponse { + return { + slashes: [], + pagination: undefined + }; +} +export const QueryValidatorSlashesResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse", + encode(message: QueryValidatorSlashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.slashes) { + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorSlashesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorSlashesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.slashes.push(ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorSlashesResponse { + const message = createBaseQueryValidatorSlashesResponse(); + message.slashes = object.slashes?.map(e => ValidatorSlashEvent.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorSlashesResponseAmino): QueryValidatorSlashesResponse { + const message = createBaseQueryValidatorSlashesResponse(); + message.slashes = object.slashes?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorSlashesResponse): QueryValidatorSlashesResponseAmino { + const obj: any = {}; + if (message.slashes) { + obj.slashes = message.slashes.map(e => e ? ValidatorSlashEvent.toAmino(e) : undefined); + } else { + obj.slashes = message.slashes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorSlashesResponseAminoMsg): QueryValidatorSlashesResponse { + return QueryValidatorSlashesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorSlashesResponse): QueryValidatorSlashesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorSlashesResponse", + value: QueryValidatorSlashesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorSlashesResponseProtoMsg): QueryValidatorSlashesResponse { + return QueryValidatorSlashesResponse.decode(message.value); + }, + toProto(message: QueryValidatorSlashesResponse): Uint8Array { + return QueryValidatorSlashesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorSlashesResponse): QueryValidatorSlashesResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse", + value: QueryValidatorSlashesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationRewardsRequest(): QueryDelegationRewardsRequest { + return { + delegatorAddress: "", + validatorAddress: "" + }; +} +export const QueryDelegationRewardsRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest", + encode(message: QueryDelegationRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationRewardsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegationRewardsRequest { + const message = createBaseQueryDelegationRewardsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegationRewardsRequestAmino): QueryDelegationRewardsRequest { + const message = createBaseQueryDelegationRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryDelegationRewardsRequest): QueryDelegationRewardsRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegationRewardsRequestAminoMsg): QueryDelegationRewardsRequest { + return QueryDelegationRewardsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationRewardsRequest): QueryDelegationRewardsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationRewardsRequest", + value: QueryDelegationRewardsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationRewardsRequestProtoMsg): QueryDelegationRewardsRequest { + return QueryDelegationRewardsRequest.decode(message.value); + }, + toProto(message: QueryDelegationRewardsRequest): Uint8Array { + return QueryDelegationRewardsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationRewardsRequest): QueryDelegationRewardsRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest", + value: QueryDelegationRewardsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationRewardsResponse(): QueryDelegationRewardsResponse { + return { + rewards: [] + }; +} +export const QueryDelegationRewardsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse", + encode(message: QueryDelegationRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegationRewardsResponse { + const message = createBaseQueryDelegationRewardsResponse(); + message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDelegationRewardsResponseAmino): QueryDelegationRewardsResponse { + const message = createBaseQueryDelegationRewardsResponse(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDelegationRewardsResponse): QueryDelegationRewardsResponseAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + return obj; + }, + fromAminoMsg(object: QueryDelegationRewardsResponseAminoMsg): QueryDelegationRewardsResponse { + return QueryDelegationRewardsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationRewardsResponse): QueryDelegationRewardsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationRewardsResponse", + value: QueryDelegationRewardsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationRewardsResponseProtoMsg): QueryDelegationRewardsResponse { + return QueryDelegationRewardsResponse.decode(message.value); + }, + toProto(message: QueryDelegationRewardsResponse): Uint8Array { + return QueryDelegationRewardsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationRewardsResponse): QueryDelegationRewardsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse", + value: QueryDelegationRewardsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationTotalRewardsRequest(): QueryDelegationTotalRewardsRequest { + return { + delegatorAddress: "" + }; +} +export const QueryDelegationTotalRewardsRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", + encode(message: QueryDelegationTotalRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationTotalRewardsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegationTotalRewardsRequest { + const message = createBaseQueryDelegationTotalRewardsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegationTotalRewardsRequestAmino): QueryDelegationTotalRewardsRequest { + const message = createBaseQueryDelegationTotalRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: QueryDelegationTotalRewardsRequest): QueryDelegationTotalRewardsRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegationTotalRewardsRequestAminoMsg): QueryDelegationTotalRewardsRequest { + return QueryDelegationTotalRewardsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationTotalRewardsRequest): QueryDelegationTotalRewardsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationTotalRewardsRequest", + value: QueryDelegationTotalRewardsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationTotalRewardsRequestProtoMsg): QueryDelegationTotalRewardsRequest { + return QueryDelegationTotalRewardsRequest.decode(message.value); + }, + toProto(message: QueryDelegationTotalRewardsRequest): Uint8Array { + return QueryDelegationTotalRewardsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationTotalRewardsRequest): QueryDelegationTotalRewardsRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", + value: QueryDelegationTotalRewardsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationTotalRewardsResponse(): QueryDelegationTotalRewardsResponse { + return { + rewards: [], + total: [] + }; +} +export const QueryDelegationTotalRewardsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", + encode(message: QueryDelegationTotalRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewards) { + DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.total) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationTotalRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DelegationDelegatorReward.decode(reader, reader.uint32())); + break; + case 2: + message.total.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegationTotalRewardsResponse { + const message = createBaseQueryDelegationTotalRewardsResponse(); + message.rewards = object.rewards?.map(e => DelegationDelegatorReward.fromPartial(e)) || []; + message.total = object.total?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDelegationTotalRewardsResponseAmino): QueryDelegationTotalRewardsResponse { + const message = createBaseQueryDelegationTotalRewardsResponse(); + message.rewards = object.rewards?.map(e => DelegationDelegatorReward.fromAmino(e)) || []; + message.total = object.total?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDelegationTotalRewardsResponse): QueryDelegationTotalRewardsResponseAmino { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DelegationDelegatorReward.toAmino(e) : undefined); + } else { + obj.rewards = message.rewards; + } + if (message.total) { + obj.total = message.total.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.total = message.total; + } + return obj; + }, + fromAminoMsg(object: QueryDelegationTotalRewardsResponseAminoMsg): QueryDelegationTotalRewardsResponse { + return QueryDelegationTotalRewardsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationTotalRewardsResponse): QueryDelegationTotalRewardsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationTotalRewardsResponse", + value: QueryDelegationTotalRewardsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationTotalRewardsResponseProtoMsg): QueryDelegationTotalRewardsResponse { + return QueryDelegationTotalRewardsResponse.decode(message.value); + }, + toProto(message: QueryDelegationTotalRewardsResponse): Uint8Array { + return QueryDelegationTotalRewardsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationTotalRewardsResponse): QueryDelegationTotalRewardsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", + value: QueryDelegationTotalRewardsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { + return { + delegatorAddress: "" + }; +} +export const QueryDelegatorValidatorsRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest", + encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsRequestAminoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsRequestProtoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsRequest): Uint8Array { + return QueryDelegatorValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { + return { + validators: [] + }; +} +export const QueryDelegatorValidatorsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", + encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => e) || []; + return message; + }, + toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e); + } else { + obj.validators = message.validators; + } + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsResponseAminoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsResponseProtoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsResponse): Uint8Array { + return QueryDelegatorValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorWithdrawAddressRequest(): QueryDelegatorWithdrawAddressRequest { + return { + delegatorAddress: "" + }; +} +export const QueryDelegatorWithdrawAddressRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", + encode(message: QueryDelegatorWithdrawAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorWithdrawAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorWithdrawAddressRequest { + const message = createBaseQueryDelegatorWithdrawAddressRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegatorWithdrawAddressRequestAmino): QueryDelegatorWithdrawAddressRequest { + const message = createBaseQueryDelegatorWithdrawAddressRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: QueryDelegatorWithdrawAddressRequest): QueryDelegatorWithdrawAddressRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegatorWithdrawAddressRequestAminoMsg): QueryDelegatorWithdrawAddressRequest { + return QueryDelegatorWithdrawAddressRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorWithdrawAddressRequest): QueryDelegatorWithdrawAddressRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorWithdrawAddressRequest", + value: QueryDelegatorWithdrawAddressRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorWithdrawAddressRequestProtoMsg): QueryDelegatorWithdrawAddressRequest { + return QueryDelegatorWithdrawAddressRequest.decode(message.value); + }, + toProto(message: QueryDelegatorWithdrawAddressRequest): Uint8Array { + return QueryDelegatorWithdrawAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorWithdrawAddressRequest): QueryDelegatorWithdrawAddressRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", + value: QueryDelegatorWithdrawAddressRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorWithdrawAddressResponse(): QueryDelegatorWithdrawAddressResponse { + return { + withdrawAddress: "" + }; +} +export const QueryDelegatorWithdrawAddressResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", + encode(message: QueryDelegatorWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.withdrawAddress !== "") { + writer.uint32(10).string(message.withdrawAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorWithdrawAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorWithdrawAddressResponse { + const message = createBaseQueryDelegatorWithdrawAddressResponse(); + message.withdrawAddress = object.withdrawAddress ?? ""; + return message; + }, + fromAmino(object: QueryDelegatorWithdrawAddressResponseAmino): QueryDelegatorWithdrawAddressResponse { + const message = createBaseQueryDelegatorWithdrawAddressResponse(); + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; + }, + toAmino(message: QueryDelegatorWithdrawAddressResponse): QueryDelegatorWithdrawAddressResponseAmino { + const obj: any = {}; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; + return obj; + }, + fromAminoMsg(object: QueryDelegatorWithdrawAddressResponseAminoMsg): QueryDelegatorWithdrawAddressResponse { + return QueryDelegatorWithdrawAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorWithdrawAddressResponse): QueryDelegatorWithdrawAddressResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorWithdrawAddressResponse", + value: QueryDelegatorWithdrawAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorWithdrawAddressResponseProtoMsg): QueryDelegatorWithdrawAddressResponse { + return QueryDelegatorWithdrawAddressResponse.decode(message.value); + }, + toProto(message: QueryDelegatorWithdrawAddressResponse): Uint8Array { + return QueryDelegatorWithdrawAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorWithdrawAddressResponse): QueryDelegatorWithdrawAddressResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", + value: QueryDelegatorWithdrawAddressResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCommunityPoolRequest(): QueryCommunityPoolRequest { + return {}; +} +export const QueryCommunityPoolRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolRequest", + encode(_: QueryCommunityPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCommunityPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCommunityPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryCommunityPoolRequest { + const message = createBaseQueryCommunityPoolRequest(); + return message; + }, + fromAmino(_: QueryCommunityPoolRequestAmino): QueryCommunityPoolRequest { + const message = createBaseQueryCommunityPoolRequest(); + return message; + }, + toAmino(_: QueryCommunityPoolRequest): QueryCommunityPoolRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCommunityPoolRequestAminoMsg): QueryCommunityPoolRequest { + return QueryCommunityPoolRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCommunityPoolRequest): QueryCommunityPoolRequestAminoMsg { + return { + type: "cosmos-sdk/QueryCommunityPoolRequest", + value: QueryCommunityPoolRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCommunityPoolRequestProtoMsg): QueryCommunityPoolRequest { + return QueryCommunityPoolRequest.decode(message.value); + }, + toProto(message: QueryCommunityPoolRequest): Uint8Array { + return QueryCommunityPoolRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCommunityPoolRequest): QueryCommunityPoolRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolRequest", + value: QueryCommunityPoolRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCommunityPoolResponse(): QueryCommunityPoolResponse { + return { + pool: [] + }; +} +export const QueryCommunityPoolResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolResponse", + encode(message: QueryCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pool) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCommunityPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCommunityPoolResponse { + const message = createBaseQueryCommunityPoolResponse(); + message.pool = object.pool?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCommunityPoolResponseAmino): QueryCommunityPoolResponse { + const message = createBaseQueryCommunityPoolResponse(); + message.pool = object.pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCommunityPoolResponse): QueryCommunityPoolResponseAmino { + const obj: any = {}; + if (message.pool) { + obj.pool = message.pool.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.pool = message.pool; + } + return obj; + }, + fromAminoMsg(object: QueryCommunityPoolResponseAminoMsg): QueryCommunityPoolResponse { + return QueryCommunityPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCommunityPoolResponse): QueryCommunityPoolResponseAminoMsg { + return { + type: "cosmos-sdk/QueryCommunityPoolResponse", + value: QueryCommunityPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCommunityPoolResponseProtoMsg): QueryCommunityPoolResponse { + return QueryCommunityPoolResponse.decode(message.value); + }, + toProto(message: QueryCommunityPoolResponse): Uint8Array { + return QueryCommunityPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCommunityPoolResponse): QueryCommunityPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolResponse", + value: QueryCommunityPoolResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.amino.ts new file mode 100644 index 00000000..a55f1e3f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.amino.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; +export const AminoConverter = { + "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { + aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", + toAmino: MsgSetWithdrawAddress.toAmino, + fromAmino: MsgSetWithdrawAddress.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": { + aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", + toAmino: MsgWithdrawDelegatorReward.toAmino, + fromAmino: MsgWithdrawDelegatorReward.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": { + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", + toAmino: MsgWithdrawValidatorCommission.toAmino, + fromAmino: MsgWithdrawValidatorCommission.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgFundCommunityPool": { + aminoType: "cosmos-sdk/MsgFundCommunityPool", + toAmino: MsgFundCommunityPool.toAmino, + fromAmino: MsgFundCommunityPool.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.registry.ts new file mode 100644 index 00000000..52151ed5 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.registry.ts @@ -0,0 +1,89 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.encode(value).finish() + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.encode(value).finish() + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.encode(value).finish() + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.encode(value).finish() + }; + } + }, + withTypeUrl: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value + }; + } + }, + fromPartial: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.fromPartial(value) + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.fromPartial(value) + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.fromPartial(value) + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..fefe32ff --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,57 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse } from "./tx"; +/** Msg defines the distribution Msg service. */ +export interface Msg { + /** + * SetWithdrawAddress defines a method to change the withdraw address + * for a delegator (or validator self-delegation). + */ + setWithdrawAddress(request: MsgSetWithdrawAddress): Promise; + /** + * WithdrawDelegatorReward defines a method to withdraw rewards of delegator + * from a single validator. + */ + withdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; + /** + * WithdrawValidatorCommission defines a method to withdraw the + * full commission to the validator address. + */ + withdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise; + /** + * FundCommunityPool defines a method to allow an account to directly + * fund the community pool. + */ + fundCommunityPool(request: MsgFundCommunityPool): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setWithdrawAddress = this.setWithdrawAddress.bind(this); + this.withdrawDelegatorReward = this.withdrawDelegatorReward.bind(this); + this.withdrawValidatorCommission = this.withdrawValidatorCommission.bind(this); + this.fundCommunityPool = this.fundCommunityPool.bind(this); + } + setWithdrawAddress(request: MsgSetWithdrawAddress): Promise { + const data = MsgSetWithdrawAddress.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data); + return promise.then(data => MsgSetWithdrawAddressResponse.decode(new BinaryReader(data))); + } + withdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise { + const data = MsgWithdrawDelegatorReward.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data); + return promise.then(data => MsgWithdrawDelegatorRewardResponse.decode(new BinaryReader(data))); + } + withdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise { + const data = MsgWithdrawValidatorCommission.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data); + return promise.then(data => MsgWithdrawValidatorCommissionResponse.decode(new BinaryReader(data))); + } + fundCommunityPool(request: MsgFundCommunityPool): Promise { + const data = MsgFundCommunityPool.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); + return promise.then(data => MsgFundCommunityPoolResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.ts new file mode 100644 index 00000000..3e33141b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/distribution/v1beta1/tx.ts @@ -0,0 +1,764 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddress { + delegatorAddress: string; + withdrawAddress: string; +} +export interface MsgSetWithdrawAddressProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress"; + value: Uint8Array; +} +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddressAmino { + delegator_address?: string; + withdraw_address?: string; +} +export interface MsgSetWithdrawAddressAminoMsg { + type: "cosmos-sdk/MsgModifyWithdrawAddress"; + value: MsgSetWithdrawAddressAmino; +} +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddressSDKType { + delegator_address: string; + withdraw_address: string; +} +/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +export interface MsgSetWithdrawAddressResponse {} +export interface MsgSetWithdrawAddressResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse"; + value: Uint8Array; +} +/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +export interface MsgSetWithdrawAddressResponseAmino {} +export interface MsgSetWithdrawAddressResponseAminoMsg { + type: "cosmos-sdk/MsgSetWithdrawAddressResponse"; + value: MsgSetWithdrawAddressResponseAmino; +} +/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +export interface MsgSetWithdrawAddressResponseSDKType {} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorReward { + delegatorAddress: string; + validatorAddress: string; +} +export interface MsgWithdrawDelegatorRewardProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"; + value: Uint8Array; +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorRewardAmino { + delegator_address?: string; + validator_address?: string; +} +export interface MsgWithdrawDelegatorRewardAminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegationReward"; + value: MsgWithdrawDelegatorRewardAmino; +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorRewardSDKType { + delegator_address: string; + validator_address: string; +} +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponse { + amount: Coin[]; +} +export interface MsgWithdrawDelegatorRewardResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse"; + value: Uint8Array; +} +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponseAmino { + amount?: CoinAmino[]; +} +export interface MsgWithdrawDelegatorRewardResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; + value: MsgWithdrawDelegatorRewardResponseAmino; +} +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponseSDKType { + amount: CoinSDKType[]; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommission { + validatorAddress: string; +} +export interface MsgWithdrawValidatorCommissionProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"; + value: Uint8Array; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommissionAmino { + validator_address?: string; +} +export interface MsgWithdrawValidatorCommissionAminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommission"; + value: MsgWithdrawValidatorCommissionAmino; +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommissionSDKType { + validator_address: string; +} +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponse { + amount: Coin[]; +} +export interface MsgWithdrawValidatorCommissionResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse"; + value: Uint8Array; +} +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponseAmino { + amount?: CoinAmino[]; +} +export interface MsgWithdrawValidatorCommissionResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; + value: MsgWithdrawValidatorCommissionResponseAmino; +} +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponseSDKType { + amount: CoinSDKType[]; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPool { + amount: Coin[]; + depositor: string; +} +export interface MsgFundCommunityPoolProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool"; + value: Uint8Array; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPoolAmino { + amount?: CoinAmino[]; + depositor?: string; +} +export interface MsgFundCommunityPoolAminoMsg { + type: "cosmos-sdk/MsgFundCommunityPool"; + value: MsgFundCommunityPoolAmino; +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPoolSDKType { + amount: CoinSDKType[]; + depositor: string; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponse {} +export interface MsgFundCommunityPoolResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse"; + value: Uint8Array; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponseAmino {} +export interface MsgFundCommunityPoolResponseAminoMsg { + type: "cosmos-sdk/MsgFundCommunityPoolResponse"; + value: MsgFundCommunityPoolResponseAmino; +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponseSDKType {} +function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { + return { + delegatorAddress: "", + withdrawAddress: "" + }; +} +export const MsgSetWithdrawAddress = { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + encode(message: MsgSetWithdrawAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetWithdrawAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.withdrawAddress = object.withdrawAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; + }, + toAmino(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; + return obj; + }, + fromAminoMsg(object: MsgSetWithdrawAddressAminoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAminoMsg { + return { + type: "cosmos-sdk/MsgModifyWithdrawAddress", + value: MsgSetWithdrawAddress.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetWithdrawAddressProtoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.decode(message.value); + }, + toProto(message: MsgSetWithdrawAddress): Uint8Array { + return MsgSetWithdrawAddress.encode(message).finish(); + }, + toProtoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.encode(message).finish() + }; + } +}; +function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressResponse { + return {}; +} +export const MsgSetWithdrawAddressResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + encode(_: MsgSetWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetWithdrawAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; + }, + fromAmino(_: MsgSetWithdrawAddressResponseAmino): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; + }, + toAmino(_: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetWithdrawAddressResponseAminoMsg): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSetWithdrawAddressResponse", + value: MsgSetWithdrawAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetWithdrawAddressResponseProtoMsg): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.decode(message.value); + }, + toProto(message: MsgSetWithdrawAddressResponse): Uint8Array { + return MsgSetWithdrawAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + value: MsgSetWithdrawAddressResponse.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { + return { + delegatorAddress: "", + validatorAddress: "" + }; +} +export const MsgWithdrawDelegatorReward = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + encode(message: MsgWithdrawDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegatorReward(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawDelegatorRewardAmino): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: MsgWithdrawDelegatorRewardAminoMsg): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawDelegationReward", + value: MsgWithdrawDelegatorReward.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawDelegatorRewardProtoMsg): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.decode(message.value); + }, + toProto(message: MsgWithdrawDelegatorReward): Uint8Array { + return MsgWithdrawDelegatorReward.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { + return { + amount: [] + }; +} +export const MsgWithdrawDelegatorRewardResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + encode(message: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgWithdrawDelegatorRewardResponseAminoMsg): MsgWithdrawDelegatorRewardResponse { + return MsgWithdrawDelegatorRewardResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse", + value: MsgWithdrawDelegatorRewardResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawDelegatorRewardResponseProtoMsg): MsgWithdrawDelegatorRewardResponse { + return MsgWithdrawDelegatorRewardResponse.decode(message.value); + }, + toProto(message: MsgWithdrawDelegatorRewardResponse): Uint8Array { + return MsgWithdrawDelegatorRewardResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + value: MsgWithdrawDelegatorRewardResponse.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommission { + return { + validatorAddress: "" + }; +} +export const MsgWithdrawValidatorCommission = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + encode(message: MsgWithdrawValidatorCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawValidatorCommission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawValidatorCommission { + const message = createBaseMsgWithdrawValidatorCommission(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawValidatorCommissionAmino): MsgWithdrawValidatorCommission { + const message = createBaseMsgWithdrawValidatorCommission(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: MsgWithdrawValidatorCommissionAminoMsg): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawValidatorCommissionProtoMsg): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.decode(message.value); + }, + toProto(message: MsgWithdrawValidatorCommission): Uint8Array { + return MsgWithdrawValidatorCommission.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { + return { + amount: [] + }; +} +export const MsgWithdrawValidatorCommissionResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + encode(message: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgWithdrawValidatorCommissionResponseAminoMsg): MsgWithdrawValidatorCommissionResponse { + return MsgWithdrawValidatorCommissionResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse", + value: MsgWithdrawValidatorCommissionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawValidatorCommissionResponseProtoMsg): MsgWithdrawValidatorCommissionResponse { + return MsgWithdrawValidatorCommissionResponse.decode(message.value); + }, + toProto(message: MsgWithdrawValidatorCommissionResponse): Uint8Array { + return MsgWithdrawValidatorCommissionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + value: MsgWithdrawValidatorCommissionResponse.encode(message).finish() + }; + } +}; +function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { + return { + amount: [], + depositor: "" + }; +} +export const MsgFundCommunityPool = { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + encode(message: MsgFundCommunityPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundCommunityPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.depositor = object.depositor ?? ""; + return message; + }, + fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; + }, + toAmino(message: MsgFundCommunityPool): MsgFundCommunityPoolAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.depositor = message.depositor === "" ? undefined : message.depositor; + return obj; + }, + fromAminoMsg(object: MsgFundCommunityPoolAminoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolAminoMsg { + return { + type: "cosmos-sdk/MsgFundCommunityPool", + value: MsgFundCommunityPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundCommunityPoolProtoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.decode(message.value); + }, + toProto(message: MsgFundCommunityPool): Uint8Array { + return MsgFundCommunityPool.encode(message).finish(); + }, + toProtoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.encode(message).finish() + }; + } +}; +function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse { + return {}; +} +export const MsgFundCommunityPoolResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + encode(_: MsgFundCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundCommunityPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse(); + return message; + }, + fromAmino(_: MsgFundCommunityPoolResponseAmino): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse(); + return message; + }, + toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgFundCommunityPoolResponseAminoMsg): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAminoMsg { + return { + type: "cosmos-sdk/MsgFundCommunityPoolResponse", + value: MsgFundCommunityPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgFundCommunityPoolResponseProtoMsg): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.decode(message.value); + }, + toProto(message: MsgFundCommunityPoolResponse): Uint8Array { + return MsgFundCommunityPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + value: MsgFundCommunityPoolResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/feegrant.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/feegrant.ts new file mode 100644 index 00000000..85da5d08 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/feegrant.ts @@ -0,0 +1,632 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** + * BasicAllowance implements Allowance with a one-time grant of tokens + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowance { + $typeUrl?: "/cosmos.feegrant.v1beta1.BasicAllowance"; + /** + * spend_limit specifies the maximum amount of tokens that can be spent + * by this allowance and will be updated as tokens are spent. If it is + * empty, there is no spend limit and any amount of coins can be spent. + */ + spendLimit: Coin[]; + /** expiration specifies an optional time when this allowance expires */ + expiration?: Date; +} +export interface BasicAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance"; + value: Uint8Array; +} +/** + * BasicAllowance implements Allowance with a one-time grant of tokens + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowanceAmino { + /** + * spend_limit specifies the maximum amount of tokens that can be spent + * by this allowance and will be updated as tokens are spent. If it is + * empty, there is no spend limit and any amount of coins can be spent. + */ + spend_limit?: CoinAmino[]; + /** expiration specifies an optional time when this allowance expires */ + expiration?: string; +} +export interface BasicAllowanceAminoMsg { + type: "cosmos-sdk/BasicAllowance"; + value: BasicAllowanceAmino; +} +/** + * BasicAllowance implements Allowance with a one-time grant of tokens + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowanceSDKType { + $typeUrl?: "/cosmos.feegrant.v1beta1.BasicAllowance"; + spend_limit: CoinSDKType[]; + expiration?: Date; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowance { + $typeUrl?: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; + /** basic specifies a struct of `BasicAllowance` */ + basic: BasicAllowance; + /** + * period specifies the time duration in which period_spend_limit coins can + * be spent before that allowance is reset + */ + period: Duration; + /** + * period_spend_limit specifies the maximum number of coins that can be spent + * in the period + */ + periodSpendLimit: Coin[]; + /** period_can_spend is the number of coins left to be spent before the period_reset time */ + periodCanSpend: Coin[]; + /** + * period_reset is the time at which this period resets and a new one begins, + * it is calculated from the start time of the first transaction after the + * last period ended + */ + periodReset: Date; +} +export interface PeriodicAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; + value: Uint8Array; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowanceAmino { + /** basic specifies a struct of `BasicAllowance` */ + basic?: BasicAllowanceAmino; + /** + * period specifies the time duration in which period_spend_limit coins can + * be spent before that allowance is reset + */ + period?: DurationAmino; + /** + * period_spend_limit specifies the maximum number of coins that can be spent + * in the period + */ + period_spend_limit?: CoinAmino[]; + /** period_can_spend is the number of coins left to be spent before the period_reset time */ + period_can_spend?: CoinAmino[]; + /** + * period_reset is the time at which this period resets and a new one begins, + * it is calculated from the start time of the first transaction after the + * last period ended + */ + period_reset?: string; +} +export interface PeriodicAllowanceAminoMsg { + type: "cosmos-sdk/PeriodicAllowance"; + value: PeriodicAllowanceAmino; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowanceSDKType { + $typeUrl?: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; + basic: BasicAllowanceSDKType; + period: DurationSDKType; + period_spend_limit: CoinSDKType[]; + period_can_spend: CoinSDKType[]; + period_reset: Date; +} +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowance { + $typeUrl?: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + /** allowance can be any of basic and periodic fee allowance. */ + allowance?: BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any | undefined; + /** allowed_messages are the messages for which the grantee has the access. */ + allowedMessages: string[]; +} +export interface AllowedMsgAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + value: Uint8Array; +} +export type AllowedMsgAllowanceEncoded = Omit & { + /** allowance can be any of basic and periodic fee allowance. */allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined; +}; +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowanceAmino { + /** allowance can be any of basic and periodic fee allowance. */ + allowance?: AnyAmino; + /** allowed_messages are the messages for which the grantee has the access. */ + allowed_messages?: string[]; +} +export interface AllowedMsgAllowanceAminoMsg { + type: "cosmos-sdk/AllowedMsgAllowance"; + value: AllowedMsgAllowanceAmino; +} +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowanceSDKType { + $typeUrl?: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; + allowed_messages: string[]; +} +/** Grant is stored in the KVStore to record a grant with full context */ +export interface Grant { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any | undefined; +} +export interface GrantProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.Grant"; + value: Uint8Array; +} +export type GrantEncoded = Omit & { + /** allowance can be any of basic, periodic, allowed fee allowance. */allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined; +}; +/** Grant is stored in the KVStore to record a grant with full context */ +export interface GrantAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: AnyAmino; +} +export interface GrantAminoMsg { + type: "cosmos-sdk/Grant"; + value: GrantAmino; +} +/** Grant is stored in the KVStore to record a grant with full context */ +export interface GrantSDKType { + granter: string; + grantee: string; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; +} +function createBaseBasicAllowance(): BasicAllowance { + return { + $typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + spendLimit: [], + expiration: undefined + }; +} +export const BasicAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + encode(message: BasicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.spendLimit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BasicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBasicAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spendLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BasicAllowance { + const message = createBaseBasicAllowance(); + message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: BasicAllowanceAmino): BasicAllowance { + const message = createBaseBasicAllowance(); + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: BasicAllowance): BasicAllowanceAmino { + const obj: any = {}; + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.spend_limit = message.spendLimit; + } + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { + return BasicAllowance.fromAmino(object.value); + }, + toAminoMsg(message: BasicAllowance): BasicAllowanceAminoMsg { + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: BasicAllowanceProtoMsg): BasicAllowance { + return BasicAllowance.decode(message.value); + }, + toProto(message: BasicAllowance): Uint8Array { + return BasicAllowance.encode(message).finish(); + }, + toProtoMsg(message: BasicAllowance): BasicAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + value: BasicAllowance.encode(message).finish() + }; + } +}; +function createBasePeriodicAllowance(): PeriodicAllowance { + return { + $typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + basic: BasicAllowance.fromPartial({}), + period: Duration.fromPartial({}), + periodSpendLimit: [], + periodCanSpend: [], + periodReset: new Date() + }; +} +export const PeriodicAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + encode(message: PeriodicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.basic !== undefined) { + BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim(); + } + if (message.period !== undefined) { + Duration.encode(message.period, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.periodSpendLimit) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.periodCanSpend) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.periodReset !== undefined) { + Timestamp.encode(toTimestamp(message.periodReset), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriodicAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.basic = BasicAllowance.decode(reader, reader.uint32()); + break; + case 2: + message.period = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.periodSpendLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.periodCanSpend.push(Coin.decode(reader, reader.uint32())); + break; + case 5: + message.periodReset = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PeriodicAllowance { + const message = createBasePeriodicAllowance(); + message.basic = object.basic !== undefined && object.basic !== null ? BasicAllowance.fromPartial(object.basic) : undefined; + message.period = object.period !== undefined && object.period !== null ? Duration.fromPartial(object.period) : undefined; + message.periodSpendLimit = object.periodSpendLimit?.map(e => Coin.fromPartial(e)) || []; + message.periodCanSpend = object.periodCanSpend?.map(e => Coin.fromPartial(e)) || []; + message.periodReset = object.periodReset ?? undefined; + return message; + }, + fromAmino(object: PeriodicAllowanceAmino): PeriodicAllowance { + const message = createBasePeriodicAllowance(); + if (object.basic !== undefined && object.basic !== null) { + message.basic = BasicAllowance.fromAmino(object.basic); + } + if (object.period !== undefined && object.period !== null) { + message.period = Duration.fromAmino(object.period); + } + message.periodSpendLimit = object.period_spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.periodCanSpend = object.period_can_spend?.map(e => Coin.fromAmino(e)) || []; + if (object.period_reset !== undefined && object.period_reset !== null) { + message.periodReset = fromTimestamp(Timestamp.fromAmino(object.period_reset)); + } + return message; + }, + toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { + const obj: any = {}; + obj.basic = message.basic ? BasicAllowance.toAmino(message.basic) : undefined; + obj.period = message.period ? Duration.toAmino(message.period) : undefined; + if (message.periodSpendLimit) { + obj.period_spend_limit = message.periodSpendLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.period_spend_limit = message.periodSpendLimit; + } + if (message.periodCanSpend) { + obj.period_can_spend = message.periodCanSpend.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.period_can_spend = message.periodCanSpend; + } + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : undefined; + return obj; + }, + fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { + return PeriodicAllowance.fromAmino(object.value); + }, + toAminoMsg(message: PeriodicAllowance): PeriodicAllowanceAminoMsg { + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodicAllowanceProtoMsg): PeriodicAllowance { + return PeriodicAllowance.decode(message.value); + }, + toProto(message: PeriodicAllowance): Uint8Array { + return PeriodicAllowance.encode(message).finish(); + }, + toProtoMsg(message: PeriodicAllowance): PeriodicAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + value: PeriodicAllowance.encode(message).finish() + }; + } +}; +function createBaseAllowedMsgAllowance(): AllowedMsgAllowance { + return { + $typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + allowance: undefined, + allowedMessages: [] + }; +} +export const AllowedMsgAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + encode(message: AllowedMsgAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowance !== undefined) { + Any.encode(message.allowance as Any, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.allowedMessages) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllowedMsgAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllowedMsgAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowance = Cosmos_feegrantFeeAllowanceI_InterfaceDecoder(reader) as Any; + break; + case 2: + message.allowedMessages.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllowedMsgAllowance { + const message = createBaseAllowedMsgAllowance(); + message.allowance = object.allowance !== undefined && object.allowance !== null ? Any.fromPartial(object.allowance) : undefined; + message.allowedMessages = object.allowedMessages?.map(e => e) || []; + return message; + }, + fromAmino(object: AllowedMsgAllowanceAmino): AllowedMsgAllowance { + const message = createBaseAllowedMsgAllowance(); + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Cosmos_feegrantFeeAllowanceI_FromAmino(object.allowance); + } + message.allowedMessages = object.allowed_messages?.map(e => e) || []; + return message; + }, + toAmino(message: AllowedMsgAllowance): AllowedMsgAllowanceAmino { + const obj: any = {}; + obj.allowance = message.allowance ? Cosmos_feegrantFeeAllowanceI_ToAmino(message.allowance as Any) : undefined; + if (message.allowedMessages) { + obj.allowed_messages = message.allowedMessages.map(e => e); + } else { + obj.allowed_messages = message.allowedMessages; + } + return obj; + }, + fromAminoMsg(object: AllowedMsgAllowanceAminoMsg): AllowedMsgAllowance { + return AllowedMsgAllowance.fromAmino(object.value); + }, + toAminoMsg(message: AllowedMsgAllowance): AllowedMsgAllowanceAminoMsg { + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: AllowedMsgAllowanceProtoMsg): AllowedMsgAllowance { + return AllowedMsgAllowance.decode(message.value); + }, + toProto(message: AllowedMsgAllowance): Uint8Array { + return AllowedMsgAllowance.encode(message).finish(); + }, + toProtoMsg(message: AllowedMsgAllowance): AllowedMsgAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + value: AllowedMsgAllowance.encode(message).finish() + }; + } +}; +function createBaseGrant(): Grant { + return { + granter: "", + grantee: "", + allowance: undefined + }; +} +export const Grant = { + typeUrl: "/cosmos.feegrant.v1beta1.Grant", + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.allowance !== undefined) { + Any.encode(message.allowance as Any, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.allowance = Cosmos_feegrantFeeAllowanceI_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Grant { + const message = createBaseGrant(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = object.allowance !== undefined && object.allowance !== null ? Any.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: GrantAmino): Grant { + const message = createBaseGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Cosmos_feegrantFeeAllowanceI_FromAmino(object.allowance); + } + return message; + }, + toAmino(message: Grant): GrantAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.allowance = message.allowance ? Cosmos_feegrantFeeAllowanceI_ToAmino(message.allowance as Any) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAminoMsg): Grant { + return Grant.fromAmino(object.value); + }, + toAminoMsg(message: Grant): GrantAminoMsg { + return { + type: "cosmos-sdk/Grant", + value: Grant.toAmino(message) + }; + }, + fromProtoMsg(message: GrantProtoMsg): Grant { + return Grant.decode(message.value); + }, + toProto(message: Grant): Uint8Array { + return Grant.encode(message).finish(); + }, + toProtoMsg(message: Grant): GrantProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.Grant", + value: Grant.encode(message).finish() + }; + } +}; +export const Cosmos_feegrantFeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return BasicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return PeriodicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return AllowedMsgAllowance.decode(data.value); + default: + return data; + } +}; +export const Cosmos_feegrantFeeAllowanceI_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/BasicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + value: BasicAllowance.encode(BasicAllowance.fromPartial(BasicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/PeriodicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + value: PeriodicAllowance.encode(PeriodicAllowance.fromPartial(PeriodicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/AllowedMsgAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + value: AllowedMsgAllowance.encode(AllowedMsgAllowance.fromPartial(AllowedMsgAllowance.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_feegrantFeeAllowanceI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/genesis.ts new file mode 100644 index 00000000..2998b092 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/genesis.ts @@ -0,0 +1,94 @@ +//@ts-nocheck +import { Grant, GrantAmino, GrantSDKType } from "./feegrant"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisState { + allowances: Grant[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisStateAmino { + allowances?: GrantAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisStateSDKType { + allowances: GrantSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + allowances: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowances) { + Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowances.push(Grant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.allowances = object.allowances?.map(e => Grant.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); + } else { + obj.allowances = message.allowances; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..2db2960e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/query.rpc.Query.ts @@ -0,0 +1,56 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Allowance returns fee granted to the grantee by the granter. */ + allowance(request: QueryAllowanceRequest): Promise; + /** Allowances returns all the grants for address. */ + allowances(request: QueryAllowancesRequest): Promise; + /** + * AllowancesByGranter returns all the grants given by an address + * Since v0.46 + */ + allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.allowance = this.allowance.bind(this); + this.allowances = this.allowances.bind(this); + this.allowancesByGranter = this.allowancesByGranter.bind(this); + } + allowance(request: QueryAllowanceRequest): Promise { + const data = QueryAllowanceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowance", data); + return promise.then(data => QueryAllowanceResponse.decode(new BinaryReader(data))); + } + allowances(request: QueryAllowancesRequest): Promise { + const data = QueryAllowancesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowances", data); + return promise.then(data => QueryAllowancesResponse.decode(new BinaryReader(data))); + } + allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { + const data = QueryAllowancesByGranterRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "AllowancesByGranter", data); + return promise.then(data => QueryAllowancesByGranterResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + allowance(request: QueryAllowanceRequest): Promise { + return queryService.allowance(request); + }, + allowances(request: QueryAllowancesRequest): Promise { + return queryService.allowances(request); + }, + allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { + return queryService.allowancesByGranter(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/query.ts new file mode 100644 index 00000000..6deb455c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/query.ts @@ -0,0 +1,635 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Grant, GrantAmino, GrantSDKType } from "./feegrant"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ +export interface QueryAllowanceRequest { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface QueryAllowanceRequestProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest"; + value: Uint8Array; +} +/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ +export interface QueryAllowanceRequestAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; +} +export interface QueryAllowanceRequestAminoMsg { + type: "cosmos-sdk/QueryAllowanceRequest"; + value: QueryAllowanceRequestAmino; +} +/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ +export interface QueryAllowanceRequestSDKType { + granter: string; + grantee: string; +} +/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ +export interface QueryAllowanceResponse { + /** allowance is a allowance granted for grantee by granter. */ + allowance?: Grant; +} +export interface QueryAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse"; + value: Uint8Array; +} +/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ +export interface QueryAllowanceResponseAmino { + /** allowance is a allowance granted for grantee by granter. */ + allowance?: GrantAmino; +} +export interface QueryAllowanceResponseAminoMsg { + type: "cosmos-sdk/QueryAllowanceResponse"; + value: QueryAllowanceResponseAmino; +} +/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ +export interface QueryAllowanceResponseSDKType { + allowance?: GrantSDKType; +} +/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ +export interface QueryAllowancesRequest { + grantee: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAllowancesRequestProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest"; + value: Uint8Array; +} +/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ +export interface QueryAllowancesRequestAmino { + grantee?: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAllowancesRequestAminoMsg { + type: "cosmos-sdk/QueryAllowancesRequest"; + value: QueryAllowancesRequestAmino; +} +/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ +export interface QueryAllowancesRequestSDKType { + grantee: string; + pagination?: PageRequestSDKType; +} +/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ +export interface QueryAllowancesResponse { + /** allowances are allowance's granted for grantee by granter. */ + allowances: Grant[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} +export interface QueryAllowancesResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse"; + value: Uint8Array; +} +/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ +export interface QueryAllowancesResponseAmino { + /** allowances are allowance's granted for grantee by granter. */ + allowances?: GrantAmino[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllowancesResponseAminoMsg { + type: "cosmos-sdk/QueryAllowancesResponse"; + value: QueryAllowancesResponseAmino; +} +/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ +export interface QueryAllowancesResponseSDKType { + allowances: GrantSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterRequest { + granter: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAllowancesByGranterRequestProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest"; + value: Uint8Array; +} +/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterRequestAmino { + granter?: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAllowancesByGranterRequestAminoMsg { + type: "cosmos-sdk/QueryAllowancesByGranterRequest"; + value: QueryAllowancesByGranterRequestAmino; +} +/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterRequestSDKType { + granter: string; + pagination?: PageRequestSDKType; +} +/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterResponse { + /** allowances that have been issued by the granter. */ + allowances: Grant[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} +export interface QueryAllowancesByGranterResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse"; + value: Uint8Array; +} +/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterResponseAmino { + /** allowances that have been issued by the granter. */ + allowances?: GrantAmino[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllowancesByGranterResponseAminoMsg { + type: "cosmos-sdk/QueryAllowancesByGranterResponse"; + value: QueryAllowancesByGranterResponseAmino; +} +/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterResponseSDKType { + allowances: GrantSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryAllowanceRequest(): QueryAllowanceRequest { + return { + granter: "", + grantee: "" + }; +} +export const QueryAllowanceRequest = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest", + encode(message: QueryAllowanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowanceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowanceRequest { + const message = createBaseQueryAllowanceRequest(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: QueryAllowanceRequestAmino): QueryAllowanceRequest { + const message = createBaseQueryAllowanceRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: QueryAllowanceRequest): QueryAllowanceRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: QueryAllowanceRequestAminoMsg): QueryAllowanceRequest { + return QueryAllowanceRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowanceRequest): QueryAllowanceRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowanceRequest", + value: QueryAllowanceRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowanceRequestProtoMsg): QueryAllowanceRequest { + return QueryAllowanceRequest.decode(message.value); + }, + toProto(message: QueryAllowanceRequest): Uint8Array { + return QueryAllowanceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowanceRequest): QueryAllowanceRequestProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest", + value: QueryAllowanceRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllowanceResponse(): QueryAllowanceResponse { + return { + allowance: undefined + }; +} +export const QueryAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse", + encode(message: QueryAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowance !== undefined) { + Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowance = Grant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowanceResponse { + const message = createBaseQueryAllowanceResponse(); + message.allowance = object.allowance !== undefined && object.allowance !== null ? Grant.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: QueryAllowanceResponseAmino): QueryAllowanceResponse { + const message = createBaseQueryAllowanceResponse(); + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Grant.fromAmino(object.allowance); + } + return message; + }, + toAmino(message: QueryAllowanceResponse): QueryAllowanceResponseAmino { + const obj: any = {}; + obj.allowance = message.allowance ? Grant.toAmino(message.allowance) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowanceResponseAminoMsg): QueryAllowanceResponse { + return QueryAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowanceResponse): QueryAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowanceResponse", + value: QueryAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowanceResponseProtoMsg): QueryAllowanceResponse { + return QueryAllowanceResponse.decode(message.value); + }, + toProto(message: QueryAllowanceResponse): Uint8Array { + return QueryAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowanceResponse): QueryAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse", + value: QueryAllowanceResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesRequest(): QueryAllowancesRequest { + return { + grantee: "", + pagination: undefined + }; +} +export const QueryAllowancesRequest = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest", + encode(message: QueryAllowancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesRequest { + const message = createBaseQueryAllowancesRequest(); + message.grantee = object.grantee ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesRequestAmino): QueryAllowancesRequest { + const message = createBaseQueryAllowancesRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesRequest): QueryAllowancesRequestAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesRequestAminoMsg): QueryAllowancesRequest { + return QueryAllowancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesRequest): QueryAllowancesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesRequest", + value: QueryAllowancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesRequestProtoMsg): QueryAllowancesRequest { + return QueryAllowancesRequest.decode(message.value); + }, + toProto(message: QueryAllowancesRequest): Uint8Array { + return QueryAllowancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesRequest): QueryAllowancesRequestProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest", + value: QueryAllowancesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesResponse(): QueryAllowancesResponse { + return { + allowances: [], + pagination: undefined + }; +} +export const QueryAllowancesResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse", + encode(message: QueryAllowancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowances) { + Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowances.push(Grant.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesResponse { + const message = createBaseQueryAllowancesResponse(); + message.allowances = object.allowances?.map(e => Grant.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesResponseAmino): QueryAllowancesResponse { + const message = createBaseQueryAllowancesResponse(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesResponse): QueryAllowancesResponseAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); + } else { + obj.allowances = message.allowances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesResponseAminoMsg): QueryAllowancesResponse { + return QueryAllowancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesResponse): QueryAllowancesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesResponse", + value: QueryAllowancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesResponseProtoMsg): QueryAllowancesResponse { + return QueryAllowancesResponse.decode(message.value); + }, + toProto(message: QueryAllowancesResponse): Uint8Array { + return QueryAllowancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesResponse): QueryAllowancesResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse", + value: QueryAllowancesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesByGranterRequest(): QueryAllowancesByGranterRequest { + return { + granter: "", + pagination: undefined + }; +} +export const QueryAllowancesByGranterRequest = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", + encode(message: QueryAllowancesByGranterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesByGranterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesByGranterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesByGranterRequest { + const message = createBaseQueryAllowancesByGranterRequest(); + message.granter = object.granter ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesByGranterRequestAmino): QueryAllowancesByGranterRequest { + const message = createBaseQueryAllowancesByGranterRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesByGranterRequest): QueryAllowancesByGranterRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesByGranterRequestAminoMsg): QueryAllowancesByGranterRequest { + return QueryAllowancesByGranterRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesByGranterRequest): QueryAllowancesByGranterRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesByGranterRequest", + value: QueryAllowancesByGranterRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesByGranterRequestProtoMsg): QueryAllowancesByGranterRequest { + return QueryAllowancesByGranterRequest.decode(message.value); + }, + toProto(message: QueryAllowancesByGranterRequest): Uint8Array { + return QueryAllowancesByGranterRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesByGranterRequest): QueryAllowancesByGranterRequestProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", + value: QueryAllowancesByGranterRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesByGranterResponse(): QueryAllowancesByGranterResponse { + return { + allowances: [], + pagination: undefined + }; +} +export const QueryAllowancesByGranterResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", + encode(message: QueryAllowancesByGranterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowances) { + Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesByGranterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesByGranterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowances.push(Grant.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesByGranterResponse { + const message = createBaseQueryAllowancesByGranterResponse(); + message.allowances = object.allowances?.map(e => Grant.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesByGranterResponseAmino): QueryAllowancesByGranterResponse { + const message = createBaseQueryAllowancesByGranterResponse(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesByGranterResponse): QueryAllowancesByGranterResponseAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); + } else { + obj.allowances = message.allowances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesByGranterResponseAminoMsg): QueryAllowancesByGranterResponse { + return QueryAllowancesByGranterResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesByGranterResponse): QueryAllowancesByGranterResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesByGranterResponse", + value: QueryAllowancesByGranterResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesByGranterResponseProtoMsg): QueryAllowancesByGranterResponse { + return QueryAllowancesByGranterResponse.decode(message.value); + }, + toProto(message: QueryAllowancesByGranterResponse): Uint8Array { + return QueryAllowancesByGranterResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesByGranterResponse): QueryAllowancesByGranterResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", + value: QueryAllowancesByGranterResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.amino.ts new file mode 100644 index 00000000..4caf0da6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgGrantAllowance, MsgRevokeAllowance } from "./tx"; +export const AminoConverter = { + "/cosmos.feegrant.v1beta1.MsgGrantAllowance": { + aminoType: "cosmos-sdk/MsgGrantAllowance", + toAmino: MsgGrantAllowance.toAmino, + fromAmino: MsgGrantAllowance.fromAmino + }, + "/cosmos.feegrant.v1beta1.MsgRevokeAllowance": { + aminoType: "cosmos-sdk/MsgRevokeAllowance", + toAmino: MsgRevokeAllowance.toAmino, + fromAmino: MsgRevokeAllowance.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.registry.ts new file mode 100644 index 00000000..0ef6e3bc --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgGrantAllowance, MsgRevokeAllowance } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.encode(value).finish() + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.encode(value).finish() + }; + } + }, + withTypeUrl: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value + }; + } + }, + fromPartial: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.fromPartial(value) + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..ab613eab --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse } from "./tx"; +/** Msg defines the feegrant msg service. */ +export interface Msg { + /** + * GrantAllowance grants fee allowance to the grantee on the granter's + * account with the provided expiration time. + */ + grantAllowance(request: MsgGrantAllowance): Promise; + /** + * RevokeAllowance revokes any fee allowance of granter's account that + * has been granted to the grantee. + */ + revokeAllowance(request: MsgRevokeAllowance): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.grantAllowance = this.grantAllowance.bind(this); + this.revokeAllowance = this.revokeAllowance.bind(this); + } + grantAllowance(request: MsgGrantAllowance): Promise { + const data = MsgGrantAllowance.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "GrantAllowance", data); + return promise.then(data => MsgGrantAllowanceResponse.decode(new BinaryReader(data))); + } + revokeAllowance(request: MsgRevokeAllowance): Promise { + const data = MsgRevokeAllowance.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "RevokeAllowance", data); + return promise.then(data => MsgRevokeAllowanceResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.ts new file mode 100644 index 00000000..6bcc95d6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/feegrant/v1beta1/tx.ts @@ -0,0 +1,445 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BasicAllowance, BasicAllowanceProtoMsg, BasicAllowanceSDKType, PeriodicAllowance, PeriodicAllowanceProtoMsg, PeriodicAllowanceSDKType, AllowedMsgAllowance, AllowedMsgAllowanceProtoMsg, AllowedMsgAllowanceSDKType } from "./feegrant"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any | undefined; +} +export interface MsgGrantAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; + value: Uint8Array; +} +export type MsgGrantAllowanceEncoded = Omit & { + /** allowance can be any of basic, periodic, allowed fee allowance. */allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined; +}; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: AnyAmino; +} +export interface MsgGrantAllowanceAminoMsg { + type: "cosmos-sdk/MsgGrantAllowance"; + value: MsgGrantAllowanceAmino; +} +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowanceSDKType { + granter: string; + grantee: string; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponse {} +export interface MsgGrantAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse"; + value: Uint8Array; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponseAmino {} +export interface MsgGrantAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgGrantAllowanceResponse"; + value: MsgGrantAllowanceResponseAmino; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponseSDKType {} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface MsgRevokeAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance"; + value: Uint8Array; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; +} +export interface MsgRevokeAllowanceAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowance"; + value: MsgRevokeAllowanceAmino; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowanceSDKType { + granter: string; + grantee: string; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponse {} +export interface MsgRevokeAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse"; + value: Uint8Array; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponseAmino {} +export interface MsgRevokeAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowanceResponse"; + value: MsgRevokeAllowanceResponseAmino; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponseSDKType {} +function createBaseMsgGrantAllowance(): MsgGrantAllowance { + return { + granter: "", + grantee: "", + allowance: undefined + }; +} +export const MsgGrantAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + encode(message: MsgGrantAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.allowance !== undefined) { + Any.encode(message.allowance as Any, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.allowance = Cosmos_feegrantFeeAllowanceI_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = object.allowance !== undefined && object.allowance !== null ? Any.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: MsgGrantAllowanceAmino): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Cosmos_feegrantFeeAllowanceI_FromAmino(object.allowance); + } + return message; + }, + toAmino(message: MsgGrantAllowance): MsgGrantAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.allowance = message.allowance ? Cosmos_feegrantFeeAllowanceI_ToAmino(message.allowance as Any) : undefined; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceAminoMsg): MsgGrantAllowance { + return MsgGrantAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowance): MsgGrantAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowance", + value: MsgGrantAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceProtoMsg): MsgGrantAllowance { + return MsgGrantAllowance.decode(message.value); + }, + toProto(message: MsgGrantAllowance): Uint8Array { + return MsgGrantAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowance): MsgGrantAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.encode(message).finish() + }; + } +}; +function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { + return {}; +} +export const MsgGrantAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + encode(_: MsgGrantAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + fromAmino(_: MsgGrantAllowanceResponseAmino): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + toAmino(_: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceResponseAminoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceResponseProtoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.decode(message.value); + }, + toProto(message: MsgGrantAllowanceResponse): Uint8Array { + return MsgGrantAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { + return { + granter: "", + grantee: "" + }; +} +export const MsgRevokeAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + encode(message: MsgRevokeAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: MsgRevokeAllowanceAmino): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: MsgRevokeAllowance): MsgRevokeAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceAminoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowance", + value: MsgRevokeAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceProtoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.decode(message.value); + }, + toProto(message: MsgRevokeAllowance): Uint8Array { + return MsgRevokeAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.encode(message).finish() + }; + } +}; +function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { + return {}; +} +export const MsgRevokeAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + encode(_: MsgRevokeAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + fromAmino(_: MsgRevokeAllowanceResponseAmino): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + toAmino(_: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceResponseAminoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceResponseProtoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.decode(message.value); + }, + toProto(message: MsgRevokeAllowanceResponse): Uint8Array { + return MsgRevokeAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.encode(message).finish() + }; + } +}; +export const Cosmos_feegrantFeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return BasicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return PeriodicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return AllowedMsgAllowance.decode(data.value); + default: + return data; + } +}; +export const Cosmos_feegrantFeeAllowanceI_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/BasicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + value: BasicAllowance.encode(BasicAllowance.fromPartial(BasicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/PeriodicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + value: PeriodicAllowance.encode(PeriodicAllowance.fromPartial(PeriodicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/AllowedMsgAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + value: AllowedMsgAllowance.encode(AllowedMsgAllowance.fromPartial(AllowedMsgAllowance.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_feegrantFeeAllowanceI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/genesis.ts new file mode 100644 index 00000000..1c20fcef --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/genesis.ts @@ -0,0 +1,202 @@ +//@ts-nocheck +import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType } from "./gov"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisState { + /** starting_proposal_id is the ID of the starting proposal. */ + startingProposalId: bigint; + /** deposits defines all the deposits present at genesis. */ + deposits: Deposit[]; + /** votes defines all the votes present at genesis. */ + votes: Vote[]; + /** proposals defines all the proposals present at genesis. */ + proposals: Proposal[]; + /** params defines all the paramaters of related to deposit. */ + depositParams?: DepositParams; + /** params defines all the paramaters of related to voting. */ + votingParams?: VotingParams; + /** params defines all the paramaters of related to tally. */ + tallyParams?: TallyParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.gov.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateAmino { + /** starting_proposal_id is the ID of the starting proposal. */ + starting_proposal_id?: string; + /** deposits defines all the deposits present at genesis. */ + deposits?: DepositAmino[]; + /** votes defines all the votes present at genesis. */ + votes?: VoteAmino[]; + /** proposals defines all the proposals present at genesis. */ + proposals?: ProposalAmino[]; + /** params defines all the paramaters of related to deposit. */ + deposit_params?: DepositParamsAmino; + /** params defines all the paramaters of related to voting. */ + voting_params?: VotingParamsAmino; + /** params defines all the paramaters of related to tally. */ + tally_params?: TallyParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/v1/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateSDKType { + starting_proposal_id: bigint; + deposits: DepositSDKType[]; + votes: VoteSDKType[]; + proposals: ProposalSDKType[]; + deposit_params?: DepositParamsSDKType; + voting_params?: VotingParamsSDKType; + tally_params?: TallyParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + startingProposalId: BigInt(0), + deposits: [], + votes: [], + proposals: [], + depositParams: undefined, + votingParams: undefined, + tallyParams: undefined + }; +} +export const GenesisState = { + typeUrl: "/cosmos.gov.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startingProposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.startingProposalId); + } + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim(); + } + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startingProposalId = reader.uint64(); + break; + case 2: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 3: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 4: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 5: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 6: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 7: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? BigInt(object.startingProposalId.toString()) : BigInt(0); + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.depositParams = object.depositParams !== undefined && object.depositParams !== null ? DepositParams.fromPartial(object.depositParams) : undefined; + message.votingParams = object.votingParams !== undefined && object.votingParams !== null ? VotingParams.fromPartial(object.votingParams) : undefined; + message.tallyParams = object.tallyParams !== undefined && object.tallyParams !== null ? TallyParams.fromPartial(object.tallyParams) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.starting_proposal_id !== undefined && object.starting_proposal_id !== null) { + message.startingProposalId = BigInt(object.starting_proposal_id); + } + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.starting_proposal_id = message.startingProposalId !== BigInt(0) ? message.startingProposalId.toString() : undefined; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/v1/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/gov.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/gov.ts new file mode 100644 index 00000000..2cb75004 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/gov.ts @@ -0,0 +1,1240 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given governance proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** + * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + case 2: + case "PROPOSAL_STATUS_VOTING_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + case 3: + case "PROPOSAL_STATUS_PASSED": + return ProposalStatus.PROPOSAL_STATUS_PASSED; + case 4: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 5: + case "PROPOSAL_STATUS_FAILED": + return ProposalStatus.PROPOSAL_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return "PROPOSAL_STATUS_VOTING_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return "PROPOSAL_STATUS_PASSED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return "PROPOSAL_STATUS_FAILED"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOption { + option: VoteOption; + weight: string; +} +export interface WeightedVoteOptionProtoMsg { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption"; + value: Uint8Array; +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOptionAmino { + option?: VoteOption; + weight?: string; +} +export interface WeightedVoteOptionAminoMsg { + type: "cosmos-sdk/v1/WeightedVoteOption"; + value: WeightedVoteOptionAmino; +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOptionSDKType { + option: VoteOption; + weight: string; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface Deposit { + proposalId: bigint; + depositor: string; + amount: Coin[]; +} +export interface DepositProtoMsg { + typeUrl: "/cosmos.gov.v1.Deposit"; + value: Uint8Array; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositAmino { + proposal_id?: string; + depositor?: string; + amount?: CoinAmino[]; +} +export interface DepositAminoMsg { + type: "cosmos-sdk/v1/Deposit"; + value: DepositAmino; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositSDKType { + proposal_id: bigint; + depositor: string; + amount: CoinSDKType[]; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface Proposal { + id: bigint; + messages: Any[]; + status: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + finalTallyResult?: TallyResult; + submitTime?: Date; + depositEndTime?: Date; + totalDeposit: Coin[]; + votingStartTime?: Date; + votingEndTime?: Date; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; +} +export interface ProposalProtoMsg { + typeUrl: "/cosmos.gov.v1.Proposal"; + value: Uint8Array; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalAmino { + id?: string; + messages?: AnyAmino[]; + status?: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result?: TallyResultAmino; + submit_time?: string; + deposit_end_time?: string; + total_deposit?: CoinAmino[]; + voting_start_time?: string; + voting_end_time?: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata?: string; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/v1/Proposal"; + value: ProposalAmino; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalSDKType { + id: bigint; + messages: AnySDKType[]; + status: ProposalStatus; + final_tally_result?: TallyResultSDKType; + submit_time?: Date; + deposit_end_time?: Date; + total_deposit: CoinSDKType[]; + voting_start_time?: Date; + voting_end_time?: Date; + metadata: string; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResult { + yesCount: string; + abstainCount: string; + noCount: string; + noWithVetoCount: string; +} +export interface TallyResultProtoMsg { + typeUrl: "/cosmos.gov.v1.TallyResult"; + value: Uint8Array; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultAmino { + yes_count?: string; + abstain_count?: string; + no_count?: string; + no_with_veto_count?: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/v1/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultSDKType { + yes_count: string; + abstain_count: string; + no_count: string; + no_with_veto_count: string; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface Vote { + proposalId: bigint; + voter: string; + options: WeightedVoteOption[]; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata: string; +} +export interface VoteProtoMsg { + typeUrl: "/cosmos.gov.v1.Vote"; + value: Uint8Array; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteAmino { + proposal_id?: string; + voter?: string; + options?: WeightedVoteOptionAmino[]; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata?: string; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/v1/Vote"; + value: VoteAmino; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteSDKType { + proposal_id: bigint; + voter: string; + options: WeightedVoteOptionSDKType[]; + metadata: string; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParams { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod?: Duration; +} +export interface DepositParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.DepositParams"; + value: Uint8Array; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsAmino { + /** Minimum deposit for a proposal to enter voting period. */ + min_deposit?: CoinAmino[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + max_deposit_period?: DurationAmino; +} +export interface DepositParamsAminoMsg { + type: "cosmos-sdk/v1/DepositParams"; + value: DepositParamsAmino; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsSDKType { + min_deposit: CoinSDKType[]; + max_deposit_period?: DurationSDKType; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Length of the voting period. */ + votingPeriod?: Duration; +} +export interface VotingParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.VotingParams"; + value: Uint8Array; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsAmino { + /** Length of the voting period. */ + voting_period?: DurationAmino; +} +export interface VotingParamsAminoMsg { + type: "cosmos-sdk/v1/VotingParams"; + value: VotingParamsAmino; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsSDKType { + voting_period?: DurationSDKType; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + vetoThreshold: string; +} +export interface TallyParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.TallyParams"; + value: Uint8Array; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsAmino { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum?: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold?: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold?: string; +} +export interface TallyParamsAminoMsg { + type: "cosmos-sdk/v1/TallyParams"; + value: TallyParamsAmino; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsSDKType { + quorum: string; + threshold: string; + veto_threshold: string; +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: "" + }; +} +export const WeightedVoteOption = { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption", + encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.option !== 0) { + writer.uint32(8).int32(message.option); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightedVoteOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.option = reader.int32() as any; + break; + case 2: + message.weight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + message.option = object.option ?? 0; + message.weight = object.weight ?? ""; + return message; + }, + fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; + }, + toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { + const obj: any = {}; + obj.option = message.option === 0 ? undefined : message.option; + obj.weight = message.weight === "" ? undefined : message.weight; + return obj; + }, + fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { + return WeightedVoteOption.fromAmino(object.value); + }, + toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { + return { + type: "cosmos-sdk/v1/WeightedVoteOption", + value: WeightedVoteOption.toAmino(message) + }; + }, + fromProtoMsg(message: WeightedVoteOptionProtoMsg): WeightedVoteOption { + return WeightedVoteOption.decode(message.value); + }, + toProto(message: WeightedVoteOption): Uint8Array { + return WeightedVoteOption.encode(message).finish(); + }, + toProtoMsg(message: WeightedVoteOption): WeightedVoteOptionProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption", + value: WeightedVoteOption.encode(message).finish() + }; + } +}; +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const Deposit = { + typeUrl: "/cosmos.gov.v1.Deposit", + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Deposit { + const message = createBaseDeposit(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DepositAmino): Deposit { + const message = createBaseDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Deposit): DepositAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: DepositAminoMsg): Deposit { + return Deposit.fromAmino(object.value); + }, + toAminoMsg(message: Deposit): DepositAminoMsg { + return { + type: "cosmos-sdk/v1/Deposit", + value: Deposit.toAmino(message) + }; + }, + fromProtoMsg(message: DepositProtoMsg): Deposit { + return Deposit.decode(message.value); + }, + toProto(message: Deposit): Uint8Array { + return Deposit.encode(message).finish(); + }, + toProtoMsg(message: Deposit): DepositProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +function createBaseProposal(): Proposal { + return { + id: BigInt(0), + messages: [], + status: 0, + finalTallyResult: undefined, + submitTime: undefined, + depositEndTime: undefined, + totalDeposit: [], + votingStartTime: undefined, + votingEndTime: undefined, + metadata: "" + }; +} +export const Proposal = { + typeUrl: "/cosmos.gov.v1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + for (const v of message.messages) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status); + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim(); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + if (message.depositEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim(); + } + for (const v of message.totalDeposit) { + Coin.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.votingStartTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim(); + } + if (message.votingEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(82).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 3: + message.status = reader.int32() as any; + break; + case 4: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.depositEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.totalDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 9: + message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Proposal { + const message = createBaseProposal(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.status = object.status ?? 0; + message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; + message.submitTime = object.submitTime ?? undefined; + message.depositEndTime = object.depositEndTime ?? undefined; + message.totalDeposit = object.totalDeposit?.map(e => Coin.fromPartial(e)) || []; + message.votingStartTime = object.votingStartTime ?? undefined; + message.votingEndTime = object.votingEndTime ?? undefined; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + if (object.deposit_end_time !== undefined && object.deposit_end_time !== null) { + message.depositEndTime = fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)); + } + message.totalDeposit = object.total_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.voting_start_time !== undefined && object.voting_start_time !== null) { + message.votingStartTime = fromTimestamp(Timestamp.fromAmino(object.voting_start_time)); + } + if (object.voting_end_time !== undefined && object.voting_end_time !== null) { + message.votingEndTime = fromTimestamp(Timestamp.fromAmino(object.voting_end_time)); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.status = message.status === 0 ? undefined : message.status; + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; + if (message.totalDeposit) { + obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total_deposit = message.totalDeposit; + } + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + toAminoMsg(message: Proposal): ProposalAminoMsg { + return { + type: "cosmos-sdk/v1/Proposal", + value: Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.gov.v1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.yesCount !== "") { + writer.uint32(10).string(message.yesCount); + } + if (message.abstainCount !== "") { + writer.uint32(18).string(message.abstainCount); + } + if (message.noCount !== "") { + writer.uint32(26).string(message.noCount); + } + if (message.noWithVetoCount !== "") { + writer.uint32(34).string(message.noWithVetoCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yesCount = reader.string(); + break; + case 2: + message.abstainCount = reader.string(); + break; + case 3: + message.noCount = reader.string(); + break; + case 4: + message.noWithVetoCount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyResult { + const message = createBaseTallyResult(); + message.yesCount = object.yesCount ?? ""; + message.abstainCount = object.abstainCount ?? ""; + message.noCount = object.noCount ?? ""; + message.noWithVetoCount = object.noWithVetoCount ?? ""; + return message; + }, + fromAmino(object: TallyResultAmino): TallyResult { + const message = createBaseTallyResult(); + if (object.yes_count !== undefined && object.yes_count !== null) { + message.yesCount = object.yes_count; + } + if (object.abstain_count !== undefined && object.abstain_count !== null) { + message.abstainCount = object.abstain_count; + } + if (object.no_count !== undefined && object.no_count !== null) { + message.noCount = object.no_count; + } + if (object.no_with_veto_count !== undefined && object.no_with_veto_count !== null) { + message.noWithVetoCount = object.no_with_veto_count; + } + return message; + }, + toAmino(message: TallyResult): TallyResultAmino { + const obj: any = {}; + obj.yes_count = message.yesCount === "" ? undefined : message.yesCount; + obj.abstain_count = message.abstainCount === "" ? undefined : message.abstainCount; + obj.no_count = message.noCount === "" ? undefined : message.noCount; + obj.no_with_veto_count = message.noWithVetoCount === "" ? undefined : message.noWithVetoCount; + return obj; + }, + fromAminoMsg(object: TallyResultAminoMsg): TallyResult { + return TallyResult.fromAmino(object.value); + }, + toAminoMsg(message: TallyResult): TallyResultAminoMsg { + return { + type: "cosmos-sdk/v1/TallyResult", + value: TallyResult.toAmino(message) + }; + }, + fromProtoMsg(message: TallyResultProtoMsg): TallyResult { + return TallyResult.decode(message.value); + }, + toProto(message: TallyResult): Uint8Array { + return TallyResult.encode(message).finish(); + }, + toProtoMsg(message: TallyResult): TallyResultProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.TallyResult", + value: TallyResult.encode(message).finish() + }; + } +}; +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const Vote = { + typeUrl: "/cosmos.gov.v1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(42).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 4: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + case 5: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: VoteAmino): Vote { + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: Vote): VoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value); + }, + toAminoMsg(message: Vote): VoteAminoMsg { + return { + type: "cosmos-sdk/v1/Vote", + value: Vote.toAmino(message) + }; + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.Vote", + value: Vote.encode(message).finish() + }; + } +}; +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + maxDepositPeriod: undefined + }; +} +export const DepositParams = { + typeUrl: "/cosmos.gov.v1.DepositParams", + encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.minDeposit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.minDeposit?.map(e => Coin.fromPartial(e)) || []; + message.maxDepositPeriod = object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null ? Duration.fromPartial(object.maxDepositPeriod) : undefined; + return message; + }, + fromAmino(object: DepositParamsAmino): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + return message; + }, + toAmino(message: DepositParams): DepositParamsAmino { + const obj: any = {}; + if (message.minDeposit) { + obj.min_deposit = message.minDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.min_deposit = message.minDeposit; + } + obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; + return obj; + }, + fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { + return DepositParams.fromAmino(object.value); + }, + toAminoMsg(message: DepositParams): DepositParamsAminoMsg { + return { + type: "cosmos-sdk/v1/DepositParams", + value: DepositParams.toAmino(message) + }; + }, + fromProtoMsg(message: DepositParamsProtoMsg): DepositParams { + return DepositParams.decode(message.value); + }, + toProto(message: DepositParams): Uint8Array { + return DepositParams.encode(message).finish(); + }, + toProtoMsg(message: DepositParams): DepositParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.DepositParams", + value: DepositParams.encode(message).finish() + }; + } +}; +function createBaseVotingParams(): VotingParams { + return { + votingPeriod: undefined + }; +} +export const VotingParams = { + typeUrl: "/cosmos.gov.v1.VotingParams", + encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVotingParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VotingParams { + const message = createBaseVotingParams(); + message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; + return message; + }, + fromAmino(object: VotingParamsAmino): VotingParams { + const message = createBaseVotingParams(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + return message; + }, + toAmino(message: VotingParams): VotingParamsAmino { + const obj: any = {}; + obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; + return obj; + }, + fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { + return VotingParams.fromAmino(object.value); + }, + toAminoMsg(message: VotingParams): VotingParamsAminoMsg { + return { + type: "cosmos-sdk/v1/VotingParams", + value: VotingParams.toAmino(message) + }; + }, + fromProtoMsg(message: VotingParamsProtoMsg): VotingParams { + return VotingParams.decode(message.value); + }, + toProto(message: VotingParams): Uint8Array { + return VotingParams.encode(message).finish(); + }, + toProtoMsg(message: VotingParams): VotingParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.VotingParams", + value: VotingParams.encode(message).finish() + }; + } +}; +function createBaseTallyParams(): TallyParams { + return { + quorum: "", + threshold: "", + vetoThreshold: "" + }; +} +export const TallyParams = { + typeUrl: "/cosmos.gov.v1.TallyParams", + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quorum !== "") { + writer.uint32(10).string(message.quorum); + } + if (message.threshold !== "") { + writer.uint32(18).string(message.threshold); + } + if (message.vetoThreshold !== "") { + writer.uint32(26).string(message.vetoThreshold); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.string(); + break; + case 2: + message.threshold = reader.string(); + break; + case 3: + message.vetoThreshold = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyParams { + const message = createBaseTallyParams(); + message.quorum = object.quorum ?? ""; + message.threshold = object.threshold ?? ""; + message.vetoThreshold = object.vetoThreshold ?? ""; + return message; + }, + fromAmino(object: TallyParamsAmino): TallyParams { + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = object.quorum; + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = object.veto_threshold; + } + return message; + }, + toAmino(message: TallyParams): TallyParamsAmino { + const obj: any = {}; + obj.quorum = message.quorum === "" ? undefined : message.quorum; + obj.threshold = message.threshold === "" ? undefined : message.threshold; + obj.veto_threshold = message.vetoThreshold === "" ? undefined : message.vetoThreshold; + return obj; + }, + fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { + return TallyParams.fromAmino(object.value); + }, + toAminoMsg(message: TallyParams): TallyParamsAminoMsg { + return { + type: "cosmos-sdk/v1/TallyParams", + value: TallyParams.toAmino(message) + }; + }, + fromProtoMsg(message: TallyParamsProtoMsg): TallyParams { + return TallyParams.decode(message.value); + }, + toProto(message: TallyParams): Uint8Array { + return TallyParams.encode(message).finish(); + }, + toProtoMsg(message: TallyParams): TallyParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.TallyParams", + value: TallyParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/query.rpc.Query.ts new file mode 100644 index 00000000..9ed348ce --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/query.rpc.Query.ts @@ -0,0 +1,108 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +/** Query defines the gRPC querier service for gov module */ +export interface Query { + /** Proposal queries proposal details based on ProposalID. */ + proposal(request: QueryProposalRequest): Promise; + /** Proposals queries all proposals based on given status. */ + proposals(request: QueryProposalsRequest): Promise; + /** Vote queries voted information based on proposalID, voterAddr. */ + vote(request: QueryVoteRequest): Promise; + /** Votes queries votes of a given proposal. */ + votes(request: QueryVotesRequest): Promise; + /** Params queries all parameters of the gov module. */ + params(request: QueryParamsRequest): Promise; + /** Deposit queries single deposit information based proposalID, depositAddr. */ + deposit(request: QueryDepositRequest): Promise; + /** Deposits queries all deposits of a single proposal. */ + deposits(request: QueryDepositsRequest): Promise; + /** TallyResult queries the tally of a proposal vote. */ + tallyResult(request: QueryTallyResultRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.proposal = this.proposal.bind(this); + this.proposals = this.proposals.bind(this); + this.vote = this.vote.bind(this); + this.votes = this.votes.bind(this); + this.params = this.params.bind(this); + this.deposit = this.deposit.bind(this); + this.deposits = this.deposits.bind(this); + this.tallyResult = this.tallyResult.bind(this); + } + proposal(request: QueryProposalRequest): Promise { + const data = QueryProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposal", data); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); + } + proposals(request: QueryProposalsRequest): Promise { + const data = QueryProposalsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposals", data); + return promise.then(data => QueryProposalsResponse.decode(new BinaryReader(data))); + } + vote(request: QueryVoteRequest): Promise { + const data = QueryVoteRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Vote", data); + return promise.then(data => QueryVoteResponse.decode(new BinaryReader(data))); + } + votes(request: QueryVotesRequest): Promise { + const data = QueryVotesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Votes", data); + return promise.then(data => QueryVotesResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + deposit(request: QueryDepositRequest): Promise { + const data = QueryDepositRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposit", data); + return promise.then(data => QueryDepositResponse.decode(new BinaryReader(data))); + } + deposits(request: QueryDepositsRequest): Promise { + const data = QueryDepositsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposits", data); + return promise.then(data => QueryDepositsResponse.decode(new BinaryReader(data))); + } + tallyResult(request: QueryTallyResultRequest): Promise { + const data = QueryTallyResultRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "TallyResult", data); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + proposal(request: QueryProposalRequest): Promise { + return queryService.proposal(request); + }, + proposals(request: QueryProposalsRequest): Promise { + return queryService.proposals(request); + }, + vote(request: QueryVoteRequest): Promise { + return queryService.vote(request); + }, + votes(request: QueryVotesRequest): Promise { + return queryService.votes(request); + }, + params(request: QueryParamsRequest): Promise { + return queryService.params(request); + }, + deposit(request: QueryDepositRequest): Promise { + return queryService.deposit(request); + }, + deposits(request: QueryDepositsRequest): Promise { + return queryService.deposits(request); + }, + tallyResult(request: QueryTallyResultRequest): Promise { + return queryService.tallyResult(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/query.ts new file mode 100644 index 00000000..c0d13f73 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/query.ts @@ -0,0 +1,1679 @@ +//@ts-nocheck +import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType } from "./gov"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; +} +export interface QueryProposalRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalRequest"; + value: Uint8Array; +} +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; +} +export interface QueryProposalRequestAminoMsg { + type: "cosmos-sdk/v1/QueryProposalRequest"; + value: QueryProposalRequestAmino; +} +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequestSDKType { + proposal_id: bigint; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponse { + proposal?: Proposal; +} +export interface QueryProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalResponse"; + value: Uint8Array; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseAmino { + proposal?: ProposalAmino; +} +export interface QueryProposalResponseAminoMsg { + type: "cosmos-sdk/v1/QueryProposalResponse"; + value: QueryProposalResponseAmino; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseSDKType { + proposal?: ProposalSDKType; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequest { + /** proposal_status defines the status of the proposals. */ + proposalStatus: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryProposalsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalsRequest"; + value: Uint8Array; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequestAmino { + /** proposal_status defines the status of the proposals. */ + proposal_status?: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryProposalsRequestAminoMsg { + type: "cosmos-sdk/v1/QueryProposalsRequest"; + value: QueryProposalsRequestAmino; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequestSDKType { + proposal_status: ProposalStatus; + voter: string; + depositor: string; + pagination?: PageRequestSDKType; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponse { + proposals: Proposal[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryProposalsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalsResponse"; + value: Uint8Array; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponseAmino { + proposals?: ProposalAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryProposalsResponseAminoMsg { + type: "cosmos-sdk/v1/QueryProposalsResponse"; + value: QueryProposalsResponseAmino; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponseSDKType { + proposals: ProposalSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** voter defines the oter address for the proposals. */ + voter: string; +} +export interface QueryVoteRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVoteRequest"; + value: Uint8Array; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** voter defines the oter address for the proposals. */ + voter?: string; +} +export interface QueryVoteRequestAminoMsg { + type: "cosmos-sdk/v1/QueryVoteRequest"; + value: QueryVoteRequestAmino; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequestSDKType { + proposal_id: bigint; + voter: string; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponse { + /** vote defined the queried vote. */ + vote?: Vote; +} +export interface QueryVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVoteResponse"; + value: Uint8Array; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponseAmino { + /** vote defined the queried vote. */ + vote?: VoteAmino; +} +export interface QueryVoteResponseAminoMsg { + type: "cosmos-sdk/v1/QueryVoteResponse"; + value: QueryVoteResponseAmino; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponseSDKType { + vote?: VoteSDKType; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryVotesRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVotesRequest"; + value: Uint8Array; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryVotesRequestAminoMsg { + type: "cosmos-sdk/v1/QueryVotesRequest"; + value: QueryVotesRequestAmino; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponse { + /** votes defined the queried votes. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryVotesResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVotesResponse"; + value: Uint8Array; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponseAmino { + /** votes defined the queried votes. */ + votes?: VoteAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryVotesResponseAminoMsg { + type: "cosmos-sdk/v1/QueryVotesResponse"; + value: QueryVotesResponseAmino; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponseSDKType { + votes: VoteSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + paramsType: string; +} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + params_type?: string; +} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/v1/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType { + params_type: string; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** voting_params defines the parameters related to voting. */ + votingParams?: VotingParams; + /** deposit_params defines the parameters related to deposit. */ + depositParams?: DepositParams; + /** tally_params defines the parameters related to tally. */ + tallyParams?: TallyParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** voting_params defines the parameters related to voting. */ + voting_params?: VotingParamsAmino; + /** deposit_params defines the parameters related to deposit. */ + deposit_params?: DepositParamsAmino; + /** tally_params defines the parameters related to tally. */ + tally_params?: TallyParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/v1/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + voting_params?: VotingParamsSDKType; + deposit_params?: DepositParamsSDKType; + tally_params?: TallyParamsSDKType; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; +} +export interface QueryDepositRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositRequest"; + value: Uint8Array; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; +} +export interface QueryDepositRequestAminoMsg { + type: "cosmos-sdk/v1/QueryDepositRequest"; + value: QueryDepositRequestAmino; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequestSDKType { + proposal_id: bigint; + depositor: string; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponse { + /** deposit defines the requested deposit. */ + deposit?: Deposit; +} +export interface QueryDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositResponse"; + value: Uint8Array; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponseAmino { + /** deposit defines the requested deposit. */ + deposit?: DepositAmino; +} +export interface QueryDepositResponseAminoMsg { + type: "cosmos-sdk/v1/QueryDepositResponse"; + value: QueryDepositResponseAmino; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponseSDKType { + deposit?: DepositSDKType; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDepositsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositsRequest"; + value: Uint8Array; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDepositsRequestAminoMsg { + type: "cosmos-sdk/v1/QueryDepositsRequest"; + value: QueryDepositsRequestAmino; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponse { + deposits: Deposit[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDepositsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositsResponse"; + value: Uint8Array; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponseAmino { + deposits?: DepositAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDepositsResponseAminoMsg { + type: "cosmos-sdk/v1/QueryDepositsResponse"; + value: QueryDepositsResponseAmino; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponseSDKType { + deposits: DepositSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; +} +export interface QueryTallyResultRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest"; + value: Uint8Array; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; +} +export interface QueryTallyResultRequestAminoMsg { + type: "cosmos-sdk/v1/QueryTallyResultRequest"; + value: QueryTallyResultRequestAmino; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequestSDKType { + proposal_id: bigint; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally?: TallyResult; +} +export interface QueryTallyResultResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse"; + value: Uint8Array; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponseAmino { + /** tally defines the requested tally. */ + tally?: TallyResultAmino; +} +export interface QueryTallyResultResponseAminoMsg { + type: "cosmos-sdk/v1/QueryTallyResultResponse"; + value: QueryTallyResultResponseAmino; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponseSDKType { + tally?: TallyResultSDKType; +} +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryProposalRequest = { + typeUrl: "/cosmos.gov.v1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { + return QueryProposalRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalRequest", + value: QueryProposalRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { + return QueryProposalRequest.decode(message.value); + }, + toProto(message: QueryProposalRequest): Uint8Array { + return QueryProposalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalRequest): QueryProposalRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalRequest", + value: QueryProposalRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { + proposal: undefined + }; +} +export const QueryProposalResponse = { + typeUrl: "/cosmos.gov.v1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposal !== undefined) { + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + message.proposal = object.proposal !== undefined && object.proposal !== null ? Proposal.fromPartial(object.proposal) : undefined; + return message; + }, + fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; + }, + toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { + const obj: any = {}; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { + return QueryProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalResponse", + value: QueryProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { + return QueryProposalResponse.decode(message.value); + }, + toProto(message: QueryProposalResponse): Uint8Array { + return QueryProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalResponse): QueryProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalResponse", + value: QueryProposalResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsRequest(): QueryProposalsRequest { + return { + proposalStatus: 0, + voter: "", + depositor: "", + pagination: undefined + }; +} +export const QueryProposalsRequest = { + typeUrl: "/cosmos.gov.v1.QueryProposalsRequest", + encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalStatus !== 0) { + writer.uint32(8).int32(message.proposalStatus); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.depositor !== "") { + writer.uint32(26).string(message.depositor); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalStatus = reader.int32() as any; + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.depositor = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + message.proposalStatus = object.proposalStatus ?? 0; + message.voter = object.voter ?? ""; + message.depositor = object.depositor ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + if (object.proposal_status !== undefined && object.proposal_status !== null) { + message.proposalStatus = object.proposal_status; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { + const obj: any = {}; + obj.proposal_status = message.proposalStatus === 0 ? undefined : message.proposalStatus; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsRequestAminoMsg): QueryProposalsRequest { + return QueryProposalsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsRequest): QueryProposalsRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalsRequest", + value: QueryProposalsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsRequestProtoMsg): QueryProposalsRequest { + return QueryProposalsRequest.decode(message.value); + }, + toProto(message: QueryProposalsRequest): Uint8Array { + return QueryProposalsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsRequest): QueryProposalsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalsRequest", + value: QueryProposalsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { + proposals: [], + pagination: undefined + }; +} +export const QueryProposalsResponse = { + typeUrl: "/cosmos.gov.v1.QueryProposalsResponse", + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsResponseAminoMsg): QueryProposalsResponse { + return QueryProposalsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsResponse): QueryProposalsResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalsResponse", + value: QueryProposalsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsResponseProtoMsg): QueryProposalsResponse { + return QueryProposalsResponse.decode(message.value); + }, + toProto(message: QueryProposalsResponse): Uint8Array { + return QueryProposalsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsResponse): QueryProposalsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalsResponse", + value: QueryProposalsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVoteRequest(): QueryVoteRequest { + return { + proposalId: BigInt(0), + voter: "" + }; +} +export const QueryVoteRequest = { + typeUrl: "/cosmos.gov.v1.QueryVoteRequest", + encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + return obj; + }, + fromAminoMsg(object: QueryVoteRequestAminoMsg): QueryVoteRequest { + return QueryVoteRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteRequest): QueryVoteRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVoteRequest", + value: QueryVoteRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteRequestProtoMsg): QueryVoteRequest { + return QueryVoteRequest.decode(message.value); + }, + toProto(message: QueryVoteRequest): Uint8Array { + return QueryVoteRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteRequest): QueryVoteRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVoteRequest", + value: QueryVoteRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVoteResponse(): QueryVoteResponse { + return { + vote: undefined + }; +} +export const QueryVoteResponse = { + typeUrl: "/cosmos.gov.v1.QueryVoteResponse", + encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vote !== undefined) { + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + message.vote = object.vote !== undefined && object.vote !== null ? Vote.fromPartial(object.vote) : undefined; + return message; + }, + fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; + }, + toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { + const obj: any = {}; + obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { + return QueryVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteResponse): QueryVoteResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVoteResponse", + value: QueryVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteResponseProtoMsg): QueryVoteResponse { + return QueryVoteResponse.decode(message.value); + }, + toProto(message: QueryVoteResponse): Uint8Array { + return QueryVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteResponse): QueryVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVoteResponse", + value: QueryVoteResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVotesRequest(): QueryVotesRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryVotesRequest = { + typeUrl: "/cosmos.gov.v1.QueryVotesRequest", + encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesRequestAminoMsg): QueryVotesRequest { + return QueryVotesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesRequest): QueryVotesRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVotesRequest", + value: QueryVotesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesRequestProtoMsg): QueryVotesRequest { + return QueryVotesRequest.decode(message.value); + }, + toProto(message: QueryVotesRequest): Uint8Array { + return QueryVotesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesRequest): QueryVotesRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVotesRequest", + value: QueryVotesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVotesResponse(): QueryVotesResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesResponse = { + typeUrl: "/cosmos.gov.v1.QueryVotesResponse", + encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesResponseAminoMsg): QueryVotesResponse { + return QueryVotesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesResponse): QueryVotesResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVotesResponse", + value: QueryVotesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesResponseProtoMsg): QueryVotesResponse { + return QueryVotesResponse.decode(message.value); + }, + toProto(message: QueryVotesResponse): Uint8Array { + return QueryVotesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesResponse): QueryVotesResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVotesResponse", + value: QueryVotesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { + paramsType: "" + }; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.gov.v1.QueryParamsRequest", + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.paramsType !== "") { + writer.uint32(10).string(message.paramsType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paramsType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.paramsType = object.paramsType ?? ""; + return message; + }, + fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + if (object.params_type !== undefined && object.params_type !== null) { + message.paramsType = object.params_type; + } + return message; + }, + toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + obj.params_type = message.paramsType === "" ? undefined : message.paramsType; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + votingParams: undefined, + depositParams: undefined, + tallyParams: undefined + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.gov.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 2: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 3: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.votingParams = object.votingParams !== undefined && object.votingParams !== null ? VotingParams.fromPartial(object.votingParams) : undefined; + message.depositParams = object.depositParams !== undefined && object.depositParams !== null ? DepositParams.fromPartial(object.depositParams) : undefined; + message.tallyParams = object.tallyParams !== undefined && object.tallyParams !== null ? TallyParams.fromPartial(object.tallyParams) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositRequest(): QueryDepositRequest { + return { + proposalId: BigInt(0), + depositor: "" + }; +} +export const QueryDepositRequest = { + typeUrl: "/cosmos.gov.v1.QueryDepositRequest", + encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + return message; + }, + fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; + }, + toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + return obj; + }, + fromAminoMsg(object: QueryDepositRequestAminoMsg): QueryDepositRequest { + return QueryDepositRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositRequest): QueryDepositRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositRequest", + value: QueryDepositRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositRequestProtoMsg): QueryDepositRequest { + return QueryDepositRequest.decode(message.value); + }, + toProto(message: QueryDepositRequest): Uint8Array { + return QueryDepositRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositRequest): QueryDepositRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositRequest", + value: QueryDepositRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositResponse(): QueryDepositResponse { + return { + deposit: undefined + }; +} +export const QueryDepositResponse = { + typeUrl: "/cosmos.gov.v1.QueryDepositResponse", + encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { + const obj: any = {}; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { + return QueryDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositResponse): QueryDepositResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositResponse", + value: QueryDepositResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositResponseProtoMsg): QueryDepositResponse { + return QueryDepositResponse.decode(message.value); + }, + toProto(message: QueryDepositResponse): Uint8Array { + return QueryDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositResponse): QueryDepositResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositResponse", + value: QueryDepositResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryDepositsRequest = { + typeUrl: "/cosmos.gov.v1.QueryDepositsRequest", + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositsRequestAminoMsg): QueryDepositsRequest { + return QueryDepositsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositsRequest): QueryDepositsRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositsRequest", + value: QueryDepositsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositsRequestProtoMsg): QueryDepositsRequest { + return QueryDepositsRequest.decode(message.value); + }, + toProto(message: QueryDepositsRequest): Uint8Array { + return QueryDepositsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsRequest): QueryDepositsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositsRequest", + value: QueryDepositsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { + deposits: [], + pagination: undefined + }; +} +export const QueryDepositsResponse = { + typeUrl: "/cosmos.gov.v1.QueryDepositsResponse", + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositsResponseAminoMsg): QueryDepositsResponse { + return QueryDepositsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositsResponse): QueryDepositsResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositsResponse", + value: QueryDepositsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositsResponseProtoMsg): QueryDepositsResponse { + return QueryDepositsResponse.decode(message.value); + }, + toProto(message: QueryDepositsResponse): Uint8Array { + return QueryDepositsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsResponse): QueryDepositsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositsResponse", + value: QueryDepositsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryTallyResultRequest = { + typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryTallyResultRequest", + value: QueryTallyResultRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultRequestProtoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.decode(message.value); + }, + toProto(message: QueryTallyResultRequest): Uint8Array { + return QueryTallyResultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest", + value: QueryTallyResultRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { + tally: undefined + }; +} +export const QueryTallyResultResponse = { + typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tally !== undefined) { + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + message.tally = object.tally !== undefined && object.tally !== null ? TallyResult.fromPartial(object.tally) : undefined; + return message; + }, + fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; + }, + toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { + const obj: any = {}; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryTallyResultResponse", + value: QueryTallyResultResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultResponseProtoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.decode(message.value); + }, + toProto(message: QueryTallyResultResponse): Uint8Array { + return QueryTallyResultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse", + value: QueryTallyResultResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.amino.ts new file mode 100644 index 00000000..a648548e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.amino.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const AminoConverter = { + "/cosmos.gov.v1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/v1/MsgSubmitProposal", + toAmino: MsgSubmitProposal.toAmino, + fromAmino: MsgSubmitProposal.fromAmino + }, + "/cosmos.gov.v1.MsgExecLegacyContent": { + aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", + toAmino: MsgExecLegacyContent.toAmino, + fromAmino: MsgExecLegacyContent.fromAmino + }, + "/cosmos.gov.v1.MsgVote": { + aminoType: "cosmos-sdk/v1/MsgVote", + toAmino: MsgVote.toAmino, + fromAmino: MsgVote.fromAmino + }, + "/cosmos.gov.v1.MsgVoteWeighted": { + aminoType: "cosmos-sdk/v1/MsgVoteWeighted", + toAmino: MsgVoteWeighted.toAmino, + fromAmino: MsgVoteWeighted.fromAmino + }, + "/cosmos.gov.v1.MsgDeposit": { + aminoType: "cosmos-sdk/v1/MsgDeposit", + toAmino: MsgDeposit.toAmino, + fromAmino: MsgDeposit.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.registry.ts new file mode 100644 index 00000000..1201c07b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.registry.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.gov.v1.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.gov.v1.MsgExecLegacyContent", MsgExecLegacyContent], ["/cosmos.gov.v1.MsgVote", MsgVote], ["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted], ["/cosmos.gov.v1.MsgDeposit", MsgDeposit]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish() + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.encode(value).finish() + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.encode(value).finish() + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(value).finish() + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.encode(value).finish() + }; + } + }, + withTypeUrl: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value + }; + } + }, + fromPartial: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value) + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.fromPartial(value) + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.fromPartial(value) + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.fromPartial(value) + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..7141fdd1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.rpc.msg.ts @@ -0,0 +1,56 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgExecLegacyContent, MsgExecLegacyContentResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; +/** Msg defines the gov Msg service. */ +export interface Msg { + /** SubmitProposal defines a method to create new proposal given a content. */ + submitProposal(request: MsgSubmitProposal): Promise; + /** + * ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + * to execute a legacy content-based proposal. + */ + execLegacyContent(request: MsgExecLegacyContent): Promise; + /** Vote defines a method to add a vote on a specific proposal. */ + vote(request: MsgVote): Promise; + /** VoteWeighted defines a method to add a weighted vote on a specific proposal. */ + voteWeighted(request: MsgVoteWeighted): Promise; + /** Deposit defines a method to add deposit on a specific proposal. */ + deposit(request: MsgDeposit): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.submitProposal = this.submitProposal.bind(this); + this.execLegacyContent = this.execLegacyContent.bind(this); + this.vote = this.vote.bind(this); + this.voteWeighted = this.voteWeighted.bind(this); + this.deposit = this.deposit.bind(this); + } + submitProposal(request: MsgSubmitProposal): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "SubmitProposal", data); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); + } + execLegacyContent(request: MsgExecLegacyContent): Promise { + const data = MsgExecLegacyContent.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "ExecLegacyContent", data); + return promise.then(data => MsgExecLegacyContentResponse.decode(new BinaryReader(data))); + } + vote(request: MsgVote): Promise { + const data = MsgVote.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "Vote", data); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); + } + voteWeighted(request: MsgVoteWeighted): Promise { + const data = MsgVoteWeighted.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "VoteWeighted", data); + return promise.then(data => MsgVoteWeightedResponse.decode(new BinaryReader(data))); + } + deposit(request: MsgDeposit): Promise { + const data = MsgDeposit.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "Deposit", data); + return promise.then(data => MsgDepositResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.ts new file mode 100644 index 00000000..7f2d7664 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1/tx.ts @@ -0,0 +1,1300 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType } from "./gov"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { TextProposal, TextProposalProtoMsg, TextProposalSDKType } from "../v1beta1/gov"; +import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; +import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + messages: Any[]; + initialDeposit: Coin[]; + proposer: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal"; + value: Uint8Array; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + messages?: AnyAmino[]; + initial_deposit?: CoinAmino[]; + proposer?: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata?: string; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/v1/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + messages: AnySDKType[]; + initial_deposit: CoinSDKType[]; + proposer: string; + metadata: string; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + proposalId: bigint; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + proposal_id?: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/v1/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContent { + /** content is the proposal's content. */ + content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | Any | undefined; + /** authority must be the gov module address. */ + authority: string; +} +export interface MsgExecLegacyContentProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; + value: Uint8Array; +} +export type MsgExecLegacyContentEncoded = Omit & { + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentAmino { + /** content is the proposal's content. */ + content?: AnyAmino; + /** authority must be the gov module address. */ + authority?: string; +} +export interface MsgExecLegacyContentAminoMsg { + type: "cosmos-sdk/v1/MsgExecLegacyContent"; + value: MsgExecLegacyContentAmino; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentSDKType { + content?: CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | AnySDKType | undefined; + authority: string; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponse {} +export interface MsgExecLegacyContentResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; + value: Uint8Array; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseAmino {} +export interface MsgExecLegacyContentResponseAminoMsg { + type: "cosmos-sdk/v1/MsgExecLegacyContentResponse"; + value: MsgExecLegacyContentResponseAmino; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseSDKType {} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + proposalId: bigint; + voter: string; + option: VoteOption; + metadata: string; +} +export interface MsgVoteProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVote"; + value: Uint8Array; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteAmino { + proposal_id: string; + voter?: string; + option?: VoteOption; + metadata?: string; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/v1/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteSDKType { + proposal_id: bigint; + voter: string; + option: VoteOption; + metadata: string; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/v1/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeighted { + proposalId: bigint; + voter: string; + options: WeightedVoteOption[]; + metadata: string; +} +export interface MsgVoteWeightedProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted"; + value: Uint8Array; +} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeightedAmino { + proposal_id: string; + voter?: string; + options?: WeightedVoteOptionAmino[]; + metadata?: string; +} +export interface MsgVoteWeightedAminoMsg { + type: "cosmos-sdk/v1/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; +} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeightedSDKType { + proposal_id: bigint; + voter: string; + options: WeightedVoteOptionSDKType[]; + metadata: string; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; + value: Uint8Array; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: "cosmos-sdk/v1/MsgVoteWeightedResponse"; + value: MsgVoteWeightedResponseAmino; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseSDKType {} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + proposalId: bigint; + depositor: string; + amount: Coin[]; +} +export interface MsgDepositProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgDeposit"; + value: Uint8Array; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositAmino { + proposal_id: string; + depositor?: string; + amount?: CoinAmino[]; +} +export interface MsgDepositAminoMsg { + type: "cosmos-sdk/v1/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositSDKType { + proposal_id: bigint; + depositor: string; + amount: CoinSDKType[]; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "cosmos-sdk/v1/MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + messages: [], + initialDeposit: [], + proposer: "", + metadata: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.proposer !== "") { + writer.uint32(26).string(message.proposer); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + case 4: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.initial_deposit = message.initialDeposit; + } + obj.proposer = message.proposer === "" ? undefined : message.proposer; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/v1/MsgSubmitProposal", + value: MsgSubmitProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value); + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value); + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { + return { + content: undefined, + authority: "" + }; +} +export const MsgExecLegacyContent = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode(message.content as Any, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any; + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent(); + message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent(); + if (object.content !== undefined && object.content !== null) { + message.content = Cosmos_govv1beta1Content_FromAmino(object.content); + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgExecLegacyContent): MsgExecLegacyContentAmino { + const obj: any = {}; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) : undefined; + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { + return MsgExecLegacyContent.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentAminoMsg { + return { + type: "cosmos-sdk/v1/MsgExecLegacyContent", + value: MsgExecLegacyContent.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecLegacyContentProtoMsg): MsgExecLegacyContent { + return MsgExecLegacyContent.decode(message.value); + }, + toProto(message: MsgExecLegacyContent): Uint8Array { + return MsgExecLegacyContent.encode(message).finish(); + }, + toProtoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.encode(message).finish() + }; + } +}; +function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { + return {}; +} +export const MsgExecLegacyContentResponse = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + encode(_: MsgExecLegacyContentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse(); + return message; + }, + fromAmino(_: MsgExecLegacyContentResponseAmino): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse(); + return message; + }, + toAmino(_: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgExecLegacyContentResponseAminoMsg): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgExecLegacyContentResponse", + value: MsgExecLegacyContentResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecLegacyContentResponseProtoMsg): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.decode(message.value); + }, + toProto(message: MsgExecLegacyContentResponse): Uint8Array { + return MsgExecLegacyContentResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + value: MsgExecLegacyContentResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "" + }; +} +export const MsgVote = { + typeUrl: "/cosmos.gov.v1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32() as any; + break; + case 4: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVote { + const message = createBaseMsgVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgVoteAmino): MsgVote { + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgVote): MsgVoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value); + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVote", + value: MsgVote.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { + return MsgVote.decode(message.value); + }, + toProto(message: MsgVote): Uint8Array { + return MsgVote.encode(message).finish(); + }, + toProtoMsg(message: MsgVote): MsgVoteProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { + return MsgVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVoteResponse", + value: MsgVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { + return MsgVoteResponse.decode(message.value); + }, + toProto(message: MsgVoteResponse): Uint8Array { + return MsgVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const MsgVoteWeighted = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeighted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + case 4: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { + return MsgVoteWeighted.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVoteWeighted", + value: MsgVoteWeighted.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteWeightedProtoMsg): MsgVoteWeighted { + return MsgVoteWeighted.decode(message.value); + }, + toProto(message: MsgVoteWeighted): Uint8Array { + return MsgVoteWeighted.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(message).finish() + }; + } +}; +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} +export const MsgVoteWeightedResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeightedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, + fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, + toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedResponseAminoMsg): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteWeightedResponseProtoMsg): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.decode(message.value); + }, + toProto(message: MsgVoteWeightedResponse): Uint8Array { + return MsgVoteWeightedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const MsgDeposit = { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDeposit { + const message = createBaseMsgDeposit(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgDepositAmino): MsgDeposit { + const message = createBaseMsgDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgDeposit): MsgDepositAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { + return MsgDeposit.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { + return { + type: "cosmos-sdk/v1/MsgDeposit", + value: MsgDeposit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositProtoMsg): MsgDeposit { + return MsgDeposit.decode(message.value); + }, + toProto(message: MsgDeposit): Uint8Array { + return MsgDeposit.encode(message).finish(); + }, + toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); + return message; + }, + fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); + return message; + }, + toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { + return MsgDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDepositResponse): MsgDepositResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgDepositResponse", + value: MsgDepositResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { + return MsgDepositResponse.decode(message.value); + }, + toProto(message: MsgDepositResponse): Uint8Array { + return MsgDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return CommunityPoolSpendProposal.decode(data.value); + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return CommunityPoolSpendProposalWithDeposit.decode(data.value); + case "/cosmos.gov.v1beta1.TextProposal": + return TextProposal.decode(data.value); + case "/cosmos.params.v1beta1.ParameterChangeProposal": + return ParameterChangeProposal.decode(data.value); + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return SoftwareUpgradeProposal.decode(data.value); + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return CancelSoftwareUpgradeProposal.decode(data.value); + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return StoreCodeProposal.decode(data.value); + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return InstantiateContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return InstantiateContract2Proposal.decode(data.value); + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return MigrateContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.SudoContractProposal": + return SudoContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return ExecuteContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return UpdateAdminProposal.decode(data.value); + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return ClearAdminProposal.decode(data.value); + case "/cosmwasm.wasm.v1.PinCodesProposal": + return PinCodesProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return UnpinCodesProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return UpdateInstantiateConfigProposal.decode(data.value); + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return StoreAndInstantiateContractProposal.decode(data.value); + case "/ibc.core.client.v1.ClientUpdateProposal": + return ClientUpdateProposal.decode(data.value); + case "/ibc.core.client.v1.UpgradeProposal": + return UpgradeProposal.decode(data.value); + default: + return data; + } +}; +export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/v1/CommunityPoolSpendProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/v1/TextProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/v1/ParameterChangeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + value: ParameterChangeProposal.encode(ParameterChangeProposal.fromPartial(ParameterChangeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/v1/SoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/v1/CancelSoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreCodeProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(StoreCodeProposal.fromPartial(StoreCodeProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(InstantiateContractProposal.fromPartial(InstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContract2Proposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(InstantiateContract2Proposal.fromPartial(InstantiateContract2Proposal.fromAmino(content.value))).finish() + }); + case "wasm/MigrateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(MigrateContractProposal.fromPartial(MigrateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/SudoContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(SudoContractProposal.fromPartial(SudoContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/ExecuteContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(ExecuteContractProposal.fromPartial(ExecuteContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(UpdateAdminProposal.fromPartial(UpdateAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/ClearAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(ClearAdminProposal.fromPartial(ClearAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/PinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(PinCodesProposal.fromPartial(PinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UnpinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(UnpinCodesProposal.fromPartial(UnpinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateInstantiateConfigProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(UpdateInstantiateConfigProposal.fromPartial(UpdateInstantiateConfigProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreAndInstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(StoreAndInstantiateContractProposal.fromPartial(StoreAndInstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ClientUpdateProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/UpgradeProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return { + type: "cosmos-sdk/v1/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined)) + }; + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return { + type: "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined)) + }; + case "/cosmos.gov.v1beta1.TextProposal": + return { + type: "cosmos-sdk/v1/TextProposal", + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) + }; + case "/cosmos.params.v1beta1.ParameterChangeProposal": + return { + type: "cosmos-sdk/v1/ParameterChangeProposal", + value: ParameterChangeProposal.toAmino(ParameterChangeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return { + type: "cosmos-sdk/v1/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return { + type: "cosmos-sdk/v1/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(StoreCodeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(InstantiateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(InstantiateContract2Proposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(MigrateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.SudoContractProposal": + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(SudoContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(ExecuteContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(UpdateAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(ClearAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.PinCodesProposal": + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(PinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(UnpinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(UpdateInstantiateConfigProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(StoreAndInstantiateContractProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.ClientUpdateProposal": + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.UpgradeProposal": + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/genesis.ts new file mode 100644 index 00000000..25644b8b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/genesis.ts @@ -0,0 +1,202 @@ +//@ts-nocheck +import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType } from "./gov"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisState { + /** starting_proposal_id is the ID of the starting proposal. */ + startingProposalId: bigint; + /** deposits defines all the deposits present at genesis. */ + deposits: Deposit[]; + /** votes defines all the votes present at genesis. */ + votes: Vote[]; + /** proposals defines all the proposals present at genesis. */ + proposals: Proposal[]; + /** params defines all the paramaters of related to deposit. */ + depositParams: DepositParams; + /** params defines all the paramaters of related to voting. */ + votingParams: VotingParams; + /** params defines all the paramaters of related to tally. */ + tallyParams: TallyParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateAmino { + /** starting_proposal_id is the ID of the starting proposal. */ + starting_proposal_id?: string; + /** deposits defines all the deposits present at genesis. */ + deposits?: DepositAmino[]; + /** votes defines all the votes present at genesis. */ + votes?: VoteAmino[]; + /** proposals defines all the proposals present at genesis. */ + proposals?: ProposalAmino[]; + /** params defines all the paramaters of related to deposit. */ + deposit_params?: DepositParamsAmino; + /** params defines all the paramaters of related to voting. */ + voting_params?: VotingParamsAmino; + /** params defines all the paramaters of related to tally. */ + tally_params?: TallyParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateSDKType { + starting_proposal_id: bigint; + deposits: DepositSDKType[]; + votes: VoteSDKType[]; + proposals: ProposalSDKType[]; + deposit_params: DepositParamsSDKType; + voting_params: VotingParamsSDKType; + tally_params: TallyParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + startingProposalId: BigInt(0), + deposits: [], + votes: [], + proposals: [], + depositParams: DepositParams.fromPartial({}), + votingParams: VotingParams.fromPartial({}), + tallyParams: TallyParams.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/cosmos.gov.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startingProposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.startingProposalId); + } + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim(); + } + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startingProposalId = reader.uint64(); + break; + case 2: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 3: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 4: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 5: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 6: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 7: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? BigInt(object.startingProposalId.toString()) : BigInt(0); + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.depositParams = object.depositParams !== undefined && object.depositParams !== null ? DepositParams.fromPartial(object.depositParams) : undefined; + message.votingParams = object.votingParams !== undefined && object.votingParams !== null ? VotingParams.fromPartial(object.votingParams) : undefined; + message.tallyParams = object.tallyParams !== undefined && object.tallyParams !== null ? TallyParams.fromPartial(object.tallyParams) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.starting_proposal_id !== undefined && object.starting_proposal_id !== null) { + message.startingProposalId = BigInt(object.starting_proposal_id); + } + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.starting_proposal_id = message.startingProposalId !== BigInt(0) ? message.startingProposalId.toString() : undefined; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/gov.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/gov.ts new file mode 100644 index 00000000..86387898 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/gov.ts @@ -0,0 +1,1631 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; +import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given governance proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** + * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + case 2: + case "PROPOSAL_STATUS_VOTING_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + case 3: + case "PROPOSAL_STATUS_PASSED": + return ProposalStatus.PROPOSAL_STATUS_PASSED; + case 4: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 5: + case "PROPOSAL_STATUS_FAILED": + return ProposalStatus.PROPOSAL_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return "PROPOSAL_STATUS_VOTING_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return "PROPOSAL_STATUS_PASSED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return "PROPOSAL_STATUS_FAILED"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +export interface WeightedVoteOption { + option: VoteOption; + weight: string; +} +export interface WeightedVoteOptionProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption"; + value: Uint8Array; +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +export interface WeightedVoteOptionAmino { + option?: VoteOption; + weight?: string; +} +export interface WeightedVoteOptionAminoMsg { + type: "cosmos-sdk/WeightedVoteOption"; + value: WeightedVoteOptionAmino; +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +export interface WeightedVoteOptionSDKType { + option: VoteOption; + weight: string; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposal { + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; + title: string; + description: string; +} +export interface TextProposalProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.TextProposal"; + value: Uint8Array; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposalAmino { + title?: string; + description?: string; +} +export interface TextProposalAminoMsg { + type: "cosmos-sdk/TextProposal"; + value: TextProposalAmino; +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposalSDKType { + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; + title: string; + description: string; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface Deposit { + proposalId: bigint; + depositor: string; + amount: Coin[]; +} +export interface DepositProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.Deposit"; + value: Uint8Array; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositAmino { + proposal_id?: string; + depositor?: string; + amount?: CoinAmino[]; +} +export interface DepositAminoMsg { + type: "cosmos-sdk/Deposit"; + value: DepositAmino; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositSDKType { + proposal_id: bigint; + depositor: string; + amount: CoinSDKType[]; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface Proposal { + proposalId: bigint; + content?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | Any | undefined; + status: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + finalTallyResult: TallyResult; + submitTime: Date; + depositEndTime: Date; + totalDeposit: Coin[]; + votingStartTime: Date; + votingEndTime: Date; +} +export interface ProposalProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.Proposal"; + value: Uint8Array; +} +export type ProposalEncoded = Omit & { + content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalAmino { + proposal_id?: string; + content?: AnyAmino; + status?: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result?: TallyResultAmino; + submit_time?: string; + deposit_end_time?: string; + total_deposit?: CoinAmino[]; + voting_start_time?: string; + voting_end_time?: string; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/Proposal"; + value: ProposalAmino; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalSDKType { + proposal_id: bigint; + content?: TextProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | AnySDKType | undefined; + status: ProposalStatus; + final_tally_result: TallyResultSDKType; + submit_time: Date; + deposit_end_time: Date; + total_deposit: CoinSDKType[]; + voting_start_time: Date; + voting_end_time: Date; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResult { + yes: string; + abstain: string; + no: string; + noWithVeto: string; +} +export interface TallyResultProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.TallyResult"; + value: Uint8Array; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultAmino { + yes?: string; + abstain?: string; + no?: string; + no_with_veto?: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultSDKType { + yes: string; + abstain: string; + no: string; + no_with_veto: string; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface Vote { + proposalId: bigint; + voter: string; + /** + * Deprecated: Prefer to use `options` instead. This field is set in queries + * if and only if `len(options) == 1` and that option has weight 1. In all + * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + */ + /** @deprecated */ + option: VoteOption; + /** Since: cosmos-sdk 0.43 */ + options: WeightedVoteOption[]; +} +export interface VoteProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.Vote"; + value: Uint8Array; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteAmino { + proposal_id: string; + voter?: string; + /** + * Deprecated: Prefer to use `options` instead. This field is set in queries + * if and only if `len(options) == 1` and that option has weight 1. In all + * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + */ + /** @deprecated */ + option?: VoteOption; + /** Since: cosmos-sdk 0.43 */ + options?: WeightedVoteOptionAmino[]; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/Vote"; + value: VoteAmino; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteSDKType { + proposal_id: bigint; + voter: string; + /** @deprecated */ + option: VoteOption; + options: WeightedVoteOptionSDKType[]; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParams { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod: Duration; +} +export interface DepositParamsProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.DepositParams"; + value: Uint8Array; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsAmino { + /** Minimum deposit for a proposal to enter voting period. */ + min_deposit?: CoinAmino[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + max_deposit_period?: DurationAmino; +} +export interface DepositParamsAminoMsg { + type: "cosmos-sdk/DepositParams"; + value: DepositParamsAmino; +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsSDKType { + min_deposit: CoinSDKType[]; + max_deposit_period: DurationSDKType; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Length of the voting period. */ + votingPeriod: Duration; +} +export interface VotingParamsProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.VotingParams"; + value: Uint8Array; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsAmino { + /** Length of the voting period. */ + voting_period?: DurationAmino; +} +export interface VotingParamsAminoMsg { + type: "cosmos-sdk/VotingParams"; + value: VotingParamsAmino; +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsSDKType { + voting_period: DurationSDKType; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: Uint8Array; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: Uint8Array; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + vetoThreshold: Uint8Array; +} +export interface TallyParamsProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.TallyParams"; + value: Uint8Array; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsAmino { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum?: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold?: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold?: string; +} +export interface TallyParamsAminoMsg { + type: "cosmos-sdk/TallyParams"; + value: TallyParamsAmino; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsSDKType { + quorum: Uint8Array; + threshold: Uint8Array; + veto_threshold: Uint8Array; +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: "" + }; +} +export const WeightedVoteOption = { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption", + encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.option !== 0) { + writer.uint32(8).int32(message.option); + } + if (message.weight !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.weight, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightedVoteOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.option = reader.int32() as any; + break; + case 2: + message.weight = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + message.option = object.option ?? 0; + message.weight = object.weight ?? ""; + return message; + }, + fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; + }, + toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { + const obj: any = {}; + obj.option = message.option === 0 ? undefined : message.option; + obj.weight = message.weight === "" ? undefined : message.weight; + return obj; + }, + fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { + return WeightedVoteOption.fromAmino(object.value); + }, + toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { + return { + type: "cosmos-sdk/WeightedVoteOption", + value: WeightedVoteOption.toAmino(message) + }; + }, + fromProtoMsg(message: WeightedVoteOptionProtoMsg): WeightedVoteOption { + return WeightedVoteOption.decode(message.value); + }, + toProto(message: WeightedVoteOption): Uint8Array { + return WeightedVoteOption.encode(message).finish(); + }, + toProtoMsg(message: WeightedVoteOption): WeightedVoteOptionProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption", + value: WeightedVoteOption.encode(message).finish() + }; + } +}; +function createBaseTextProposal(): TextProposal { + return { + $typeUrl: "/cosmos.gov.v1beta1.TextProposal", + title: "", + description: "" + }; +} +export const TextProposal = { + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + encode(message: TextProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TextProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTextProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TextProposal { + const message = createBaseTextProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: TextProposalAmino): TextProposal { + const message = createBaseTextProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: TextProposal): TextProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: TextProposalAminoMsg): TextProposal { + return TextProposal.fromAmino(object.value); + }, + toAminoMsg(message: TextProposal): TextProposalAminoMsg { + return { + type: "cosmos-sdk/TextProposal", + value: TextProposal.toAmino(message) + }; + }, + fromProtoMsg(message: TextProposalProtoMsg): TextProposal { + return TextProposal.decode(message.value); + }, + toProto(message: TextProposal): Uint8Array { + return TextProposal.encode(message).finish(); + }, + toProtoMsg(message: TextProposal): TextProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(message).finish() + }; + } +}; +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const Deposit = { + typeUrl: "/cosmos.gov.v1beta1.Deposit", + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Deposit { + const message = createBaseDeposit(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DepositAmino): Deposit { + const message = createBaseDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Deposit): DepositAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: DepositAminoMsg): Deposit { + return Deposit.fromAmino(object.value); + }, + toAminoMsg(message: Deposit): DepositAminoMsg { + return { + type: "cosmos-sdk/Deposit", + value: Deposit.toAmino(message) + }; + }, + fromProtoMsg(message: DepositProtoMsg): Deposit { + return Deposit.decode(message.value); + }, + toProto(message: Deposit): Uint8Array { + return Deposit.encode(message).finish(); + }, + toProtoMsg(message: Deposit): DepositProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +function createBaseProposal(): Proposal { + return { + proposalId: BigInt(0), + content: undefined, + status: 0, + finalTallyResult: TallyResult.fromPartial({}), + submitTime: new Date(), + depositEndTime: new Date(), + totalDeposit: [], + votingStartTime: new Date(), + votingEndTime: new Date() + }; +} +export const Proposal = { + typeUrl: "/cosmos.gov.v1beta1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.content !== undefined) { + Any.encode(message.content as Any, writer.uint32(18).fork()).ldelim(); + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status); + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim(); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + if (message.depositEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim(); + } + for (const v of message.totalDeposit) { + Coin.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.votingStartTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim(); + } + if (message.votingEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.content = Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any; + break; + case 3: + message.status = reader.int32() as any; + break; + case 4: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.depositEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.totalDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 9: + message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Proposal { + const message = createBaseProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.status = object.status ?? 0; + message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; + message.submitTime = object.submitTime ?? undefined; + message.depositEndTime = object.depositEndTime ?? undefined; + message.totalDeposit = object.totalDeposit?.map(e => Coin.fromPartial(e)) || []; + message.votingStartTime = object.votingStartTime ?? undefined; + message.votingEndTime = object.votingEndTime ?? undefined; + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.content !== undefined && object.content !== null) { + message.content = Cosmos_govv1beta1Content_FromAmino(object.content); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + if (object.deposit_end_time !== undefined && object.deposit_end_time !== null) { + message.depositEndTime = fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)); + } + message.totalDeposit = object.total_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.voting_start_time !== undefined && object.voting_start_time !== null) { + message.votingStartTime = fromTimestamp(Timestamp.fromAmino(object.voting_start_time)); + } + if (object.voting_end_time !== undefined && object.voting_end_time !== null) { + message.votingEndTime = fromTimestamp(Timestamp.fromAmino(object.voting_end_time)); + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) : undefined; + obj.status = message.status === 0 ? undefined : message.status; + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; + if (message.totalDeposit) { + obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total_deposit = message.totalDeposit; + } + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + toAminoMsg(message: Proposal): ProposalAminoMsg { + return { + type: "cosmos-sdk/Proposal", + value: Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +function createBaseTallyResult(): TallyResult { + return { + yes: "", + abstain: "", + no: "", + noWithVeto: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.gov.v1beta1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.yes !== "") { + writer.uint32(10).string(message.yes); + } + if (message.abstain !== "") { + writer.uint32(18).string(message.abstain); + } + if (message.no !== "") { + writer.uint32(26).string(message.no); + } + if (message.noWithVeto !== "") { + writer.uint32(34).string(message.noWithVeto); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yes = reader.string(); + break; + case 2: + message.abstain = reader.string(); + break; + case 3: + message.no = reader.string(); + break; + case 4: + message.noWithVeto = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyResult { + const message = createBaseTallyResult(); + message.yes = object.yes ?? ""; + message.abstain = object.abstain ?? ""; + message.no = object.no ?? ""; + message.noWithVeto = object.noWithVeto ?? ""; + return message; + }, + fromAmino(object: TallyResultAmino): TallyResult { + const message = createBaseTallyResult(); + if (object.yes !== undefined && object.yes !== null) { + message.yes = object.yes; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = object.abstain; + } + if (object.no !== undefined && object.no !== null) { + message.no = object.no; + } + if (object.no_with_veto !== undefined && object.no_with_veto !== null) { + message.noWithVeto = object.no_with_veto; + } + return message; + }, + toAmino(message: TallyResult): TallyResultAmino { + const obj: any = {}; + obj.yes = message.yes === "" ? undefined : message.yes; + obj.abstain = message.abstain === "" ? undefined : message.abstain; + obj.no = message.no === "" ? undefined : message.no; + obj.no_with_veto = message.noWithVeto === "" ? undefined : message.noWithVeto; + return obj; + }, + fromAminoMsg(object: TallyResultAminoMsg): TallyResult { + return TallyResult.fromAmino(object.value); + }, + toAminoMsg(message: TallyResult): TallyResultAminoMsg { + return { + type: "cosmos-sdk/TallyResult", + value: TallyResult.toAmino(message) + }; + }, + fromProtoMsg(message: TallyResultProtoMsg): TallyResult { + return TallyResult.decode(message.value); + }, + toProto(message: TallyResult): Uint8Array { + return TallyResult.encode(message).finish(); + }, + toProtoMsg(message: TallyResult): TallyResultProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.TallyResult", + value: TallyResult.encode(message).finish() + }; + } +}; +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + options: [] + }; +} +export const Vote = { + typeUrl: "/cosmos.gov.v1beta1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32() as any; + break; + case 4: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: VoteAmino): Vote { + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: Vote): VoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + return obj; + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value); + }, + toAminoMsg(message: Vote): VoteAminoMsg { + return { + type: "cosmos-sdk/Vote", + value: Vote.toAmino(message) + }; + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.Vote", + value: Vote.encode(message).finish() + }; + } +}; +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + maxDepositPeriod: Duration.fromPartial({}) + }; +} +export const DepositParams = { + typeUrl: "/cosmos.gov.v1beta1.DepositParams", + encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.minDeposit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.minDeposit?.map(e => Coin.fromPartial(e)) || []; + message.maxDepositPeriod = object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null ? Duration.fromPartial(object.maxDepositPeriod) : undefined; + return message; + }, + fromAmino(object: DepositParamsAmino): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + return message; + }, + toAmino(message: DepositParams): DepositParamsAmino { + const obj: any = {}; + if (message.minDeposit) { + obj.min_deposit = message.minDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.min_deposit = message.minDeposit; + } + obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; + return obj; + }, + fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { + return DepositParams.fromAmino(object.value); + }, + toAminoMsg(message: DepositParams): DepositParamsAminoMsg { + return { + type: "cosmos-sdk/DepositParams", + value: DepositParams.toAmino(message) + }; + }, + fromProtoMsg(message: DepositParamsProtoMsg): DepositParams { + return DepositParams.decode(message.value); + }, + toProto(message: DepositParams): Uint8Array { + return DepositParams.encode(message).finish(); + }, + toProtoMsg(message: DepositParams): DepositParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.DepositParams", + value: DepositParams.encode(message).finish() + }; + } +}; +function createBaseVotingParams(): VotingParams { + return { + votingPeriod: Duration.fromPartial({}) + }; +} +export const VotingParams = { + typeUrl: "/cosmos.gov.v1beta1.VotingParams", + encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVotingParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VotingParams { + const message = createBaseVotingParams(); + message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; + return message; + }, + fromAmino(object: VotingParamsAmino): VotingParams { + const message = createBaseVotingParams(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + return message; + }, + toAmino(message: VotingParams): VotingParamsAmino { + const obj: any = {}; + obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; + return obj; + }, + fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { + return VotingParams.fromAmino(object.value); + }, + toAminoMsg(message: VotingParams): VotingParamsAminoMsg { + return { + type: "cosmos-sdk/VotingParams", + value: VotingParams.toAmino(message) + }; + }, + fromProtoMsg(message: VotingParamsProtoMsg): VotingParams { + return VotingParams.decode(message.value); + }, + toProto(message: VotingParams): Uint8Array { + return VotingParams.encode(message).finish(); + }, + toProtoMsg(message: VotingParams): VotingParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.VotingParams", + value: VotingParams.encode(message).finish() + }; + } +}; +function createBaseTallyParams(): TallyParams { + return { + quorum: new Uint8Array(), + threshold: new Uint8Array(), + vetoThreshold: new Uint8Array() + }; +} +export const TallyParams = { + typeUrl: "/cosmos.gov.v1beta1.TallyParams", + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quorum.length !== 0) { + writer.uint32(10).bytes(message.quorum); + } + if (message.threshold.length !== 0) { + writer.uint32(18).bytes(message.threshold); + } + if (message.vetoThreshold.length !== 0) { + writer.uint32(26).bytes(message.vetoThreshold); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.bytes(); + break; + case 2: + message.threshold = reader.bytes(); + break; + case 3: + message.vetoThreshold = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyParams { + const message = createBaseTallyParams(); + message.quorum = object.quorum ?? new Uint8Array(); + message.threshold = object.threshold ?? new Uint8Array(); + message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); + return message; + }, + fromAmino(object: TallyParamsAmino): TallyParams { + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = bytesFromBase64(object.quorum); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = bytesFromBase64(object.threshold); + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = bytesFromBase64(object.veto_threshold); + } + return message; + }, + toAmino(message: TallyParams): TallyParamsAmino { + const obj: any = {}; + obj.quorum = message.quorum ? base64FromBytes(message.quorum) : undefined; + obj.threshold = message.threshold ? base64FromBytes(message.threshold) : undefined; + obj.veto_threshold = message.vetoThreshold ? base64FromBytes(message.vetoThreshold) : undefined; + return obj; + }, + fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { + return TallyParams.fromAmino(object.value); + }, + toAminoMsg(message: TallyParams): TallyParamsAminoMsg { + return { + type: "cosmos-sdk/TallyParams", + value: TallyParams.toAmino(message) + }; + }, + fromProtoMsg(message: TallyParamsProtoMsg): TallyParams { + return TallyParams.decode(message.value); + }, + toProto(message: TallyParams): Uint8Array { + return TallyParams.encode(message).finish(); + }, + toProtoMsg(message: TallyParams): TallyParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.TallyParams", + value: TallyParams.encode(message).finish() + }; + } +}; +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return CommunityPoolSpendProposal.decode(data.value); + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return CommunityPoolSpendProposalWithDeposit.decode(data.value); + case "/cosmos.gov.v1beta1.TextProposal": + return TextProposal.decode(data.value); + case "/cosmos.params.v1beta1.ParameterChangeProposal": + return ParameterChangeProposal.decode(data.value); + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return SoftwareUpgradeProposal.decode(data.value); + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return CancelSoftwareUpgradeProposal.decode(data.value); + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return StoreCodeProposal.decode(data.value); + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return InstantiateContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return InstantiateContract2Proposal.decode(data.value); + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return MigrateContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.SudoContractProposal": + return SudoContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return ExecuteContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return UpdateAdminProposal.decode(data.value); + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return ClearAdminProposal.decode(data.value); + case "/cosmwasm.wasm.v1.PinCodesProposal": + return PinCodesProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return UnpinCodesProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return UpdateInstantiateConfigProposal.decode(data.value); + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return StoreAndInstantiateContractProposal.decode(data.value); + case "/ibc.core.client.v1.ClientUpdateProposal": + return ClientUpdateProposal.decode(data.value); + case "/ibc.core.client.v1.UpgradeProposal": + return UpgradeProposal.decode(data.value); + default: + return data; + } +}; +export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/CommunityPoolSpendProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CommunityPoolSpendProposalWithDeposit": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/TextProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ParameterChangeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + value: ParameterChangeProposal.encode(ParameterChangeProposal.fromPartial(ParameterChangeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/SoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CancelSoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreCodeProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(StoreCodeProposal.fromPartial(StoreCodeProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(InstantiateContractProposal.fromPartial(InstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContract2Proposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(InstantiateContract2Proposal.fromPartial(InstantiateContract2Proposal.fromAmino(content.value))).finish() + }); + case "wasm/MigrateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(MigrateContractProposal.fromPartial(MigrateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/SudoContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(SudoContractProposal.fromPartial(SudoContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/ExecuteContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(ExecuteContractProposal.fromPartial(ExecuteContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(UpdateAdminProposal.fromPartial(UpdateAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/ClearAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(ClearAdminProposal.fromPartial(ClearAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/PinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(PinCodesProposal.fromPartial(PinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UnpinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(UnpinCodesProposal.fromPartial(UnpinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateInstantiateConfigProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(UpdateInstantiateConfigProposal.fromPartial(UpdateInstantiateConfigProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreAndInstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(StoreAndInstantiateContractProposal.fromPartial(StoreAndInstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ClientUpdateProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/UpgradeProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return { + type: "cosmos-sdk/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined)) + }; + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined)) + }; + case "/cosmos.gov.v1beta1.TextProposal": + return { + type: "cosmos-sdk/TextProposal", + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) + }; + case "/cosmos.params.v1beta1.ParameterChangeProposal": + return { + type: "cosmos-sdk/ParameterChangeProposal", + value: ParameterChangeProposal.toAmino(ParameterChangeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(StoreCodeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(InstantiateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(InstantiateContract2Proposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(MigrateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.SudoContractProposal": + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(SudoContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(ExecuteContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(UpdateAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(ClearAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.PinCodesProposal": + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(PinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(UnpinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(UpdateInstantiateConfigProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(StoreAndInstantiateContractProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.ClientUpdateProposal": + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.UpgradeProposal": + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..17fd7312 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/query.rpc.Query.ts @@ -0,0 +1,108 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +/** Query defines the gRPC querier service for gov module */ +export interface Query { + /** Proposal queries proposal details based on ProposalID. */ + proposal(request: QueryProposalRequest): Promise; + /** Proposals queries all proposals based on given status. */ + proposals(request: QueryProposalsRequest): Promise; + /** Vote queries voted information based on proposalID, voterAddr. */ + vote(request: QueryVoteRequest): Promise; + /** Votes queries votes of a given proposal. */ + votes(request: QueryVotesRequest): Promise; + /** Params queries all parameters of the gov module. */ + params(request: QueryParamsRequest): Promise; + /** Deposit queries single deposit information based proposalID, depositAddr. */ + deposit(request: QueryDepositRequest): Promise; + /** Deposits queries all deposits of a single proposal. */ + deposits(request: QueryDepositsRequest): Promise; + /** TallyResult queries the tally of a proposal vote. */ + tallyResult(request: QueryTallyResultRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.proposal = this.proposal.bind(this); + this.proposals = this.proposals.bind(this); + this.vote = this.vote.bind(this); + this.votes = this.votes.bind(this); + this.params = this.params.bind(this); + this.deposit = this.deposit.bind(this); + this.deposits = this.deposits.bind(this); + this.tallyResult = this.tallyResult.bind(this); + } + proposal(request: QueryProposalRequest): Promise { + const data = QueryProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposal", data); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); + } + proposals(request: QueryProposalsRequest): Promise { + const data = QueryProposalsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposals", data); + return promise.then(data => QueryProposalsResponse.decode(new BinaryReader(data))); + } + vote(request: QueryVoteRequest): Promise { + const data = QueryVoteRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data); + return promise.then(data => QueryVoteResponse.decode(new BinaryReader(data))); + } + votes(request: QueryVotesRequest): Promise { + const data = QueryVotesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data); + return promise.then(data => QueryVotesResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + deposit(request: QueryDepositRequest): Promise { + const data = QueryDepositRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposit", data); + return promise.then(data => QueryDepositResponse.decode(new BinaryReader(data))); + } + deposits(request: QueryDepositsRequest): Promise { + const data = QueryDepositsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposits", data); + return promise.then(data => QueryDepositsResponse.decode(new BinaryReader(data))); + } + tallyResult(request: QueryTallyResultRequest): Promise { + const data = QueryTallyResultRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "TallyResult", data); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + proposal(request: QueryProposalRequest): Promise { + return queryService.proposal(request); + }, + proposals(request: QueryProposalsRequest): Promise { + return queryService.proposals(request); + }, + vote(request: QueryVoteRequest): Promise { + return queryService.vote(request); + }, + votes(request: QueryVotesRequest): Promise { + return queryService.votes(request); + }, + params(request: QueryParamsRequest): Promise { + return queryService.params(request); + }, + deposit(request: QueryDepositRequest): Promise { + return queryService.deposit(request); + }, + deposits(request: QueryDepositsRequest): Promise { + return queryService.deposits(request); + }, + tallyResult(request: QueryTallyResultRequest): Promise { + return queryService.tallyResult(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/query.ts new file mode 100644 index 00000000..0f2ae626 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/query.ts @@ -0,0 +1,1679 @@ +//@ts-nocheck +import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType } from "./gov"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; +} +export interface QueryProposalRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest"; + value: Uint8Array; +} +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; +} +export interface QueryProposalRequestAminoMsg { + type: "cosmos-sdk/QueryProposalRequest"; + value: QueryProposalRequestAmino; +} +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequestSDKType { + proposal_id: bigint; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponse { + proposal: Proposal; +} +export interface QueryProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse"; + value: Uint8Array; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseAmino { + proposal?: ProposalAmino; +} +export interface QueryProposalResponseAminoMsg { + type: "cosmos-sdk/QueryProposalResponse"; + value: QueryProposalResponseAmino; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseSDKType { + proposal: ProposalSDKType; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequest { + /** proposal_status defines the status of the proposals. */ + proposalStatus: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryProposalsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest"; + value: Uint8Array; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequestAmino { + /** proposal_status defines the status of the proposals. */ + proposal_status?: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryProposalsRequestAminoMsg { + type: "cosmos-sdk/QueryProposalsRequest"; + value: QueryProposalsRequestAmino; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequestSDKType { + proposal_status: ProposalStatus; + voter: string; + depositor: string; + pagination?: PageRequestSDKType; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponse { + proposals: Proposal[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryProposalsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse"; + value: Uint8Array; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponseAmino { + proposals?: ProposalAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryProposalsResponseAminoMsg { + type: "cosmos-sdk/QueryProposalsResponse"; + value: QueryProposalsResponseAmino; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponseSDKType { + proposals: ProposalSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** voter defines the oter address for the proposals. */ + voter: string; +} +export interface QueryVoteRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest"; + value: Uint8Array; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** voter defines the oter address for the proposals. */ + voter?: string; +} +export interface QueryVoteRequestAminoMsg { + type: "cosmos-sdk/QueryVoteRequest"; + value: QueryVoteRequestAmino; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequestSDKType { + proposal_id: bigint; + voter: string; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponse { + /** vote defined the queried vote. */ + vote: Vote; +} +export interface QueryVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse"; + value: Uint8Array; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponseAmino { + /** vote defined the queried vote. */ + vote?: VoteAmino; +} +export interface QueryVoteResponseAminoMsg { + type: "cosmos-sdk/QueryVoteResponse"; + value: QueryVoteResponseAmino; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponseSDKType { + vote: VoteSDKType; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryVotesRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest"; + value: Uint8Array; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryVotesRequestAminoMsg { + type: "cosmos-sdk/QueryVotesRequest"; + value: QueryVotesRequestAmino; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponse { + /** votes defined the queried votes. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryVotesResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse"; + value: Uint8Array; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponseAmino { + /** votes defined the queried votes. */ + votes?: VoteAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryVotesResponseAminoMsg { + type: "cosmos-sdk/QueryVotesResponse"; + value: QueryVotesResponseAmino; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponseSDKType { + votes: VoteSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + paramsType: string; +} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + params_type?: string; +} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType { + params_type: string; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** voting_params defines the parameters related to voting. */ + votingParams: VotingParams; + /** deposit_params defines the parameters related to deposit. */ + depositParams: DepositParams; + /** tally_params defines the parameters related to tally. */ + tallyParams: TallyParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** voting_params defines the parameters related to voting. */ + voting_params?: VotingParamsAmino; + /** deposit_params defines the parameters related to deposit. */ + deposit_params?: DepositParamsAmino; + /** tally_params defines the parameters related to tally. */ + tally_params?: TallyParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + voting_params: VotingParamsSDKType; + deposit_params: DepositParamsSDKType; + tally_params: TallyParamsSDKType; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; +} +export interface QueryDepositRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest"; + value: Uint8Array; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; +} +export interface QueryDepositRequestAminoMsg { + type: "cosmos-sdk/QueryDepositRequest"; + value: QueryDepositRequestAmino; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequestSDKType { + proposal_id: bigint; + depositor: string; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponse { + /** deposit defines the requested deposit. */ + deposit: Deposit; +} +export interface QueryDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse"; + value: Uint8Array; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponseAmino { + /** deposit defines the requested deposit. */ + deposit?: DepositAmino; +} +export interface QueryDepositResponseAminoMsg { + type: "cosmos-sdk/QueryDepositResponse"; + value: QueryDepositResponseAmino; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponseSDKType { + deposit: DepositSDKType; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDepositsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest"; + value: Uint8Array; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDepositsRequestAminoMsg { + type: "cosmos-sdk/QueryDepositsRequest"; + value: QueryDepositsRequestAmino; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponse { + deposits: Deposit[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDepositsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse"; + value: Uint8Array; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponseAmino { + deposits?: DepositAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDepositsResponseAminoMsg { + type: "cosmos-sdk/QueryDepositsResponse"; + value: QueryDepositsResponseAmino; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponseSDKType { + deposits: DepositSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; +} +export interface QueryTallyResultRequestProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest"; + value: Uint8Array; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; +} +export interface QueryTallyResultRequestAminoMsg { + type: "cosmos-sdk/QueryTallyResultRequest"; + value: QueryTallyResultRequestAmino; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequestSDKType { + proposal_id: bigint; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally: TallyResult; +} +export interface QueryTallyResultResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse"; + value: Uint8Array; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponseAmino { + /** tally defines the requested tally. */ + tally?: TallyResultAmino; +} +export interface QueryTallyResultResponseAminoMsg { + type: "cosmos-sdk/QueryTallyResultResponse"; + value: QueryTallyResultResponseAmino; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponseSDKType { + tally: TallyResultSDKType; +} +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryProposalRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { + return QueryProposalRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { + return { + type: "cosmos-sdk/QueryProposalRequest", + value: QueryProposalRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { + return QueryProposalRequest.decode(message.value); + }, + toProto(message: QueryProposalRequest): Uint8Array { + return QueryProposalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalRequest): QueryProposalRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest", + value: QueryProposalRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { + proposal: Proposal.fromPartial({}) + }; +} +export const QueryProposalResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposal !== undefined) { + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + message.proposal = object.proposal !== undefined && object.proposal !== null ? Proposal.fromPartial(object.proposal) : undefined; + return message; + }, + fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; + }, + toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { + const obj: any = {}; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { + return QueryProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { + return { + type: "cosmos-sdk/QueryProposalResponse", + value: QueryProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { + return QueryProposalResponse.decode(message.value); + }, + toProto(message: QueryProposalResponse): Uint8Array { + return QueryProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalResponse): QueryProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse", + value: QueryProposalResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsRequest(): QueryProposalsRequest { + return { + proposalStatus: 0, + voter: "", + depositor: "", + pagination: undefined + }; +} +export const QueryProposalsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest", + encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalStatus !== 0) { + writer.uint32(8).int32(message.proposalStatus); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.depositor !== "") { + writer.uint32(26).string(message.depositor); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalStatus = reader.int32() as any; + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.depositor = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + message.proposalStatus = object.proposalStatus ?? 0; + message.voter = object.voter ?? ""; + message.depositor = object.depositor ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + if (object.proposal_status !== undefined && object.proposal_status !== null) { + message.proposalStatus = object.proposal_status; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { + const obj: any = {}; + obj.proposal_status = message.proposalStatus === 0 ? undefined : message.proposalStatus; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsRequestAminoMsg): QueryProposalsRequest { + return QueryProposalsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsRequest): QueryProposalsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryProposalsRequest", + value: QueryProposalsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsRequestProtoMsg): QueryProposalsRequest { + return QueryProposalsRequest.decode(message.value); + }, + toProto(message: QueryProposalsRequest): Uint8Array { + return QueryProposalsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsRequest): QueryProposalsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest", + value: QueryProposalsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { + proposals: [], + pagination: undefined + }; +} +export const QueryProposalsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse", + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsResponseAminoMsg): QueryProposalsResponse { + return QueryProposalsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsResponse): QueryProposalsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryProposalsResponse", + value: QueryProposalsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsResponseProtoMsg): QueryProposalsResponse { + return QueryProposalsResponse.decode(message.value); + }, + toProto(message: QueryProposalsResponse): Uint8Array { + return QueryProposalsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsResponse): QueryProposalsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse", + value: QueryProposalsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVoteRequest(): QueryVoteRequest { + return { + proposalId: BigInt(0), + voter: "" + }; +} +export const QueryVoteRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest", + encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + return obj; + }, + fromAminoMsg(object: QueryVoteRequestAminoMsg): QueryVoteRequest { + return QueryVoteRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteRequest): QueryVoteRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVoteRequest", + value: QueryVoteRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteRequestProtoMsg): QueryVoteRequest { + return QueryVoteRequest.decode(message.value); + }, + toProto(message: QueryVoteRequest): Uint8Array { + return QueryVoteRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteRequest): QueryVoteRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest", + value: QueryVoteRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVoteResponse(): QueryVoteResponse { + return { + vote: Vote.fromPartial({}) + }; +} +export const QueryVoteResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse", + encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vote !== undefined) { + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + message.vote = object.vote !== undefined && object.vote !== null ? Vote.fromPartial(object.vote) : undefined; + return message; + }, + fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; + }, + toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { + const obj: any = {}; + obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { + return QueryVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteResponse): QueryVoteResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVoteResponse", + value: QueryVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteResponseProtoMsg): QueryVoteResponse { + return QueryVoteResponse.decode(message.value); + }, + toProto(message: QueryVoteResponse): Uint8Array { + return QueryVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteResponse): QueryVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse", + value: QueryVoteResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVotesRequest(): QueryVotesRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryVotesRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest", + encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesRequestAminoMsg): QueryVotesRequest { + return QueryVotesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesRequest): QueryVotesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVotesRequest", + value: QueryVotesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesRequestProtoMsg): QueryVotesRequest { + return QueryVotesRequest.decode(message.value); + }, + toProto(message: QueryVotesRequest): Uint8Array { + return QueryVotesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesRequest): QueryVotesRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest", + value: QueryVotesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVotesResponse(): QueryVotesResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse", + encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesResponseAminoMsg): QueryVotesResponse { + return QueryVotesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesResponse): QueryVotesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVotesResponse", + value: QueryVotesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesResponseProtoMsg): QueryVotesResponse { + return QueryVotesResponse.decode(message.value); + }, + toProto(message: QueryVotesResponse): Uint8Array { + return QueryVotesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesResponse): QueryVotesResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse", + value: QueryVotesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { + paramsType: "" + }; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest", + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.paramsType !== "") { + writer.uint32(10).string(message.paramsType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paramsType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.paramsType = object.paramsType ?? ""; + return message; + }, + fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + if (object.params_type !== undefined && object.params_type !== null) { + message.paramsType = object.params_type; + } + return message; + }, + toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + obj.params_type = message.paramsType === "" ? undefined : message.paramsType; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + votingParams: VotingParams.fromPartial({}), + depositParams: DepositParams.fromPartial({}), + tallyParams: TallyParams.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 2: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 3: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.votingParams = object.votingParams !== undefined && object.votingParams !== null ? VotingParams.fromPartial(object.votingParams) : undefined; + message.depositParams = object.depositParams !== undefined && object.depositParams !== null ? DepositParams.fromPartial(object.depositParams) : undefined; + message.tallyParams = object.tallyParams !== undefined && object.tallyParams !== null ? TallyParams.fromPartial(object.tallyParams) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositRequest(): QueryDepositRequest { + return { + proposalId: BigInt(0), + depositor: "" + }; +} +export const QueryDepositRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest", + encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + return message; + }, + fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; + }, + toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + return obj; + }, + fromAminoMsg(object: QueryDepositRequestAminoMsg): QueryDepositRequest { + return QueryDepositRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositRequest): QueryDepositRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDepositRequest", + value: QueryDepositRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositRequestProtoMsg): QueryDepositRequest { + return QueryDepositRequest.decode(message.value); + }, + toProto(message: QueryDepositRequest): Uint8Array { + return QueryDepositRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositRequest): QueryDepositRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest", + value: QueryDepositRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositResponse(): QueryDepositResponse { + return { + deposit: Deposit.fromPartial({}) + }; +} +export const QueryDepositResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse", + encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { + const obj: any = {}; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { + return QueryDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositResponse): QueryDepositResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDepositResponse", + value: QueryDepositResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositResponseProtoMsg): QueryDepositResponse { + return QueryDepositResponse.decode(message.value); + }, + toProto(message: QueryDepositResponse): Uint8Array { + return QueryDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositResponse): QueryDepositResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse", + value: QueryDepositResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryDepositsRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest", + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositsRequestAminoMsg): QueryDepositsRequest { + return QueryDepositsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositsRequest): QueryDepositsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDepositsRequest", + value: QueryDepositsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositsRequestProtoMsg): QueryDepositsRequest { + return QueryDepositsRequest.decode(message.value); + }, + toProto(message: QueryDepositsRequest): Uint8Array { + return QueryDepositsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsRequest): QueryDepositsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest", + value: QueryDepositsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { + deposits: [], + pagination: undefined + }; +} +export const QueryDepositsResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse", + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositsResponseAminoMsg): QueryDepositsResponse { + return QueryDepositsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositsResponse): QueryDepositsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDepositsResponse", + value: QueryDepositsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositsResponseProtoMsg): QueryDepositsResponse { + return QueryDepositsResponse.decode(message.value); + }, + toProto(message: QueryDepositsResponse): Uint8Array { + return QueryDepositsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsResponse): QueryDepositsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse", + value: QueryDepositsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryTallyResultRequest = { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTallyResultRequest", + value: QueryTallyResultRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultRequestProtoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.decode(message.value); + }, + toProto(message: QueryTallyResultRequest): Uint8Array { + return QueryTallyResultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest", + value: QueryTallyResultRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { + tally: TallyResult.fromPartial({}) + }; +} +export const QueryTallyResultResponse = { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tally !== undefined) { + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + message.tally = object.tally !== undefined && object.tally !== null ? TallyResult.fromPartial(object.tally) : undefined; + return message; + }, + fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; + }, + toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { + const obj: any = {}; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTallyResultResponse", + value: QueryTallyResultResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultResponseProtoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.decode(message.value); + }, + toProto(message: QueryTallyResultResponse): Uint8Array { + return QueryTallyResultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse", + value: QueryTallyResultResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.amino.ts new file mode 100644 index 00000000..933c1663 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.amino.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const AminoConverter = { + "/cosmos.gov.v1beta1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/MsgSubmitProposal", + toAmino: MsgSubmitProposal.toAmino, + fromAmino: MsgSubmitProposal.fromAmino + }, + "/cosmos.gov.v1beta1.MsgVote": { + aminoType: "cosmos-sdk/MsgVote", + toAmino: MsgVote.toAmino, + fromAmino: MsgVote.fromAmino + }, + "/cosmos.gov.v1beta1.MsgVoteWeighted": { + aminoType: "cosmos-sdk/MsgVoteWeighted", + toAmino: MsgVoteWeighted.toAmino, + fromAmino: MsgVoteWeighted.fromAmino + }, + "/cosmos.gov.v1beta1.MsgDeposit": { + aminoType: "cosmos-sdk/MsgDeposit", + toAmino: MsgDeposit.toAmino, + fromAmino: MsgDeposit.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.registry.ts new file mode 100644 index 00000000..604c0b30 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.registry.ts @@ -0,0 +1,89 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.gov.v1beta1.MsgVote", MsgVote], ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted], ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish() + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.encode(value).finish() + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(value).finish() + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.encode(value).finish() + }; + } + }, + withTypeUrl: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value + }; + } + }, + fromPartial: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value) + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.fromPartial(value) + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.fromPartial(value) + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..92c3feaa --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,49 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; +/** Msg defines the bank Msg service. */ +export interface Msg { + /** SubmitProposal defines a method to create new proposal given a content. */ + submitProposal(request: MsgSubmitProposal): Promise; + /** Vote defines a method to add a vote on a specific proposal. */ + vote(request: MsgVote): Promise; + /** + * VoteWeighted defines a method to add a weighted vote on a specific proposal. + * + * Since: cosmos-sdk 0.43 + */ + voteWeighted(request: MsgVoteWeighted): Promise; + /** Deposit defines a method to add deposit on a specific proposal. */ + deposit(request: MsgDeposit): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.submitProposal = this.submitProposal.bind(this); + this.vote = this.vote.bind(this); + this.voteWeighted = this.voteWeighted.bind(this); + this.deposit = this.deposit.bind(this); + } + submitProposal(request: MsgSubmitProposal): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "SubmitProposal", data); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); + } + vote(request: MsgVote): Promise { + const data = MsgVote.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); + } + voteWeighted(request: MsgVoteWeighted): Promise { + const data = MsgVoteWeighted.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "VoteWeighted", data); + return promise.then(data => MsgVoteWeightedResponse.decode(new BinaryReader(data))); + } + deposit(request: MsgDeposit): Promise { + const data = MsgDeposit.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); + return promise.then(data => MsgDepositResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.ts new file mode 100644 index 00000000..5dad39bd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/gov/v1beta1/tx.ts @@ -0,0 +1,1087 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, TextProposal, TextProposalProtoMsg, TextProposalSDKType } from "./gov"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; +import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | Any | undefined; + initialDeposit: Coin[]; + proposer: string; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; + value: Uint8Array; +} +export type MsgSubmitProposalEncoded = Omit & { + content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | AnyProtoMsg | undefined; +}; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + content?: AnyAmino; + initial_deposit?: CoinAmino[]; + proposer?: string; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + content?: CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | AnySDKType | undefined; + initial_deposit: CoinSDKType[]; + proposer: string; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + proposalId: bigint; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + proposal_id: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + proposalId: bigint; + voter: string; + option: VoteOption; +} +export interface MsgVoteProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVote"; + value: Uint8Array; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteAmino { + proposal_id?: string; + voter?: string; + option?: VoteOption; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteSDKType { + proposal_id: bigint; + voter: string; + option: VoteOption; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeighted { + proposalId: bigint; + voter: string; + options: WeightedVoteOption[]; +} +export interface MsgVoteWeightedProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted"; + value: Uint8Array; +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedAmino { + proposal_id: string; + voter?: string; + options?: WeightedVoteOptionAmino[]; +} +export interface MsgVoteWeightedAminoMsg { + type: "cosmos-sdk/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedSDKType { + proposal_id: bigint; + voter: string; + options: WeightedVoteOptionSDKType[]; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse"; + value: Uint8Array; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: "cosmos-sdk/MsgVoteWeightedResponse"; + value: MsgVoteWeightedResponseAmino; +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponseSDKType {} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + proposalId: bigint; + depositor: string; + amount: Coin[]; +} +export interface MsgDepositProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit"; + value: Uint8Array; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositAmino { + proposal_id: string; + depositor?: string; + amount?: CoinAmino[]; +} +export interface MsgDepositAminoMsg { + type: "cosmos-sdk/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositSDKType { + proposal_id: bigint; + depositor: string; + amount: CoinSDKType[]; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "cosmos-sdk/MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + content: undefined, + initialDeposit: [], + proposer: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode(message.content as Any, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.proposer !== "") { + writer.uint32(26).string(message.proposer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any; + break; + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + if (object.content !== undefined && object.content !== null) { + message.content = Cosmos_govv1beta1Content_FromAmino(object.content); + } + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; + }, + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) : undefined; + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.initial_deposit = message.initialDeposit; + } + obj.proposer = message.proposer === "" ? undefined : message.proposer; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposal", + value: MsgSubmitProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value); + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value); + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0 + }; +} +export const MsgVote = { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVote { + const message = createBaseMsgVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + return message; + }, + fromAmino(object: MsgVoteAmino): MsgVote { + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + return message; + }, + toAmino(message: MsgVote): MsgVoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + return obj; + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value); + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: "cosmos-sdk/MsgVote", + value: MsgVote.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { + return MsgVote.decode(message.value); + }, + toProto(message: MsgVote): Uint8Array { + return MsgVote.encode(message).finish(); + }, + toProtoMsg(message: MsgVote): MsgVoteProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { + return MsgVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { + return { + type: "cosmos-sdk/MsgVoteResponse", + value: MsgVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { + return MsgVoteResponse.decode(message.value); + }, + toProto(message: MsgVoteResponse): Uint8Array { + return MsgVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: "", + options: [] + }; +} +export const MsgVoteWeighted = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeighted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { + return MsgVoteWeighted.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { + return { + type: "cosmos-sdk/MsgVoteWeighted", + value: MsgVoteWeighted.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteWeightedProtoMsg): MsgVoteWeighted { + return MsgVoteWeighted.decode(message.value); + }, + toProto(message: MsgVoteWeighted): Uint8Array { + return MsgVoteWeighted.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(message).finish() + }; + } +}; +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} +export const MsgVoteWeightedResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse", + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeightedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, + fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, + toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedResponseAminoMsg): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseAminoMsg { + return { + type: "cosmos-sdk/MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteWeightedResponseProtoMsg): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.decode(message.value); + }, + toProto(message: MsgVoteWeightedResponse): Uint8Array { + return MsgVoteWeightedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const MsgDeposit = { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDeposit { + const message = createBaseMsgDeposit(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgDepositAmino): MsgDeposit { + const message = createBaseMsgDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgDeposit): MsgDepositAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { + return MsgDeposit.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { + return { + type: "cosmos-sdk/MsgDeposit", + value: MsgDeposit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositProtoMsg): MsgDeposit { + return MsgDeposit.decode(message.value); + }, + toProto(message: MsgDeposit): Uint8Array { + return MsgDeposit.encode(message).finish(); + }, + toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse", + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); + return message; + }, + fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); + return message; + }, + toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { + return MsgDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDepositResponse): MsgDepositResponseAminoMsg { + return { + type: "cosmos-sdk/MsgDepositResponse", + value: MsgDepositResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { + return MsgDepositResponse.decode(message.value); + }, + toProto(message: MsgDepositResponse): Uint8Array { + return MsgDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return CommunityPoolSpendProposal.decode(data.value); + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return CommunityPoolSpendProposalWithDeposit.decode(data.value); + case "/cosmos.gov.v1beta1.TextProposal": + return TextProposal.decode(data.value); + case "/cosmos.params.v1beta1.ParameterChangeProposal": + return ParameterChangeProposal.decode(data.value); + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return SoftwareUpgradeProposal.decode(data.value); + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return CancelSoftwareUpgradeProposal.decode(data.value); + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return StoreCodeProposal.decode(data.value); + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return InstantiateContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return InstantiateContract2Proposal.decode(data.value); + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return MigrateContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.SudoContractProposal": + return SudoContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return ExecuteContractProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return UpdateAdminProposal.decode(data.value); + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return ClearAdminProposal.decode(data.value); + case "/cosmwasm.wasm.v1.PinCodesProposal": + return PinCodesProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return UnpinCodesProposal.decode(data.value); + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return UpdateInstantiateConfigProposal.decode(data.value); + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return StoreAndInstantiateContractProposal.decode(data.value); + case "/ibc.core.client.v1.ClientUpdateProposal": + return ClientUpdateProposal.decode(data.value); + case "/ibc.core.client.v1.UpgradeProposal": + return UpgradeProposal.decode(data.value); + default: + return data; + } +}; +export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/CommunityPoolSpendProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CommunityPoolSpendProposalWithDeposit": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/TextProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ParameterChangeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + value: ParameterChangeProposal.encode(ParameterChangeProposal.fromPartial(ParameterChangeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/SoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CancelSoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreCodeProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(StoreCodeProposal.fromPartial(StoreCodeProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(InstantiateContractProposal.fromPartial(InstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContract2Proposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(InstantiateContract2Proposal.fromPartial(InstantiateContract2Proposal.fromAmino(content.value))).finish() + }); + case "wasm/MigrateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(MigrateContractProposal.fromPartial(MigrateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/SudoContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(SudoContractProposal.fromPartial(SudoContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/ExecuteContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(ExecuteContractProposal.fromPartial(ExecuteContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(UpdateAdminProposal.fromPartial(UpdateAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/ClearAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(ClearAdminProposal.fromPartial(ClearAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/PinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(PinCodesProposal.fromPartial(PinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UnpinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(UnpinCodesProposal.fromPartial(UnpinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateInstantiateConfigProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(UpdateInstantiateConfigProposal.fromPartial(UpdateInstantiateConfigProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreAndInstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(StoreAndInstantiateContractProposal.fromPartial(StoreAndInstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ClientUpdateProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/UpgradeProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return { + type: "cosmos-sdk/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined)) + }; + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined)) + }; + case "/cosmos.gov.v1beta1.TextProposal": + return { + type: "cosmos-sdk/TextProposal", + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) + }; + case "/cosmos.params.v1beta1.ParameterChangeProposal": + return { + type: "cosmos-sdk/ParameterChangeProposal", + value: ParameterChangeProposal.toAmino(ParameterChangeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(StoreCodeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(InstantiateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(InstantiateContract2Proposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(MigrateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.SudoContractProposal": + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(SudoContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(ExecuteContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(UpdateAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(ClearAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.PinCodesProposal": + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(PinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(UnpinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(UpdateInstantiateConfigProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(StoreAndInstantiateContractProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.ClientUpdateProposal": + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.UpgradeProposal": + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/events.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/events.ts new file mode 100644 index 00000000..406223f1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/events.ts @@ -0,0 +1,856 @@ +//@ts-nocheck +import { ProposalExecutorResult } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroup { + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface EventCreateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventCreateGroup"; + value: Uint8Array; +} +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroupAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface EventCreateGroupAminoMsg { + type: "cosmos-sdk/EventCreateGroup"; + value: EventCreateGroupAmino; +} +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroupSDKType { + group_id: bigint; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroup { + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface EventUpdateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventUpdateGroup"; + value: Uint8Array; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroupAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface EventUpdateGroupAminoMsg { + type: "cosmos-sdk/EventUpdateGroup"; + value: EventUpdateGroupAmino; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroupSDKType { + group_id: bigint; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicy { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy"; + value: Uint8Array; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicyAmino { + /** address is the account address of the group policy. */ + address?: string; +} +export interface EventCreateGroupPolicyAminoMsg { + type: "cosmos-sdk/EventCreateGroupPolicy"; + value: EventCreateGroupPolicyAmino; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicySDKType { + address: string; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicy { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventUpdateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy"; + value: Uint8Array; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicyAmino { + /** address is the account address of the group policy. */ + address?: string; +} +export interface EventUpdateGroupPolicyAminoMsg { + type: "cosmos-sdk/EventUpdateGroupPolicy"; + value: EventUpdateGroupPolicyAmino; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicySDKType { + address: string; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposal { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface EventSubmitProposalProtoMsg { + typeUrl: "/cosmos.group.v1.EventSubmitProposal"; + value: Uint8Array; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposalAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface EventSubmitProposalAminoMsg { + type: "cosmos-sdk/EventSubmitProposal"; + value: EventSubmitProposalAmino; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposalSDKType { + proposal_id: bigint; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposal { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface EventWithdrawProposalProtoMsg { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal"; + value: Uint8Array; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposalAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface EventWithdrawProposalAminoMsg { + type: "cosmos-sdk/EventWithdrawProposal"; + value: EventWithdrawProposalAmino; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposalSDKType { + proposal_id: bigint; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVote { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface EventVoteProtoMsg { + typeUrl: "/cosmos.group.v1.EventVote"; + value: Uint8Array; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVoteAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface EventVoteAminoMsg { + type: "cosmos-sdk/EventVote"; + value: EventVoteAmino; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVoteSDKType { + proposal_id: bigint; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExec { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; + /** result is the proposal execution result. */ + result: ProposalExecutorResult; +} +export interface EventExecProtoMsg { + typeUrl: "/cosmos.group.v1.EventExec"; + value: Uint8Array; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExecAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; + /** result is the proposal execution result. */ + result?: ProposalExecutorResult; +} +export interface EventExecAminoMsg { + type: "cosmos-sdk/EventExec"; + value: EventExecAmino; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExecSDKType { + proposal_id: bigint; + result: ProposalExecutorResult; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroup { + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** address is the account address of the group member. */ + address: string; +} +export interface EventLeaveGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventLeaveGroup"; + value: Uint8Array; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroupAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; + /** address is the account address of the group member. */ + address?: string; +} +export interface EventLeaveGroupAminoMsg { + type: "cosmos-sdk/EventLeaveGroup"; + value: EventLeaveGroupAmino; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroupSDKType { + group_id: bigint; + address: string; +} +function createBaseEventCreateGroup(): EventCreateGroup { + return { + groupId: BigInt(0) + }; +} +export const EventCreateGroup = { + typeUrl: "/cosmos.group.v1.EventCreateGroup", + encode(message: EventCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventCreateGroup { + const message = createBaseEventCreateGroup(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventCreateGroupAmino): EventCreateGroup { + const message = createBaseEventCreateGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: EventCreateGroup): EventCreateGroupAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventCreateGroupAminoMsg): EventCreateGroup { + return EventCreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: EventCreateGroup): EventCreateGroupAminoMsg { + return { + type: "cosmos-sdk/EventCreateGroup", + value: EventCreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: EventCreateGroupProtoMsg): EventCreateGroup { + return EventCreateGroup.decode(message.value); + }, + toProto(message: EventCreateGroup): Uint8Array { + return EventCreateGroup.encode(message).finish(); + }, + toProtoMsg(message: EventCreateGroup): EventCreateGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventCreateGroup", + value: EventCreateGroup.encode(message).finish() + }; + } +}; +function createBaseEventUpdateGroup(): EventUpdateGroup { + return { + groupId: BigInt(0) + }; +} +export const EventUpdateGroup = { + typeUrl: "/cosmos.group.v1.EventUpdateGroup", + encode(message: EventUpdateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventUpdateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventUpdateGroup { + const message = createBaseEventUpdateGroup(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventUpdateGroupAmino): EventUpdateGroup { + const message = createBaseEventUpdateGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: EventUpdateGroup): EventUpdateGroupAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventUpdateGroupAminoMsg): EventUpdateGroup { + return EventUpdateGroup.fromAmino(object.value); + }, + toAminoMsg(message: EventUpdateGroup): EventUpdateGroupAminoMsg { + return { + type: "cosmos-sdk/EventUpdateGroup", + value: EventUpdateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: EventUpdateGroupProtoMsg): EventUpdateGroup { + return EventUpdateGroup.decode(message.value); + }, + toProto(message: EventUpdateGroup): Uint8Array { + return EventUpdateGroup.encode(message).finish(); + }, + toProtoMsg(message: EventUpdateGroup): EventUpdateGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventUpdateGroup", + value: EventUpdateGroup.encode(message).finish() + }; + } +}; +function createBaseEventCreateGroupPolicy(): EventCreateGroupPolicy { + return { + address: "" + }; +} +export const EventCreateGroupPolicy = { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy", + encode(message: EventCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCreateGroupPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventCreateGroupPolicy { + const message = createBaseEventCreateGroupPolicy(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: EventCreateGroupPolicyAmino): EventCreateGroupPolicy { + const message = createBaseEventCreateGroupPolicy(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: EventCreateGroupPolicy): EventCreateGroupPolicyAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: EventCreateGroupPolicyAminoMsg): EventCreateGroupPolicy { + return EventCreateGroupPolicy.fromAmino(object.value); + }, + toAminoMsg(message: EventCreateGroupPolicy): EventCreateGroupPolicyAminoMsg { + return { + type: "cosmos-sdk/EventCreateGroupPolicy", + value: EventCreateGroupPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: EventCreateGroupPolicyProtoMsg): EventCreateGroupPolicy { + return EventCreateGroupPolicy.decode(message.value); + }, + toProto(message: EventCreateGroupPolicy): Uint8Array { + return EventCreateGroupPolicy.encode(message).finish(); + }, + toProtoMsg(message: EventCreateGroupPolicy): EventCreateGroupPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy", + value: EventCreateGroupPolicy.encode(message).finish() + }; + } +}; +function createBaseEventUpdateGroupPolicy(): EventUpdateGroupPolicy { + return { + address: "" + }; +} +export const EventUpdateGroupPolicy = { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy", + encode(message: EventUpdateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventUpdateGroupPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventUpdateGroupPolicy { + const message = createBaseEventUpdateGroupPolicy(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: EventUpdateGroupPolicyAmino): EventUpdateGroupPolicy { + const message = createBaseEventUpdateGroupPolicy(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: EventUpdateGroupPolicyAminoMsg): EventUpdateGroupPolicy { + return EventUpdateGroupPolicy.fromAmino(object.value); + }, + toAminoMsg(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyAminoMsg { + return { + type: "cosmos-sdk/EventUpdateGroupPolicy", + value: EventUpdateGroupPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: EventUpdateGroupPolicyProtoMsg): EventUpdateGroupPolicy { + return EventUpdateGroupPolicy.decode(message.value); + }, + toProto(message: EventUpdateGroupPolicy): Uint8Array { + return EventUpdateGroupPolicy.encode(message).finish(); + }, + toProtoMsg(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy", + value: EventUpdateGroupPolicy.encode(message).finish() + }; + } +}; +function createBaseEventSubmitProposal(): EventSubmitProposal { + return { + proposalId: BigInt(0) + }; +} +export const EventSubmitProposal = { + typeUrl: "/cosmos.group.v1.EventSubmitProposal", + encode(message: EventSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventSubmitProposal { + const message = createBaseEventSubmitProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventSubmitProposalAmino): EventSubmitProposal { + const message = createBaseEventSubmitProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: EventSubmitProposal): EventSubmitProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventSubmitProposalAminoMsg): EventSubmitProposal { + return EventSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: EventSubmitProposal): EventSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/EventSubmitProposal", + value: EventSubmitProposal.toAmino(message) + }; + }, + fromProtoMsg(message: EventSubmitProposalProtoMsg): EventSubmitProposal { + return EventSubmitProposal.decode(message.value); + }, + toProto(message: EventSubmitProposal): Uint8Array { + return EventSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: EventSubmitProposal): EventSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventSubmitProposal", + value: EventSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseEventWithdrawProposal(): EventWithdrawProposal { + return { + proposalId: BigInt(0) + }; +} +export const EventWithdrawProposal = { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal", + encode(message: EventWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventWithdrawProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventWithdrawProposal { + const message = createBaseEventWithdrawProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventWithdrawProposalAmino): EventWithdrawProposal { + const message = createBaseEventWithdrawProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: EventWithdrawProposal): EventWithdrawProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventWithdrawProposalAminoMsg): EventWithdrawProposal { + return EventWithdrawProposal.fromAmino(object.value); + }, + toAminoMsg(message: EventWithdrawProposal): EventWithdrawProposalAminoMsg { + return { + type: "cosmos-sdk/EventWithdrawProposal", + value: EventWithdrawProposal.toAmino(message) + }; + }, + fromProtoMsg(message: EventWithdrawProposalProtoMsg): EventWithdrawProposal { + return EventWithdrawProposal.decode(message.value); + }, + toProto(message: EventWithdrawProposal): Uint8Array { + return EventWithdrawProposal.encode(message).finish(); + }, + toProtoMsg(message: EventWithdrawProposal): EventWithdrawProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal", + value: EventWithdrawProposal.encode(message).finish() + }; + } +}; +function createBaseEventVote(): EventVote { + return { + proposalId: BigInt(0) + }; +} +export const EventVote = { + typeUrl: "/cosmos.group.v1.EventVote", + encode(message: EventVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventVote { + const message = createBaseEventVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventVoteAmino): EventVote { + const message = createBaseEventVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: EventVote): EventVoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventVoteAminoMsg): EventVote { + return EventVote.fromAmino(object.value); + }, + toAminoMsg(message: EventVote): EventVoteAminoMsg { + return { + type: "cosmos-sdk/EventVote", + value: EventVote.toAmino(message) + }; + }, + fromProtoMsg(message: EventVoteProtoMsg): EventVote { + return EventVote.decode(message.value); + }, + toProto(message: EventVote): Uint8Array { + return EventVote.encode(message).finish(); + }, + toProtoMsg(message: EventVote): EventVoteProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventVote", + value: EventVote.encode(message).finish() + }; + } +}; +function createBaseEventExec(): EventExec { + return { + proposalId: BigInt(0), + result: 0 + }; +} +export const EventExec = { + typeUrl: "/cosmos.group.v1.EventExec", + encode(message: EventExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.result !== 0) { + writer.uint32(16).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventExec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventExec { + const message = createBaseEventExec(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: EventExecAmino): EventExec { + const message = createBaseEventExec(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: EventExec): EventExecAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: EventExecAminoMsg): EventExec { + return EventExec.fromAmino(object.value); + }, + toAminoMsg(message: EventExec): EventExecAminoMsg { + return { + type: "cosmos-sdk/EventExec", + value: EventExec.toAmino(message) + }; + }, + fromProtoMsg(message: EventExecProtoMsg): EventExec { + return EventExec.decode(message.value); + }, + toProto(message: EventExec): Uint8Array { + return EventExec.encode(message).finish(); + }, + toProtoMsg(message: EventExec): EventExecProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventExec", + value: EventExec.encode(message).finish() + }; + } +}; +function createBaseEventLeaveGroup(): EventLeaveGroup { + return { + groupId: BigInt(0), + address: "" + }; +} +export const EventLeaveGroup = { + typeUrl: "/cosmos.group.v1.EventLeaveGroup", + encode(message: EventLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventLeaveGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventLeaveGroup { + const message = createBaseEventLeaveGroup(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: EventLeaveGroupAmino): EventLeaveGroup { + const message = createBaseEventLeaveGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: EventLeaveGroup): EventLeaveGroupAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: EventLeaveGroupAminoMsg): EventLeaveGroup { + return EventLeaveGroup.fromAmino(object.value); + }, + toAminoMsg(message: EventLeaveGroup): EventLeaveGroupAminoMsg { + return { + type: "cosmos-sdk/EventLeaveGroup", + value: EventLeaveGroup.toAmino(message) + }; + }, + fromProtoMsg(message: EventLeaveGroupProtoMsg): EventLeaveGroup { + return EventLeaveGroup.decode(message.value); + }, + toProto(message: EventLeaveGroup): Uint8Array { + return EventLeaveGroup.encode(message).finish(); + }, + toProtoMsg(message: EventLeaveGroup): EventLeaveGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventLeaveGroup", + value: EventLeaveGroup.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/genesis.ts new file mode 100644 index 00000000..44d152d4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/genesis.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +import { GroupInfo, GroupInfoAmino, GroupInfoSDKType, GroupMember, GroupMemberAmino, GroupMemberSDKType, GroupPolicyInfo, GroupPolicyInfoAmino, GroupPolicyInfoSDKType, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the group module's genesis state. */ +export interface GenesisState { + /** + * group_seq is the group table orm.Sequence, + * it is used to get the next group ID. + */ + groupSeq: bigint; + /** groups is the list of groups info. */ + groups: GroupInfo[]; + /** group_members is the list of groups members. */ + groupMembers: GroupMember[]; + /** + * group_policy_seq is the group policy table orm.Sequence, + * it is used to generate the next group policy account address. + */ + groupPolicySeq: bigint; + /** group_policies is the list of group policies info. */ + groupPolicies: GroupPolicyInfo[]; + /** + * proposal_seq is the proposal table orm.Sequence, + * it is used to get the next proposal ID. + */ + proposalSeq: bigint; + /** proposals is the list of proposals. */ + proposals: Proposal[]; + /** votes is the list of votes. */ + votes: Vote[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.group.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the group module's genesis state. */ +export interface GenesisStateAmino { + /** + * group_seq is the group table orm.Sequence, + * it is used to get the next group ID. + */ + group_seq?: string; + /** groups is the list of groups info. */ + groups?: GroupInfoAmino[]; + /** group_members is the list of groups members. */ + group_members?: GroupMemberAmino[]; + /** + * group_policy_seq is the group policy table orm.Sequence, + * it is used to generate the next group policy account address. + */ + group_policy_seq?: string; + /** group_policies is the list of group policies info. */ + group_policies?: GroupPolicyInfoAmino[]; + /** + * proposal_seq is the proposal table orm.Sequence, + * it is used to get the next proposal ID. + */ + proposal_seq?: string; + /** proposals is the list of proposals. */ + proposals?: ProposalAmino[]; + /** votes is the list of votes. */ + votes?: VoteAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the group module's genesis state. */ +export interface GenesisStateSDKType { + group_seq: bigint; + groups: GroupInfoSDKType[]; + group_members: GroupMemberSDKType[]; + group_policy_seq: bigint; + group_policies: GroupPolicyInfoSDKType[]; + proposal_seq: bigint; + proposals: ProposalSDKType[]; + votes: VoteSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + groupSeq: BigInt(0), + groups: [], + groupMembers: [], + groupPolicySeq: BigInt(0), + groupPolicies: [], + proposalSeq: BigInt(0), + proposals: [], + votes: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.group.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupSeq !== BigInt(0)) { + writer.uint32(8).uint64(message.groupSeq); + } + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.groupMembers) { + GroupMember.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.groupPolicySeq !== BigInt(0)) { + writer.uint32(32).uint64(message.groupPolicySeq); + } + for (const v of message.groupPolicies) { + GroupPolicyInfo.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.proposalSeq !== BigInt(0)) { + writer.uint32(48).uint64(message.proposalSeq); + } + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupSeq = reader.uint64(); + break; + case 2: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 3: + message.groupMembers.push(GroupMember.decode(reader, reader.uint32())); + break; + case 4: + message.groupPolicySeq = reader.uint64(); + break; + case 5: + message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); + break; + case 6: + message.proposalSeq = reader.uint64(); + break; + case 7: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 8: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.groupSeq = object.groupSeq !== undefined && object.groupSeq !== null ? BigInt(object.groupSeq.toString()) : BigInt(0); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.groupMembers = object.groupMembers?.map(e => GroupMember.fromPartial(e)) || []; + message.groupPolicySeq = object.groupPolicySeq !== undefined && object.groupPolicySeq !== null ? BigInt(object.groupPolicySeq.toString()) : BigInt(0); + message.groupPolicies = object.groupPolicies?.map(e => GroupPolicyInfo.fromPartial(e)) || []; + message.proposalSeq = object.proposalSeq !== undefined && object.proposalSeq !== null ? BigInt(object.proposalSeq.toString()) : BigInt(0); + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.group_seq !== undefined && object.group_seq !== null) { + message.groupSeq = BigInt(object.group_seq); + } + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + message.groupMembers = object.group_members?.map(e => GroupMember.fromAmino(e)) || []; + if (object.group_policy_seq !== undefined && object.group_policy_seq !== null) { + message.groupPolicySeq = BigInt(object.group_policy_seq); + } + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.proposal_seq !== undefined && object.proposal_seq !== null) { + message.proposalSeq = BigInt(object.proposal_seq); + } + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.group_seq = message.groupSeq !== BigInt(0) ? message.groupSeq.toString() : undefined; + if (message.groups) { + obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); + } else { + obj.groups = message.groups; + } + if (message.groupMembers) { + obj.group_members = message.groupMembers.map(e => e ? GroupMember.toAmino(e) : undefined); + } else { + obj.group_members = message.groupMembers; + } + obj.group_policy_seq = message.groupPolicySeq !== BigInt(0) ? message.groupPolicySeq.toString() : undefined; + if (message.groupPolicies) { + obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); + } else { + obj.group_policies = message.groupPolicies; + } + obj.proposal_seq = message.proposalSeq !== BigInt(0) ? message.proposalSeq.toString() : undefined; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/query.rpc.Query.ts new file mode 100644 index 00000000..eb918db5 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/query.rpc.Query.ts @@ -0,0 +1,163 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +/** Query is the cosmos.group.v1 Query service. */ +export interface Query { + /** GroupInfo queries group info based on group id. */ + groupInfo(request: QueryGroupInfoRequest): Promise; + /** GroupPolicyInfo queries group policy info based on account address of group policy. */ + groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise; + /** GroupMembers queries members of a group */ + groupMembers(request: QueryGroupMembersRequest): Promise; + /** GroupsByAdmin queries groups by admin address. */ + groupsByAdmin(request: QueryGroupsByAdminRequest): Promise; + /** GroupPoliciesByGroup queries group policies by group id. */ + groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise; + /** GroupsByAdmin queries group policies by admin address. */ + groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise; + /** Proposal queries a proposal based on proposal id. */ + proposal(request: QueryProposalRequest): Promise; + /** ProposalsByGroupPolicy queries proposals based on account address of group policy. */ + proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise; + /** VoteByProposalVoter queries a vote by proposal id and voter. */ + voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise; + /** VotesByProposal queries a vote by proposal. */ + votesByProposal(request: QueryVotesByProposalRequest): Promise; + /** VotesByVoter queries a vote by voter. */ + votesByVoter(request: QueryVotesByVoterRequest): Promise; + /** GroupsByMember queries groups by member address. */ + groupsByMember(request: QueryGroupsByMemberRequest): Promise; + /** TallyResult queries the tally of a proposal votes. */ + tallyResult(request: QueryTallyResultRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.groupInfo = this.groupInfo.bind(this); + this.groupPolicyInfo = this.groupPolicyInfo.bind(this); + this.groupMembers = this.groupMembers.bind(this); + this.groupsByAdmin = this.groupsByAdmin.bind(this); + this.groupPoliciesByGroup = this.groupPoliciesByGroup.bind(this); + this.groupPoliciesByAdmin = this.groupPoliciesByAdmin.bind(this); + this.proposal = this.proposal.bind(this); + this.proposalsByGroupPolicy = this.proposalsByGroupPolicy.bind(this); + this.voteByProposalVoter = this.voteByProposalVoter.bind(this); + this.votesByProposal = this.votesByProposal.bind(this); + this.votesByVoter = this.votesByVoter.bind(this); + this.groupsByMember = this.groupsByMember.bind(this); + this.tallyResult = this.tallyResult.bind(this); + } + groupInfo(request: QueryGroupInfoRequest): Promise { + const data = QueryGroupInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupInfo", data); + return promise.then(data => QueryGroupInfoResponse.decode(new BinaryReader(data))); + } + groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise { + const data = QueryGroupPolicyInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPolicyInfo", data); + return promise.then(data => QueryGroupPolicyInfoResponse.decode(new BinaryReader(data))); + } + groupMembers(request: QueryGroupMembersRequest): Promise { + const data = QueryGroupMembersRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupMembers", data); + return promise.then(data => QueryGroupMembersResponse.decode(new BinaryReader(data))); + } + groupsByAdmin(request: QueryGroupsByAdminRequest): Promise { + const data = QueryGroupsByAdminRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByAdmin", data); + return promise.then(data => QueryGroupsByAdminResponse.decode(new BinaryReader(data))); + } + groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise { + const data = QueryGroupPoliciesByGroupRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByGroup", data); + return promise.then(data => QueryGroupPoliciesByGroupResponse.decode(new BinaryReader(data))); + } + groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise { + const data = QueryGroupPoliciesByAdminRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByAdmin", data); + return promise.then(data => QueryGroupPoliciesByAdminResponse.decode(new BinaryReader(data))); + } + proposal(request: QueryProposalRequest): Promise { + const data = QueryProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "Proposal", data); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); + } + proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise { + const data = QueryProposalsByGroupPolicyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "ProposalsByGroupPolicy", data); + return promise.then(data => QueryProposalsByGroupPolicyResponse.decode(new BinaryReader(data))); + } + voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise { + const data = QueryVoteByProposalVoterRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "VoteByProposalVoter", data); + return promise.then(data => QueryVoteByProposalVoterResponse.decode(new BinaryReader(data))); + } + votesByProposal(request: QueryVotesByProposalRequest): Promise { + const data = QueryVotesByProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByProposal", data); + return promise.then(data => QueryVotesByProposalResponse.decode(new BinaryReader(data))); + } + votesByVoter(request: QueryVotesByVoterRequest): Promise { + const data = QueryVotesByVoterRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByVoter", data); + return promise.then(data => QueryVotesByVoterResponse.decode(new BinaryReader(data))); + } + groupsByMember(request: QueryGroupsByMemberRequest): Promise { + const data = QueryGroupsByMemberRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByMember", data); + return promise.then(data => QueryGroupsByMemberResponse.decode(new BinaryReader(data))); + } + tallyResult(request: QueryTallyResultRequest): Promise { + const data = QueryTallyResultRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + groupInfo(request: QueryGroupInfoRequest): Promise { + return queryService.groupInfo(request); + }, + groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise { + return queryService.groupPolicyInfo(request); + }, + groupMembers(request: QueryGroupMembersRequest): Promise { + return queryService.groupMembers(request); + }, + groupsByAdmin(request: QueryGroupsByAdminRequest): Promise { + return queryService.groupsByAdmin(request); + }, + groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise { + return queryService.groupPoliciesByGroup(request); + }, + groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise { + return queryService.groupPoliciesByAdmin(request); + }, + proposal(request: QueryProposalRequest): Promise { + return queryService.proposal(request); + }, + proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise { + return queryService.proposalsByGroupPolicy(request); + }, + voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise { + return queryService.voteByProposalVoter(request); + }, + votesByProposal(request: QueryVotesByProposalRequest): Promise { + return queryService.votesByProposal(request); + }, + votesByVoter(request: QueryVotesByVoterRequest): Promise { + return queryService.votesByVoter(request); + }, + groupsByMember(request: QueryGroupsByMemberRequest): Promise { + return queryService.groupsByMember(request); + }, + tallyResult(request: QueryTallyResultRequest): Promise { + return queryService.tallyResult(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/query.ts new file mode 100644 index 00000000..c8150ce3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/query.ts @@ -0,0 +1,2675 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { GroupInfo, GroupInfoAmino, GroupInfoSDKType, GroupPolicyInfo, GroupPolicyInfoAmino, GroupPolicyInfoSDKType, GroupMember, GroupMemberAmino, GroupMemberSDKType, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, TallyResult, TallyResultAmino, TallyResultSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryGroupInfoRequest is the Query/GroupInfo request type. */ +export interface QueryGroupInfoRequest { + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface QueryGroupInfoRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest"; + value: Uint8Array; +} +/** QueryGroupInfoRequest is the Query/GroupInfo request type. */ +export interface QueryGroupInfoRequestAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface QueryGroupInfoRequestAminoMsg { + type: "cosmos-sdk/QueryGroupInfoRequest"; + value: QueryGroupInfoRequestAmino; +} +/** QueryGroupInfoRequest is the Query/GroupInfo request type. */ +export interface QueryGroupInfoRequestSDKType { + group_id: bigint; +} +/** QueryGroupInfoResponse is the Query/GroupInfo response type. */ +export interface QueryGroupInfoResponse { + /** info is the GroupInfo for the group. */ + info?: GroupInfo; +} +export interface QueryGroupInfoResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse"; + value: Uint8Array; +} +/** QueryGroupInfoResponse is the Query/GroupInfo response type. */ +export interface QueryGroupInfoResponseAmino { + /** info is the GroupInfo for the group. */ + info?: GroupInfoAmino; +} +export interface QueryGroupInfoResponseAminoMsg { + type: "cosmos-sdk/QueryGroupInfoResponse"; + value: QueryGroupInfoResponseAmino; +} +/** QueryGroupInfoResponse is the Query/GroupInfo response type. */ +export interface QueryGroupInfoResponseSDKType { + info?: GroupInfoSDKType; +} +/** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ +export interface QueryGroupPolicyInfoRequest { + /** address is the account address of the group policy. */ + address: string; +} +export interface QueryGroupPolicyInfoRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest"; + value: Uint8Array; +} +/** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ +export interface QueryGroupPolicyInfoRequestAmino { + /** address is the account address of the group policy. */ + address?: string; +} +export interface QueryGroupPolicyInfoRequestAminoMsg { + type: "cosmos-sdk/QueryGroupPolicyInfoRequest"; + value: QueryGroupPolicyInfoRequestAmino; +} +/** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ +export interface QueryGroupPolicyInfoRequestSDKType { + address: string; +} +/** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ +export interface QueryGroupPolicyInfoResponse { + /** info is the GroupPolicyInfo for the group policy. */ + info?: GroupPolicyInfo; +} +export interface QueryGroupPolicyInfoResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse"; + value: Uint8Array; +} +/** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ +export interface QueryGroupPolicyInfoResponseAmino { + /** info is the GroupPolicyInfo for the group policy. */ + info?: GroupPolicyInfoAmino; +} +export interface QueryGroupPolicyInfoResponseAminoMsg { + type: "cosmos-sdk/QueryGroupPolicyInfoResponse"; + value: QueryGroupPolicyInfoResponseAmino; +} +/** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ +export interface QueryGroupPolicyInfoResponseSDKType { + info?: GroupPolicyInfoSDKType; +} +/** QueryGroupMembersRequest is the Query/GroupMembers request type. */ +export interface QueryGroupMembersRequest { + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupMembersRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest"; + value: Uint8Array; +} +/** QueryGroupMembersRequest is the Query/GroupMembers request type. */ +export interface QueryGroupMembersRequestAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupMembersRequestAminoMsg { + type: "cosmos-sdk/QueryGroupMembersRequest"; + value: QueryGroupMembersRequestAmino; +} +/** QueryGroupMembersRequest is the Query/GroupMembers request type. */ +export interface QueryGroupMembersRequestSDKType { + group_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ +export interface QueryGroupMembersResponse { + /** members are the members of the group with given group_id. */ + members: GroupMember[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupMembersResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse"; + value: Uint8Array; +} +/** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ +export interface QueryGroupMembersResponseAmino { + /** members are the members of the group with given group_id. */ + members?: GroupMemberAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupMembersResponseAminoMsg { + type: "cosmos-sdk/QueryGroupMembersResponse"; + value: QueryGroupMembersResponseAmino; +} +/** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ +export interface QueryGroupMembersResponseSDKType { + members: GroupMemberSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ +export interface QueryGroupsByAdminRequest { + /** admin is the account address of a group's admin. */ + admin: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupsByAdminRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest"; + value: Uint8Array; +} +/** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ +export interface QueryGroupsByAdminRequestAmino { + /** admin is the account address of a group's admin. */ + admin?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupsByAdminRequestAminoMsg { + type: "cosmos-sdk/QueryGroupsByAdminRequest"; + value: QueryGroupsByAdminRequestAmino; +} +/** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ +export interface QueryGroupsByAdminRequestSDKType { + admin: string; + pagination?: PageRequestSDKType; +} +/** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ +export interface QueryGroupsByAdminResponse { + /** groups are the groups info with the provided admin. */ + groups: GroupInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupsByAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse"; + value: Uint8Array; +} +/** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ +export interface QueryGroupsByAdminResponseAmino { + /** groups are the groups info with the provided admin. */ + groups?: GroupInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupsByAdminResponseAminoMsg { + type: "cosmos-sdk/QueryGroupsByAdminResponse"; + value: QueryGroupsByAdminResponseAmino; +} +/** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ +export interface QueryGroupsByAdminResponseSDKType { + groups: GroupInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ +export interface QueryGroupPoliciesByGroupRequest { + /** group_id is the unique ID of the group policy's group. */ + groupId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupPoliciesByGroupRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest"; + value: Uint8Array; +} +/** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ +export interface QueryGroupPoliciesByGroupRequestAmino { + /** group_id is the unique ID of the group policy's group. */ + group_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupPoliciesByGroupRequestAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByGroupRequest"; + value: QueryGroupPoliciesByGroupRequestAmino; +} +/** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ +export interface QueryGroupPoliciesByGroupRequestSDKType { + group_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ +export interface QueryGroupPoliciesByGroupResponse { + /** group_policies are the group policies info associated with the provided group. */ + groupPolicies: GroupPolicyInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupPoliciesByGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse"; + value: Uint8Array; +} +/** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ +export interface QueryGroupPoliciesByGroupResponseAmino { + /** group_policies are the group policies info associated with the provided group. */ + group_policies?: GroupPolicyInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupPoliciesByGroupResponseAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByGroupResponse"; + value: QueryGroupPoliciesByGroupResponseAmino; +} +/** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ +export interface QueryGroupPoliciesByGroupResponseSDKType { + group_policies: GroupPolicyInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ +export interface QueryGroupPoliciesByAdminRequest { + /** admin is the admin address of the group policy. */ + admin: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupPoliciesByAdminRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest"; + value: Uint8Array; +} +/** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ +export interface QueryGroupPoliciesByAdminRequestAmino { + /** admin is the admin address of the group policy. */ + admin?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupPoliciesByAdminRequestAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByAdminRequest"; + value: QueryGroupPoliciesByAdminRequestAmino; +} +/** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ +export interface QueryGroupPoliciesByAdminRequestSDKType { + admin: string; + pagination?: PageRequestSDKType; +} +/** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ +export interface QueryGroupPoliciesByAdminResponse { + /** group_policies are the group policies info with provided admin. */ + groupPolicies: GroupPolicyInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupPoliciesByAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse"; + value: Uint8Array; +} +/** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ +export interface QueryGroupPoliciesByAdminResponseAmino { + /** group_policies are the group policies info with provided admin. */ + group_policies?: GroupPolicyInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupPoliciesByAdminResponseAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByAdminResponse"; + value: QueryGroupPoliciesByAdminResponseAmino; +} +/** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ +export interface QueryGroupPoliciesByAdminResponseSDKType { + group_policies: GroupPolicyInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryProposalRequest is the Query/Proposal request type. */ +export interface QueryProposalRequest { + /** proposal_id is the unique ID of a proposal. */ + proposalId: bigint; +} +export interface QueryProposalRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalRequest"; + value: Uint8Array; +} +/** QueryProposalRequest is the Query/Proposal request type. */ +export interface QueryProposalRequestAmino { + /** proposal_id is the unique ID of a proposal. */ + proposal_id?: string; +} +export interface QueryProposalRequestAminoMsg { + type: "cosmos-sdk/QueryProposalRequest"; + value: QueryProposalRequestAmino; +} +/** QueryProposalRequest is the Query/Proposal request type. */ +export interface QueryProposalRequestSDKType { + proposal_id: bigint; +} +/** QueryProposalResponse is the Query/Proposal response type. */ +export interface QueryProposalResponse { + /** proposal is the proposal info. */ + proposal?: Proposal; +} +export interface QueryProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalResponse"; + value: Uint8Array; +} +/** QueryProposalResponse is the Query/Proposal response type. */ +export interface QueryProposalResponseAmino { + /** proposal is the proposal info. */ + proposal?: ProposalAmino; +} +export interface QueryProposalResponseAminoMsg { + type: "cosmos-sdk/QueryProposalResponse"; + value: QueryProposalResponseAmino; +} +/** QueryProposalResponse is the Query/Proposal response type. */ +export interface QueryProposalResponseSDKType { + proposal?: ProposalSDKType; +} +/** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ +export interface QueryProposalsByGroupPolicyRequest { + /** address is the account address of the group policy related to proposals. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryProposalsByGroupPolicyRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest"; + value: Uint8Array; +} +/** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ +export interface QueryProposalsByGroupPolicyRequestAmino { + /** address is the account address of the group policy related to proposals. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryProposalsByGroupPolicyRequestAminoMsg { + type: "cosmos-sdk/QueryProposalsByGroupPolicyRequest"; + value: QueryProposalsByGroupPolicyRequestAmino; +} +/** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ +export interface QueryProposalsByGroupPolicyRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ +export interface QueryProposalsByGroupPolicyResponse { + /** proposals are the proposals with given group policy. */ + proposals: Proposal[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryProposalsByGroupPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse"; + value: Uint8Array; +} +/** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ +export interface QueryProposalsByGroupPolicyResponseAmino { + /** proposals are the proposals with given group policy. */ + proposals?: ProposalAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryProposalsByGroupPolicyResponseAminoMsg { + type: "cosmos-sdk/QueryProposalsByGroupPolicyResponse"; + value: QueryProposalsByGroupPolicyResponseAmino; +} +/** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ +export interface QueryProposalsByGroupPolicyResponseSDKType { + proposals: ProposalSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ +export interface QueryVoteByProposalVoterRequest { + /** proposal_id is the unique ID of a proposal. */ + proposalId: bigint; + /** voter is a proposal voter account address. */ + voter: string; +} +export interface QueryVoteByProposalVoterRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest"; + value: Uint8Array; +} +/** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ +export interface QueryVoteByProposalVoterRequestAmino { + /** proposal_id is the unique ID of a proposal. */ + proposal_id?: string; + /** voter is a proposal voter account address. */ + voter?: string; +} +export interface QueryVoteByProposalVoterRequestAminoMsg { + type: "cosmos-sdk/QueryVoteByProposalVoterRequest"; + value: QueryVoteByProposalVoterRequestAmino; +} +/** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ +export interface QueryVoteByProposalVoterRequestSDKType { + proposal_id: bigint; + voter: string; +} +/** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ +export interface QueryVoteByProposalVoterResponse { + /** vote is the vote with given proposal_id and voter. */ + vote?: Vote; +} +export interface QueryVoteByProposalVoterResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse"; + value: Uint8Array; +} +/** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ +export interface QueryVoteByProposalVoterResponseAmino { + /** vote is the vote with given proposal_id and voter. */ + vote?: VoteAmino; +} +export interface QueryVoteByProposalVoterResponseAminoMsg { + type: "cosmos-sdk/QueryVoteByProposalVoterResponse"; + value: QueryVoteByProposalVoterResponseAmino; +} +/** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ +export interface QueryVoteByProposalVoterResponseSDKType { + vote?: VoteSDKType; +} +/** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ +export interface QueryVotesByProposalRequest { + /** proposal_id is the unique ID of a proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryVotesByProposalRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest"; + value: Uint8Array; +} +/** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ +export interface QueryVotesByProposalRequestAmino { + /** proposal_id is the unique ID of a proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryVotesByProposalRequestAminoMsg { + type: "cosmos-sdk/QueryVotesByProposalRequest"; + value: QueryVotesByProposalRequestAmino; +} +/** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ +export interface QueryVotesByProposalRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ +export interface QueryVotesByProposalResponse { + /** votes are the list of votes for given proposal_id. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryVotesByProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse"; + value: Uint8Array; +} +/** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ +export interface QueryVotesByProposalResponseAmino { + /** votes are the list of votes for given proposal_id. */ + votes?: VoteAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryVotesByProposalResponseAminoMsg { + type: "cosmos-sdk/QueryVotesByProposalResponse"; + value: QueryVotesByProposalResponseAmino; +} +/** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ +export interface QueryVotesByProposalResponseSDKType { + votes: VoteSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ +export interface QueryVotesByVoterRequest { + /** voter is a proposal voter account address. */ + voter: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryVotesByVoterRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest"; + value: Uint8Array; +} +/** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ +export interface QueryVotesByVoterRequestAmino { + /** voter is a proposal voter account address. */ + voter?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryVotesByVoterRequestAminoMsg { + type: "cosmos-sdk/QueryVotesByVoterRequest"; + value: QueryVotesByVoterRequestAmino; +} +/** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ +export interface QueryVotesByVoterRequestSDKType { + voter: string; + pagination?: PageRequestSDKType; +} +/** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ +export interface QueryVotesByVoterResponse { + /** votes are the list of votes by given voter. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryVotesByVoterResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse"; + value: Uint8Array; +} +/** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ +export interface QueryVotesByVoterResponseAmino { + /** votes are the list of votes by given voter. */ + votes?: VoteAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryVotesByVoterResponseAminoMsg { + type: "cosmos-sdk/QueryVotesByVoterResponse"; + value: QueryVotesByVoterResponseAmino; +} +/** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ +export interface QueryVotesByVoterResponseSDKType { + votes: VoteSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ +export interface QueryGroupsByMemberRequest { + /** address is the group member address. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupsByMemberRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest"; + value: Uint8Array; +} +/** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ +export interface QueryGroupsByMemberRequestAmino { + /** address is the group member address. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupsByMemberRequestAminoMsg { + type: "cosmos-sdk/QueryGroupsByMemberRequest"; + value: QueryGroupsByMemberRequestAmino; +} +/** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ +export interface QueryGroupsByMemberRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ +export interface QueryGroupsByMemberResponse { + /** groups are the groups info with the provided group member. */ + groups: GroupInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupsByMemberResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse"; + value: Uint8Array; +} +/** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ +export interface QueryGroupsByMemberResponseAmino { + /** groups are the groups info with the provided group member. */ + groups?: GroupInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupsByMemberResponseAminoMsg { + type: "cosmos-sdk/QueryGroupsByMemberResponse"; + value: QueryGroupsByMemberResponseAmino; +} +/** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ +export interface QueryGroupsByMemberResponseSDKType { + groups: GroupInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryTallyResultRequest is the Query/TallyResult request type. */ +export interface QueryTallyResultRequest { + /** proposal_id is the unique id of a proposal. */ + proposalId: bigint; +} +export interface QueryTallyResultRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryTallyResultRequest"; + value: Uint8Array; +} +/** QueryTallyResultRequest is the Query/TallyResult request type. */ +export interface QueryTallyResultRequestAmino { + /** proposal_id is the unique id of a proposal. */ + proposal_id?: string; +} +export interface QueryTallyResultRequestAminoMsg { + type: "cosmos-sdk/QueryTallyResultRequest"; + value: QueryTallyResultRequestAmino; +} +/** QueryTallyResultRequest is the Query/TallyResult request type. */ +export interface QueryTallyResultRequestSDKType { + proposal_id: bigint; +} +/** QueryTallyResultResponse is the Query/TallyResult response type. */ +export interface QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally: TallyResult; +} +export interface QueryTallyResultResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryTallyResultResponse"; + value: Uint8Array; +} +/** QueryTallyResultResponse is the Query/TallyResult response type. */ +export interface QueryTallyResultResponseAmino { + /** tally defines the requested tally. */ + tally?: TallyResultAmino; +} +export interface QueryTallyResultResponseAminoMsg { + type: "cosmos-sdk/QueryTallyResultResponse"; + value: QueryTallyResultResponseAmino; +} +/** QueryTallyResultResponse is the Query/TallyResult response type. */ +export interface QueryTallyResultResponseSDKType { + tally: TallyResultSDKType; +} +function createBaseQueryGroupInfoRequest(): QueryGroupInfoRequest { + return { + groupId: BigInt(0) + }; +} +export const QueryGroupInfoRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest", + encode(message: QueryGroupInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupInfoRequest { + const message = createBaseQueryGroupInfoRequest(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryGroupInfoRequestAmino): QueryGroupInfoRequest { + const message = createBaseQueryGroupInfoRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: QueryGroupInfoRequest): QueryGroupInfoRequestAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupInfoRequestAminoMsg): QueryGroupInfoRequest { + return QueryGroupInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupInfoRequest): QueryGroupInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupInfoRequest", + value: QueryGroupInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupInfoRequestProtoMsg): QueryGroupInfoRequest { + return QueryGroupInfoRequest.decode(message.value); + }, + toProto(message: QueryGroupInfoRequest): Uint8Array { + return QueryGroupInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupInfoRequest): QueryGroupInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest", + value: QueryGroupInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupInfoResponse(): QueryGroupInfoResponse { + return { + info: undefined + }; +} +export const QueryGroupInfoResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse", + encode(message: QueryGroupInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + GroupInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = GroupInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupInfoResponse { + const message = createBaseQueryGroupInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? GroupInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryGroupInfoResponseAmino): QueryGroupInfoResponse { + const message = createBaseQueryGroupInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = GroupInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryGroupInfoResponse): QueryGroupInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? GroupInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupInfoResponseAminoMsg): QueryGroupInfoResponse { + return QueryGroupInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupInfoResponse): QueryGroupInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupInfoResponse", + value: QueryGroupInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupInfoResponseProtoMsg): QueryGroupInfoResponse { + return QueryGroupInfoResponse.decode(message.value); + }, + toProto(message: QueryGroupInfoResponse): Uint8Array { + return QueryGroupInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupInfoResponse): QueryGroupInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse", + value: QueryGroupInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPolicyInfoRequest(): QueryGroupPolicyInfoRequest { + return { + address: "" + }; +} +export const QueryGroupPolicyInfoRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest", + encode(message: QueryGroupPolicyInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPolicyInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPolicyInfoRequest { + const message = createBaseQueryGroupPolicyInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryGroupPolicyInfoRequestAmino): QueryGroupPolicyInfoRequest { + const message = createBaseQueryGroupPolicyInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryGroupPolicyInfoRequest): QueryGroupPolicyInfoRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryGroupPolicyInfoRequestAminoMsg): QueryGroupPolicyInfoRequest { + return QueryGroupPolicyInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPolicyInfoRequest): QueryGroupPolicyInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPolicyInfoRequest", + value: QueryGroupPolicyInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPolicyInfoRequestProtoMsg): QueryGroupPolicyInfoRequest { + return QueryGroupPolicyInfoRequest.decode(message.value); + }, + toProto(message: QueryGroupPolicyInfoRequest): Uint8Array { + return QueryGroupPolicyInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPolicyInfoRequest): QueryGroupPolicyInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest", + value: QueryGroupPolicyInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPolicyInfoResponse(): QueryGroupPolicyInfoResponse { + return { + info: undefined + }; +} +export const QueryGroupPolicyInfoResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse", + encode(message: QueryGroupPolicyInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + GroupPolicyInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPolicyInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = GroupPolicyInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPolicyInfoResponse { + const message = createBaseQueryGroupPolicyInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? GroupPolicyInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryGroupPolicyInfoResponseAmino): QueryGroupPolicyInfoResponse { + const message = createBaseQueryGroupPolicyInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = GroupPolicyInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryGroupPolicyInfoResponse): QueryGroupPolicyInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? GroupPolicyInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPolicyInfoResponseAminoMsg): QueryGroupPolicyInfoResponse { + return QueryGroupPolicyInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPolicyInfoResponse): QueryGroupPolicyInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPolicyInfoResponse", + value: QueryGroupPolicyInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPolicyInfoResponseProtoMsg): QueryGroupPolicyInfoResponse { + return QueryGroupPolicyInfoResponse.decode(message.value); + }, + toProto(message: QueryGroupPolicyInfoResponse): Uint8Array { + return QueryGroupPolicyInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPolicyInfoResponse): QueryGroupPolicyInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse", + value: QueryGroupPolicyInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupMembersRequest(): QueryGroupMembersRequest { + return { + groupId: BigInt(0), + pagination: undefined + }; +} +export const QueryGroupMembersRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest", + encode(message: QueryGroupMembersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupMembersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupMembersRequest { + const message = createBaseQueryGroupMembersRequest(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupMembersRequestAmino): QueryGroupMembersRequest { + const message = createBaseQueryGroupMembersRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupMembersRequest): QueryGroupMembersRequestAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupMembersRequestAminoMsg): QueryGroupMembersRequest { + return QueryGroupMembersRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupMembersRequest): QueryGroupMembersRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupMembersRequest", + value: QueryGroupMembersRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupMembersRequestProtoMsg): QueryGroupMembersRequest { + return QueryGroupMembersRequest.decode(message.value); + }, + toProto(message: QueryGroupMembersRequest): Uint8Array { + return QueryGroupMembersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupMembersRequest): QueryGroupMembersRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest", + value: QueryGroupMembersRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupMembersResponse(): QueryGroupMembersResponse { + return { + members: [], + pagination: undefined + }; +} +export const QueryGroupMembersResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse", + encode(message: QueryGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.members) { + GroupMember.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupMembersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.members.push(GroupMember.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupMembersResponse { + const message = createBaseQueryGroupMembersResponse(); + message.members = object.members?.map(e => GroupMember.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupMembersResponseAmino): QueryGroupMembersResponse { + const message = createBaseQueryGroupMembersResponse(); + message.members = object.members?.map(e => GroupMember.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupMembersResponse): QueryGroupMembersResponseAmino { + const obj: any = {}; + if (message.members) { + obj.members = message.members.map(e => e ? GroupMember.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupMembersResponseAminoMsg): QueryGroupMembersResponse { + return QueryGroupMembersResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupMembersResponse): QueryGroupMembersResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupMembersResponse", + value: QueryGroupMembersResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupMembersResponseProtoMsg): QueryGroupMembersResponse { + return QueryGroupMembersResponse.decode(message.value); + }, + toProto(message: QueryGroupMembersResponse): Uint8Array { + return QueryGroupMembersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupMembersResponse): QueryGroupMembersResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse", + value: QueryGroupMembersResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByAdminRequest(): QueryGroupsByAdminRequest { + return { + admin: "", + pagination: undefined + }; +} +export const QueryGroupsByAdminRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest", + encode(message: QueryGroupsByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByAdminRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByAdminRequest { + const message = createBaseQueryGroupsByAdminRequest(); + message.admin = object.admin ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByAdminRequestAmino): QueryGroupsByAdminRequest { + const message = createBaseQueryGroupsByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByAdminRequestAminoMsg): QueryGroupsByAdminRequest { + return QueryGroupsByAdminRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByAdminRequest", + value: QueryGroupsByAdminRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByAdminRequestProtoMsg): QueryGroupsByAdminRequest { + return QueryGroupsByAdminRequest.decode(message.value); + }, + toProto(message: QueryGroupsByAdminRequest): Uint8Array { + return QueryGroupsByAdminRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest", + value: QueryGroupsByAdminRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByAdminResponse(): QueryGroupsByAdminResponse { + return { + groups: [], + pagination: undefined + }; +} +export const QueryGroupsByAdminResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse", + encode(message: QueryGroupsByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByAdminResponse { + const message = createBaseQueryGroupsByAdminResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByAdminResponseAmino): QueryGroupsByAdminResponse { + const message = createBaseQueryGroupsByAdminResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByAdminResponse): QueryGroupsByAdminResponseAmino { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); + } else { + obj.groups = message.groups; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByAdminResponseAminoMsg): QueryGroupsByAdminResponse { + return QueryGroupsByAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByAdminResponse): QueryGroupsByAdminResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByAdminResponse", + value: QueryGroupsByAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByAdminResponseProtoMsg): QueryGroupsByAdminResponse { + return QueryGroupsByAdminResponse.decode(message.value); + }, + toProto(message: QueryGroupsByAdminResponse): Uint8Array { + return QueryGroupsByAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByAdminResponse): QueryGroupsByAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse", + value: QueryGroupsByAdminResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByGroupRequest(): QueryGroupPoliciesByGroupRequest { + return { + groupId: BigInt(0), + pagination: undefined + }; +} +export const QueryGroupPoliciesByGroupRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest", + encode(message: QueryGroupPoliciesByGroupRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByGroupRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByGroupRequest { + const message = createBaseQueryGroupPoliciesByGroupRequest(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByGroupRequestAmino): QueryGroupPoliciesByGroupRequest { + const message = createBaseQueryGroupPoliciesByGroupRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByGroupRequest): QueryGroupPoliciesByGroupRequestAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByGroupRequestAminoMsg): QueryGroupPoliciesByGroupRequest { + return QueryGroupPoliciesByGroupRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByGroupRequest): QueryGroupPoliciesByGroupRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByGroupRequest", + value: QueryGroupPoliciesByGroupRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByGroupRequestProtoMsg): QueryGroupPoliciesByGroupRequest { + return QueryGroupPoliciesByGroupRequest.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByGroupRequest): Uint8Array { + return QueryGroupPoliciesByGroupRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByGroupRequest): QueryGroupPoliciesByGroupRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest", + value: QueryGroupPoliciesByGroupRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByGroupResponse(): QueryGroupPoliciesByGroupResponse { + return { + groupPolicies: [], + pagination: undefined + }; +} +export const QueryGroupPoliciesByGroupResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse", + encode(message: QueryGroupPoliciesByGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groupPolicies) { + GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByGroupResponse { + const message = createBaseQueryGroupPoliciesByGroupResponse(); + message.groupPolicies = object.groupPolicies?.map(e => GroupPolicyInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByGroupResponseAmino): QueryGroupPoliciesByGroupResponse { + const message = createBaseQueryGroupPoliciesByGroupResponse(); + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByGroupResponse): QueryGroupPoliciesByGroupResponseAmino { + const obj: any = {}; + if (message.groupPolicies) { + obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); + } else { + obj.group_policies = message.groupPolicies; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByGroupResponseAminoMsg): QueryGroupPoliciesByGroupResponse { + return QueryGroupPoliciesByGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByGroupResponse): QueryGroupPoliciesByGroupResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByGroupResponse", + value: QueryGroupPoliciesByGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByGroupResponseProtoMsg): QueryGroupPoliciesByGroupResponse { + return QueryGroupPoliciesByGroupResponse.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByGroupResponse): Uint8Array { + return QueryGroupPoliciesByGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByGroupResponse): QueryGroupPoliciesByGroupResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse", + value: QueryGroupPoliciesByGroupResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByAdminRequest(): QueryGroupPoliciesByAdminRequest { + return { + admin: "", + pagination: undefined + }; +} +export const QueryGroupPoliciesByAdminRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest", + encode(message: QueryGroupPoliciesByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByAdminRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByAdminRequest { + const message = createBaseQueryGroupPoliciesByAdminRequest(); + message.admin = object.admin ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByAdminRequestAmino): QueryGroupPoliciesByAdminRequest { + const message = createBaseQueryGroupPoliciesByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByAdminRequest): QueryGroupPoliciesByAdminRequestAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByAdminRequestAminoMsg): QueryGroupPoliciesByAdminRequest { + return QueryGroupPoliciesByAdminRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByAdminRequest): QueryGroupPoliciesByAdminRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByAdminRequest", + value: QueryGroupPoliciesByAdminRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByAdminRequestProtoMsg): QueryGroupPoliciesByAdminRequest { + return QueryGroupPoliciesByAdminRequest.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByAdminRequest): Uint8Array { + return QueryGroupPoliciesByAdminRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByAdminRequest): QueryGroupPoliciesByAdminRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest", + value: QueryGroupPoliciesByAdminRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByAdminResponse(): QueryGroupPoliciesByAdminResponse { + return { + groupPolicies: [], + pagination: undefined + }; +} +export const QueryGroupPoliciesByAdminResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse", + encode(message: QueryGroupPoliciesByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groupPolicies) { + GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByAdminResponse { + const message = createBaseQueryGroupPoliciesByAdminResponse(); + message.groupPolicies = object.groupPolicies?.map(e => GroupPolicyInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByAdminResponseAmino): QueryGroupPoliciesByAdminResponse { + const message = createBaseQueryGroupPoliciesByAdminResponse(); + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByAdminResponse): QueryGroupPoliciesByAdminResponseAmino { + const obj: any = {}; + if (message.groupPolicies) { + obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); + } else { + obj.group_policies = message.groupPolicies; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByAdminResponseAminoMsg): QueryGroupPoliciesByAdminResponse { + return QueryGroupPoliciesByAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByAdminResponse): QueryGroupPoliciesByAdminResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByAdminResponse", + value: QueryGroupPoliciesByAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByAdminResponseProtoMsg): QueryGroupPoliciesByAdminResponse { + return QueryGroupPoliciesByAdminResponse.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByAdminResponse): Uint8Array { + return QueryGroupPoliciesByAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByAdminResponse): QueryGroupPoliciesByAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse", + value: QueryGroupPoliciesByAdminResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryProposalRequest = { + typeUrl: "/cosmos.group.v1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { + return QueryProposalRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { + return { + type: "cosmos-sdk/QueryProposalRequest", + value: QueryProposalRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { + return QueryProposalRequest.decode(message.value); + }, + toProto(message: QueryProposalRequest): Uint8Array { + return QueryProposalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalRequest): QueryProposalRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalRequest", + value: QueryProposalRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { + proposal: undefined + }; +} +export const QueryProposalResponse = { + typeUrl: "/cosmos.group.v1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposal !== undefined) { + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + message.proposal = object.proposal !== undefined && object.proposal !== null ? Proposal.fromPartial(object.proposal) : undefined; + return message; + }, + fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; + }, + toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { + const obj: any = {}; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { + return QueryProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { + return { + type: "cosmos-sdk/QueryProposalResponse", + value: QueryProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { + return QueryProposalResponse.decode(message.value); + }, + toProto(message: QueryProposalResponse): Uint8Array { + return QueryProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalResponse): QueryProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalResponse", + value: QueryProposalResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsByGroupPolicyRequest(): QueryProposalsByGroupPolicyRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryProposalsByGroupPolicyRequest = { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest", + encode(message: QueryProposalsByGroupPolicyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsByGroupPolicyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsByGroupPolicyRequest { + const message = createBaseQueryProposalsByGroupPolicyRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsByGroupPolicyRequestAmino): QueryProposalsByGroupPolicyRequest { + const message = createBaseQueryProposalsByGroupPolicyRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsByGroupPolicyRequest): QueryProposalsByGroupPolicyRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsByGroupPolicyRequestAminoMsg): QueryProposalsByGroupPolicyRequest { + return QueryProposalsByGroupPolicyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsByGroupPolicyRequest): QueryProposalsByGroupPolicyRequestAminoMsg { + return { + type: "cosmos-sdk/QueryProposalsByGroupPolicyRequest", + value: QueryProposalsByGroupPolicyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsByGroupPolicyRequestProtoMsg): QueryProposalsByGroupPolicyRequest { + return QueryProposalsByGroupPolicyRequest.decode(message.value); + }, + toProto(message: QueryProposalsByGroupPolicyRequest): Uint8Array { + return QueryProposalsByGroupPolicyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsByGroupPolicyRequest): QueryProposalsByGroupPolicyRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest", + value: QueryProposalsByGroupPolicyRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsByGroupPolicyResponse(): QueryProposalsByGroupPolicyResponse { + return { + proposals: [], + pagination: undefined + }; +} +export const QueryProposalsByGroupPolicyResponse = { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse", + encode(message: QueryProposalsByGroupPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsByGroupPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsByGroupPolicyResponse { + const message = createBaseQueryProposalsByGroupPolicyResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsByGroupPolicyResponseAmino): QueryProposalsByGroupPolicyResponse { + const message = createBaseQueryProposalsByGroupPolicyResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsByGroupPolicyResponse): QueryProposalsByGroupPolicyResponseAmino { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsByGroupPolicyResponseAminoMsg): QueryProposalsByGroupPolicyResponse { + return QueryProposalsByGroupPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsByGroupPolicyResponse): QueryProposalsByGroupPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/QueryProposalsByGroupPolicyResponse", + value: QueryProposalsByGroupPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsByGroupPolicyResponseProtoMsg): QueryProposalsByGroupPolicyResponse { + return QueryProposalsByGroupPolicyResponse.decode(message.value); + }, + toProto(message: QueryProposalsByGroupPolicyResponse): Uint8Array { + return QueryProposalsByGroupPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsByGroupPolicyResponse): QueryProposalsByGroupPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse", + value: QueryProposalsByGroupPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVoteByProposalVoterRequest(): QueryVoteByProposalVoterRequest { + return { + proposalId: BigInt(0), + voter: "" + }; +} +export const QueryVoteByProposalVoterRequest = { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest", + encode(message: QueryVoteByProposalVoterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteByProposalVoterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteByProposalVoterRequest { + const message = createBaseQueryVoteByProposalVoterRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: QueryVoteByProposalVoterRequestAmino): QueryVoteByProposalVoterRequest { + const message = createBaseQueryVoteByProposalVoterRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: QueryVoteByProposalVoterRequest): QueryVoteByProposalVoterRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + return obj; + }, + fromAminoMsg(object: QueryVoteByProposalVoterRequestAminoMsg): QueryVoteByProposalVoterRequest { + return QueryVoteByProposalVoterRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteByProposalVoterRequest): QueryVoteByProposalVoterRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVoteByProposalVoterRequest", + value: QueryVoteByProposalVoterRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteByProposalVoterRequestProtoMsg): QueryVoteByProposalVoterRequest { + return QueryVoteByProposalVoterRequest.decode(message.value); + }, + toProto(message: QueryVoteByProposalVoterRequest): Uint8Array { + return QueryVoteByProposalVoterRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteByProposalVoterRequest): QueryVoteByProposalVoterRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest", + value: QueryVoteByProposalVoterRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVoteByProposalVoterResponse(): QueryVoteByProposalVoterResponse { + return { + vote: undefined + }; +} +export const QueryVoteByProposalVoterResponse = { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse", + encode(message: QueryVoteByProposalVoterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vote !== undefined) { + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteByProposalVoterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteByProposalVoterResponse { + const message = createBaseQueryVoteByProposalVoterResponse(); + message.vote = object.vote !== undefined && object.vote !== null ? Vote.fromPartial(object.vote) : undefined; + return message; + }, + fromAmino(object: QueryVoteByProposalVoterResponseAmino): QueryVoteByProposalVoterResponse { + const message = createBaseQueryVoteByProposalVoterResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; + }, + toAmino(message: QueryVoteByProposalVoterResponse): QueryVoteByProposalVoterResponseAmino { + const obj: any = {}; + obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVoteByProposalVoterResponseAminoMsg): QueryVoteByProposalVoterResponse { + return QueryVoteByProposalVoterResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteByProposalVoterResponse): QueryVoteByProposalVoterResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVoteByProposalVoterResponse", + value: QueryVoteByProposalVoterResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteByProposalVoterResponseProtoMsg): QueryVoteByProposalVoterResponse { + return QueryVoteByProposalVoterResponse.decode(message.value); + }, + toProto(message: QueryVoteByProposalVoterResponse): Uint8Array { + return QueryVoteByProposalVoterResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteByProposalVoterResponse): QueryVoteByProposalVoterResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse", + value: QueryVoteByProposalVoterResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByProposalRequest(): QueryVotesByProposalRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryVotesByProposalRequest = { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest", + encode(message: QueryVotesByProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByProposalRequest { + const message = createBaseQueryVotesByProposalRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByProposalRequestAmino): QueryVotesByProposalRequest { + const message = createBaseQueryVotesByProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByProposalRequest): QueryVotesByProposalRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByProposalRequestAminoMsg): QueryVotesByProposalRequest { + return QueryVotesByProposalRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByProposalRequest): QueryVotesByProposalRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByProposalRequest", + value: QueryVotesByProposalRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByProposalRequestProtoMsg): QueryVotesByProposalRequest { + return QueryVotesByProposalRequest.decode(message.value); + }, + toProto(message: QueryVotesByProposalRequest): Uint8Array { + return QueryVotesByProposalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByProposalRequest): QueryVotesByProposalRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest", + value: QueryVotesByProposalRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByProposalResponse(): QueryVotesByProposalResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesByProposalResponse = { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse", + encode(message: QueryVotesByProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByProposalResponse { + const message = createBaseQueryVotesByProposalResponse(); + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByProposalResponseAmino): QueryVotesByProposalResponse { + const message = createBaseQueryVotesByProposalResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByProposalResponse): QueryVotesByProposalResponseAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByProposalResponseAminoMsg): QueryVotesByProposalResponse { + return QueryVotesByProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByProposalResponse): QueryVotesByProposalResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByProposalResponse", + value: QueryVotesByProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByProposalResponseProtoMsg): QueryVotesByProposalResponse { + return QueryVotesByProposalResponse.decode(message.value); + }, + toProto(message: QueryVotesByProposalResponse): Uint8Array { + return QueryVotesByProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByProposalResponse): QueryVotesByProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse", + value: QueryVotesByProposalResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByVoterRequest(): QueryVotesByVoterRequest { + return { + voter: "", + pagination: undefined + }; +} +export const QueryVotesByVoterRequest = { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest", + encode(message: QueryVotesByVoterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.voter !== "") { + writer.uint32(10).string(message.voter); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByVoterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voter = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByVoterRequest { + const message = createBaseQueryVotesByVoterRequest(); + message.voter = object.voter ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByVoterRequestAmino): QueryVotesByVoterRequest { + const message = createBaseQueryVotesByVoterRequest(); + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestAmino { + const obj: any = {}; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByVoterRequestAminoMsg): QueryVotesByVoterRequest { + return QueryVotesByVoterRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByVoterRequest", + value: QueryVotesByVoterRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByVoterRequestProtoMsg): QueryVotesByVoterRequest { + return QueryVotesByVoterRequest.decode(message.value); + }, + toProto(message: QueryVotesByVoterRequest): Uint8Array { + return QueryVotesByVoterRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest", + value: QueryVotesByVoterRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByVoterResponse(): QueryVotesByVoterResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesByVoterResponse = { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse", + encode(message: QueryVotesByVoterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByVoterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByVoterResponse { + const message = createBaseQueryVotesByVoterResponse(); + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByVoterResponseAmino): QueryVotesByVoterResponse { + const message = createBaseQueryVotesByVoterResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByVoterResponseAminoMsg): QueryVotesByVoterResponse { + return QueryVotesByVoterResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByVoterResponse", + value: QueryVotesByVoterResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByVoterResponseProtoMsg): QueryVotesByVoterResponse { + return QueryVotesByVoterResponse.decode(message.value); + }, + toProto(message: QueryVotesByVoterResponse): Uint8Array { + return QueryVotesByVoterResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse", + value: QueryVotesByVoterResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByMemberRequest(): QueryGroupsByMemberRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryGroupsByMemberRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest", + encode(message: QueryGroupsByMemberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByMemberRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByMemberRequest { + const message = createBaseQueryGroupsByMemberRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByMemberRequestAmino): QueryGroupsByMemberRequest { + const message = createBaseQueryGroupsByMemberRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByMemberRequest): QueryGroupsByMemberRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByMemberRequestAminoMsg): QueryGroupsByMemberRequest { + return QueryGroupsByMemberRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByMemberRequest): QueryGroupsByMemberRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByMemberRequest", + value: QueryGroupsByMemberRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByMemberRequestProtoMsg): QueryGroupsByMemberRequest { + return QueryGroupsByMemberRequest.decode(message.value); + }, + toProto(message: QueryGroupsByMemberRequest): Uint8Array { + return QueryGroupsByMemberRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByMemberRequest): QueryGroupsByMemberRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest", + value: QueryGroupsByMemberRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByMemberResponse(): QueryGroupsByMemberResponse { + return { + groups: [], + pagination: undefined + }; +} +export const QueryGroupsByMemberResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse", + encode(message: QueryGroupsByMemberResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByMemberResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByMemberResponse { + const message = createBaseQueryGroupsByMemberResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByMemberResponseAmino): QueryGroupsByMemberResponse { + const message = createBaseQueryGroupsByMemberResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByMemberResponse): QueryGroupsByMemberResponseAmino { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); + } else { + obj.groups = message.groups; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByMemberResponseAminoMsg): QueryGroupsByMemberResponse { + return QueryGroupsByMemberResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByMemberResponse): QueryGroupsByMemberResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByMemberResponse", + value: QueryGroupsByMemberResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByMemberResponseProtoMsg): QueryGroupsByMemberResponse { + return QueryGroupsByMemberResponse.decode(message.value); + }, + toProto(message: QueryGroupsByMemberResponse): Uint8Array { + return QueryGroupsByMemberResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByMemberResponse): QueryGroupsByMemberResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse", + value: QueryGroupsByMemberResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryTallyResultRequest = { + typeUrl: "/cosmos.group.v1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTallyResultRequest", + value: QueryTallyResultRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultRequestProtoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.decode(message.value); + }, + toProto(message: QueryTallyResultRequest): Uint8Array { + return QueryTallyResultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryTallyResultRequest", + value: QueryTallyResultRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { + tally: TallyResult.fromPartial({}) + }; +} +export const QueryTallyResultResponse = { + typeUrl: "/cosmos.group.v1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tally !== undefined) { + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + message.tally = object.tally !== undefined && object.tally !== null ? TallyResult.fromPartial(object.tally) : undefined; + return message; + }, + fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; + }, + toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { + const obj: any = {}; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTallyResultResponse", + value: QueryTallyResultResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultResponseProtoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.decode(message.value); + }, + toProto(message: QueryTallyResultResponse): Uint8Array { + return QueryTallyResultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryTallyResultResponse", + value: QueryTallyResultResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.amino.ts new file mode 100644 index 00000000..179cca8f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.amino.ts @@ -0,0 +1,74 @@ +//@ts-nocheck +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const AminoConverter = { + "/cosmos.group.v1.MsgCreateGroup": { + aminoType: "cosmos-sdk/MsgCreateGroup", + toAmino: MsgCreateGroup.toAmino, + fromAmino: MsgCreateGroup.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupMembers": { + aminoType: "cosmos-sdk/MsgUpdateGroupMembers", + toAmino: MsgUpdateGroupMembers.toAmino, + fromAmino: MsgUpdateGroupMembers.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupAdmin": { + aminoType: "cosmos-sdk/MsgUpdateGroupAdmin", + toAmino: MsgUpdateGroupAdmin.toAmino, + fromAmino: MsgUpdateGroupAdmin.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupMetadata": { + aminoType: "cosmos-sdk/MsgUpdateGroupMetadata", + toAmino: MsgUpdateGroupMetadata.toAmino, + fromAmino: MsgUpdateGroupMetadata.fromAmino + }, + "/cosmos.group.v1.MsgCreateGroupPolicy": { + aminoType: "cosmos-sdk/MsgCreateGroupPolicy", + toAmino: MsgCreateGroupPolicy.toAmino, + fromAmino: MsgCreateGroupPolicy.fromAmino + }, + "/cosmos.group.v1.MsgCreateGroupWithPolicy": { + aminoType: "cosmos-sdk/MsgCreateGroupWithPolicy", + toAmino: MsgCreateGroupWithPolicy.toAmino, + fromAmino: MsgCreateGroupWithPolicy.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin": { + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", + toAmino: MsgUpdateGroupPolicyAdmin.toAmino, + fromAmino: MsgUpdateGroupPolicyAdmin.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy": { + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy", + toAmino: MsgUpdateGroupPolicyDecisionPolicy.toAmino, + fromAmino: MsgUpdateGroupPolicyDecisionPolicy.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata": { + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", + toAmino: MsgUpdateGroupPolicyMetadata.toAmino, + fromAmino: MsgUpdateGroupPolicyMetadata.fromAmino + }, + "/cosmos.group.v1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/group/MsgSubmitProposal", + toAmino: MsgSubmitProposal.toAmino, + fromAmino: MsgSubmitProposal.fromAmino + }, + "/cosmos.group.v1.MsgWithdrawProposal": { + aminoType: "cosmos-sdk/group/MsgWithdrawProposal", + toAmino: MsgWithdrawProposal.toAmino, + fromAmino: MsgWithdrawProposal.fromAmino + }, + "/cosmos.group.v1.MsgVote": { + aminoType: "cosmos-sdk/group/MsgVote", + toAmino: MsgVote.toAmino, + fromAmino: MsgVote.fromAmino + }, + "/cosmos.group.v1.MsgExec": { + aminoType: "cosmos-sdk/group/MsgExec", + toAmino: MsgExec.toAmino, + fromAmino: MsgExec.fromAmino + }, + "/cosmos.group.v1.MsgLeaveGroup": { + aminoType: "cosmos-sdk/group/MsgLeaveGroup", + toAmino: MsgLeaveGroup.toAmino, + fromAmino: MsgLeaveGroup.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.registry.ts new file mode 100644 index 00000000..f40d6969 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.registry.ts @@ -0,0 +1,269 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.group.v1.MsgCreateGroup", MsgCreateGroup], ["/cosmos.group.v1.MsgUpdateGroupMembers", MsgUpdateGroupMembers], ["/cosmos.group.v1.MsgUpdateGroupAdmin", MsgUpdateGroupAdmin], ["/cosmos.group.v1.MsgUpdateGroupMetadata", MsgUpdateGroupMetadata], ["/cosmos.group.v1.MsgCreateGroupPolicy", MsgCreateGroupPolicy], ["/cosmos.group.v1.MsgCreateGroupWithPolicy", MsgCreateGroupWithPolicy], ["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", MsgUpdateGroupPolicyAdmin], ["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", MsgUpdateGroupPolicyDecisionPolicy], ["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", MsgUpdateGroupPolicyMetadata], ["/cosmos.group.v1.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.group.v1.MsgWithdrawProposal", MsgWithdrawProposal], ["/cosmos.group.v1.MsgVote", MsgVote], ["/cosmos.group.v1.MsgExec", MsgExec], ["/cosmos.group.v1.MsgLeaveGroup", MsgLeaveGroup]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.encode(value).finish() + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.encode(value).finish() + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.encode(value).finish() + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.encode(value).finish() + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.encode(value).finish() + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.encode(value).finish() + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.encode(value).finish() + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.encode(value).finish() + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.encode(value).finish() + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish() + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.encode(value).finish() + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.encode(value).finish() + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.encode(value).finish() + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.encode(value).finish() + }; + } + }, + withTypeUrl: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value + }; + } + }, + fromPartial: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.fromPartial(value) + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.fromPartial(value) + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.fromPartial(value) + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.fromPartial(value) + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.fromPartial(value) + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.fromPartial(value) + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.fromPartial(value) + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial(value) + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.fromPartial(value) + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value) + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.fromPartial(value) + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.fromPartial(value) + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.fromPartial(value) + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..c0f463d3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.rpc.msg.ts @@ -0,0 +1,125 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateGroup, MsgCreateGroupResponse, MsgUpdateGroupMembers, MsgUpdateGroupMembersResponse, MsgUpdateGroupAdmin, MsgUpdateGroupAdminResponse, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataResponse, MsgCreateGroupPolicy, MsgCreateGroupPolicyResponse, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicyResponse, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminResponse, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicyResponse, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataResponse, MsgSubmitProposal, MsgSubmitProposalResponse, MsgWithdrawProposal, MsgWithdrawProposalResponse, MsgVote, MsgVoteResponse, MsgExec, MsgExecResponse, MsgLeaveGroup, MsgLeaveGroupResponse } from "./tx"; +/** Msg is the cosmos.group.v1 Msg service. */ +export interface Msg { + /** CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. */ + createGroup(request: MsgCreateGroup): Promise; + /** UpdateGroupMembers updates the group members with given group id and admin address. */ + updateGroupMembers(request: MsgUpdateGroupMembers): Promise; + /** UpdateGroupAdmin updates the group admin with given group id and previous admin address. */ + updateGroupAdmin(request: MsgUpdateGroupAdmin): Promise; + /** UpdateGroupMetadata updates the group metadata with given group id and admin address. */ + updateGroupMetadata(request: MsgUpdateGroupMetadata): Promise; + /** CreateGroupPolicy creates a new group policy using given DecisionPolicy. */ + createGroupPolicy(request: MsgCreateGroupPolicy): Promise; + /** CreateGroupWithPolicy creates a new group with policy. */ + createGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise; + /** UpdateGroupPolicyAdmin updates a group policy admin. */ + updateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise; + /** UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. */ + updateGroupPolicyDecisionPolicy(request: MsgUpdateGroupPolicyDecisionPolicy): Promise; + /** UpdateGroupPolicyMetadata updates a group policy metadata. */ + updateGroupPolicyMetadata(request: MsgUpdateGroupPolicyMetadata): Promise; + /** SubmitProposal submits a new proposal. */ + submitProposal(request: MsgSubmitProposal): Promise; + /** WithdrawProposal aborts a proposal. */ + withdrawProposal(request: MsgWithdrawProposal): Promise; + /** Vote allows a voter to vote on a proposal. */ + vote(request: MsgVote): Promise; + /** Exec executes a proposal. */ + exec(request: MsgExec): Promise; + /** LeaveGroup allows a group member to leave the group. */ + leaveGroup(request: MsgLeaveGroup): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createGroup = this.createGroup.bind(this); + this.updateGroupMembers = this.updateGroupMembers.bind(this); + this.updateGroupAdmin = this.updateGroupAdmin.bind(this); + this.updateGroupMetadata = this.updateGroupMetadata.bind(this); + this.createGroupPolicy = this.createGroupPolicy.bind(this); + this.createGroupWithPolicy = this.createGroupWithPolicy.bind(this); + this.updateGroupPolicyAdmin = this.updateGroupPolicyAdmin.bind(this); + this.updateGroupPolicyDecisionPolicy = this.updateGroupPolicyDecisionPolicy.bind(this); + this.updateGroupPolicyMetadata = this.updateGroupPolicyMetadata.bind(this); + this.submitProposal = this.submitProposal.bind(this); + this.withdrawProposal = this.withdrawProposal.bind(this); + this.vote = this.vote.bind(this); + this.exec = this.exec.bind(this); + this.leaveGroup = this.leaveGroup.bind(this); + } + createGroup(request: MsgCreateGroup): Promise { + const data = MsgCreateGroup.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroup", data); + return promise.then(data => MsgCreateGroupResponse.decode(new BinaryReader(data))); + } + updateGroupMembers(request: MsgUpdateGroupMembers): Promise { + const data = MsgUpdateGroupMembers.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMembers", data); + return promise.then(data => MsgUpdateGroupMembersResponse.decode(new BinaryReader(data))); + } + updateGroupAdmin(request: MsgUpdateGroupAdmin): Promise { + const data = MsgUpdateGroupAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupAdmin", data); + return promise.then(data => MsgUpdateGroupAdminResponse.decode(new BinaryReader(data))); + } + updateGroupMetadata(request: MsgUpdateGroupMetadata): Promise { + const data = MsgUpdateGroupMetadata.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMetadata", data); + return promise.then(data => MsgUpdateGroupMetadataResponse.decode(new BinaryReader(data))); + } + createGroupPolicy(request: MsgCreateGroupPolicy): Promise { + const data = MsgCreateGroupPolicy.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupPolicy", data); + return promise.then(data => MsgCreateGroupPolicyResponse.decode(new BinaryReader(data))); + } + createGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise { + const data = MsgCreateGroupWithPolicy.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupWithPolicy", data); + return promise.then(data => MsgCreateGroupWithPolicyResponse.decode(new BinaryReader(data))); + } + updateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise { + const data = MsgUpdateGroupPolicyAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyAdmin", data); + return promise.then(data => MsgUpdateGroupPolicyAdminResponse.decode(new BinaryReader(data))); + } + updateGroupPolicyDecisionPolicy(request: MsgUpdateGroupPolicyDecisionPolicy): Promise { + const data = MsgUpdateGroupPolicyDecisionPolicy.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyDecisionPolicy", data); + return promise.then(data => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new BinaryReader(data))); + } + updateGroupPolicyMetadata(request: MsgUpdateGroupPolicyMetadata): Promise { + const data = MsgUpdateGroupPolicyMetadata.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyMetadata", data); + return promise.then(data => MsgUpdateGroupPolicyMetadataResponse.decode(new BinaryReader(data))); + } + submitProposal(request: MsgSubmitProposal): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "SubmitProposal", data); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); + } + withdrawProposal(request: MsgWithdrawProposal): Promise { + const data = MsgWithdrawProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "WithdrawProposal", data); + return promise.then(data => MsgWithdrawProposalResponse.decode(new BinaryReader(data))); + } + vote(request: MsgVote): Promise { + const data = MsgVote.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "Vote", data); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); + } + exec(request: MsgExec): Promise { + const data = MsgExec.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "Exec", data); + return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); + } + leaveGroup(request: MsgLeaveGroup): Promise { + const data = MsgLeaveGroup.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "LeaveGroup", data); + return promise.then(data => MsgLeaveGroupResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.ts new file mode 100644 index 00000000..12537ac5 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/tx.ts @@ -0,0 +1,3052 @@ +//@ts-nocheck +import { Member, MemberAmino, MemberSDKType, VoteOption, ThresholdDecisionPolicy, ThresholdDecisionPolicyProtoMsg, ThresholdDecisionPolicySDKType, PercentageDecisionPolicy, PercentageDecisionPolicyProtoMsg, PercentageDecisionPolicySDKType } from "./types"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Exec defines modes of execution of a proposal on creation or on new vote. */ +export enum Exec { + /** + * EXEC_UNSPECIFIED - An empty value means that there should be a separate + * MsgExec request for the proposal to execute. + */ + EXEC_UNSPECIFIED = 0, + /** + * EXEC_TRY - Try to execute the proposal immediately. + * If the proposal is not allowed per the DecisionPolicy, + * the proposal will still be open and could + * be executed at a later point. + */ + EXEC_TRY = 1, + UNRECOGNIZED = -1, +} +export const ExecSDKType = Exec; +export const ExecAmino = Exec; +export function execFromJSON(object: any): Exec { + switch (object) { + case 0: + case "EXEC_UNSPECIFIED": + return Exec.EXEC_UNSPECIFIED; + case 1: + case "EXEC_TRY": + return Exec.EXEC_TRY; + case -1: + case "UNRECOGNIZED": + default: + return Exec.UNRECOGNIZED; + } +} +export function execToJSON(object: Exec): string { + switch (object) { + case Exec.EXEC_UNSPECIFIED: + return "EXEC_UNSPECIFIED"; + case Exec.EXEC_TRY: + return "EXEC_TRY"; + case Exec.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroup { + /** admin is the account address of the group admin. */ + admin: string; + /** members defines the group members. */ + members: Member[]; + /** metadata is any arbitrary metadata to attached to the group. */ + metadata: string; +} +export interface MsgCreateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroup"; + value: Uint8Array; +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroupAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** members defines the group members. */ + members?: MemberAmino[]; + /** metadata is any arbitrary metadata to attached to the group. */ + metadata?: string; +} +export interface MsgCreateGroupAminoMsg { + type: "cosmos-sdk/MsgCreateGroup"; + value: MsgCreateGroupAmino; +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroupSDKType { + admin: string; + members: MemberSDKType[]; + metadata: string; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponse { + /** group_id is the unique ID of the newly created group. */ + groupId: bigint; +} +export interface MsgCreateGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse"; + value: Uint8Array; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponseAmino { + /** group_id is the unique ID of the newly created group. */ + group_id?: string; +} +export interface MsgCreateGroupResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupResponse"; + value: MsgCreateGroupResponseAmino; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponseSDKType { + group_id: bigint; +} +/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ +export interface MsgUpdateGroupMembers { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** + * member_updates is the list of members to update, + * set weight to 0 to remove a member. + */ + memberUpdates: Member[]; +} +export interface MsgUpdateGroupMembersProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers"; + value: Uint8Array; +} +/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ +export interface MsgUpdateGroupMembersAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** + * member_updates is the list of members to update, + * set weight to 0 to remove a member. + */ + member_updates?: MemberAmino[]; +} +export interface MsgUpdateGroupMembersAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMembers"; + value: MsgUpdateGroupMembersAmino; +} +/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ +export interface MsgUpdateGroupMembersSDKType { + admin: string; + group_id: bigint; + member_updates: MemberSDKType[]; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponse {} +export interface MsgUpdateGroupMembersResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponseAmino {} +export interface MsgUpdateGroupMembersResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMembersResponse"; + value: MsgUpdateGroupMembersResponseAmino; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponseSDKType {} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdmin { + /** admin is the current account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** new_admin is the group new admin account address. */ + newAdmin: string; +} +export interface MsgUpdateGroupAdminProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin"; + value: Uint8Array; +} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdminAmino { + /** admin is the current account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** new_admin is the group new admin account address. */ + new_admin?: string; +} +export interface MsgUpdateGroupAdminAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupAdmin"; + value: MsgUpdateGroupAdminAmino; +} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdminSDKType { + admin: string; + group_id: bigint; + new_admin: string; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponse {} +export interface MsgUpdateGroupAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponseAmino {} +export interface MsgUpdateGroupAdminResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupAdminResponse"; + value: MsgUpdateGroupAdminResponseAmino; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponseSDKType {} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadata { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** metadata is the updated group's metadata. */ + metadata: string; +} +export interface MsgUpdateGroupMetadataProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata"; + value: Uint8Array; +} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadataAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** metadata is the updated group's metadata. */ + metadata?: string; +} +export interface MsgUpdateGroupMetadataAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMetadata"; + value: MsgUpdateGroupMetadataAmino; +} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadataSDKType { + admin: string; + group_id: bigint; + metadata: string; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponse {} +export interface MsgUpdateGroupMetadataResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponseAmino {} +export interface MsgUpdateGroupMetadataResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMetadataResponse"; + value: MsgUpdateGroupMetadataResponseAmino; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponseSDKType {} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicy { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** metadata is any arbitrary metadata attached to the group policy. */ + metadata: string; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; + value: Uint8Array; +} +export type MsgCreateGroupPolicyEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicyAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** metadata is any arbitrary metadata attached to the group policy. */ + metadata?: string; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgCreateGroupPolicyAminoMsg { + type: "cosmos-sdk/MsgCreateGroupPolicy"; + value: MsgCreateGroupPolicyAmino; +} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicySDKType { + admin: string; + group_id: bigint; + metadata: string; + decision_policy?: ThresholdDecisionPolicySDKType | PercentageDecisionPolicySDKType | AnySDKType | undefined; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponse { + /** address is the account address of the newly created group policy. */ + address: string; +} +export interface MsgCreateGroupPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse"; + value: Uint8Array; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponseAmino { + /** address is the account address of the newly created group policy. */ + address?: string; +} +export interface MsgCreateGroupPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupPolicyResponse"; + value: MsgCreateGroupPolicyResponseAmino; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponseSDKType { + address: string; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdmin { + /** admin is the account address of the group admin. */ + admin: string; + /** address is the account address of the group policy. */ + address: string; + /** new_admin is the new group policy admin. */ + newAdmin: string; +} +export interface MsgUpdateGroupPolicyAdminProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdminAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** address is the account address of the group policy. */ + address?: string; + /** new_admin is the new group policy admin. */ + new_admin?: string; +} +export interface MsgUpdateGroupPolicyAdminAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; + value: MsgUpdateGroupPolicyAdminAmino; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdminSDKType { + admin: string; + address: string; + new_admin: string; +} +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicy { + /** admin is the account address of the group and group policy admin. */ + admin: string; + /** members defines the group members. */ + members: Member[]; + /** group_metadata is any arbitrary metadata attached to the group. */ + groupMetadata: string; + /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ + groupPolicyMetadata: string; + /** group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. */ + groupPolicyAsAdmin: boolean; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgCreateGroupWithPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy"; + value: Uint8Array; +} +export type MsgCreateGroupWithPolicyEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicyAmino { + /** admin is the account address of the group and group policy admin. */ + admin?: string; + /** members defines the group members. */ + members?: MemberAmino[]; + /** group_metadata is any arbitrary metadata attached to the group. */ + group_metadata?: string; + /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ + group_policy_metadata?: string; + /** group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. */ + group_policy_as_admin?: boolean; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgCreateGroupWithPolicyAminoMsg { + type: "cosmos-sdk/MsgCreateGroupWithPolicy"; + value: MsgCreateGroupWithPolicyAmino; +} +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicySDKType { + admin: string; + members: MemberSDKType[]; + group_metadata: string; + group_policy_metadata: string; + group_policy_as_admin: boolean; + decision_policy?: ThresholdDecisionPolicySDKType | PercentageDecisionPolicySDKType | AnySDKType | undefined; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponse { + /** group_id is the unique ID of the newly created group with policy. */ + groupId: bigint; + /** group_policy_address is the account address of the newly created group policy. */ + groupPolicyAddress: string; +} +export interface MsgCreateGroupWithPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse"; + value: Uint8Array; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponseAmino { + /** group_id is the unique ID of the newly created group with policy. */ + group_id?: string; + /** group_policy_address is the account address of the newly created group policy. */ + group_policy_address?: string; +} +export interface MsgCreateGroupWithPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupWithPolicyResponse"; + value: MsgCreateGroupWithPolicyResponseAmino; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponseSDKType { + group_id: bigint; + group_policy_address: string; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponse {} +export interface MsgUpdateGroupPolicyAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponseAmino {} +export interface MsgUpdateGroupPolicyAdminResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdminResponse"; + value: MsgUpdateGroupPolicyAdminResponseAmino; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponseSDKType {} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicy { + /** admin is the account address of the group admin. */ + admin: string; + /** address is the account address of group policy. */ + address: string; + /** decision_policy is the updated group policy's decision policy. */ + decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; +} +export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy"; + value: Uint8Array; +} +export type MsgUpdateGroupPolicyDecisionPolicyEncoded = Omit & { + /** decision_policy is the updated group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** address is the account address of group policy. */ + address?: string; + /** decision_policy is the updated group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgUpdateGroupPolicyDecisionPolicyAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy"; + value: MsgUpdateGroupPolicyDecisionPolicyAmino; +} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicySDKType { + admin: string; + address: string; + decision_policy?: ThresholdDecisionPolicySDKType | PercentageDecisionPolicySDKType | AnySDKType | undefined; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponse {} +export interface MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponseAmino {} +export interface MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse"; + value: MsgUpdateGroupPolicyDecisionPolicyResponseAmino; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponseSDKType {} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadata { + /** admin is the account address of the group admin. */ + admin: string; + /** address is the account address of group policy. */ + address: string; + /** metadata is the updated group policy metadata. */ + metadata: string; +} +export interface MsgUpdateGroupPolicyMetadataProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadataAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** address is the account address of group policy. */ + address?: string; + /** metadata is the updated group policy metadata. */ + metadata?: string; +} +export interface MsgUpdateGroupPolicyMetadataAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; + value: MsgUpdateGroupPolicyMetadataAmino; +} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadataSDKType { + admin: string; + address: string; + metadata: string; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponse {} +export interface MsgUpdateGroupPolicyMetadataResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponseAmino {} +export interface MsgUpdateGroupPolicyMetadataResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse"; + value: MsgUpdateGroupPolicyMetadataResponseAmino; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponseSDKType {} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposal { + /** address is the account address of group policy. */ + address: string; + /** + * proposers are the account addresses of the proposers. + * Proposers signatures will be counted as yes votes. + */ + proposers: string[]; + /** metadata is any arbitrary metadata to attached to the proposal. */ + metadata: string; + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ + messages: Any[]; + /** + * exec defines the mode of execution of the proposal, + * whether it should be executed immediately on creation or not. + * If so, proposers signatures are considered as Yes votes. + */ + exec: Exec; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal"; + value: Uint8Array; +} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposalAmino { + /** address is the account address of group policy. */ + address?: string; + /** + * proposers are the account addresses of the proposers. + * Proposers signatures will be counted as yes votes. + */ + proposers?: string[]; + /** metadata is any arbitrary metadata to attached to the proposal. */ + metadata?: string; + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ + messages?: AnyAmino[]; + /** + * exec defines the mode of execution of the proposal, + * whether it should be executed immediately on creation or not. + * If so, proposers signatures are considered as Yes votes. + */ + exec?: Exec; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/group/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposalSDKType { + address: string; + proposers: string[]; + metadata: string; + messages: AnySDKType[]; + exec: Exec; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposal { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** address is the admin of the group policy or one of the proposer of the proposal. */ + address: string; +} +export interface MsgWithdrawProposalProtoMsg { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal"; + value: Uint8Array; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposalAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** address is the admin of the group policy or one of the proposer of the proposal. */ + address?: string; +} +export interface MsgWithdrawProposalAminoMsg { + type: "cosmos-sdk/group/MsgWithdrawProposal"; + value: MsgWithdrawProposalAmino; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposalSDKType { + proposal_id: bigint; + address: string; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponse {} +export interface MsgWithdrawProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse"; + value: Uint8Array; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponseAmino {} +export interface MsgWithdrawProposalResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawProposalResponse"; + value: MsgWithdrawProposalResponseAmino; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponseSDKType {} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVote { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** voter is the voter account address. */ + voter: string; + /** option is the voter's choice on the proposal. */ + option: VoteOption; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata: string; + /** + * exec defines whether the proposal should be executed + * immediately after voting or not. + */ + exec: Exec; +} +export interface MsgVoteProtoMsg { + typeUrl: "/cosmos.group.v1.MsgVote"; + value: Uint8Array; +} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVoteAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** voter is the voter account address. */ + voter?: string; + /** option is the voter's choice on the proposal. */ + option?: VoteOption; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata?: string; + /** + * exec defines whether the proposal should be executed + * immediately after voting or not. + */ + exec?: Exec; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/group/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVoteSDKType { + proposal_id: bigint; + voter: string; + option: VoteOption; + metadata: string; + exec: Exec; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExec { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** signer is the account address used to execute the proposal. */ + signer: string; +} +export interface MsgExecProtoMsg { + typeUrl: "/cosmos.group.v1.MsgExec"; + value: Uint8Array; +} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExecAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** signer is the account address used to execute the proposal. */ + signer?: string; +} +export interface MsgExecAminoMsg { + type: "cosmos-sdk/group/MsgExec"; + value: MsgExecAmino; +} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExecSDKType { + proposal_id: bigint; + signer: string; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponse {} +export interface MsgExecResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgExecResponse"; + value: Uint8Array; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponseAmino {} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponseSDKType {} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroup { + /** address is the account address of the group member. */ + address: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface MsgLeaveGroupProtoMsg { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup"; + value: Uint8Array; +} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroupAmino { + /** address is the account address of the group member. */ + address?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface MsgLeaveGroupAminoMsg { + type: "cosmos-sdk/group/MsgLeaveGroup"; + value: MsgLeaveGroupAmino; +} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroupSDKType { + address: string; + group_id: bigint; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponse {} +export interface MsgLeaveGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse"; + value: Uint8Array; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponseAmino {} +export interface MsgLeaveGroupResponseAminoMsg { + type: "cosmos-sdk/MsgLeaveGroupResponse"; + value: MsgLeaveGroupResponseAmino; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponseSDKType {} +function createBaseMsgCreateGroup(): MsgCreateGroup { + return { + admin: "", + members: [], + metadata: "" + }; +} +export const MsgCreateGroup = { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + encode(message: MsgCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + for (const v of message.members) { + Member.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.members.push(Member.decode(reader, reader.uint32())); + break; + case 3: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.admin = object.admin ?? ""; + message.members = object.members?.map(e => Member.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgCreateGroupAmino): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.members = object.members?.map(e => Member.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgCreateGroup): MsgCreateGroupAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + if (message.members) { + obj.members = message.members.map(e => e ? Member.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupAminoMsg): MsgCreateGroup { + return MsgCreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroup): MsgCreateGroupAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroup", + value: MsgCreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupProtoMsg): MsgCreateGroup { + return MsgCreateGroup.decode(message.value); + }, + toProto(message: MsgCreateGroup): Uint8Array { + return MsgCreateGroup.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroup): MsgCreateGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { + return { + groupId: BigInt(0) + }; +} +export const MsgCreateGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse", + encode(message: MsgCreateGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCreateGroupResponseAmino): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: MsgCreateGroupResponse): MsgCreateGroupResponseAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupResponseAminoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupResponse", + value: MsgCreateGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupResponseProtoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupResponse): Uint8Array { + return MsgCreateGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse", + value: MsgCreateGroupResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMembers(): MsgUpdateGroupMembers { + return { + admin: "", + groupId: BigInt(0), + memberUpdates: [] + }; +} +export const MsgUpdateGroupMembers = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + encode(message: MsgUpdateGroupMembers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + for (const v of message.memberUpdates) { + Member.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMembers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.memberUpdates.push(Member.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupMembers { + const message = createBaseMsgUpdateGroupMembers(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.memberUpdates = object.memberUpdates?.map(e => Member.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateGroupMembersAmino): MsgUpdateGroupMembers { + const message = createBaseMsgUpdateGroupMembers(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + message.memberUpdates = object.member_updates?.map(e => Member.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + if (message.memberUpdates) { + obj.member_updates = message.memberUpdates.map(e => e ? Member.toAmino(e) : undefined); + } else { + obj.member_updates = message.memberUpdates; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMembersAminoMsg): MsgUpdateGroupMembers { + return MsgUpdateGroupMembers.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMembersProtoMsg): MsgUpdateGroupMembers { + return MsgUpdateGroupMembers.decode(message.value); + }, + toProto(message: MsgUpdateGroupMembers): Uint8Array { + return MsgUpdateGroupMembers.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMembersResponse(): MsgUpdateGroupMembersResponse { + return {}; +} +export const MsgUpdateGroupMembersResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse", + encode(_: MsgUpdateGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMembersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupMembersResponse { + const message = createBaseMsgUpdateGroupMembersResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupMembersResponseAmino): MsgUpdateGroupMembersResponse { + const message = createBaseMsgUpdateGroupMembersResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupMembersResponse): MsgUpdateGroupMembersResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMembersResponseAminoMsg): MsgUpdateGroupMembersResponse { + return MsgUpdateGroupMembersResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMembersResponse): MsgUpdateGroupMembersResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMembersResponse", + value: MsgUpdateGroupMembersResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMembersResponseProtoMsg): MsgUpdateGroupMembersResponse { + return MsgUpdateGroupMembersResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupMembersResponse): Uint8Array { + return MsgUpdateGroupMembersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMembersResponse): MsgUpdateGroupMembersResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse", + value: MsgUpdateGroupMembersResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupAdmin(): MsgUpdateGroupAdmin { + return { + admin: "", + groupId: BigInt(0), + newAdmin: "" + }; +} +export const MsgUpdateGroupAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + encode(message: MsgUpdateGroupAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.newAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupAdmin { + const message = createBaseMsgUpdateGroupAdmin(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.newAdmin = object.newAdmin ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupAdminAmino): MsgUpdateGroupAdmin { + const message = createBaseMsgUpdateGroupAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; + }, + toAmino(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupAdminAminoMsg): MsgUpdateGroupAdmin { + return MsgUpdateGroupAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupAdminProtoMsg): MsgUpdateGroupAdmin { + return MsgUpdateGroupAdmin.decode(message.value); + }, + toProto(message: MsgUpdateGroupAdmin): Uint8Array { + return MsgUpdateGroupAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupAdminResponse(): MsgUpdateGroupAdminResponse { + return {}; +} +export const MsgUpdateGroupAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse", + encode(_: MsgUpdateGroupAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupAdminResponse { + const message = createBaseMsgUpdateGroupAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupAdminResponseAmino): MsgUpdateGroupAdminResponse { + const message = createBaseMsgUpdateGroupAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupAdminResponseAminoMsg): MsgUpdateGroupAdminResponse { + return MsgUpdateGroupAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupAdminResponse", + value: MsgUpdateGroupAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupAdminResponseProtoMsg): MsgUpdateGroupAdminResponse { + return MsgUpdateGroupAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupAdminResponse): Uint8Array { + return MsgUpdateGroupAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse", + value: MsgUpdateGroupAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMetadata(): MsgUpdateGroupMetadata { + return { + admin: "", + groupId: BigInt(0), + metadata: "" + }; +} +export const MsgUpdateGroupMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + encode(message: MsgUpdateGroupMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupMetadata { + const message = createBaseMsgUpdateGroupMetadata(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupMetadataAmino): MsgUpdateGroupMetadata { + const message = createBaseMsgUpdateGroupMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMetadataAminoMsg): MsgUpdateGroupMetadata { + return MsgUpdateGroupMetadata.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMetadataProtoMsg): MsgUpdateGroupMetadata { + return MsgUpdateGroupMetadata.decode(message.value); + }, + toProto(message: MsgUpdateGroupMetadata): Uint8Array { + return MsgUpdateGroupMetadata.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMetadataResponse(): MsgUpdateGroupMetadataResponse { + return {}; +} +export const MsgUpdateGroupMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse", + encode(_: MsgUpdateGroupMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupMetadataResponse { + const message = createBaseMsgUpdateGroupMetadataResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupMetadataResponseAmino): MsgUpdateGroupMetadataResponse { + const message = createBaseMsgUpdateGroupMetadataResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupMetadataResponse): MsgUpdateGroupMetadataResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMetadataResponseAminoMsg): MsgUpdateGroupMetadataResponse { + return MsgUpdateGroupMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMetadataResponse): MsgUpdateGroupMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMetadataResponse", + value: MsgUpdateGroupMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMetadataResponseProtoMsg): MsgUpdateGroupMetadataResponse { + return MsgUpdateGroupMetadataResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupMetadataResponse): Uint8Array { + return MsgUpdateGroupMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMetadataResponse): MsgUpdateGroupMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse", + value: MsgUpdateGroupMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupPolicy(): MsgCreateGroupPolicy { + return { + admin: "", + groupId: BigInt(0), + metadata: "", + decisionPolicy: undefined + }; +} +export const MsgCreateGroupPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + encode(message: MsgCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy as Any, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupPolicy { + const message = createBaseMsgCreateGroupPolicy(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.metadata = object.metadata ?? ""; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + return message; + }, + fromAmino(object: MsgCreateGroupPolicyAmino): MsgCreateGroupPolicy { + const message = createBaseMsgCreateGroupPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino(object.decision_policy); + } + return message; + }, + toAmino(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupPolicyAminoMsg): MsgCreateGroupPolicy { + return MsgCreateGroupPolicy.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupPolicyProtoMsg): MsgCreateGroupPolicy { + return MsgCreateGroupPolicy.decode(message.value); + }, + toProto(message: MsgCreateGroupPolicy): Uint8Array { + return MsgCreateGroupPolicy.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupPolicyResponse(): MsgCreateGroupPolicyResponse { + return { + address: "" + }; +} +export const MsgCreateGroupPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse", + encode(message: MsgCreateGroupPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupPolicyResponse { + const message = createBaseMsgCreateGroupPolicyResponse(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: MsgCreateGroupPolicyResponseAmino): MsgCreateGroupPolicyResponse { + const message = createBaseMsgCreateGroupPolicyResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: MsgCreateGroupPolicyResponse): MsgCreateGroupPolicyResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupPolicyResponseAminoMsg): MsgCreateGroupPolicyResponse { + return MsgCreateGroupPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupPolicyResponse): MsgCreateGroupPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupPolicyResponse", + value: MsgCreateGroupPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupPolicyResponseProtoMsg): MsgCreateGroupPolicyResponse { + return MsgCreateGroupPolicyResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupPolicyResponse): Uint8Array { + return MsgCreateGroupPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupPolicyResponse): MsgCreateGroupPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse", + value: MsgCreateGroupPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyAdmin(): MsgUpdateGroupPolicyAdmin { + return { + admin: "", + address: "", + newAdmin: "" + }; +} +export const MsgUpdateGroupPolicyAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + encode(message: MsgUpdateGroupPolicyAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupPolicyAdmin { + const message = createBaseMsgUpdateGroupPolicyAdmin(); + message.admin = object.admin ?? ""; + message.address = object.address ?? ""; + message.newAdmin = object.newAdmin ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupPolicyAdminAmino): MsgUpdateGroupPolicyAdmin { + const message = createBaseMsgUpdateGroupPolicyAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; + }, + toAmino(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.address = message.address === "" ? undefined : message.address; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyAdminAminoMsg): MsgUpdateGroupPolicyAdmin { + return MsgUpdateGroupPolicyAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyAdminProtoMsg): MsgUpdateGroupPolicyAdmin { + return MsgUpdateGroupPolicyAdmin.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyAdmin): Uint8Array { + return MsgUpdateGroupPolicyAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupWithPolicy(): MsgCreateGroupWithPolicy { + return { + admin: "", + members: [], + groupMetadata: "", + groupPolicyMetadata: "", + groupPolicyAsAdmin: false, + decisionPolicy: undefined + }; +} +export const MsgCreateGroupWithPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + encode(message: MsgCreateGroupWithPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + for (const v of message.members) { + Member.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.groupMetadata !== "") { + writer.uint32(26).string(message.groupMetadata); + } + if (message.groupPolicyMetadata !== "") { + writer.uint32(34).string(message.groupPolicyMetadata); + } + if (message.groupPolicyAsAdmin === true) { + writer.uint32(40).bool(message.groupPolicyAsAdmin); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy as Any, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupWithPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.members.push(Member.decode(reader, reader.uint32())); + break; + case 3: + message.groupMetadata = reader.string(); + break; + case 4: + message.groupPolicyMetadata = reader.string(); + break; + case 5: + message.groupPolicyAsAdmin = reader.bool(); + break; + case 6: + message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupWithPolicy { + const message = createBaseMsgCreateGroupWithPolicy(); + message.admin = object.admin ?? ""; + message.members = object.members?.map(e => Member.fromPartial(e)) || []; + message.groupMetadata = object.groupMetadata ?? ""; + message.groupPolicyMetadata = object.groupPolicyMetadata ?? ""; + message.groupPolicyAsAdmin = object.groupPolicyAsAdmin ?? false; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + return message; + }, + fromAmino(object: MsgCreateGroupWithPolicyAmino): MsgCreateGroupWithPolicy { + const message = createBaseMsgCreateGroupWithPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.members = object.members?.map(e => Member.fromAmino(e)) || []; + if (object.group_metadata !== undefined && object.group_metadata !== null) { + message.groupMetadata = object.group_metadata; + } + if (object.group_policy_metadata !== undefined && object.group_policy_metadata !== null) { + message.groupPolicyMetadata = object.group_policy_metadata; + } + if (object.group_policy_as_admin !== undefined && object.group_policy_as_admin !== null) { + message.groupPolicyAsAdmin = object.group_policy_as_admin; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino(object.decision_policy); + } + return message; + }, + toAmino(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + if (message.members) { + obj.members = message.members.map(e => e ? Member.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.group_metadata = message.groupMetadata === "" ? undefined : message.groupMetadata; + obj.group_policy_metadata = message.groupPolicyMetadata === "" ? undefined : message.groupPolicyMetadata; + obj.group_policy_as_admin = message.groupPolicyAsAdmin === false ? undefined : message.groupPolicyAsAdmin; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupWithPolicyAminoMsg): MsgCreateGroupWithPolicy { + return MsgCreateGroupWithPolicy.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupWithPolicyProtoMsg): MsgCreateGroupWithPolicy { + return MsgCreateGroupWithPolicy.decode(message.value); + }, + toProto(message: MsgCreateGroupWithPolicy): Uint8Array { + return MsgCreateGroupWithPolicy.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupWithPolicyResponse(): MsgCreateGroupWithPolicyResponse { + return { + groupId: BigInt(0), + groupPolicyAddress: "" + }; +} +export const MsgCreateGroupWithPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse", + encode(message: MsgCreateGroupWithPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.groupPolicyAddress !== "") { + writer.uint32(18).string(message.groupPolicyAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupWithPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.groupPolicyAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupWithPolicyResponse { + const message = createBaseMsgCreateGroupWithPolicyResponse(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + return message; + }, + fromAmino(object: MsgCreateGroupWithPolicyResponseAmino): MsgCreateGroupWithPolicyResponse { + const message = createBaseMsgCreateGroupWithPolicyResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + return message; + }, + toAmino(message: MsgCreateGroupWithPolicyResponse): MsgCreateGroupWithPolicyResponseAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupWithPolicyResponseAminoMsg): MsgCreateGroupWithPolicyResponse { + return MsgCreateGroupWithPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupWithPolicyResponse): MsgCreateGroupWithPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupWithPolicyResponse", + value: MsgCreateGroupWithPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupWithPolicyResponseProtoMsg): MsgCreateGroupWithPolicyResponse { + return MsgCreateGroupWithPolicyResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupWithPolicyResponse): Uint8Array { + return MsgCreateGroupWithPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupWithPolicyResponse): MsgCreateGroupWithPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse", + value: MsgCreateGroupWithPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyAdminResponse(): MsgUpdateGroupPolicyAdminResponse { + return {}; +} +export const MsgUpdateGroupPolicyAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", + encode(_: MsgUpdateGroupPolicyAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupPolicyAdminResponse { + const message = createBaseMsgUpdateGroupPolicyAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupPolicyAdminResponseAmino): MsgUpdateGroupPolicyAdminResponse { + const message = createBaseMsgUpdateGroupPolicyAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupPolicyAdminResponse): MsgUpdateGroupPolicyAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyAdminResponseAminoMsg): MsgUpdateGroupPolicyAdminResponse { + return MsgUpdateGroupPolicyAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyAdminResponse): MsgUpdateGroupPolicyAdminResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdminResponse", + value: MsgUpdateGroupPolicyAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyAdminResponseProtoMsg): MsgUpdateGroupPolicyAdminResponse { + return MsgUpdateGroupPolicyAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyAdminResponse): Uint8Array { + return MsgUpdateGroupPolicyAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyAdminResponse): MsgUpdateGroupPolicyAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", + value: MsgUpdateGroupPolicyAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyDecisionPolicy(): MsgUpdateGroupPolicyDecisionPolicy { + return { + admin: "", + address: "", + decisionPolicy: undefined + }; +} +export const MsgUpdateGroupPolicyDecisionPolicy = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + encode(message: MsgUpdateGroupPolicyDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy as Any, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupPolicyDecisionPolicy { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + message.admin = object.admin ?? ""; + message.address = object.address ?? ""; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + return message; + }, + fromAmino(object: MsgUpdateGroupPolicyDecisionPolicyAmino): MsgUpdateGroupPolicyDecisionPolicy { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino(object.decision_policy); + } + return message; + }, + toAmino(message: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.address = message.address === "" ? undefined : message.address; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyDecisionPolicyAminoMsg): MsgUpdateGroupPolicyDecisionPolicy { + return MsgUpdateGroupPolicyDecisionPolicy.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicyProtoMsg): MsgUpdateGroupPolicyDecisionPolicy { + return MsgUpdateGroupPolicyDecisionPolicy.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyDecisionPolicy): Uint8Array { + return MsgUpdateGroupPolicyDecisionPolicy.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(): MsgUpdateGroupPolicyDecisionPolicyResponse { + return {}; +} +export const MsgUpdateGroupPolicyDecisionPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", + encode(_: MsgUpdateGroupPolicyDecisionPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupPolicyDecisionPolicyResponse { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupPolicyDecisionPolicyResponseAmino): MsgUpdateGroupPolicyDecisionPolicyResponse { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupPolicyDecisionPolicyResponse): MsgUpdateGroupPolicyDecisionPolicyResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg): MsgUpdateGroupPolicyDecisionPolicyResponse { + return MsgUpdateGroupPolicyDecisionPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyDecisionPolicyResponse): MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse", + value: MsgUpdateGroupPolicyDecisionPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg): MsgUpdateGroupPolicyDecisionPolicyResponse { + return MsgUpdateGroupPolicyDecisionPolicyResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyDecisionPolicyResponse): Uint8Array { + return MsgUpdateGroupPolicyDecisionPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicyResponse): MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", + value: MsgUpdateGroupPolicyDecisionPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyMetadata(): MsgUpdateGroupPolicyMetadata { + return { + admin: "", + address: "", + metadata: "" + }; +} +export const MsgUpdateGroupPolicyMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + encode(message: MsgUpdateGroupPolicyMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupPolicyMetadata { + const message = createBaseMsgUpdateGroupPolicyMetadata(); + message.admin = object.admin ?? ""; + message.address = object.address ?? ""; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupPolicyMetadataAmino): MsgUpdateGroupPolicyMetadata { + const message = createBaseMsgUpdateGroupPolicyMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.address = message.address === "" ? undefined : message.address; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyMetadataAminoMsg): MsgUpdateGroupPolicyMetadata { + return MsgUpdateGroupPolicyMetadata.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyMetadataProtoMsg): MsgUpdateGroupPolicyMetadata { + return MsgUpdateGroupPolicyMetadata.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyMetadata): Uint8Array { + return MsgUpdateGroupPolicyMetadata.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyMetadataResponse(): MsgUpdateGroupPolicyMetadataResponse { + return {}; +} +export const MsgUpdateGroupPolicyMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", + encode(_: MsgUpdateGroupPolicyMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupPolicyMetadataResponse { + const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupPolicyMetadataResponseAmino): MsgUpdateGroupPolicyMetadataResponse { + const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupPolicyMetadataResponse): MsgUpdateGroupPolicyMetadataResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyMetadataResponseAminoMsg): MsgUpdateGroupPolicyMetadataResponse { + return MsgUpdateGroupPolicyMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyMetadataResponse): MsgUpdateGroupPolicyMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse", + value: MsgUpdateGroupPolicyMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyMetadataResponseProtoMsg): MsgUpdateGroupPolicyMetadataResponse { + return MsgUpdateGroupPolicyMetadataResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyMetadataResponse): Uint8Array { + return MsgUpdateGroupPolicyMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyMetadataResponse): MsgUpdateGroupPolicyMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", + value: MsgUpdateGroupPolicyMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + address: "", + proposers: [], + metadata: "", + messages: [], + exec: 0 + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.proposers) { + writer.uint32(18).string(v!); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + for (const v of message.messages) { + Any.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.exec !== 0) { + writer.uint32(40).int32(message.exec); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.proposers.push(reader.string()); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 5: + message.exec = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.address = object.address ?? ""; + message.proposers = object.proposers?.map(e => e) || []; + message.metadata = object.metadata ?? ""; + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.exec = object.exec ?? 0; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.proposers = object.proposers?.map(e => e) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.exec !== undefined && object.exec !== null) { + message.exec = object.exec; + } + return message; + }, + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + if (message.proposers) { + obj.proposers = message.proposers.map(e => e); + } else { + obj.proposers = message.proposers; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.exec = message.exec === 0 ? undefined : message.exec; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/group/MsgSubmitProposal", + value: MsgSubmitProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value); + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value); + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawProposal(): MsgWithdrawProposal { + return { + proposalId: BigInt(0), + address: "" + }; +} +export const MsgWithdrawProposal = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + encode(message: MsgWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawProposal { + const message = createBaseMsgWithdrawProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawProposalAmino): MsgWithdrawProposal { + const message = createBaseMsgWithdrawProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: MsgWithdrawProposal): MsgWithdrawProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: MsgWithdrawProposalAminoMsg): MsgWithdrawProposal { + return MsgWithdrawProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawProposal): MsgWithdrawProposalAminoMsg { + return { + type: "cosmos-sdk/group/MsgWithdrawProposal", + value: MsgWithdrawProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawProposalProtoMsg): MsgWithdrawProposal { + return MsgWithdrawProposal.decode(message.value); + }, + toProto(message: MsgWithdrawProposal): Uint8Array { + return MsgWithdrawProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawProposal): MsgWithdrawProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawProposalResponse(): MsgWithdrawProposalResponse { + return {}; +} +export const MsgWithdrawProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse", + encode(_: MsgWithdrawProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgWithdrawProposalResponse { + const message = createBaseMsgWithdrawProposalResponse(); + return message; + }, + fromAmino(_: MsgWithdrawProposalResponseAmino): MsgWithdrawProposalResponse { + const message = createBaseMsgWithdrawProposalResponse(); + return message; + }, + toAmino(_: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawProposalResponseAminoMsg): MsgWithdrawProposalResponse { + return MsgWithdrawProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawProposalResponse", + value: MsgWithdrawProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawProposalResponseProtoMsg): MsgWithdrawProposalResponse { + return MsgWithdrawProposalResponse.decode(message.value); + }, + toProto(message: MsgWithdrawProposalResponse): Uint8Array { + return MsgWithdrawProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse", + value: MsgWithdrawProposalResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + exec: 0 + }; +} +export const MsgVote = { + typeUrl: "/cosmos.group.v1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.exec !== 0) { + writer.uint32(40).int32(message.exec); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32() as any; + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.exec = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVote { + const message = createBaseMsgVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + message.exec = object.exec ?? 0; + return message; + }, + fromAmino(object: MsgVoteAmino): MsgVote { + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.exec !== undefined && object.exec !== null) { + message.exec = object.exec; + } + return message; + }, + toAmino(message: MsgVote): MsgVoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.exec = message.exec === 0 ? undefined : message.exec; + return obj; + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value); + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: "cosmos-sdk/group/MsgVote", + value: MsgVote.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { + return MsgVote.decode(message.value); + }, + toProto(message: MsgVote): Uint8Array { + return MsgVote.encode(message).finish(); + }, + toProtoMsg(message: MsgVote): MsgVoteProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.group.v1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { + return MsgVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { + return { + type: "cosmos-sdk/MsgVoteResponse", + value: MsgVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { + return MsgVoteResponse.decode(message.value); + }, + toProto(message: MsgVoteResponse): Uint8Array { + return MsgVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; +function createBaseMsgExec(): MsgExec { + return { + proposalId: BigInt(0), + signer: "" + }; +} +export const MsgExec = { + typeUrl: "/cosmos.group.v1.MsgExec", + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.signer !== "") { + writer.uint32(18).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExec { + const message = createBaseMsgExec(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgExecAmino): MsgExec { + const message = createBaseMsgExec(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgExec): MsgExecAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgExecAminoMsg): MsgExec { + return MsgExec.fromAmino(object.value); + }, + toAminoMsg(message: MsgExec): MsgExecAminoMsg { + return { + type: "cosmos-sdk/group/MsgExec", + value: MsgExec.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecProtoMsg): MsgExec { + return MsgExec.decode(message.value); + }, + toProto(message: MsgExec): Uint8Array { + return MsgExec.encode(message).finish(); + }, + toProtoMsg(message: MsgExec): MsgExecProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.encode(message).finish() + }; + } +}; +function createBaseMsgExecResponse(): MsgExecResponse { + return {}; +} +export const MsgExecResponse = { + typeUrl: "/cosmos.group.v1.MsgExecResponse", + encode(_: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgExecResponse { + const message = createBaseMsgExecResponse(); + return message; + }, + fromAmino(_: MsgExecResponseAmino): MsgExecResponse { + const message = createBaseMsgExecResponse(); + return message; + }, + toAmino(_: MsgExecResponse): MsgExecResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { + return MsgExecResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { + return { + type: "cosmos-sdk/MsgExecResponse", + value: MsgExecResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { + return MsgExecResponse.decode(message.value); + }, + toProto(message: MsgExecResponse): Uint8Array { + return MsgExecResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgExecResponse", + value: MsgExecResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLeaveGroup(): MsgLeaveGroup { + return { + address: "", + groupId: BigInt(0) + }; +} +export const MsgLeaveGroup = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + encode(message: MsgLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLeaveGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLeaveGroup { + const message = createBaseMsgLeaveGroup(); + message.address = object.address ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgLeaveGroupAmino): MsgLeaveGroup { + const message = createBaseMsgLeaveGroup(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: MsgLeaveGroup): MsgLeaveGroupAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgLeaveGroupAminoMsg): MsgLeaveGroup { + return MsgLeaveGroup.fromAmino(object.value); + }, + toAminoMsg(message: MsgLeaveGroup): MsgLeaveGroupAminoMsg { + return { + type: "cosmos-sdk/group/MsgLeaveGroup", + value: MsgLeaveGroup.toAmino(message) + }; + }, + fromProtoMsg(message: MsgLeaveGroupProtoMsg): MsgLeaveGroup { + return MsgLeaveGroup.decode(message.value); + }, + toProto(message: MsgLeaveGroup): Uint8Array { + return MsgLeaveGroup.encode(message).finish(); + }, + toProtoMsg(message: MsgLeaveGroup): MsgLeaveGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.encode(message).finish() + }; + } +}; +function createBaseMsgLeaveGroupResponse(): MsgLeaveGroupResponse { + return {}; +} +export const MsgLeaveGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse", + encode(_: MsgLeaveGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLeaveGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLeaveGroupResponse { + const message = createBaseMsgLeaveGroupResponse(); + return message; + }, + fromAmino(_: MsgLeaveGroupResponseAmino): MsgLeaveGroupResponse { + const message = createBaseMsgLeaveGroupResponse(); + return message; + }, + toAmino(_: MsgLeaveGroupResponse): MsgLeaveGroupResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLeaveGroupResponseAminoMsg): MsgLeaveGroupResponse { + return MsgLeaveGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgLeaveGroupResponse): MsgLeaveGroupResponseAminoMsg { + return { + type: "cosmos-sdk/MsgLeaveGroupResponse", + value: MsgLeaveGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgLeaveGroupResponseProtoMsg): MsgLeaveGroupResponse { + return MsgLeaveGroupResponse.decode(message.value); + }, + toProto(message: MsgLeaveGroupResponse): Uint8Array { + return MsgLeaveGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLeaveGroupResponse): MsgLeaveGroupResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse", + value: MsgLeaveGroupResponse.encode(message).finish() + }; + } +}; +export const Cosmos_groupDecisionPolicy_InterfaceDecoder = (input: BinaryReader | Uint8Array): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.group.v1.ThresholdDecisionPolicy": + return ThresholdDecisionPolicy.decode(data.value); + case "/cosmos.group.v1.PercentageDecisionPolicy": + return PercentageDecisionPolicy.decode(data.value); + default: + return data; + } +}; +export const Cosmos_groupDecisionPolicy_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/ThresholdDecisionPolicy": + return Any.fromPartial({ + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.encode(ThresholdDecisionPolicy.fromPartial(ThresholdDecisionPolicy.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/PercentageDecisionPolicy": + return Any.fromPartial({ + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + value: PercentageDecisionPolicy.encode(PercentageDecisionPolicy.fromPartial(PercentageDecisionPolicy.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_groupDecisionPolicy_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.group.v1.ThresholdDecisionPolicy": + return { + type: "cosmos-sdk/ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.toAmino(ThresholdDecisionPolicy.decode(content.value, undefined)) + }; + case "/cosmos.group.v1.PercentageDecisionPolicy": + return { + type: "cosmos-sdk/PercentageDecisionPolicy", + value: PercentageDecisionPolicy.toAmino(PercentageDecisionPolicy.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/group/v1/types.ts b/dydxjs/packages/dydxjs/src/cosmos/group/v1/types.ts new file mode 100644 index 00000000..cdce8048 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/group/v1/types.ts @@ -0,0 +1,2018 @@ +//@ts-nocheck +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus defines proposal statuses. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - An empty value is invalid and not allowed. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** PROPOSAL_STATUS_SUBMITTED - Initial status of a proposal when persisted. */ + PROPOSAL_STATUS_SUBMITTED = 1, + /** PROPOSAL_STATUS_CLOSED - Final status of a proposal when the final tally was executed. */ + PROPOSAL_STATUS_CLOSED = 2, + /** PROPOSAL_STATUS_ABORTED - Final status of a proposal when the group was modified before the final tally. */ + PROPOSAL_STATUS_ABORTED = 3, + /** + * PROPOSAL_STATUS_WITHDRAWN - A proposal can be deleted before the voting start time by the owner. When this happens the final status + * is Withdrawn. + */ + PROPOSAL_STATUS_WITHDRAWN = 4, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_SUBMITTED": + return ProposalStatus.PROPOSAL_STATUS_SUBMITTED; + case 2: + case "PROPOSAL_STATUS_CLOSED": + return ProposalStatus.PROPOSAL_STATUS_CLOSED; + case 3: + case "PROPOSAL_STATUS_ABORTED": + return ProposalStatus.PROPOSAL_STATUS_ABORTED; + case 4: + case "PROPOSAL_STATUS_WITHDRAWN": + return ProposalStatus.PROPOSAL_STATUS_WITHDRAWN; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_SUBMITTED: + return "PROPOSAL_STATUS_SUBMITTED"; + case ProposalStatus.PROPOSAL_STATUS_CLOSED: + return "PROPOSAL_STATUS_CLOSED"; + case ProposalStatus.PROPOSAL_STATUS_ABORTED: + return "PROPOSAL_STATUS_ABORTED"; + case ProposalStatus.PROPOSAL_STATUS_WITHDRAWN: + return "PROPOSAL_STATUS_WITHDRAWN"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalResult defines types of proposal results. */ +export enum ProposalResult { + /** PROPOSAL_RESULT_UNSPECIFIED - An empty value is invalid and not allowed */ + PROPOSAL_RESULT_UNSPECIFIED = 0, + /** PROPOSAL_RESULT_UNFINALIZED - Until a final tally has happened the status is unfinalized */ + PROPOSAL_RESULT_UNFINALIZED = 1, + /** PROPOSAL_RESULT_ACCEPTED - Final result of the tally */ + PROPOSAL_RESULT_ACCEPTED = 2, + /** PROPOSAL_RESULT_REJECTED - Final result of the tally */ + PROPOSAL_RESULT_REJECTED = 3, + UNRECOGNIZED = -1, +} +export const ProposalResultSDKType = ProposalResult; +export const ProposalResultAmino = ProposalResult; +export function proposalResultFromJSON(object: any): ProposalResult { + switch (object) { + case 0: + case "PROPOSAL_RESULT_UNSPECIFIED": + return ProposalResult.PROPOSAL_RESULT_UNSPECIFIED; + case 1: + case "PROPOSAL_RESULT_UNFINALIZED": + return ProposalResult.PROPOSAL_RESULT_UNFINALIZED; + case 2: + case "PROPOSAL_RESULT_ACCEPTED": + return ProposalResult.PROPOSAL_RESULT_ACCEPTED; + case 3: + case "PROPOSAL_RESULT_REJECTED": + return ProposalResult.PROPOSAL_RESULT_REJECTED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalResult.UNRECOGNIZED; + } +} +export function proposalResultToJSON(object: ProposalResult): string { + switch (object) { + case ProposalResult.PROPOSAL_RESULT_UNSPECIFIED: + return "PROPOSAL_RESULT_UNSPECIFIED"; + case ProposalResult.PROPOSAL_RESULT_UNFINALIZED: + return "PROPOSAL_RESULT_UNFINALIZED"; + case ProposalResult.PROPOSAL_RESULT_ACCEPTED: + return "PROPOSAL_RESULT_ACCEPTED"; + case ProposalResult.PROPOSAL_RESULT_REJECTED: + return "PROPOSAL_RESULT_REJECTED"; + case ProposalResult.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalExecutorResult defines types of proposal executor results. */ +export enum ProposalExecutorResult { + /** PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED - An empty value is not allowed. */ + PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0, + /** PROPOSAL_EXECUTOR_RESULT_NOT_RUN - We have not yet run the executor. */ + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1, + /** PROPOSAL_EXECUTOR_RESULT_SUCCESS - The executor was successful and proposed action updated state. */ + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2, + /** PROPOSAL_EXECUTOR_RESULT_FAILURE - The executor returned an error and proposed action didn't update state. */ + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3, + UNRECOGNIZED = -1, +} +export const ProposalExecutorResultSDKType = ProposalExecutorResult; +export const ProposalExecutorResultAmino = ProposalExecutorResult; +export function proposalExecutorResultFromJSON(object: any): ProposalExecutorResult { + switch (object) { + case 0: + case "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED; + case 1: + case "PROPOSAL_EXECUTOR_RESULT_NOT_RUN": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_NOT_RUN; + case 2: + case "PROPOSAL_EXECUTOR_RESULT_SUCCESS": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_SUCCESS; + case 3: + case "PROPOSAL_EXECUTOR_RESULT_FAILURE": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_FAILURE; + case -1: + case "UNRECOGNIZED": + default: + return ProposalExecutorResult.UNRECOGNIZED; + } +} +export function proposalExecutorResultToJSON(object: ProposalExecutorResult): string { + switch (object) { + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED: + return "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_NOT_RUN: + return "PROPOSAL_EXECUTOR_RESULT_NOT_RUN"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_SUCCESS: + return "PROPOSAL_EXECUTOR_RESULT_SUCCESS"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_FAILURE: + return "PROPOSAL_EXECUTOR_RESULT_FAILURE"; + case ProposalExecutorResult.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Member represents a group member with an account address, + * non-zero weight and metadata. + */ +export interface Member { + /** address is the member's account address. */ + address: string; + /** weight is the member's voting weight that should be greater than 0. */ + weight: string; + /** metadata is any arbitrary metadata to attached to the member. */ + metadata: string; + /** added_at is a timestamp specifying when a member was added. */ + addedAt: Date; +} +export interface MemberProtoMsg { + typeUrl: "/cosmos.group.v1.Member"; + value: Uint8Array; +} +/** + * Member represents a group member with an account address, + * non-zero weight and metadata. + */ +export interface MemberAmino { + /** address is the member's account address. */ + address?: string; + /** weight is the member's voting weight that should be greater than 0. */ + weight?: string; + /** metadata is any arbitrary metadata to attached to the member. */ + metadata?: string; + /** added_at is a timestamp specifying when a member was added. */ + added_at?: string; +} +export interface MemberAminoMsg { + type: "cosmos-sdk/Member"; + value: MemberAmino; +} +/** + * Member represents a group member with an account address, + * non-zero weight and metadata. + */ +export interface MemberSDKType { + address: string; + weight: string; + metadata: string; + added_at: Date; +} +/** Members defines a repeated slice of Member objects. */ +export interface Members { + /** members is the list of members. */ + members: Member[]; +} +export interface MembersProtoMsg { + typeUrl: "/cosmos.group.v1.Members"; + value: Uint8Array; +} +/** Members defines a repeated slice of Member objects. */ +export interface MembersAmino { + /** members is the list of members. */ + members?: MemberAmino[]; +} +export interface MembersAminoMsg { + type: "cosmos-sdk/Members"; + value: MembersAmino; +} +/** Members defines a repeated slice of Member objects. */ +export interface MembersSDKType { + members: MemberSDKType[]; +} +/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ +export interface ThresholdDecisionPolicy { + $typeUrl?: "/cosmos.group.v1.ThresholdDecisionPolicy"; + /** threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. */ + threshold: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindows; +} +export interface ThresholdDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy"; + value: Uint8Array; +} +/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ +export interface ThresholdDecisionPolicyAmino { + /** threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. */ + threshold?: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindowsAmino; +} +export interface ThresholdDecisionPolicyAminoMsg { + type: "cosmos-sdk/ThresholdDecisionPolicy"; + value: ThresholdDecisionPolicyAmino; +} +/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ +export interface ThresholdDecisionPolicySDKType { + $typeUrl?: "/cosmos.group.v1.ThresholdDecisionPolicy"; + threshold: string; + windows?: DecisionPolicyWindowsSDKType; +} +/** PercentageDecisionPolicy implements the DecisionPolicy interface */ +export interface PercentageDecisionPolicy { + $typeUrl?: "/cosmos.group.v1.PercentageDecisionPolicy"; + /** percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. */ + percentage: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindows; +} +export interface PercentageDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy"; + value: Uint8Array; +} +/** PercentageDecisionPolicy implements the DecisionPolicy interface */ +export interface PercentageDecisionPolicyAmino { + /** percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. */ + percentage?: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindowsAmino; +} +export interface PercentageDecisionPolicyAminoMsg { + type: "cosmos-sdk/PercentageDecisionPolicy"; + value: PercentageDecisionPolicyAmino; +} +/** PercentageDecisionPolicy implements the DecisionPolicy interface */ +export interface PercentageDecisionPolicySDKType { + $typeUrl?: "/cosmos.group.v1.PercentageDecisionPolicy"; + percentage: string; + windows?: DecisionPolicyWindowsSDKType; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindows { + /** + * voting_period is the duration from submission of a proposal to the end of voting period + * Within this times votes can be submitted with MsgVote. + */ + votingPeriod: Duration; + /** + * min_execution_period is the minimum duration after the proposal submission + * where members can start sending MsgExec. This means that the window for + * sending a MsgExec transaction is: + * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + * where max_execution_period is a app-specific config, defined in the keeper. + * If not set, min_execution_period will default to 0. + * + * Please make sure to set a `min_execution_period` that is smaller than + * `voting_period + max_execution_period`, or else the above execution window + * is empty, meaning that all proposals created with this decision policy + * won't be able to be executed. + */ + minExecutionPeriod: Duration; +} +export interface DecisionPolicyWindowsProtoMsg { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows"; + value: Uint8Array; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindowsAmino { + /** + * voting_period is the duration from submission of a proposal to the end of voting period + * Within this times votes can be submitted with MsgVote. + */ + voting_period?: DurationAmino; + /** + * min_execution_period is the minimum duration after the proposal submission + * where members can start sending MsgExec. This means that the window for + * sending a MsgExec transaction is: + * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + * where max_execution_period is a app-specific config, defined in the keeper. + * If not set, min_execution_period will default to 0. + * + * Please make sure to set a `min_execution_period` that is smaller than + * `voting_period + max_execution_period`, or else the above execution window + * is empty, meaning that all proposals created with this decision policy + * won't be able to be executed. + */ + min_execution_period?: DurationAmino; +} +export interface DecisionPolicyWindowsAminoMsg { + type: "cosmos-sdk/DecisionPolicyWindows"; + value: DecisionPolicyWindowsAmino; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindowsSDKType { + voting_period: DurationSDKType; + min_execution_period: DurationSDKType; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfo { + /** id is the unique ID of the group. */ + id: bigint; + /** admin is the account address of the group's admin. */ + admin: string; + /** metadata is any arbitrary metadata to attached to the group. */ + metadata: string; + /** + * version is used to track changes to a group's membership structure that + * would break existing proposals. Whenever any members weight is changed, + * or any member is added or removed this version is incremented and will + * cause proposals based on older versions of this group to fail + */ + version: bigint; + /** total_weight is the sum of the group members' weights. */ + totalWeight: string; + /** created_at is a timestamp specifying when a group was created. */ + createdAt: Date; +} +export interface GroupInfoProtoMsg { + typeUrl: "/cosmos.group.v1.GroupInfo"; + value: Uint8Array; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfoAmino { + /** id is the unique ID of the group. */ + id?: string; + /** admin is the account address of the group's admin. */ + admin?: string; + /** metadata is any arbitrary metadata to attached to the group. */ + metadata?: string; + /** + * version is used to track changes to a group's membership structure that + * would break existing proposals. Whenever any members weight is changed, + * or any member is added or removed this version is incremented and will + * cause proposals based on older versions of this group to fail + */ + version?: string; + /** total_weight is the sum of the group members' weights. */ + total_weight?: string; + /** created_at is a timestamp specifying when a group was created. */ + created_at?: string; +} +export interface GroupInfoAminoMsg { + type: "cosmos-sdk/GroupInfo"; + value: GroupInfoAmino; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfoSDKType { + id: bigint; + admin: string; + metadata: string; + version: bigint; + total_weight: string; + created_at: Date; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMember { + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** member is the member data. */ + member?: Member; +} +export interface GroupMemberProtoMsg { + typeUrl: "/cosmos.group.v1.GroupMember"; + value: Uint8Array; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMemberAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; + /** member is the member data. */ + member?: MemberAmino; +} +export interface GroupMemberAminoMsg { + type: "cosmos-sdk/GroupMember"; + value: GroupMemberAmino; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMemberSDKType { + group_id: bigint; + member?: MemberSDKType; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfo { + /** address is the account address of group policy. */ + address: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** admin is the account address of the group admin. */ + admin: string; + /** metadata is any arbitrary metadata to attached to the group policy. */ + metadata: string; + /** + * version is used to track changes to a group's GroupPolicyInfo structure that + * would create a different result on a running proposal. + */ + version: bigint; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy?: ThresholdDecisionPolicy | PercentageDecisionPolicy | Any | undefined; + /** created_at is a timestamp specifying when a group policy was created. */ + createdAt: Date; +} +export interface GroupPolicyInfoProtoMsg { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo"; + value: Uint8Array; +} +export type GroupPolicyInfoEncoded = Omit & { + /** decision_policy specifies the group policy's decision policy. */decisionPolicy?: ThresholdDecisionPolicyProtoMsg | PercentageDecisionPolicyProtoMsg | AnyProtoMsg | undefined; +}; +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfoAmino { + /** address is the account address of group policy. */ + address?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** admin is the account address of the group admin. */ + admin?: string; + /** metadata is any arbitrary metadata to attached to the group policy. */ + metadata?: string; + /** + * version is used to track changes to a group's GroupPolicyInfo structure that + * would create a different result on a running proposal. + */ + version?: string; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; + /** created_at is a timestamp specifying when a group policy was created. */ + created_at?: string; +} +export interface GroupPolicyInfoAminoMsg { + type: "cosmos-sdk/GroupPolicyInfo"; + value: GroupPolicyInfoAmino; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfoSDKType { + address: string; + group_id: bigint; + admin: string; + metadata: string; + version: bigint; + decision_policy?: ThresholdDecisionPolicySDKType | PercentageDecisionPolicySDKType | AnySDKType | undefined; + created_at: Date; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface Proposal { + /** id is the unique id of the proposal. */ + id: bigint; + /** address is the account address of group policy. */ + address: string; + /** metadata is any arbitrary metadata to attached to the proposal. */ + metadata: string; + /** proposers are the account addresses of the proposers. */ + proposers: string[]; + /** submit_time is a timestamp specifying when a proposal was submitted. */ + submitTime: Date; + /** + * group_version tracks the version of the group that this proposal corresponds to. + * When group membership is changed, existing proposals from previous group versions will become invalid. + */ + groupVersion: bigint; + /** + * group_policy_version tracks the version of the group policy that this proposal corresponds to. + * When a decision policy is changed, existing proposals from previous policy versions will become invalid. + */ + groupPolicyVersion: bigint; + /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ + status: ProposalStatus; + /** + * result is the final result based on the votes and election rule. Initial value is unfinalized. + * The result is persisted so that clients can always rely on this state and not have to replicate the logic. + */ + result: ProposalResult; + /** + * final_tally_result contains the sums of all weighted votes for this + * proposal for each vote option, after tallying. When querying a proposal + * via gRPC, this field is not populated until the proposal's voting period + * has ended. + */ + finalTallyResult: TallyResult; + /** + * voting_period_end is the timestamp before which voting must be done. + * Unless a successfull MsgExec is called before (to execute a proposal whose + * tally is successful before the voting period ends), tallying will be done + * at this point, and the `final_tally_result`, as well + * as `status` and `result` fields will be accordingly updated. + */ + votingPeriodEnd: Date; + /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ + executorResult: ProposalExecutorResult; + /** messages is a list of Msgs that will be executed if the proposal passes. */ + messages: Any[]; +} +export interface ProposalProtoMsg { + typeUrl: "/cosmos.group.v1.Proposal"; + value: Uint8Array; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface ProposalAmino { + /** id is the unique id of the proposal. */ + id?: string; + /** address is the account address of group policy. */ + address?: string; + /** metadata is any arbitrary metadata to attached to the proposal. */ + metadata?: string; + /** proposers are the account addresses of the proposers. */ + proposers?: string[]; + /** submit_time is a timestamp specifying when a proposal was submitted. */ + submit_time?: string; + /** + * group_version tracks the version of the group that this proposal corresponds to. + * When group membership is changed, existing proposals from previous group versions will become invalid. + */ + group_version?: string; + /** + * group_policy_version tracks the version of the group policy that this proposal corresponds to. + * When a decision policy is changed, existing proposals from previous policy versions will become invalid. + */ + group_policy_version?: string; + /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ + status?: ProposalStatus; + /** + * result is the final result based on the votes and election rule. Initial value is unfinalized. + * The result is persisted so that clients can always rely on this state and not have to replicate the logic. + */ + result?: ProposalResult; + /** + * final_tally_result contains the sums of all weighted votes for this + * proposal for each vote option, after tallying. When querying a proposal + * via gRPC, this field is not populated until the proposal's voting period + * has ended. + */ + final_tally_result?: TallyResultAmino; + /** + * voting_period_end is the timestamp before which voting must be done. + * Unless a successfull MsgExec is called before (to execute a proposal whose + * tally is successful before the voting period ends), tallying will be done + * at this point, and the `final_tally_result`, as well + * as `status` and `result` fields will be accordingly updated. + */ + voting_period_end?: string; + /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ + executor_result?: ProposalExecutorResult; + /** messages is a list of Msgs that will be executed if the proposal passes. */ + messages?: AnyAmino[]; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/Proposal"; + value: ProposalAmino; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface ProposalSDKType { + id: bigint; + address: string; + metadata: string; + proposers: string[]; + submit_time: Date; + group_version: bigint; + group_policy_version: bigint; + status: ProposalStatus; + result: ProposalResult; + final_tally_result: TallyResultSDKType; + voting_period_end: Date; + executor_result: ProposalExecutorResult; + messages: AnySDKType[]; +} +/** TallyResult represents the sum of weighted votes for each vote option. */ +export interface TallyResult { + /** yes_count is the weighted sum of yes votes. */ + yesCount: string; + /** abstain_count is the weighted sum of abstainers. */ + abstainCount: string; + /** no is the weighted sum of no votes. */ + noCount: string; + /** no_with_veto_count is the weighted sum of veto. */ + noWithVetoCount: string; +} +export interface TallyResultProtoMsg { + typeUrl: "/cosmos.group.v1.TallyResult"; + value: Uint8Array; +} +/** TallyResult represents the sum of weighted votes for each vote option. */ +export interface TallyResultAmino { + /** yes_count is the weighted sum of yes votes. */ + yes_count?: string; + /** abstain_count is the weighted sum of abstainers. */ + abstain_count?: string; + /** no is the weighted sum of no votes. */ + no_count?: string; + /** no_with_veto_count is the weighted sum of veto. */ + no_with_veto_count?: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult represents the sum of weighted votes for each vote option. */ +export interface TallyResultSDKType { + yes_count: string; + abstain_count: string; + no_count: string; + no_with_veto_count: string; +} +/** Vote represents a vote for a proposal. */ +export interface Vote { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** voter is the account address of the voter. */ + voter: string; + /** option is the voter's choice on the proposal. */ + option: VoteOption; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata: string; + /** submit_time is the timestamp when the vote was submitted. */ + submitTime: Date; +} +export interface VoteProtoMsg { + typeUrl: "/cosmos.group.v1.Vote"; + value: Uint8Array; +} +/** Vote represents a vote for a proposal. */ +export interface VoteAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** voter is the account address of the voter. */ + voter?: string; + /** option is the voter's choice on the proposal. */ + option?: VoteOption; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata?: string; + /** submit_time is the timestamp when the vote was submitted. */ + submit_time?: string; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/Vote"; + value: VoteAmino; +} +/** Vote represents a vote for a proposal. */ +export interface VoteSDKType { + proposal_id: bigint; + voter: string; + option: VoteOption; + metadata: string; + submit_time: Date; +} +function createBaseMember(): Member { + return { + address: "", + weight: "", + metadata: "", + addedAt: new Date() + }; +} +export const Member = { + typeUrl: "/cosmos.group.v1.Member", + encode(message: Member, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + if (message.addedAt !== undefined) { + Timestamp.encode(toTimestamp(message.addedAt), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Member { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMember(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.weight = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.addedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Member { + const message = createBaseMember(); + message.address = object.address ?? ""; + message.weight = object.weight ?? ""; + message.metadata = object.metadata ?? ""; + message.addedAt = object.addedAt ?? undefined; + return message; + }, + fromAmino(object: MemberAmino): Member { + const message = createBaseMember(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.added_at !== undefined && object.added_at !== null) { + message.addedAt = fromTimestamp(Timestamp.fromAmino(object.added_at)); + } + return message; + }, + toAmino(message: Member): MemberAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.weight = message.weight === "" ? undefined : message.weight; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.added_at = message.addedAt ? Timestamp.toAmino(toTimestamp(message.addedAt)) : undefined; + return obj; + }, + fromAminoMsg(object: MemberAminoMsg): Member { + return Member.fromAmino(object.value); + }, + toAminoMsg(message: Member): MemberAminoMsg { + return { + type: "cosmos-sdk/Member", + value: Member.toAmino(message) + }; + }, + fromProtoMsg(message: MemberProtoMsg): Member { + return Member.decode(message.value); + }, + toProto(message: Member): Uint8Array { + return Member.encode(message).finish(); + }, + toProtoMsg(message: Member): MemberProtoMsg { + return { + typeUrl: "/cosmos.group.v1.Member", + value: Member.encode(message).finish() + }; + } +}; +function createBaseMembers(): Members { + return { + members: [] + }; +} +export const Members = { + typeUrl: "/cosmos.group.v1.Members", + encode(message: Members, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.members) { + Member.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Members { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMembers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.members.push(Member.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Members { + const message = createBaseMembers(); + message.members = object.members?.map(e => Member.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MembersAmino): Members { + const message = createBaseMembers(); + message.members = object.members?.map(e => Member.fromAmino(e)) || []; + return message; + }, + toAmino(message: Members): MembersAmino { + const obj: any = {}; + if (message.members) { + obj.members = message.members.map(e => e ? Member.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + return obj; + }, + fromAminoMsg(object: MembersAminoMsg): Members { + return Members.fromAmino(object.value); + }, + toAminoMsg(message: Members): MembersAminoMsg { + return { + type: "cosmos-sdk/Members", + value: Members.toAmino(message) + }; + }, + fromProtoMsg(message: MembersProtoMsg): Members { + return Members.decode(message.value); + }, + toProto(message: Members): Uint8Array { + return Members.encode(message).finish(); + }, + toProtoMsg(message: Members): MembersProtoMsg { + return { + typeUrl: "/cosmos.group.v1.Members", + value: Members.encode(message).finish() + }; + } +}; +function createBaseThresholdDecisionPolicy(): ThresholdDecisionPolicy { + return { + $typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + threshold: "", + windows: undefined + }; +} +export const ThresholdDecisionPolicy = { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + encode(message: ThresholdDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.threshold !== "") { + writer.uint32(10).string(message.threshold); + } + if (message.windows !== undefined) { + DecisionPolicyWindows.encode(message.windows, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ThresholdDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseThresholdDecisionPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threshold = reader.string(); + break; + case 2: + message.windows = DecisionPolicyWindows.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ThresholdDecisionPolicy { + const message = createBaseThresholdDecisionPolicy(); + message.threshold = object.threshold ?? ""; + message.windows = object.windows !== undefined && object.windows !== null ? DecisionPolicyWindows.fromPartial(object.windows) : undefined; + return message; + }, + fromAmino(object: ThresholdDecisionPolicyAmino): ThresholdDecisionPolicy { + const message = createBaseThresholdDecisionPolicy(); + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + if (object.windows !== undefined && object.windows !== null) { + message.windows = DecisionPolicyWindows.fromAmino(object.windows); + } + return message; + }, + toAmino(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyAmino { + const obj: any = {}; + obj.threshold = message.threshold === "" ? undefined : message.threshold; + obj.windows = message.windows ? DecisionPolicyWindows.toAmino(message.windows) : undefined; + return obj; + }, + fromAminoMsg(object: ThresholdDecisionPolicyAminoMsg): ThresholdDecisionPolicy { + return ThresholdDecisionPolicy.fromAmino(object.value); + }, + toAminoMsg(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyAminoMsg { + return { + type: "cosmos-sdk/ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: ThresholdDecisionPolicyProtoMsg): ThresholdDecisionPolicy { + return ThresholdDecisionPolicy.decode(message.value); + }, + toProto(message: ThresholdDecisionPolicy): Uint8Array { + return ThresholdDecisionPolicy.encode(message).finish(); + }, + toProtoMsg(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.encode(message).finish() + }; + } +}; +function createBasePercentageDecisionPolicy(): PercentageDecisionPolicy { + return { + $typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + percentage: "", + windows: undefined + }; +} +export const PercentageDecisionPolicy = { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + encode(message: PercentageDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.percentage !== "") { + writer.uint32(10).string(message.percentage); + } + if (message.windows !== undefined) { + DecisionPolicyWindows.encode(message.windows, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PercentageDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePercentageDecisionPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.percentage = reader.string(); + break; + case 2: + message.windows = DecisionPolicyWindows.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PercentageDecisionPolicy { + const message = createBasePercentageDecisionPolicy(); + message.percentage = object.percentage ?? ""; + message.windows = object.windows !== undefined && object.windows !== null ? DecisionPolicyWindows.fromPartial(object.windows) : undefined; + return message; + }, + fromAmino(object: PercentageDecisionPolicyAmino): PercentageDecisionPolicy { + const message = createBasePercentageDecisionPolicy(); + if (object.percentage !== undefined && object.percentage !== null) { + message.percentage = object.percentage; + } + if (object.windows !== undefined && object.windows !== null) { + message.windows = DecisionPolicyWindows.fromAmino(object.windows); + } + return message; + }, + toAmino(message: PercentageDecisionPolicy): PercentageDecisionPolicyAmino { + const obj: any = {}; + obj.percentage = message.percentage === "" ? undefined : message.percentage; + obj.windows = message.windows ? DecisionPolicyWindows.toAmino(message.windows) : undefined; + return obj; + }, + fromAminoMsg(object: PercentageDecisionPolicyAminoMsg): PercentageDecisionPolicy { + return PercentageDecisionPolicy.fromAmino(object.value); + }, + toAminoMsg(message: PercentageDecisionPolicy): PercentageDecisionPolicyAminoMsg { + return { + type: "cosmos-sdk/PercentageDecisionPolicy", + value: PercentageDecisionPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: PercentageDecisionPolicyProtoMsg): PercentageDecisionPolicy { + return PercentageDecisionPolicy.decode(message.value); + }, + toProto(message: PercentageDecisionPolicy): Uint8Array { + return PercentageDecisionPolicy.encode(message).finish(); + }, + toProtoMsg(message: PercentageDecisionPolicy): PercentageDecisionPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + value: PercentageDecisionPolicy.encode(message).finish() + }; + } +}; +function createBaseDecisionPolicyWindows(): DecisionPolicyWindows { + return { + votingPeriod: Duration.fromPartial({}), + minExecutionPeriod: Duration.fromPartial({}) + }; +} +export const DecisionPolicyWindows = { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows", + encode(message: DecisionPolicyWindows, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + } + if (message.minExecutionPeriod !== undefined) { + Duration.encode(message.minExecutionPeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecisionPolicyWindows { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecisionPolicyWindows(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.minExecutionPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecisionPolicyWindows { + const message = createBaseDecisionPolicyWindows(); + message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; + message.minExecutionPeriod = object.minExecutionPeriod !== undefined && object.minExecutionPeriod !== null ? Duration.fromPartial(object.minExecutionPeriod) : undefined; + return message; + }, + fromAmino(object: DecisionPolicyWindowsAmino): DecisionPolicyWindows { + const message = createBaseDecisionPolicyWindows(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + if (object.min_execution_period !== undefined && object.min_execution_period !== null) { + message.minExecutionPeriod = Duration.fromAmino(object.min_execution_period); + } + return message; + }, + toAmino(message: DecisionPolicyWindows): DecisionPolicyWindowsAmino { + const obj: any = {}; + obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; + obj.min_execution_period = message.minExecutionPeriod ? Duration.toAmino(message.minExecutionPeriod) : undefined; + return obj; + }, + fromAminoMsg(object: DecisionPolicyWindowsAminoMsg): DecisionPolicyWindows { + return DecisionPolicyWindows.fromAmino(object.value); + }, + toAminoMsg(message: DecisionPolicyWindows): DecisionPolicyWindowsAminoMsg { + return { + type: "cosmos-sdk/DecisionPolicyWindows", + value: DecisionPolicyWindows.toAmino(message) + }; + }, + fromProtoMsg(message: DecisionPolicyWindowsProtoMsg): DecisionPolicyWindows { + return DecisionPolicyWindows.decode(message.value); + }, + toProto(message: DecisionPolicyWindows): Uint8Array { + return DecisionPolicyWindows.encode(message).finish(); + }, + toProtoMsg(message: DecisionPolicyWindows): DecisionPolicyWindowsProtoMsg { + return { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows", + value: DecisionPolicyWindows.encode(message).finish() + }; + } +}; +function createBaseGroupInfo(): GroupInfo { + return { + id: BigInt(0), + admin: "", + metadata: "", + version: BigInt(0), + totalWeight: "", + createdAt: new Date() + }; +} +export const GroupInfo = { + typeUrl: "/cosmos.group.v1.GroupInfo", + encode(message: GroupInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + if (message.version !== BigInt(0)) { + writer.uint32(32).uint64(message.version); + } + if (message.totalWeight !== "") { + writer.uint32(42).string(message.totalWeight); + } + if (message.createdAt !== undefined) { + Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.version = reader.uint64(); + break; + case 5: + message.totalWeight = reader.string(); + break; + case 6: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GroupInfo { + const message = createBaseGroupInfo(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.metadata = object.metadata ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.totalWeight = object.totalWeight ?? ""; + message.createdAt = object.createdAt ?? undefined; + return message; + }, + fromAmino(object: GroupInfoAmino): GroupInfo { + const message = createBaseGroupInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); + } + return message; + }, + toAmino(message: GroupInfo): GroupInfoAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.total_weight = message.totalWeight === "" ? undefined : message.totalWeight; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; + return obj; + }, + fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { + return GroupInfo.fromAmino(object.value); + }, + toAminoMsg(message: GroupInfo): GroupInfoAminoMsg { + return { + type: "cosmos-sdk/GroupInfo", + value: GroupInfo.toAmino(message) + }; + }, + fromProtoMsg(message: GroupInfoProtoMsg): GroupInfo { + return GroupInfo.decode(message.value); + }, + toProto(message: GroupInfo): Uint8Array { + return GroupInfo.encode(message).finish(); + }, + toProtoMsg(message: GroupInfo): GroupInfoProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GroupInfo", + value: GroupInfo.encode(message).finish() + }; + } +}; +function createBaseGroupMember(): GroupMember { + return { + groupId: BigInt(0), + member: undefined + }; +} +export const GroupMember = { + typeUrl: "/cosmos.group.v1.GroupMember", + encode(message: GroupMember, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.member !== undefined) { + Member.encode(message.member, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupMember { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupMember(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.member = Member.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GroupMember { + const message = createBaseGroupMember(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.member = object.member !== undefined && object.member !== null ? Member.fromPartial(object.member) : undefined; + return message; + }, + fromAmino(object: GroupMemberAmino): GroupMember { + const message = createBaseGroupMember(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.member !== undefined && object.member !== null) { + message.member = Member.fromAmino(object.member); + } + return message; + }, + toAmino(message: GroupMember): GroupMemberAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.member = message.member ? Member.toAmino(message.member) : undefined; + return obj; + }, + fromAminoMsg(object: GroupMemberAminoMsg): GroupMember { + return GroupMember.fromAmino(object.value); + }, + toAminoMsg(message: GroupMember): GroupMemberAminoMsg { + return { + type: "cosmos-sdk/GroupMember", + value: GroupMember.toAmino(message) + }; + }, + fromProtoMsg(message: GroupMemberProtoMsg): GroupMember { + return GroupMember.decode(message.value); + }, + toProto(message: GroupMember): Uint8Array { + return GroupMember.encode(message).finish(); + }, + toProtoMsg(message: GroupMember): GroupMemberProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GroupMember", + value: GroupMember.encode(message).finish() + }; + } +}; +function createBaseGroupPolicyInfo(): GroupPolicyInfo { + return { + address: "", + groupId: BigInt(0), + admin: "", + metadata: "", + version: BigInt(0), + decisionPolicy: undefined, + createdAt: new Date() + }; +} +export const GroupPolicyInfo = { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo", + encode(message: GroupPolicyInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.admin !== "") { + writer.uint32(26).string(message.admin); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.version !== BigInt(0)) { + writer.uint32(40).uint64(message.version); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy as Any, writer.uint32(50).fork()).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupPolicyInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupPolicyInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.admin = reader.string(); + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.version = reader.uint64(); + break; + case 6: + message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder(reader) as Any; + break; + case 7: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GroupPolicyInfo { + const message = createBaseGroupPolicyInfo(); + message.address = object.address ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.metadata = object.metadata ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + message.createdAt = object.createdAt ?? undefined; + return message; + }, + fromAmino(object: GroupPolicyInfoAmino): GroupPolicyInfo { + const message = createBaseGroupPolicyInfo(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino(object.decision_policy); + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); + } + return message; + }, + toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; + return obj; + }, + fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { + return GroupPolicyInfo.fromAmino(object.value); + }, + toAminoMsg(message: GroupPolicyInfo): GroupPolicyInfoAminoMsg { + return { + type: "cosmos-sdk/GroupPolicyInfo", + value: GroupPolicyInfo.toAmino(message) + }; + }, + fromProtoMsg(message: GroupPolicyInfoProtoMsg): GroupPolicyInfo { + return GroupPolicyInfo.decode(message.value); + }, + toProto(message: GroupPolicyInfo): Uint8Array { + return GroupPolicyInfo.encode(message).finish(); + }, + toProtoMsg(message: GroupPolicyInfo): GroupPolicyInfoProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo", + value: GroupPolicyInfo.encode(message).finish() + }; + } +}; +function createBaseProposal(): Proposal { + return { + id: BigInt(0), + address: "", + metadata: "", + proposers: [], + submitTime: new Date(), + groupVersion: BigInt(0), + groupPolicyVersion: BigInt(0), + status: 0, + result: 0, + finalTallyResult: TallyResult.fromPartial({}), + votingPeriodEnd: new Date(), + executorResult: 0, + messages: [] + }; +} +export const Proposal = { + typeUrl: "/cosmos.group.v1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + for (const v of message.proposers) { + writer.uint32(34).string(v!); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + if (message.groupVersion !== BigInt(0)) { + writer.uint32(48).uint64(message.groupVersion); + } + if (message.groupPolicyVersion !== BigInt(0)) { + writer.uint32(56).uint64(message.groupPolicyVersion); + } + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } + if (message.result !== 0) { + writer.uint32(72).int32(message.result); + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(82).fork()).ldelim(); + } + if (message.votingPeriodEnd !== undefined) { + Timestamp.encode(toTimestamp(message.votingPeriodEnd), writer.uint32(90).fork()).ldelim(); + } + if (message.executorResult !== 0) { + writer.uint32(96).int32(message.executorResult); + } + for (const v of message.messages) { + Any.encode(v!, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.proposers.push(reader.string()); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.groupVersion = reader.uint64(); + break; + case 7: + message.groupPolicyVersion = reader.uint64(); + break; + case 8: + message.status = reader.int32() as any; + break; + case 9: + message.result = reader.int32() as any; + break; + case 10: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); + break; + case 11: + message.votingPeriodEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 12: + message.executorResult = reader.int32() as any; + break; + case 13: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Proposal { + const message = createBaseProposal(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.address = object.address ?? ""; + message.metadata = object.metadata ?? ""; + message.proposers = object.proposers?.map(e => e) || []; + message.submitTime = object.submitTime ?? undefined; + message.groupVersion = object.groupVersion !== undefined && object.groupVersion !== null ? BigInt(object.groupVersion.toString()) : BigInt(0); + message.groupPolicyVersion = object.groupPolicyVersion !== undefined && object.groupPolicyVersion !== null ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0); + message.status = object.status ?? 0; + message.result = object.result ?? 0; + message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; + message.votingPeriodEnd = object.votingPeriodEnd ?? undefined; + message.executorResult = object.executorResult ?? 0; + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + message.proposers = object.proposers?.map(e => e) || []; + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + if (object.group_version !== undefined && object.group_version !== null) { + message.groupVersion = BigInt(object.group_version); + } + if (object.group_policy_version !== undefined && object.group_policy_version !== null) { + message.groupPolicyVersion = BigInt(object.group_policy_version); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.voting_period_end !== undefined && object.voting_period_end !== null) { + message.votingPeriodEnd = fromTimestamp(Timestamp.fromAmino(object.voting_period_end)); + } + if (object.executor_result !== undefined && object.executor_result !== null) { + message.executorResult = object.executor_result; + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + if (message.proposers) { + obj.proposers = message.proposers.map(e => e); + } else { + obj.proposers = message.proposers; + } + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.group_version = message.groupVersion !== BigInt(0) ? message.groupVersion.toString() : undefined; + obj.group_policy_version = message.groupPolicyVersion !== BigInt(0) ? message.groupPolicyVersion.toString() : undefined; + obj.status = message.status === 0 ? undefined : message.status; + obj.result = message.result === 0 ? undefined : message.result; + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; + obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(toTimestamp(message.votingPeriodEnd)) : undefined; + obj.executor_result = message.executorResult === 0 ? undefined : message.executorResult; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + toAminoMsg(message: Proposal): ProposalAminoMsg { + return { + type: "cosmos-sdk/Proposal", + value: Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.group.v1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.yesCount !== "") { + writer.uint32(10).string(message.yesCount); + } + if (message.abstainCount !== "") { + writer.uint32(18).string(message.abstainCount); + } + if (message.noCount !== "") { + writer.uint32(26).string(message.noCount); + } + if (message.noWithVetoCount !== "") { + writer.uint32(34).string(message.noWithVetoCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yesCount = reader.string(); + break; + case 2: + message.abstainCount = reader.string(); + break; + case 3: + message.noCount = reader.string(); + break; + case 4: + message.noWithVetoCount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyResult { + const message = createBaseTallyResult(); + message.yesCount = object.yesCount ?? ""; + message.abstainCount = object.abstainCount ?? ""; + message.noCount = object.noCount ?? ""; + message.noWithVetoCount = object.noWithVetoCount ?? ""; + return message; + }, + fromAmino(object: TallyResultAmino): TallyResult { + const message = createBaseTallyResult(); + if (object.yes_count !== undefined && object.yes_count !== null) { + message.yesCount = object.yes_count; + } + if (object.abstain_count !== undefined && object.abstain_count !== null) { + message.abstainCount = object.abstain_count; + } + if (object.no_count !== undefined && object.no_count !== null) { + message.noCount = object.no_count; + } + if (object.no_with_veto_count !== undefined && object.no_with_veto_count !== null) { + message.noWithVetoCount = object.no_with_veto_count; + } + return message; + }, + toAmino(message: TallyResult): TallyResultAmino { + const obj: any = {}; + obj.yes_count = message.yesCount === "" ? undefined : message.yesCount; + obj.abstain_count = message.abstainCount === "" ? undefined : message.abstainCount; + obj.no_count = message.noCount === "" ? undefined : message.noCount; + obj.no_with_veto_count = message.noWithVetoCount === "" ? undefined : message.noWithVetoCount; + return obj; + }, + fromAminoMsg(object: TallyResultAminoMsg): TallyResult { + return TallyResult.fromAmino(object.value); + }, + toAminoMsg(message: TallyResult): TallyResultAminoMsg { + return { + type: "cosmos-sdk/TallyResult", + value: TallyResult.toAmino(message) + }; + }, + fromProtoMsg(message: TallyResultProtoMsg): TallyResult { + return TallyResult.decode(message.value); + }, + toProto(message: TallyResult): Uint8Array { + return TallyResult.encode(message).finish(); + }, + toProtoMsg(message: TallyResult): TallyResultProtoMsg { + return { + typeUrl: "/cosmos.group.v1.TallyResult", + value: TallyResult.encode(message).finish() + }; + } +}; +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + submitTime: new Date() + }; +} +export const Vote = { + typeUrl: "/cosmos.group.v1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32() as any; + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + message.submitTime = object.submitTime ?? undefined; + return message; + }, + fromAmino(object: VoteAmino): Vote { + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + return message; + }, + toAmino(message: Vote): VoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + return obj; + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value); + }, + toAminoMsg(message: Vote): VoteAminoMsg { + return { + type: "cosmos-sdk/Vote", + value: Vote.toAmino(message) + }; + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/cosmos.group.v1.Vote", + value: Vote.encode(message).finish() + }; + } +}; +export const Cosmos_groupDecisionPolicy_InterfaceDecoder = (input: BinaryReader | Uint8Array): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.group.v1.ThresholdDecisionPolicy": + return ThresholdDecisionPolicy.decode(data.value); + case "/cosmos.group.v1.PercentageDecisionPolicy": + return PercentageDecisionPolicy.decode(data.value); + default: + return data; + } +}; +export const Cosmos_groupDecisionPolicy_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "cosmos-sdk/ThresholdDecisionPolicy": + return Any.fromPartial({ + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.encode(ThresholdDecisionPolicy.fromPartial(ThresholdDecisionPolicy.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/PercentageDecisionPolicy": + return Any.fromPartial({ + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + value: PercentageDecisionPolicy.encode(PercentageDecisionPolicy.fromPartial(PercentageDecisionPolicy.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_groupDecisionPolicy_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.group.v1.ThresholdDecisionPolicy": + return { + type: "cosmos-sdk/ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.toAmino(ThresholdDecisionPolicy.decode(content.value, undefined)) + }; + case "/cosmos.group.v1.PercentageDecisionPolicy": + return { + type: "cosmos-sdk/PercentageDecisionPolicy", + value: PercentageDecisionPolicy.toAmino(PercentageDecisionPolicy.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/genesis.ts new file mode 100644 index 00000000..1fae0bca --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/genesis.ts @@ -0,0 +1,111 @@ +//@ts-nocheck +import { Minter, MinterAmino, MinterSDKType, Params, ParamsAmino, ParamsSDKType } from "./mint"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisState { + /** minter is a space for holding current inflation information. */ + minter: Minter; + /** params defines all the paramaters of the module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisStateAmino { + /** minter is a space for holding current inflation information. */ + minter?: MinterAmino; + /** params defines all the paramaters of the module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisStateSDKType { + minter: MinterSDKType; + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + minter: Minter.fromPartial({}), + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/cosmos.mint.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.minter !== undefined) { + Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minter = Minter.decode(reader, reader.uint32()); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.minter = object.minter !== undefined && object.minter !== null ? Minter.fromPartial(object.minter) : undefined; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.minter !== undefined && object.minter !== null) { + message.minter = Minter.fromAmino(object.minter); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.minter = message.minter ? Minter.toAmino(message.minter) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/mint.ts b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/mint.ts new file mode 100644 index 00000000..c2a83473 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/mint.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** Minter represents the minting state. */ +export interface Minter { + /** current annual inflation rate */ + inflation: string; + /** current annual expected provisions */ + annualProvisions: string; +} +export interface MinterProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.Minter"; + value: Uint8Array; +} +/** Minter represents the minting state. */ +export interface MinterAmino { + /** current annual inflation rate */ + inflation?: string; + /** current annual expected provisions */ + annual_provisions?: string; +} +export interface MinterAminoMsg { + type: "cosmos-sdk/Minter"; + value: MinterAmino; +} +/** Minter represents the minting state. */ +export interface MinterSDKType { + inflation: string; + annual_provisions: string; +} +/** Params holds parameters for the mint module. */ +export interface Params { + /** type of coin to mint */ + mintDenom: string; + /** maximum annual change in inflation rate */ + inflationRateChange: string; + /** maximum inflation rate */ + inflationMax: string; + /** minimum inflation rate */ + inflationMin: string; + /** goal of percent bonded atoms */ + goalBonded: string; + /** expected blocks per year */ + blocksPerYear: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.Params"; + value: Uint8Array; +} +/** Params holds parameters for the mint module. */ +export interface ParamsAmino { + /** type of coin to mint */ + mint_denom?: string; + /** maximum annual change in inflation rate */ + inflation_rate_change?: string; + /** maximum inflation rate */ + inflation_max?: string; + /** minimum inflation rate */ + inflation_min?: string; + /** goal of percent bonded atoms */ + goal_bonded?: string; + /** expected blocks per year */ + blocks_per_year?: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params holds parameters for the mint module. */ +export interface ParamsSDKType { + mint_denom: string; + inflation_rate_change: string; + inflation_max: string; + inflation_min: string; + goal_bonded: string; + blocks_per_year: bigint; +} +function createBaseMinter(): Minter { + return { + inflation: "", + annualProvisions: "" + }; +} +export const Minter = { + typeUrl: "/cosmos.mint.v1beta1.Minter", + encode(message: Minter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.inflation !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.inflation, 18).atomics); + } + if (message.annualProvisions !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.annualProvisions, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Minter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMinter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inflation = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.annualProvisions = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Minter { + const message = createBaseMinter(); + message.inflation = object.inflation ?? ""; + message.annualProvisions = object.annualProvisions ?? ""; + return message; + }, + fromAmino(object: MinterAmino): Minter { + const message = createBaseMinter(); + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = object.inflation; + } + if (object.annual_provisions !== undefined && object.annual_provisions !== null) { + message.annualProvisions = object.annual_provisions; + } + return message; + }, + toAmino(message: Minter): MinterAmino { + const obj: any = {}; + obj.inflation = message.inflation === "" ? undefined : message.inflation; + obj.annual_provisions = message.annualProvisions === "" ? undefined : message.annualProvisions; + return obj; + }, + fromAminoMsg(object: MinterAminoMsg): Minter { + return Minter.fromAmino(object.value); + }, + toAminoMsg(message: Minter): MinterAminoMsg { + return { + type: "cosmos-sdk/Minter", + value: Minter.toAmino(message) + }; + }, + fromProtoMsg(message: MinterProtoMsg): Minter { + return Minter.decode(message.value); + }, + toProto(message: Minter): Uint8Array { + return Minter.encode(message).finish(); + }, + toProtoMsg(message: Minter): MinterProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.Minter", + value: Minter.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + mintDenom: "", + inflationRateChange: "", + inflationMax: "", + inflationMin: "", + goalBonded: "", + blocksPerYear: BigInt(0) + }; +} +export const Params = { + typeUrl: "/cosmos.mint.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mintDenom !== "") { + writer.uint32(10).string(message.mintDenom); + } + if (message.inflationRateChange !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.inflationRateChange, 18).atomics); + } + if (message.inflationMax !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.inflationMax, 18).atomics); + } + if (message.inflationMin !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.inflationMin, 18).atomics); + } + if (message.goalBonded !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.goalBonded, 18).atomics); + } + if (message.blocksPerYear !== BigInt(0)) { + writer.uint32(48).uint64(message.blocksPerYear); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mintDenom = reader.string(); + break; + case 2: + message.inflationRateChange = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.inflationMax = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.inflationMin = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.goalBonded = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.blocksPerYear = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.mintDenom = object.mintDenom ?? ""; + message.inflationRateChange = object.inflationRateChange ?? ""; + message.inflationMax = object.inflationMax ?? ""; + message.inflationMin = object.inflationMin ?? ""; + message.goalBonded = object.goalBonded ?? ""; + message.blocksPerYear = object.blocksPerYear !== undefined && object.blocksPerYear !== null ? BigInt(object.blocksPerYear.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.mint_denom !== undefined && object.mint_denom !== null) { + message.mintDenom = object.mint_denom; + } + if (object.inflation_rate_change !== undefined && object.inflation_rate_change !== null) { + message.inflationRateChange = object.inflation_rate_change; + } + if (object.inflation_max !== undefined && object.inflation_max !== null) { + message.inflationMax = object.inflation_max; + } + if (object.inflation_min !== undefined && object.inflation_min !== null) { + message.inflationMin = object.inflation_min; + } + if (object.goal_bonded !== undefined && object.goal_bonded !== null) { + message.goalBonded = object.goal_bonded; + } + if (object.blocks_per_year !== undefined && object.blocks_per_year !== null) { + message.blocksPerYear = BigInt(object.blocks_per_year); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.mint_denom = message.mintDenom === "" ? undefined : message.mintDenom; + obj.inflation_rate_change = message.inflationRateChange === "" ? undefined : message.inflationRateChange; + obj.inflation_max = message.inflationMax === "" ? undefined : message.inflationMax; + obj.inflation_min = message.inflationMin === "" ? undefined : message.inflationMin; + obj.goal_bonded = message.goalBonded === "" ? undefined : message.goalBonded; + obj.blocks_per_year = message.blocksPerYear !== BigInt(0) ? message.blocksPerYear.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..704b5206 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/query.rpc.Query.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** Params returns the total set of minting parameters. */ + params(request?: QueryParamsRequest): Promise; + /** Inflation returns the current minting inflation value. */ + inflation(request?: QueryInflationRequest): Promise; + /** AnnualProvisions current minting annual provisions value. */ + annualProvisions(request?: QueryAnnualProvisionsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.inflation = this.inflation.bind(this); + this.annualProvisions = this.annualProvisions.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + inflation(request: QueryInflationRequest = {}): Promise { + const data = QueryInflationRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Inflation", data); + return promise.then(data => QueryInflationResponse.decode(new BinaryReader(data))); + } + annualProvisions(request: QueryAnnualProvisionsRequest = {}): Promise { + const data = QueryAnnualProvisionsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "AnnualProvisions", data); + return promise.then(data => QueryAnnualProvisionsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + inflation(request?: QueryInflationRequest): Promise { + return queryService.inflation(request); + }, + annualProvisions(request?: QueryAnnualProvisionsRequest): Promise { + return queryService.annualProvisions(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/query.ts new file mode 100644 index 00000000..65abe54a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/mint/v1beta1/query.ts @@ -0,0 +1,514 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./mint"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ +export interface QueryInflationRequest {} +export interface QueryInflationRequestProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationRequest"; + value: Uint8Array; +} +/** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ +export interface QueryInflationRequestAmino {} +export interface QueryInflationRequestAminoMsg { + type: "cosmos-sdk/QueryInflationRequest"; + value: QueryInflationRequestAmino; +} +/** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ +export interface QueryInflationRequestSDKType {} +/** + * QueryInflationResponse is the response type for the Query/Inflation RPC + * method. + */ +export interface QueryInflationResponse { + /** inflation is the current minting inflation value. */ + inflation: Uint8Array; +} +export interface QueryInflationResponseProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationResponse"; + value: Uint8Array; +} +/** + * QueryInflationResponse is the response type for the Query/Inflation RPC + * method. + */ +export interface QueryInflationResponseAmino { + /** inflation is the current minting inflation value. */ + inflation?: string; +} +export interface QueryInflationResponseAminoMsg { + type: "cosmos-sdk/QueryInflationResponse"; + value: QueryInflationResponseAmino; +} +/** + * QueryInflationResponse is the response type for the Query/Inflation RPC + * method. + */ +export interface QueryInflationResponseSDKType { + inflation: Uint8Array; +} +/** + * QueryAnnualProvisionsRequest is the request type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsRequest {} +export interface QueryAnnualProvisionsRequestProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest"; + value: Uint8Array; +} +/** + * QueryAnnualProvisionsRequest is the request type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsRequestAmino {} +export interface QueryAnnualProvisionsRequestAminoMsg { + type: "cosmos-sdk/QueryAnnualProvisionsRequest"; + value: QueryAnnualProvisionsRequestAmino; +} +/** + * QueryAnnualProvisionsRequest is the request type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsRequestSDKType {} +/** + * QueryAnnualProvisionsResponse is the response type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsResponse { + /** annual_provisions is the current minting annual provisions value. */ + annualProvisions: Uint8Array; +} +export interface QueryAnnualProvisionsResponseProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse"; + value: Uint8Array; +} +/** + * QueryAnnualProvisionsResponse is the response type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsResponseAmino { + /** annual_provisions is the current minting annual provisions value. */ + annual_provisions?: string; +} +export interface QueryAnnualProvisionsResponseAminoMsg { + type: "cosmos-sdk/QueryAnnualProvisionsResponse"; + value: QueryAnnualProvisionsResponseAmino; +} +/** + * QueryAnnualProvisionsResponse is the response type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsResponseSDKType { + annual_provisions: Uint8Array; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.mint.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.mint.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryInflationRequest(): QueryInflationRequest { + return {}; +} +export const QueryInflationRequest = { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationRequest", + encode(_: QueryInflationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInflationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInflationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryInflationRequest { + const message = createBaseQueryInflationRequest(); + return message; + }, + fromAmino(_: QueryInflationRequestAmino): QueryInflationRequest { + const message = createBaseQueryInflationRequest(); + return message; + }, + toAmino(_: QueryInflationRequest): QueryInflationRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryInflationRequestAminoMsg): QueryInflationRequest { + return QueryInflationRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryInflationRequest): QueryInflationRequestAminoMsg { + return { + type: "cosmos-sdk/QueryInflationRequest", + value: QueryInflationRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryInflationRequestProtoMsg): QueryInflationRequest { + return QueryInflationRequest.decode(message.value); + }, + toProto(message: QueryInflationRequest): Uint8Array { + return QueryInflationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInflationRequest): QueryInflationRequestProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationRequest", + value: QueryInflationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryInflationResponse(): QueryInflationResponse { + return { + inflation: new Uint8Array() + }; +} +export const QueryInflationResponse = { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationResponse", + encode(message: QueryInflationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.inflation.length !== 0) { + writer.uint32(10).bytes(message.inflation); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryInflationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInflationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inflation = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryInflationResponse { + const message = createBaseQueryInflationResponse(); + message.inflation = object.inflation ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryInflationResponseAmino): QueryInflationResponse { + const message = createBaseQueryInflationResponse(); + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = bytesFromBase64(object.inflation); + } + return message; + }, + toAmino(message: QueryInflationResponse): QueryInflationResponseAmino { + const obj: any = {}; + obj.inflation = message.inflation ? base64FromBytes(message.inflation) : undefined; + return obj; + }, + fromAminoMsg(object: QueryInflationResponseAminoMsg): QueryInflationResponse { + return QueryInflationResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryInflationResponse): QueryInflationResponseAminoMsg { + return { + type: "cosmos-sdk/QueryInflationResponse", + value: QueryInflationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryInflationResponseProtoMsg): QueryInflationResponse { + return QueryInflationResponse.decode(message.value); + }, + toProto(message: QueryInflationResponse): Uint8Array { + return QueryInflationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInflationResponse): QueryInflationResponseProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationResponse", + value: QueryInflationResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAnnualProvisionsRequest(): QueryAnnualProvisionsRequest { + return {}; +} +export const QueryAnnualProvisionsRequest = { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest", + encode(_: QueryAnnualProvisionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAnnualProvisionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAnnualProvisionsRequest { + const message = createBaseQueryAnnualProvisionsRequest(); + return message; + }, + fromAmino(_: QueryAnnualProvisionsRequestAmino): QueryAnnualProvisionsRequest { + const message = createBaseQueryAnnualProvisionsRequest(); + return message; + }, + toAmino(_: QueryAnnualProvisionsRequest): QueryAnnualProvisionsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAnnualProvisionsRequestAminoMsg): QueryAnnualProvisionsRequest { + return QueryAnnualProvisionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAnnualProvisionsRequest): QueryAnnualProvisionsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAnnualProvisionsRequest", + value: QueryAnnualProvisionsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAnnualProvisionsRequestProtoMsg): QueryAnnualProvisionsRequest { + return QueryAnnualProvisionsRequest.decode(message.value); + }, + toProto(message: QueryAnnualProvisionsRequest): Uint8Array { + return QueryAnnualProvisionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAnnualProvisionsRequest): QueryAnnualProvisionsRequestProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest", + value: QueryAnnualProvisionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAnnualProvisionsResponse(): QueryAnnualProvisionsResponse { + return { + annualProvisions: new Uint8Array() + }; +} +export const QueryAnnualProvisionsResponse = { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse", + encode(message: QueryAnnualProvisionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.annualProvisions.length !== 0) { + writer.uint32(10).bytes(message.annualProvisions); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAnnualProvisionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annualProvisions = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAnnualProvisionsResponse { + const message = createBaseQueryAnnualProvisionsResponse(); + message.annualProvisions = object.annualProvisions ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryAnnualProvisionsResponseAmino): QueryAnnualProvisionsResponse { + const message = createBaseQueryAnnualProvisionsResponse(); + if (object.annual_provisions !== undefined && object.annual_provisions !== null) { + message.annualProvisions = bytesFromBase64(object.annual_provisions); + } + return message; + }, + toAmino(message: QueryAnnualProvisionsResponse): QueryAnnualProvisionsResponseAmino { + const obj: any = {}; + obj.annual_provisions = message.annualProvisions ? base64FromBytes(message.annualProvisions) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAnnualProvisionsResponseAminoMsg): QueryAnnualProvisionsResponse { + return QueryAnnualProvisionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAnnualProvisionsResponse): QueryAnnualProvisionsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAnnualProvisionsResponse", + value: QueryAnnualProvisionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAnnualProvisionsResponseProtoMsg): QueryAnnualProvisionsResponse { + return QueryAnnualProvisionsResponse.decode(message.value); + }, + toProto(message: QueryAnnualProvisionsResponse): Uint8Array { + return QueryAnnualProvisionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAnnualProvisionsResponse): QueryAnnualProvisionsResponseProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse", + value: QueryAnnualProvisionsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/msg/v1/msg.ts b/dydxjs/packages/dydxjs/src/cosmos/msg/v1/msg.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/params.ts b/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/params.ts new file mode 100644 index 00000000..d34859fb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/params.ts @@ -0,0 +1,254 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposal { + $typeUrl?: "/cosmos.params.v1beta1.ParameterChangeProposal"; + title: string; + description: string; + changes: ParamChange[]; +} +export interface ParameterChangeProposalProtoMsg { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal"; + value: Uint8Array; +} +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposalAmino { + title?: string; + description?: string; + changes?: ParamChangeAmino[]; +} +export interface ParameterChangeProposalAminoMsg { + type: "cosmos-sdk/ParameterChangeProposal"; + value: ParameterChangeProposalAmino; +} +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposalSDKType { + $typeUrl?: "/cosmos.params.v1beta1.ParameterChangeProposal"; + title: string; + description: string; + changes: ParamChangeSDKType[]; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChange { + subspace: string; + key: string; + value: string; +} +export interface ParamChangeProtoMsg { + typeUrl: "/cosmos.params.v1beta1.ParamChange"; + value: Uint8Array; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChangeAmino { + subspace?: string; + key?: string; + value?: string; +} +export interface ParamChangeAminoMsg { + type: "cosmos-sdk/ParamChange"; + value: ParamChangeAmino; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChangeSDKType { + subspace: string; + key: string; + value: string; +} +function createBaseParameterChangeProposal(): ParameterChangeProposal { + return { + $typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + title: "", + description: "", + changes: [] + }; +} +export const ParameterChangeProposal = { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + encode(message: ParameterChangeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.changes) { + ParamChange.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParameterChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParameterChangeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.changes.push(ParamChange.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParameterChangeProposal { + const message = createBaseParameterChangeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.changes = object.changes?.map(e => ParamChange.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ParameterChangeProposalAmino): ParameterChangeProposal { + const message = createBaseParameterChangeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.changes = object.changes?.map(e => ParamChange.fromAmino(e)) || []; + return message; + }, + toAmino(message: ParameterChangeProposal): ParameterChangeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.changes) { + obj.changes = message.changes.map(e => e ? ParamChange.toAmino(e) : undefined); + } else { + obj.changes = message.changes; + } + return obj; + }, + fromAminoMsg(object: ParameterChangeProposalAminoMsg): ParameterChangeProposal { + return ParameterChangeProposal.fromAmino(object.value); + }, + toAminoMsg(message: ParameterChangeProposal): ParameterChangeProposalAminoMsg { + return { + type: "cosmos-sdk/ParameterChangeProposal", + value: ParameterChangeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ParameterChangeProposalProtoMsg): ParameterChangeProposal { + return ParameterChangeProposal.decode(message.value); + }, + toProto(message: ParameterChangeProposal): Uint8Array { + return ParameterChangeProposal.encode(message).finish(); + }, + toProtoMsg(message: ParameterChangeProposal): ParameterChangeProposalProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + value: ParameterChangeProposal.encode(message).finish() + }; + } +}; +function createBaseParamChange(): ParamChange { + return { + subspace: "", + key: "", + value: "" + }; +} +export const ParamChange = { + typeUrl: "/cosmos.params.v1beta1.ParamChange", + encode(message: ParamChange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + if (message.key !== "") { + writer.uint32(18).string(message.key); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamChange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamChange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParamChange { + const message = createBaseParamChange(); + message.subspace = object.subspace ?? ""; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: ParamChangeAmino): ParamChange { + const message = createBaseParamChange(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: ParamChange): ParamChangeAmino { + const obj: any = {}; + obj.subspace = message.subspace === "" ? undefined : message.subspace; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: ParamChangeAminoMsg): ParamChange { + return ParamChange.fromAmino(object.value); + }, + toAminoMsg(message: ParamChange): ParamChangeAminoMsg { + return { + type: "cosmos-sdk/ParamChange", + value: ParamChange.toAmino(message) + }; + }, + fromProtoMsg(message: ParamChangeProtoMsg): ParamChange { + return ParamChange.decode(message.value); + }, + toProto(message: ParamChange): Uint8Array { + return ParamChange.encode(message).finish(); + }, + toProtoMsg(message: ParamChange): ParamChangeProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.ParamChange", + value: ParamChange.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..84052a3a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/query.rpc.Query.ts @@ -0,0 +1,45 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params queries a specific parameter of a module, given its subspace and + * key. + */ + params(request: QueryParamsRequest): Promise; + /** Subspaces queries for all registered subspaces and all keys for a subspace. */ + subspaces(request?: QuerySubspacesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.subspaces = this.subspaces.bind(this); + } + params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + subspaces(request: QuerySubspacesRequest = {}): Promise { + const data = QuerySubspacesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Subspaces", data); + return promise.then(data => QuerySubspacesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request: QueryParamsRequest): Promise { + return queryService.params(request); + }, + subspaces(request?: QuerySubspacesRequest): Promise { + return queryService.subspaces(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/query.ts new file mode 100644 index 00000000..d51d0155 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/params/v1beta1/query.ts @@ -0,0 +1,496 @@ +//@ts-nocheck +import { ParamChange, ParamChangeAmino, ParamChangeSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** subspace defines the module to query the parameter for. */ + subspace: string; + /** key defines the key of the parameter in the subspace. */ + key: string; +} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino { + /** subspace defines the module to query the parameter for. */ + subspace?: string; + /** key defines the key of the parameter in the subspace. */ + key?: string; +} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType { + subspace: string; + key: string; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** param defines the queried parameter. */ + param: ParamChange; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** param defines the queried parameter. */ + param?: ParamChangeAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + param: ParamChangeSDKType; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + */ +export interface QuerySubspacesRequest {} +export interface QuerySubspacesRequestProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest"; + value: Uint8Array; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + */ +export interface QuerySubspacesRequestAmino {} +export interface QuerySubspacesRequestAminoMsg { + type: "cosmos-sdk/QuerySubspacesRequest"; + value: QuerySubspacesRequestAmino; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + */ +export interface QuerySubspacesRequestSDKType {} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + */ +export interface QuerySubspacesResponse { + subspaces: Subspace[]; +} +export interface QuerySubspacesResponseProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse"; + value: Uint8Array; +} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + */ +export interface QuerySubspacesResponseAmino { + subspaces?: SubspaceAmino[]; +} +export interface QuerySubspacesResponseAminoMsg { + type: "cosmos-sdk/QuerySubspacesResponse"; + value: QuerySubspacesResponseAmino; +} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + */ +export interface QuerySubspacesResponseSDKType { + subspaces: SubspaceSDKType[]; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + */ +export interface Subspace { + subspace: string; + keys: string[]; +} +export interface SubspaceProtoMsg { + typeUrl: "/cosmos.params.v1beta1.Subspace"; + value: Uint8Array; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + */ +export interface SubspaceAmino { + subspace?: string; + keys?: string[]; +} +export interface SubspaceAminoMsg { + type: "cosmos-sdk/Subspace"; + value: SubspaceAmino; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + */ +export interface SubspaceSDKType { + subspace: string; + keys: string[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { + subspace: "", + key: "" + }; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest", + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + if (message.key !== "") { + writer.uint32(18).string(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.subspace = object.subspace ?? ""; + message.key = object.key ?? ""; + return message; + }, + fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + return message; + }, + toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + obj.subspace = message.subspace === "" ? undefined : message.subspace; + obj.key = message.key === "" ? undefined : message.key; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + param: ParamChange.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.param !== undefined) { + ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.param = ParamChange.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.param = object.param !== undefined && object.param !== null ? ParamChange.fromPartial(object.param) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.param !== undefined && object.param !== null) { + message.param = ParamChange.fromAmino(object.param); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.param = message.param ? ParamChange.toAmino(message.param) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySubspacesRequest(): QuerySubspacesRequest { + return {}; +} +export const QuerySubspacesRequest = { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest", + encode(_: QuerySubspacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QuerySubspacesRequest { + const message = createBaseQuerySubspacesRequest(); + return message; + }, + fromAmino(_: QuerySubspacesRequestAmino): QuerySubspacesRequest { + const message = createBaseQuerySubspacesRequest(); + return message; + }, + toAmino(_: QuerySubspacesRequest): QuerySubspacesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QuerySubspacesRequestAminoMsg): QuerySubspacesRequest { + return QuerySubspacesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySubspacesRequest): QuerySubspacesRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySubspacesRequest", + value: QuerySubspacesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySubspacesRequestProtoMsg): QuerySubspacesRequest { + return QuerySubspacesRequest.decode(message.value); + }, + toProto(message: QuerySubspacesRequest): Uint8Array { + return QuerySubspacesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubspacesRequest): QuerySubspacesRequestProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest", + value: QuerySubspacesRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySubspacesResponse(): QuerySubspacesResponse { + return { + subspaces: [] + }; +} +export const QuerySubspacesResponse = { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse", + encode(message: QuerySubspacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subspaces) { + Subspace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspaces.push(Subspace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySubspacesResponse { + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map(e => Subspace.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubspacesResponseAmino): QuerySubspacesResponse { + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map(e => Subspace.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubspacesResponse): QuerySubspacesResponseAmino { + const obj: any = {}; + if (message.subspaces) { + obj.subspaces = message.subspaces.map(e => e ? Subspace.toAmino(e) : undefined); + } else { + obj.subspaces = message.subspaces; + } + return obj; + }, + fromAminoMsg(object: QuerySubspacesResponseAminoMsg): QuerySubspacesResponse { + return QuerySubspacesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySubspacesResponse): QuerySubspacesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySubspacesResponse", + value: QuerySubspacesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySubspacesResponseProtoMsg): QuerySubspacesResponse { + return QuerySubspacesResponse.decode(message.value); + }, + toProto(message: QuerySubspacesResponse): Uint8Array { + return QuerySubspacesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubspacesResponse): QuerySubspacesResponseProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse", + value: QuerySubspacesResponse.encode(message).finish() + }; + } +}; +function createBaseSubspace(): Subspace { + return { + subspace: "", + keys: [] + }; +} +export const Subspace = { + typeUrl: "/cosmos.params.v1beta1.Subspace", + encode(message: Subspace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + for (const v of message.keys) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Subspace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubspace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.keys.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Subspace { + const message = createBaseSubspace(); + message.subspace = object.subspace ?? ""; + message.keys = object.keys?.map(e => e) || []; + return message; + }, + fromAmino(object: SubspaceAmino): Subspace { + const message = createBaseSubspace(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + message.keys = object.keys?.map(e => e) || []; + return message; + }, + toAmino(message: Subspace): SubspaceAmino { + const obj: any = {}; + obj.subspace = message.subspace === "" ? undefined : message.subspace; + if (message.keys) { + obj.keys = message.keys.map(e => e); + } else { + obj.keys = message.keys; + } + return obj; + }, + fromAminoMsg(object: SubspaceAminoMsg): Subspace { + return Subspace.fromAmino(object.value); + }, + toAminoMsg(message: Subspace): SubspaceAminoMsg { + return { + type: "cosmos-sdk/Subspace", + value: Subspace.toAmino(message) + }; + }, + fromProtoMsg(message: SubspaceProtoMsg): Subspace { + return Subspace.decode(message.value); + }, + toProto(message: Subspace): Uint8Array { + return Subspace.encode(message).finish(); + }, + toProtoMsg(message: Subspace): SubspaceProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.Subspace", + value: Subspace.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/rpc.query.ts b/dydxjs/packages/dydxjs/src/cosmos/rpc.query.ts new file mode 100644 index 00000000..52964c49 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/rpc.query.ts @@ -0,0 +1,52 @@ +//@ts-nocheck +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("./auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("./authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("./bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + distribution: { + v1beta1: (await import("./distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("./feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("./gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("./gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + group: { + v1: (await import("./group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("./mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("./params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("./staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("./tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("./upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/rpc.tx.ts b/dydxjs/packages/dydxjs/src/cosmos/rpc.tx.ts new file mode 100644 index 00000000..c87eaf31 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/rpc.tx.ts @@ -0,0 +1,38 @@ +//@ts-nocheck +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + authz: { + v1beta1: new (await import("./authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("./bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("./distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("./feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("./gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("./gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + group: { + v1: new (await import("./group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("./staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("./upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + vesting: { + v1beta1: new (await import("./vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/authz.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/authz.ts new file mode 100644 index 00000000..a3ea6bdf --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/authz.ts @@ -0,0 +1,316 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * AuthorizationType defines the type of staking module authorization type + * + * Since: cosmos-sdk 0.43 + */ +export enum AuthorizationType { + /** AUTHORIZATION_TYPE_UNSPECIFIED - AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type */ + AUTHORIZATION_TYPE_UNSPECIFIED = 0, + /** AUTHORIZATION_TYPE_DELEGATE - AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate */ + AUTHORIZATION_TYPE_DELEGATE = 1, + /** AUTHORIZATION_TYPE_UNDELEGATE - AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate */ + AUTHORIZATION_TYPE_UNDELEGATE = 2, + /** AUTHORIZATION_TYPE_REDELEGATE - AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate */ + AUTHORIZATION_TYPE_REDELEGATE = 3, + UNRECOGNIZED = -1, +} +export const AuthorizationTypeSDKType = AuthorizationType; +export const AuthorizationTypeAmino = AuthorizationType; +export function authorizationTypeFromJSON(object: any): AuthorizationType { + switch (object) { + case 0: + case "AUTHORIZATION_TYPE_UNSPECIFIED": + return AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED; + case 1: + case "AUTHORIZATION_TYPE_DELEGATE": + return AuthorizationType.AUTHORIZATION_TYPE_DELEGATE; + case 2: + case "AUTHORIZATION_TYPE_UNDELEGATE": + return AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE; + case 3: + case "AUTHORIZATION_TYPE_REDELEGATE": + return AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE; + case -1: + case "UNRECOGNIZED": + default: + return AuthorizationType.UNRECOGNIZED; + } +} +export function authorizationTypeToJSON(object: AuthorizationType): string { + switch (object) { + case AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED: + return "AUTHORIZATION_TYPE_UNSPECIFIED"; + case AuthorizationType.AUTHORIZATION_TYPE_DELEGATE: + return "AUTHORIZATION_TYPE_DELEGATE"; + case AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE: + return "AUTHORIZATION_TYPE_UNDELEGATE"; + case AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE: + return "AUTHORIZATION_TYPE_REDELEGATE"; + case AuthorizationType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorization { + $typeUrl?: "/cosmos.staking.v1beta1.StakeAuthorization"; + /** + * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + * empty, there is no spend limit and any amount of coins can be delegated. + */ + maxTokens?: Coin; + /** + * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + * account. + */ + allowList?: StakeAuthorization_Validators; + /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ + denyList?: StakeAuthorization_Validators; + /** authorization_type defines one of AuthorizationType. */ + authorizationType: AuthorizationType; +} +export interface StakeAuthorizationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization"; + value: Uint8Array; +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorizationAmino { + /** + * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + * empty, there is no spend limit and any amount of coins can be delegated. + */ + max_tokens?: CoinAmino; + /** + * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + * account. + */ + allow_list?: StakeAuthorization_ValidatorsAmino; + /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ + deny_list?: StakeAuthorization_ValidatorsAmino; + /** authorization_type defines one of AuthorizationType. */ + authorization_type?: AuthorizationType; +} +export interface StakeAuthorizationAminoMsg { + type: "cosmos-sdk/StakeAuthorization"; + value: StakeAuthorizationAmino; +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorizationSDKType { + $typeUrl?: "/cosmos.staking.v1beta1.StakeAuthorization"; + max_tokens?: CoinSDKType; + allow_list?: StakeAuthorization_ValidatorsSDKType; + deny_list?: StakeAuthorization_ValidatorsSDKType; + authorization_type: AuthorizationType; +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_Validators { + address: string[]; +} +export interface StakeAuthorization_ValidatorsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Validators"; + value: Uint8Array; +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_ValidatorsAmino { + address?: string[]; +} +export interface StakeAuthorization_ValidatorsAminoMsg { + type: "cosmos-sdk/Validators"; + value: StakeAuthorization_ValidatorsAmino; +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_ValidatorsSDKType { + address: string[]; +} +function createBaseStakeAuthorization(): StakeAuthorization { + return { + $typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", + maxTokens: undefined, + allowList: undefined, + denyList: undefined, + authorizationType: 0 + }; +} +export const StakeAuthorization = { + typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", + encode(message: StakeAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTokens !== undefined) { + Coin.encode(message.maxTokens, writer.uint32(10).fork()).ldelim(); + } + if (message.allowList !== undefined) { + StakeAuthorization_Validators.encode(message.allowList, writer.uint32(18).fork()).ldelim(); + } + if (message.denyList !== undefined) { + StakeAuthorization_Validators.encode(message.denyList, writer.uint32(26).fork()).ldelim(); + } + if (message.authorizationType !== 0) { + writer.uint32(32).int32(message.authorizationType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StakeAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStakeAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTokens = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.allowList = StakeAuthorization_Validators.decode(reader, reader.uint32()); + break; + case 3: + message.denyList = StakeAuthorization_Validators.decode(reader, reader.uint32()); + break; + case 4: + message.authorizationType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StakeAuthorization { + const message = createBaseStakeAuthorization(); + message.maxTokens = object.maxTokens !== undefined && object.maxTokens !== null ? Coin.fromPartial(object.maxTokens) : undefined; + message.allowList = object.allowList !== undefined && object.allowList !== null ? StakeAuthorization_Validators.fromPartial(object.allowList) : undefined; + message.denyList = object.denyList !== undefined && object.denyList !== null ? StakeAuthorization_Validators.fromPartial(object.denyList) : undefined; + message.authorizationType = object.authorizationType ?? 0; + return message; + }, + fromAmino(object: StakeAuthorizationAmino): StakeAuthorization { + const message = createBaseStakeAuthorization(); + if (object.max_tokens !== undefined && object.max_tokens !== null) { + message.maxTokens = Coin.fromAmino(object.max_tokens); + } + if (object.allow_list !== undefined && object.allow_list !== null) { + message.allowList = StakeAuthorization_Validators.fromAmino(object.allow_list); + } + if (object.deny_list !== undefined && object.deny_list !== null) { + message.denyList = StakeAuthorization_Validators.fromAmino(object.deny_list); + } + if (object.authorization_type !== undefined && object.authorization_type !== null) { + message.authorizationType = object.authorization_type; + } + return message; + }, + toAmino(message: StakeAuthorization): StakeAuthorizationAmino { + const obj: any = {}; + obj.max_tokens = message.maxTokens ? Coin.toAmino(message.maxTokens) : undefined; + obj.allow_list = message.allowList ? StakeAuthorization_Validators.toAmino(message.allowList) : undefined; + obj.deny_list = message.denyList ? StakeAuthorization_Validators.toAmino(message.denyList) : undefined; + obj.authorization_type = message.authorizationType === 0 ? undefined : message.authorizationType; + return obj; + }, + fromAminoMsg(object: StakeAuthorizationAminoMsg): StakeAuthorization { + return StakeAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: StakeAuthorization): StakeAuthorizationAminoMsg { + return { + type: "cosmos-sdk/StakeAuthorization", + value: StakeAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: StakeAuthorizationProtoMsg): StakeAuthorization { + return StakeAuthorization.decode(message.value); + }, + toProto(message: StakeAuthorization): Uint8Array { + return StakeAuthorization.encode(message).finish(); + }, + toProtoMsg(message: StakeAuthorization): StakeAuthorizationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", + value: StakeAuthorization.encode(message).finish() + }; + } +}; +function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validators { + return { + address: [] + }; +} +export const StakeAuthorization_Validators = { + typeUrl: "/cosmos.staking.v1beta1.Validators", + encode(message: StakeAuthorization_Validators, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.address) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StakeAuthorization_Validators { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStakeAuthorization_Validators(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StakeAuthorization_Validators { + const message = createBaseStakeAuthorization_Validators(); + message.address = object.address?.map(e => e) || []; + return message; + }, + fromAmino(object: StakeAuthorization_ValidatorsAmino): StakeAuthorization_Validators { + const message = createBaseStakeAuthorization_Validators(); + message.address = object.address?.map(e => e) || []; + return message; + }, + toAmino(message: StakeAuthorization_Validators): StakeAuthorization_ValidatorsAmino { + const obj: any = {}; + if (message.address) { + obj.address = message.address.map(e => e); + } else { + obj.address = message.address; + } + return obj; + }, + fromAminoMsg(object: StakeAuthorization_ValidatorsAminoMsg): StakeAuthorization_Validators { + return StakeAuthorization_Validators.fromAmino(object.value); + }, + toAminoMsg(message: StakeAuthorization_Validators): StakeAuthorization_ValidatorsAminoMsg { + return { + type: "cosmos-sdk/Validators", + value: StakeAuthorization_Validators.toAmino(message) + }; + }, + fromProtoMsg(message: StakeAuthorization_ValidatorsProtoMsg): StakeAuthorization_Validators { + return StakeAuthorization_Validators.decode(message.value); + }, + toProto(message: StakeAuthorization_Validators): Uint8Array { + return StakeAuthorization_Validators.encode(message).finish(); + }, + toProtoMsg(message: StakeAuthorization_Validators): StakeAuthorization_ValidatorsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Validators", + value: StakeAuthorization_Validators.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/genesis.ts new file mode 100644 index 00000000..ad73dcd8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/genesis.ts @@ -0,0 +1,342 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType, Validator, ValidatorAmino, ValidatorSDKType, Delegation, DelegationAmino, DelegationSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, Redelegation, RedelegationAmino, RedelegationSDKType } from "./staking"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** GenesisState defines the staking module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of related to deposit. */ + params: Params; + /** + * last_total_power tracks the total amounts of bonded tokens recorded during + * the previous end block. + */ + lastTotalPower: Uint8Array; + /** + * last_validator_powers is a special index that provides a historical list + * of the last-block's bonded validators. + */ + lastValidatorPowers: LastValidatorPower[]; + /** delegations defines the validator set at genesis. */ + validators: Validator[]; + /** delegations defines the delegations active at genesis. */ + delegations: Delegation[]; + /** unbonding_delegations defines the unbonding delegations active at genesis. */ + unbondingDelegations: UnbondingDelegation[]; + /** redelegations defines the redelegations active at genesis. */ + redelegations: Redelegation[]; + exported: boolean; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the staking module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the paramaters of related to deposit. */ + params?: ParamsAmino; + /** + * last_total_power tracks the total amounts of bonded tokens recorded during + * the previous end block. + */ + last_total_power?: string; + /** + * last_validator_powers is a special index that provides a historical list + * of the last-block's bonded validators. + */ + last_validator_powers?: LastValidatorPowerAmino[]; + /** delegations defines the validator set at genesis. */ + validators?: ValidatorAmino[]; + /** delegations defines the delegations active at genesis. */ + delegations?: DelegationAmino[]; + /** unbonding_delegations defines the unbonding delegations active at genesis. */ + unbonding_delegations?: UnbondingDelegationAmino[]; + /** redelegations defines the redelegations active at genesis. */ + redelegations?: RedelegationAmino[]; + exported?: boolean; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the staking module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + last_total_power: Uint8Array; + last_validator_powers: LastValidatorPowerSDKType[]; + validators: ValidatorSDKType[]; + delegations: DelegationSDKType[]; + unbonding_delegations: UnbondingDelegationSDKType[]; + redelegations: RedelegationSDKType[]; + exported: boolean; +} +/** LastValidatorPower required for validator set update logic. */ +export interface LastValidatorPower { + /** address is the address of the validator. */ + address: string; + /** power defines the power of the validator. */ + power: bigint; +} +export interface LastValidatorPowerProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower"; + value: Uint8Array; +} +/** LastValidatorPower required for validator set update logic. */ +export interface LastValidatorPowerAmino { + /** address is the address of the validator. */ + address?: string; + /** power defines the power of the validator. */ + power?: string; +} +export interface LastValidatorPowerAminoMsg { + type: "cosmos-sdk/LastValidatorPower"; + value: LastValidatorPowerAmino; +} +/** LastValidatorPower required for validator set update logic. */ +export interface LastValidatorPowerSDKType { + address: string; + power: bigint; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + lastTotalPower: new Uint8Array(), + lastValidatorPowers: [], + validators: [], + delegations: [], + unbondingDelegations: [], + redelegations: [], + exported: false + }; +} +export const GenesisState = { + typeUrl: "/cosmos.staking.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.lastTotalPower.length !== 0) { + writer.uint32(18).bytes(message.lastTotalPower); + } + for (const v of message.lastValidatorPowers) { + LastValidatorPower.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.delegations) { + Delegation.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.unbondingDelegations) { + UnbondingDelegation.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.redelegations) { + Redelegation.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.exported === true) { + writer.uint32(64).bool(message.exported); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.lastTotalPower = reader.bytes(); + break; + case 3: + message.lastValidatorPowers.push(LastValidatorPower.decode(reader, reader.uint32())); + break; + case 4: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 5: + message.delegations.push(Delegation.decode(reader, reader.uint32())); + break; + case 6: + message.unbondingDelegations.push(UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 7: + message.redelegations.push(Redelegation.decode(reader, reader.uint32())); + break; + case 8: + message.exported = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.lastTotalPower = object.lastTotalPower ?? new Uint8Array(); + message.lastValidatorPowers = object.lastValidatorPowers?.map(e => LastValidatorPower.fromPartial(e)) || []; + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.delegations = object.delegations?.map(e => Delegation.fromPartial(e)) || []; + message.unbondingDelegations = object.unbondingDelegations?.map(e => UnbondingDelegation.fromPartial(e)) || []; + message.redelegations = object.redelegations?.map(e => Redelegation.fromPartial(e)) || []; + message.exported = object.exported ?? false; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.last_total_power !== undefined && object.last_total_power !== null) { + message.lastTotalPower = bytesFromBase64(object.last_total_power); + } + message.lastValidatorPowers = object.last_validator_powers?.map(e => LastValidatorPower.fromAmino(e)) || []; + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + message.delegations = object.delegations?.map(e => Delegation.fromAmino(e)) || []; + message.unbondingDelegations = object.unbonding_delegations?.map(e => UnbondingDelegation.fromAmino(e)) || []; + message.redelegations = object.redelegations?.map(e => Redelegation.fromAmino(e)) || []; + if (object.exported !== undefined && object.exported !== null) { + message.exported = object.exported; + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.last_total_power = message.lastTotalPower ? base64FromBytes(message.lastTotalPower) : undefined; + if (message.lastValidatorPowers) { + obj.last_validator_powers = message.lastValidatorPowers.map(e => e ? LastValidatorPower.toAmino(e) : undefined); + } else { + obj.last_validator_powers = message.lastValidatorPowers; + } + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + if (message.delegations) { + obj.delegations = message.delegations.map(e => e ? Delegation.toAmino(e) : undefined); + } else { + obj.delegations = message.delegations; + } + if (message.unbondingDelegations) { + obj.unbonding_delegations = message.unbondingDelegations.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); + } else { + obj.unbonding_delegations = message.unbondingDelegations; + } + if (message.redelegations) { + obj.redelegations = message.redelegations.map(e => e ? Redelegation.toAmino(e) : undefined); + } else { + obj.redelegations = message.redelegations; + } + obj.exported = message.exported === false ? undefined : message.exported; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseLastValidatorPower(): LastValidatorPower { + return { + address: "", + power: BigInt(0) + }; +} +export const LastValidatorPower = { + typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower", + encode(message: LastValidatorPower, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.power !== BigInt(0)) { + writer.uint32(16).int64(message.power); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastValidatorPower { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastValidatorPower(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LastValidatorPower { + const message = createBaseLastValidatorPower(); + message.address = object.address ?? ""; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastValidatorPowerAmino): LastValidatorPower { + const message = createBaseLastValidatorPower(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; + }, + toAmino(message: LastValidatorPower): LastValidatorPowerAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastValidatorPowerAminoMsg): LastValidatorPower { + return LastValidatorPower.fromAmino(object.value); + }, + toAminoMsg(message: LastValidatorPower): LastValidatorPowerAminoMsg { + return { + type: "cosmos-sdk/LastValidatorPower", + value: LastValidatorPower.toAmino(message) + }; + }, + fromProtoMsg(message: LastValidatorPowerProtoMsg): LastValidatorPower { + return LastValidatorPower.decode(message.value); + }, + toProto(message: LastValidatorPower): Uint8Array { + return LastValidatorPower.encode(message).finish(); + }, + toProtoMsg(message: LastValidatorPower): LastValidatorPowerProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower", + value: LastValidatorPower.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..dcf1f2d4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/query.rpc.Query.ts @@ -0,0 +1,186 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Validators queries all validators that match the given status. */ + validators(request: QueryValidatorsRequest): Promise; + /** Validator queries validator info for given validator address. */ + validator(request: QueryValidatorRequest): Promise; + /** ValidatorDelegations queries delegate info for given validator. */ + validatorDelegations(request: QueryValidatorDelegationsRequest): Promise; + /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise; + /** Delegation queries delegate info for given validator delegator pair. */ + delegation(request: QueryDelegationRequest): Promise; + /** + * UnbondingDelegation queries unbonding info for given validator delegator + * pair. + */ + unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; + /** DelegatorDelegations queries all delegations of a given delegator address. */ + delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; + /** + * DelegatorUnbondingDelegations queries all unbonding delegations of a given + * delegator address. + */ + delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise; + /** Redelegations queries redelegations of given address. */ + redelegations(request: QueryRedelegationsRequest): Promise; + /** + * DelegatorValidators queries all validators info for given delegator + * address. + */ + delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + /** + * DelegatorValidator queries validator info for given delegator validator + * pair. + */ + delegatorValidator(request: QueryDelegatorValidatorRequest): Promise; + /** HistoricalInfo queries the historical info for given height. */ + historicalInfo(request: QueryHistoricalInfoRequest): Promise; + /** Pool queries the pool info. */ + pool(request?: QueryPoolRequest): Promise; + /** Parameters queries the staking parameters. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.validators = this.validators.bind(this); + this.validator = this.validator.bind(this); + this.validatorDelegations = this.validatorDelegations.bind(this); + this.validatorUnbondingDelegations = this.validatorUnbondingDelegations.bind(this); + this.delegation = this.delegation.bind(this); + this.unbondingDelegation = this.unbondingDelegation.bind(this); + this.delegatorDelegations = this.delegatorDelegations.bind(this); + this.delegatorUnbondingDelegations = this.delegatorUnbondingDelegations.bind(this); + this.redelegations = this.redelegations.bind(this); + this.delegatorValidators = this.delegatorValidators.bind(this); + this.delegatorValidator = this.delegatorValidator.bind(this); + this.historicalInfo = this.historicalInfo.bind(this); + this.pool = this.pool.bind(this); + this.params = this.params.bind(this); + } + validators(request: QueryValidatorsRequest): Promise { + const data = QueryValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validators", data); + return promise.then(data => QueryValidatorsResponse.decode(new BinaryReader(data))); + } + validator(request: QueryValidatorRequest): Promise { + const data = QueryValidatorRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validator", data); + return promise.then(data => QueryValidatorResponse.decode(new BinaryReader(data))); + } + validatorDelegations(request: QueryValidatorDelegationsRequest): Promise { + const data = QueryValidatorDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorDelegations", data); + return promise.then(data => QueryValidatorDelegationsResponse.decode(new BinaryReader(data))); + } + validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise { + const data = QueryValidatorUnbondingDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorUnbondingDelegations", data); + return promise.then(data => QueryValidatorUnbondingDelegationsResponse.decode(new BinaryReader(data))); + } + delegation(request: QueryDelegationRequest): Promise { + const data = QueryDelegationRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Delegation", data); + return promise.then(data => QueryDelegationResponse.decode(new BinaryReader(data))); + } + unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { + const data = QueryUnbondingDelegationRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "UnbondingDelegation", data); + return promise.then(data => QueryUnbondingDelegationResponse.decode(new BinaryReader(data))); + } + delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise { + const data = QueryDelegatorDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorDelegations", data); + return promise.then(data => QueryDelegatorDelegationsResponse.decode(new BinaryReader(data))); + } + delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise { + const data = QueryDelegatorUnbondingDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorUnbondingDelegations", data); + return promise.then(data => QueryDelegatorUnbondingDelegationsResponse.decode(new BinaryReader(data))); + } + redelegations(request: QueryRedelegationsRequest): Promise { + const data = QueryRedelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Redelegations", data); + return promise.then(data => QueryRedelegationsResponse.decode(new BinaryReader(data))); + } + delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { + const data = QueryDelegatorValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidators", data); + return promise.then(data => QueryDelegatorValidatorsResponse.decode(new BinaryReader(data))); + } + delegatorValidator(request: QueryDelegatorValidatorRequest): Promise { + const data = QueryDelegatorValidatorRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidator", data); + return promise.then(data => QueryDelegatorValidatorResponse.decode(new BinaryReader(data))); + } + historicalInfo(request: QueryHistoricalInfoRequest): Promise { + const data = QueryHistoricalInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "HistoricalInfo", data); + return promise.then(data => QueryHistoricalInfoResponse.decode(new BinaryReader(data))); + } + pool(request: QueryPoolRequest = {}): Promise { + const data = QueryPoolRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Pool", data); + return promise.then(data => QueryPoolResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + validators(request: QueryValidatorsRequest): Promise { + return queryService.validators(request); + }, + validator(request: QueryValidatorRequest): Promise { + return queryService.validator(request); + }, + validatorDelegations(request: QueryValidatorDelegationsRequest): Promise { + return queryService.validatorDelegations(request); + }, + validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise { + return queryService.validatorUnbondingDelegations(request); + }, + delegation(request: QueryDelegationRequest): Promise { + return queryService.delegation(request); + }, + unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { + return queryService.unbondingDelegation(request); + }, + delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise { + return queryService.delegatorDelegations(request); + }, + delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise { + return queryService.delegatorUnbondingDelegations(request); + }, + redelegations(request: QueryRedelegationsRequest): Promise { + return queryService.redelegations(request); + }, + delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { + return queryService.delegatorValidators(request); + }, + delegatorValidator(request: QueryDelegatorValidatorRequest): Promise { + return queryService.delegatorValidator(request); + }, + historicalInfo(request: QueryHistoricalInfoRequest): Promise { + return queryService.historicalInfo(request); + }, + pool(request?: QueryPoolRequest): Promise { + return queryService.pool(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/query.ts new file mode 100644 index 00000000..360f6241 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/query.ts @@ -0,0 +1,3001 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Validator, ValidatorAmino, ValidatorSDKType, DelegationResponse, DelegationResponseAmino, DelegationResponseSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, RedelegationResponse, RedelegationResponseAmino, RedelegationResponseSDKType, HistoricalInfo, HistoricalInfoAmino, HistoricalInfoSDKType, Pool, PoolAmino, PoolSDKType, Params, ParamsAmino, ParamsSDKType } from "./staking"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequest { + /** status enables to query for validators matching a given status. */ + status: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; + value: Uint8Array; +} +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequestAmino { + /** status enables to query for validators matching a given status. */ + status?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorsRequest"; + value: QueryValidatorsRequestAmino; +} +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequestSDKType { + status: string; + pagination?: PageRequestSDKType; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponse { + /** validators contains all the queried validators. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; + value: Uint8Array; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponseAmino { + /** validators contains all the queried validators. */ + validators?: ValidatorAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorsResponse"; + value: QueryValidatorsResponseAmino; +} +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponseSDKType { + validators: ValidatorSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryValidatorRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest"; + value: Uint8Array; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryValidatorRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorRequest"; + value: QueryValidatorRequestAmino; +} +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequestSDKType { + validator_addr: string; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponse { + /** validator defines the the validator info. */ + validator: Validator; +} +export interface QueryValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse"; + value: Uint8Array; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponseAmino { + /** validator defines the the validator info. */ + validator?: ValidatorAmino; +} +export interface QueryValidatorResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorResponse"; + value: QueryValidatorResponseAmino; +} +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponseSDKType { + validator: ValidatorSDKType; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorDelegationsRequest"; + value: QueryValidatorDelegationsRequestAmino; +} +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequestSDKType { + validator_addr: string; + pagination?: PageRequestSDKType; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponse { + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponseAmino { + delegation_responses?: DelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorDelegationsResponse"; + value: QueryValidatorDelegationsResponseAmino; +} +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponseSDKType { + delegation_responses: DelegationResponseSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequestAmino { + /** validator_addr defines the validator address to query for. */ + validator_addr?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryValidatorUnbondingDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest"; + value: QueryValidatorUnbondingDelegationsRequestAmino; +} +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequestSDKType { + validator_addr: string; + pagination?: PageRequestSDKType; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponseAmino { + unbonding_responses?: UnbondingDelegationAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryValidatorUnbondingDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse"; + value: QueryValidatorUnbondingDelegationsResponseAmino; +} +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponseSDKType { + unbonding_responses: UnbondingDelegationSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryDelegationRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest"; + value: Uint8Array; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr?: string; + /** validator_addr defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryDelegationRequestAminoMsg { + type: "cosmos-sdk/QueryDelegationRequest"; + value: QueryDelegationRequestAmino; +} +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequestSDKType { + delegator_addr: string; + validator_addr: string; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponse { + /** delegation_responses defines the delegation info of a delegation. */ + delegationResponse?: DelegationResponse; +} +export interface QueryDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; + value: Uint8Array; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponseAmino { + /** delegation_responses defines the delegation info of a delegation. */ + delegation_response?: DelegationResponseAmino; +} +export interface QueryDelegationResponseAminoMsg { + type: "cosmos-sdk/QueryDelegationResponse"; + value: QueryDelegationResponseAmino; +} +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponseSDKType { + delegation_response?: DelegationResponseSDKType; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryUnbondingDelegationRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest"; + value: Uint8Array; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr?: string; + /** validator_addr defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryUnbondingDelegationRequestAminoMsg { + type: "cosmos-sdk/QueryUnbondingDelegationRequest"; + value: QueryUnbondingDelegationRequestAmino; +} +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequestSDKType { + delegator_addr: string; + validator_addr: string; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponse { + /** unbond defines the unbonding information of a delegation. */ + unbond: UnbondingDelegation; +} +export interface QueryUnbondingDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse"; + value: Uint8Array; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponseAmino { + /** unbond defines the unbonding information of a delegation. */ + unbond?: UnbondingDelegationAmino; +} +export interface QueryUnbondingDelegationResponseAminoMsg { + type: "cosmos-sdk/QueryUnbondingDelegationResponse"; + value: QueryUnbondingDelegationResponseAmino; +} +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponseSDKType { + unbond: UnbondingDelegationSDKType; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorDelegationsRequest"; + value: QueryDelegatorDelegationsRequestAmino; +} +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequestSDKType { + delegator_addr: string; + pagination?: PageRequestSDKType; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponse { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponseAmino { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegation_responses?: DelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorDelegationsResponse"; + value: QueryDelegatorDelegationsResponseAmino; +} +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponseSDKType { + delegation_responses: DelegationResponseSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorUnbondingDelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest"; + value: QueryDelegatorUnbondingDelegationsRequestAmino; +} +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequestSDKType { + delegator_addr: string; + pagination?: PageRequestSDKType; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; + value: Uint8Array; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponseAmino { + unbonding_responses?: UnbondingDelegationAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorUnbondingDelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse"; + value: QueryDelegatorUnbondingDelegationsResponseAmino; +} +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponseSDKType { + unbonding_responses: UnbondingDelegationSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** src_validator_addr defines the validator address to redelegate from. */ + srcValidatorAddr: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dstValidatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryRedelegationsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; + value: Uint8Array; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr?: string; + /** src_validator_addr defines the validator address to redelegate from. */ + src_validator_addr?: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dst_validator_addr?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryRedelegationsRequestAminoMsg { + type: "cosmos-sdk/QueryRedelegationsRequest"; + value: QueryRedelegationsRequestAmino; +} +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequestSDKType { + delegator_addr: string; + src_validator_addr: string; + dst_validator_addr: string; + pagination?: PageRequestSDKType; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponse { + redelegationResponses: RedelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryRedelegationsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; + value: Uint8Array; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponseAmino { + redelegation_responses?: RedelegationResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryRedelegationsResponseAminoMsg { + type: "cosmos-sdk/QueryRedelegationsResponse"; + value: QueryRedelegationsResponseAmino; +} +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponseSDKType { + redelegation_responses: RedelegationResponseSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDelegatorValidatorsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDelegatorValidatorsRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest"; + value: QueryDelegatorValidatorsRequestAmino; +} +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequestSDKType { + delegator_addr: string; + pagination?: PageRequestSDKType; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the the validators' info of a delegator. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDelegatorValidatorsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponseAmino { + /** validators defines the the validators' info of a delegator. */ + validators?: ValidatorAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDelegatorValidatorsResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse"; + value: QueryDelegatorValidatorsResponseAmino; +} +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponseSDKType { + validators: ValidatorSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryDelegatorValidatorRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequestAmino { + /** delegator_addr defines the delegator address to query for. */ + delegator_addr?: string; + /** validator_addr defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryDelegatorValidatorRequestAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorRequest"; + value: QueryDelegatorValidatorRequestAmino; +} +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequestSDKType { + delegator_addr: string; + validator_addr: string; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponse { + /** validator defines the the validator info. */ + validator: Validator; +} +export interface QueryDelegatorValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponseAmino { + /** validator defines the the validator info. */ + validator?: ValidatorAmino; +} +export interface QueryDelegatorValidatorResponseAminoMsg { + type: "cosmos-sdk/QueryDelegatorValidatorResponse"; + value: QueryDelegatorValidatorResponseAmino; +} +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponseSDKType { + validator: ValidatorSDKType; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequest { + /** height defines at which height to query the historical info. */ + height: bigint; +} +export interface QueryHistoricalInfoRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest"; + value: Uint8Array; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequestAmino { + /** height defines at which height to query the historical info. */ + height?: string; +} +export interface QueryHistoricalInfoRequestAminoMsg { + type: "cosmos-sdk/QueryHistoricalInfoRequest"; + value: QueryHistoricalInfoRequestAmino; +} +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequestSDKType { + height: bigint; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponse { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfo; +} +export interface QueryHistoricalInfoResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; + value: Uint8Array; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponseAmino { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfoAmino; +} +export interface QueryHistoricalInfoResponseAminoMsg { + type: "cosmos-sdk/QueryHistoricalInfoResponse"; + value: QueryHistoricalInfoResponseAmino; +} +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponseSDKType { + hist?: HistoricalInfoSDKType; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequest {} +export interface QueryPoolRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest"; + value: Uint8Array; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequestAmino {} +export interface QueryPoolRequestAminoMsg { + type: "cosmos-sdk/QueryPoolRequest"; + value: QueryPoolRequestAmino; +} +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequestSDKType {} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponse { + /** pool defines the pool info. */ + pool: Pool; +} +export interface QueryPoolResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse"; + value: Uint8Array; +} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponseAmino { + /** pool defines the pool info. */ + pool?: PoolAmino; +} +export interface QueryPoolResponseAminoMsg { + type: "cosmos-sdk/QueryPoolResponse"; + value: QueryPoolResponseAmino; +} +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponseSDKType { + pool: PoolSDKType; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { + return { + status: "", + pagination: undefined + }; +} +export const QueryValidatorsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + encode(message: QueryValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest(); + message.status = object.status ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorsRequestAmino): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorsRequest): QueryValidatorsRequestAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorsRequestAminoMsg): QueryValidatorsRequest { + return QueryValidatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorsRequest): QueryValidatorsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorsRequest", + value: QueryValidatorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorsRequestProtoMsg): QueryValidatorsRequest { + return QueryValidatorsRequest.decode(message.value); + }, + toProto(message: QueryValidatorsRequest): Uint8Array { + return QueryValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorsRequest): QueryValidatorsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + value: QueryValidatorsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { + return { + validators: [], + pagination: undefined + }; +} +export const QueryValidatorsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + encode(message: QueryValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorsResponseAmino): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorsResponse): QueryValidatorsResponseAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorsResponseAminoMsg): QueryValidatorsResponse { + return QueryValidatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorsResponse): QueryValidatorsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorsResponse", + value: QueryValidatorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorsResponseProtoMsg): QueryValidatorsResponse { + return QueryValidatorsResponse.decode(message.value); + }, + toProto(message: QueryValidatorsResponse): Uint8Array { + return QueryValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorsResponse): QueryValidatorsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + value: QueryValidatorsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorRequest(): QueryValidatorRequest { + return { + validatorAddr: "" + }; +} +export const QueryValidatorRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + encode(message: QueryValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryValidatorRequestAmino): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryValidatorRequest): QueryValidatorRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryValidatorRequestAminoMsg): QueryValidatorRequest { + return QueryValidatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorRequest): QueryValidatorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorRequest", + value: QueryValidatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorRequestProtoMsg): QueryValidatorRequest { + return QueryValidatorRequest.decode(message.value); + }, + toProto(message: QueryValidatorRequest): Uint8Array { + return QueryValidatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorRequest): QueryValidatorRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + value: QueryValidatorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorResponse(): QueryValidatorResponse { + return { + validator: Validator.fromPartial({}) + }; +} +export const QueryValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + encode(message: QueryValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + return message; + }, + fromAmino(object: QueryValidatorResponseAmino): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; + }, + toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorResponseAminoMsg): QueryValidatorResponse { + return QueryValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorResponse): QueryValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorResponse", + value: QueryValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorResponseProtoMsg): QueryValidatorResponse { + return QueryValidatorResponse.decode(message.value); + }, + toProto(message: QueryValidatorResponse): Uint8Array { + return QueryValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorResponse): QueryValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + value: QueryValidatorResponse.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { + return { + validatorAddr: "", + pagination: undefined + }; +} +export const QueryValidatorDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + encode(message: QueryValidatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorDelegationsRequest { + const message = createBaseQueryValidatorDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorDelegationsRequestAmino): QueryValidatorDelegationsRequest { + const message = createBaseQueryValidatorDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorDelegationsRequestAminoMsg): QueryValidatorDelegationsRequest { + return QueryValidatorDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDelegationsRequest", + value: QueryValidatorDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDelegationsRequestProtoMsg): QueryValidatorDelegationsRequest { + return QueryValidatorDelegationsRequest.decode(message.value); + }, + toProto(message: QueryValidatorDelegationsRequest): Uint8Array { + return QueryValidatorDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + value: QueryValidatorDelegationsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { + return { + delegationResponses: [], + pagination: undefined + }; +} +export const QueryValidatorDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + encode(message: QueryValidatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delegationResponses) { + DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorDelegationsResponse { + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorDelegationsResponseAmino): QueryValidatorDelegationsResponse { + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAmino { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); + } else { + obj.delegation_responses = message.delegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorDelegationsResponseAminoMsg): QueryValidatorDelegationsResponse { + return QueryValidatorDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDelegationsResponse", + value: QueryValidatorDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDelegationsResponseProtoMsg): QueryValidatorDelegationsResponse { + return QueryValidatorDelegationsResponse.decode(message.value); + }, + toProto(message: QueryValidatorDelegationsResponse): Uint8Array { + return QueryValidatorDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + value: QueryValidatorDelegationsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { + return { + validatorAddr: "", + pagination: undefined + }; +} +export const QueryValidatorUnbondingDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + encode(message: QueryValidatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorUnbondingDelegationsRequest { + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorUnbondingDelegationsRequestAmino): QueryValidatorUnbondingDelegationsRequest { + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingDelegationsRequestAminoMsg): QueryValidatorUnbondingDelegationsRequest { + return QueryValidatorUnbondingDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest", + value: QueryValidatorUnbondingDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorUnbondingDelegationsRequestProtoMsg): QueryValidatorUnbondingDelegationsRequest { + return QueryValidatorUnbondingDelegationsRequest.decode(message.value); + }, + toProto(message: QueryValidatorUnbondingDelegationsRequest): Uint8Array { + return QueryValidatorUnbondingDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + value: QueryValidatorUnbondingDelegationsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { + return { + unbondingResponses: [], + pagination: undefined + }; +} +export const QueryValidatorUnbondingDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + encode(message: QueryValidatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unbondingResponses) { + UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorUnbondingDelegationsResponse { + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryValidatorUnbondingDelegationsResponseAmino): QueryValidatorUnbondingDelegationsResponse { + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAmino { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); + } else { + obj.unbonding_responses = message.unbondingResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingDelegationsResponseAminoMsg): QueryValidatorUnbondingDelegationsResponse { + return QueryValidatorUnbondingDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse", + value: QueryValidatorUnbondingDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorUnbondingDelegationsResponseProtoMsg): QueryValidatorUnbondingDelegationsResponse { + return QueryValidatorUnbondingDelegationsResponse.decode(message.value); + }, + toProto(message: QueryValidatorUnbondingDelegationsResponse): Uint8Array { + return QueryValidatorUnbondingDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + value: QueryValidatorUnbondingDelegationsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationRequest(): QueryDelegationRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryDelegationRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + encode(message: QueryDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryDelegationRequestAmino): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryDelegationRequest): QueryDelegationRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryDelegationRequestAminoMsg): QueryDelegationRequest { + return QueryDelegationRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationRequest): QueryDelegationRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationRequest", + value: QueryDelegationRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationRequestProtoMsg): QueryDelegationRequest { + return QueryDelegationRequest.decode(message.value); + }, + toProto(message: QueryDelegationRequest): Uint8Array { + return QueryDelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationRequest): QueryDelegationRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + value: QueryDelegationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationResponse(): QueryDelegationResponse { + return { + delegationResponse: undefined + }; +} +export const QueryDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + encode(message: QueryDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegationResponse !== undefined) { + DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponse = DelegationResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse(); + message.delegationResponse = object.delegationResponse !== undefined && object.delegationResponse !== null ? DelegationResponse.fromPartial(object.delegationResponse) : undefined; + return message; + }, + fromAmino(object: QueryDelegationResponseAmino): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse(); + if (object.delegation_response !== undefined && object.delegation_response !== null) { + message.delegationResponse = DelegationResponse.fromAmino(object.delegation_response); + } + return message; + }, + toAmino(message: QueryDelegationResponse): QueryDelegationResponseAmino { + const obj: any = {}; + obj.delegation_response = message.delegationResponse ? DelegationResponse.toAmino(message.delegationResponse) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegationResponseAminoMsg): QueryDelegationResponse { + return QueryDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegationResponse): QueryDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegationResponse", + value: QueryDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegationResponseProtoMsg): QueryDelegationResponse { + return QueryDelegationResponse.decode(message.value); + }, + toProto(message: QueryDelegationResponse): Uint8Array { + return QueryDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationResponse): QueryDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + value: QueryDelegationResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryUnbondingDelegationRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + encode(message: QueryUnbondingDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingDelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingDelegationRequest { + const message = createBaseQueryUnbondingDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryUnbondingDelegationRequestAmino): QueryUnbondingDelegationRequest { + const message = createBaseQueryUnbondingDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryUnbondingDelegationRequestAminoMsg): QueryUnbondingDelegationRequest { + return QueryUnbondingDelegationRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUnbondingDelegationRequest", + value: QueryUnbondingDelegationRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnbondingDelegationRequestProtoMsg): QueryUnbondingDelegationRequest { + return QueryUnbondingDelegationRequest.decode(message.value); + }, + toProto(message: QueryUnbondingDelegationRequest): Uint8Array { + return QueryUnbondingDelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + value: QueryUnbondingDelegationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationResponse { + return { + unbond: UnbondingDelegation.fromPartial({}) + }; +} +export const QueryUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + encode(message: QueryUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbond !== undefined) { + UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbond = UnbondingDelegation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingDelegationResponse { + const message = createBaseQueryUnbondingDelegationResponse(); + message.unbond = object.unbond !== undefined && object.unbond !== null ? UnbondingDelegation.fromPartial(object.unbond) : undefined; + return message; + }, + fromAmino(object: QueryUnbondingDelegationResponseAmino): QueryUnbondingDelegationResponse { + const message = createBaseQueryUnbondingDelegationResponse(); + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromAmino(object.unbond); + } + return message; + }, + toAmino(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAmino { + const obj: any = {}; + obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUnbondingDelegationResponseAminoMsg): QueryUnbondingDelegationResponse { + return QueryUnbondingDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUnbondingDelegationResponse", + value: QueryUnbondingDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnbondingDelegationResponseProtoMsg): QueryUnbondingDelegationResponse { + return QueryUnbondingDelegationResponse.decode(message.value); + }, + toProto(message: QueryUnbondingDelegationResponse): Uint8Array { + return QueryUnbondingDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + value: QueryUnbondingDelegationResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + encode(message: QueryDelegatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorDelegationsRequest { + const message = createBaseQueryDelegatorDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorDelegationsRequestAmino): QueryDelegatorDelegationsRequest { + const message = createBaseQueryDelegatorDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorDelegationsRequestAminoMsg): QueryDelegatorDelegationsRequest { + return QueryDelegatorDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorDelegationsRequest", + value: QueryDelegatorDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorDelegationsRequestProtoMsg): QueryDelegatorDelegationsRequest { + return QueryDelegatorDelegationsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorDelegationsRequest): Uint8Array { + return QueryDelegatorDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + value: QueryDelegatorDelegationsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { + return { + delegationResponses: [], + pagination: undefined + }; +} +export const QueryDelegatorDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + encode(message: QueryDelegatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delegationResponses) { + DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorDelegationsResponse { + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorDelegationsResponseAmino): QueryDelegatorDelegationsResponse { + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAmino { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); + } else { + obj.delegation_responses = message.delegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorDelegationsResponseAminoMsg): QueryDelegatorDelegationsResponse { + return QueryDelegatorDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorDelegationsResponse", + value: QueryDelegatorDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorDelegationsResponseProtoMsg): QueryDelegatorDelegationsResponse { + return QueryDelegatorDelegationsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorDelegationsResponse): Uint8Array { + return QueryDelegatorDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + value: QueryDelegatorDelegationsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorUnbondingDelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorUnbondingDelegationsRequest { + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorUnbondingDelegationsRequestAmino): QueryDelegatorUnbondingDelegationsRequest { + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingDelegationsRequestAminoMsg): QueryDelegatorUnbondingDelegationsRequest { + return QueryDelegatorUnbondingDelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest", + value: QueryDelegatorUnbondingDelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorUnbondingDelegationsRequestProtoMsg): QueryDelegatorUnbondingDelegationsRequest { + return QueryDelegatorUnbondingDelegationsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorUnbondingDelegationsRequest): Uint8Array { + return QueryDelegatorUnbondingDelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + value: QueryDelegatorUnbondingDelegationsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { + return { + unbondingResponses: [], + pagination: undefined + }; +} +export const QueryDelegatorUnbondingDelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unbondingResponses) { + UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorUnbondingDelegationsResponse { + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorUnbondingDelegationsResponseAmino): QueryDelegatorUnbondingDelegationsResponse { + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAmino { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); + } else { + obj.unbonding_responses = message.unbondingResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingDelegationsResponseAminoMsg): QueryDelegatorUnbondingDelegationsResponse { + return QueryDelegatorUnbondingDelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse", + value: QueryDelegatorUnbondingDelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorUnbondingDelegationsResponseProtoMsg): QueryDelegatorUnbondingDelegationsResponse { + return QueryDelegatorUnbondingDelegationsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorUnbondingDelegationsResponse): Uint8Array { + return QueryDelegatorUnbondingDelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + value: QueryDelegatorUnbondingDelegationsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { + return { + delegatorAddr: "", + srcValidatorAddr: "", + dstValidatorAddr: "", + pagination: undefined + }; +} +export const QueryRedelegationsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + encode(message: QueryRedelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.srcValidatorAddr !== "") { + writer.uint32(18).string(message.srcValidatorAddr); + } + if (message.dstValidatorAddr !== "") { + writer.uint32(26).string(message.dstValidatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.srcValidatorAddr = reader.string(); + break; + case 3: + message.dstValidatorAddr = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.srcValidatorAddr = object.srcValidatorAddr ?? ""; + message.dstValidatorAddr = object.dstValidatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.src_validator_addr !== undefined && object.src_validator_addr !== null) { + message.srcValidatorAddr = object.src_validator_addr; + } + if (object.dst_validator_addr !== undefined && object.dst_validator_addr !== null) { + message.dstValidatorAddr = object.dst_validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRedelegationsRequest): QueryRedelegationsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.src_validator_addr = message.srcValidatorAddr === "" ? undefined : message.srcValidatorAddr; + obj.dst_validator_addr = message.dstValidatorAddr === "" ? undefined : message.dstValidatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsRequestAminoMsg): QueryRedelegationsRequest { + return QueryRedelegationsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRedelegationsRequest): QueryRedelegationsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryRedelegationsRequest", + value: QueryRedelegationsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRedelegationsRequestProtoMsg): QueryRedelegationsRequest { + return QueryRedelegationsRequest.decode(message.value); + }, + toProto(message: QueryRedelegationsRequest): Uint8Array { + return QueryRedelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsRequest): QueryRedelegationsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + value: QueryRedelegationsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { + return { + redelegationResponses: [], + pagination: undefined + }; +} +export const QueryRedelegationsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + encode(message: QueryRedelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.redelegationResponses) { + RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationResponses.push(RedelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegationResponses?.map(e => RedelegationResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRedelegationsResponseAmino): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegation_responses?.map(e => RedelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRedelegationsResponse): QueryRedelegationsResponseAmino { + const obj: any = {}; + if (message.redelegationResponses) { + obj.redelegation_responses = message.redelegationResponses.map(e => e ? RedelegationResponse.toAmino(e) : undefined); + } else { + obj.redelegation_responses = message.redelegationResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsResponseAminoMsg): QueryRedelegationsResponse { + return QueryRedelegationsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRedelegationsResponse): QueryRedelegationsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryRedelegationsResponse", + value: QueryRedelegationsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRedelegationsResponseProtoMsg): QueryRedelegationsResponse { + return QueryRedelegationsResponse.decode(message.value); + }, + toProto(message: QueryRedelegationsResponse): Uint8Array { + return QueryRedelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsResponse): QueryRedelegationsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + value: QueryRedelegationsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { + return { + delegatorAddr: "", + pagination: undefined + }; +} +export const QueryDelegatorValidatorsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsRequestAminoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsRequestProtoMsg): QueryDelegatorValidatorsRequest { + return QueryDelegatorValidatorsRequest.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsRequest): Uint8Array { + return QueryDelegatorValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + value: QueryDelegatorValidatorsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { + return { + validators: [], + pagination: undefined + }; +} +export const QueryDelegatorValidatorsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorsResponseAminoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorsResponseProtoMsg): QueryDelegatorValidatorsResponse { + return QueryDelegatorValidatorsResponse.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorsResponse): Uint8Array { + return QueryDelegatorValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + value: QueryDelegatorValidatorsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequest { + return { + delegatorAddr: "", + validatorAddr: "" + }; +} +export const QueryDelegatorValidatorRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + encode(message: QueryDelegatorValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorValidatorRequest { + const message = createBaseQueryDelegatorValidatorRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryDelegatorValidatorRequestAmino): QueryDelegatorValidatorRequest { + const message = createBaseQueryDelegatorValidatorRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAmino { + const obj: any = {}; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorRequestAminoMsg): QueryDelegatorValidatorRequest { + return QueryDelegatorValidatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorRequest", + value: QueryDelegatorValidatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorRequestProtoMsg): QueryDelegatorValidatorRequest { + return QueryDelegatorValidatorRequest.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorRequest): Uint8Array { + return QueryDelegatorValidatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + value: QueryDelegatorValidatorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorResponse { + return { + validator: Validator.fromPartial({}) + }; +} +export const QueryDelegatorValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + encode(message: QueryDelegatorValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorValidatorResponse { + const message = createBaseQueryDelegatorValidatorResponse(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorValidatorResponseAmino): QueryDelegatorValidatorResponse { + const message = createBaseQueryDelegatorValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; + }, + toAmino(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorValidatorResponseAminoMsg): QueryDelegatorValidatorResponse { + return QueryDelegatorValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDelegatorValidatorResponse", + value: QueryDelegatorValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDelegatorValidatorResponseProtoMsg): QueryDelegatorValidatorResponse { + return QueryDelegatorValidatorResponse.decode(message.value); + }, + toProto(message: QueryDelegatorValidatorResponse): Uint8Array { + return QueryDelegatorValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + value: QueryDelegatorValidatorResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { + return { + height: BigInt(0) + }; +} +export const QueryHistoricalInfoRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + encode(message: QueryHistoricalInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryHistoricalInfoRequestAmino): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryHistoricalInfoRequestAminoMsg): QueryHistoricalInfoRequest { + return QueryHistoricalInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryHistoricalInfoRequest", + value: QueryHistoricalInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryHistoricalInfoRequestProtoMsg): QueryHistoricalInfoRequest { + return QueryHistoricalInfoRequest.decode(message.value); + }, + toProto(message: QueryHistoricalInfoRequest): Uint8Array { + return QueryHistoricalInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + value: QueryHistoricalInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { + return { + hist: undefined + }; +} +export const QueryHistoricalInfoResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + encode(message: QueryHistoricalInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hist !== undefined) { + HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHistoricalInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hist = HistoricalInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse(); + message.hist = object.hist !== undefined && object.hist !== null ? HistoricalInfo.fromPartial(object.hist) : undefined; + return message; + }, + fromAmino(object: QueryHistoricalInfoResponseAmino): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse(); + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromAmino(object.hist); + } + return message; + }, + toAmino(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAmino { + const obj: any = {}; + obj.hist = message.hist ? HistoricalInfo.toAmino(message.hist) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHistoricalInfoResponseAminoMsg): QueryHistoricalInfoResponse { + return QueryHistoricalInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryHistoricalInfoResponse", + value: QueryHistoricalInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryHistoricalInfoResponseProtoMsg): QueryHistoricalInfoResponse { + return QueryHistoricalInfoResponse.decode(message.value); + }, + toProto(message: QueryHistoricalInfoResponse): Uint8Array { + return QueryHistoricalInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + value: QueryHistoricalInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPoolRequest(): QueryPoolRequest { + return {}; +} +export const QueryPoolRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + encode(_: QueryPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryPoolRequest { + const message = createBaseQueryPoolRequest(); + return message; + }, + fromAmino(_: QueryPoolRequestAmino): QueryPoolRequest { + const message = createBaseQueryPoolRequest(); + return message; + }, + toAmino(_: QueryPoolRequest): QueryPoolRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPoolRequestAminoMsg): QueryPoolRequest { + return QueryPoolRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolRequest): QueryPoolRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPoolRequest", + value: QueryPoolRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolRequestProtoMsg): QueryPoolRequest { + return QueryPoolRequest.decode(message.value); + }, + toProto(message: QueryPoolRequest): Uint8Array { + return QueryPoolRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolRequest): QueryPoolRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + value: QueryPoolRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPoolResponse(): QueryPoolResponse { + return { + pool: Pool.fromPartial({}) + }; +} +export const QueryPoolResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + encode(message: QueryPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pool !== undefined) { + Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool = Pool.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPoolResponse { + const message = createBaseQueryPoolResponse(); + message.pool = object.pool !== undefined && object.pool !== null ? Pool.fromPartial(object.pool) : undefined; + return message; + }, + fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { + const message = createBaseQueryPoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromAmino(object.pool); + } + return message; + }, + toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { + const obj: any = {}; + obj.pool = message.pool ? Pool.toAmino(message.pool) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { + return QueryPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolResponse): QueryPoolResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPoolResponse", + value: QueryPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolResponseProtoMsg): QueryPoolResponse { + return QueryPoolResponse.decode(message.value); + }, + toProto(message: QueryPoolResponse): Uint8Array { + return QueryPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolResponse): QueryPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + value: QueryPoolResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/staking.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/staking.ts new file mode 100644 index 00000000..0b8a256f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/staking.ts @@ -0,0 +1,2756 @@ +//@ts-nocheck +import { Header, HeaderAmino, HeaderSDKType } from "../../../tendermint/types/types"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { Pubkey } from "@cosmjs/amino"; +/** BondStatus is the status of a validator. */ +export enum BondStatus { + /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ + BOND_STATUS_UNSPECIFIED = 0, + /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */ + BOND_STATUS_UNBONDED = 1, + /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */ + BOND_STATUS_UNBONDING = 2, + /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */ + BOND_STATUS_BONDED = 3, + UNRECOGNIZED = -1, +} +export const BondStatusSDKType = BondStatus; +export const BondStatusAmino = BondStatus; +export function bondStatusFromJSON(object: any): BondStatus { + switch (object) { + case 0: + case "BOND_STATUS_UNSPECIFIED": + return BondStatus.BOND_STATUS_UNSPECIFIED; + case 1: + case "BOND_STATUS_UNBONDED": + return BondStatus.BOND_STATUS_UNBONDED; + case 2: + case "BOND_STATUS_UNBONDING": + return BondStatus.BOND_STATUS_UNBONDING; + case 3: + case "BOND_STATUS_BONDED": + return BondStatus.BOND_STATUS_BONDED; + case -1: + case "UNRECOGNIZED": + default: + return BondStatus.UNRECOGNIZED; + } +} +export function bondStatusToJSON(object: BondStatus): string { + switch (object) { + case BondStatus.BOND_STATUS_UNSPECIFIED: + return "BOND_STATUS_UNSPECIFIED"; + case BondStatus.BOND_STATUS_UNBONDED: + return "BOND_STATUS_UNBONDED"; + case BondStatus.BOND_STATUS_UNBONDING: + return "BOND_STATUS_UNBONDING"; + case BondStatus.BOND_STATUS_BONDED: + return "BOND_STATUS_BONDED"; + case BondStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfo { + header: Header; + valset: Validator[]; +} +export interface HistoricalInfoProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo"; + value: Uint8Array; +} +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfoAmino { + header?: HeaderAmino; + valset?: ValidatorAmino[]; +} +export interface HistoricalInfoAminoMsg { + type: "cosmos-sdk/HistoricalInfo"; + value: HistoricalInfoAmino; +} +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfoSDKType { + header: HeaderSDKType; + valset: ValidatorSDKType[]; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRates { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate: string; + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + maxRate: string; + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + maxChangeRate: string; +} +export interface CommissionRatesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates"; + value: Uint8Array; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRatesAmino { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate?: string; + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + max_rate?: string; + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + max_change_rate?: string; +} +export interface CommissionRatesAminoMsg { + type: "cosmos-sdk/CommissionRates"; + value: CommissionRatesAmino; +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRatesSDKType { + rate: string; + max_rate: string; + max_change_rate: string; +} +/** Commission defines commission parameters for a given validator. */ +export interface Commission { + /** commission_rates defines the initial commission rates to be used for creating a validator. */ + commissionRates: CommissionRates; + /** update_time is the last time the commission rate was changed. */ + updateTime: Date; +} +export interface CommissionProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Commission"; + value: Uint8Array; +} +/** Commission defines commission parameters for a given validator. */ +export interface CommissionAmino { + /** commission_rates defines the initial commission rates to be used for creating a validator. */ + commission_rates?: CommissionRatesAmino; + /** update_time is the last time the commission rate was changed. */ + update_time?: string; +} +export interface CommissionAminoMsg { + type: "cosmos-sdk/Commission"; + value: CommissionAmino; +} +/** Commission defines commission parameters for a given validator. */ +export interface CommissionSDKType { + commission_rates: CommissionRatesSDKType; + update_time: Date; +} +/** Description defines a validator description. */ +export interface Description { + /** moniker defines a human-readable name for the validator. */ + moniker: string; + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity: string; + /** website defines an optional website link. */ + website: string; + /** security_contact defines an optional email for security contact. */ + securityContact: string; + /** details define other optional details. */ + details: string; +} +export interface DescriptionProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Description"; + value: Uint8Array; +} +/** Description defines a validator description. */ +export interface DescriptionAmino { + /** moniker defines a human-readable name for the validator. */ + moniker?: string; + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity?: string; + /** website defines an optional website link. */ + website?: string; + /** security_contact defines an optional email for security contact. */ + security_contact?: string; + /** details define other optional details. */ + details?: string; +} +export interface DescriptionAminoMsg { + type: "cosmos-sdk/Description"; + value: DescriptionAmino; +} +/** Description defines a validator description. */ +export interface DescriptionSDKType { + moniker: string; + identity: string; + website: string; + security_contact: string; + details: string; +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface Validator { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operatorAddress: string; + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ + consensusPubkey?: Any | undefined; + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed: boolean; + /** status is the validator status (bonded/unbonding/unbonded). */ + status: BondStatus; + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens: string; + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegatorShares: string; + /** description defines the description terms for the validator. */ + description: Description; + /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ + unbondingHeight: bigint; + /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ + unbondingTime: Date; + /** commission defines the commission parameters. */ + commission: Commission; + /** min_self_delegation is the validator's self declared minimum self delegation. */ + minSelfDelegation: string; +} +export interface ValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Validator"; + value: Uint8Array; +} +export type ValidatorEncoded = Omit & { + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */consensusPubkey?: AnyProtoMsg | undefined; +}; +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface ValidatorAmino { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operator_address?: string; + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ + consensus_pubkey?: AnyAmino; + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed?: boolean; + /** status is the validator status (bonded/unbonding/unbonded). */ + status?: BondStatus; + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens?: string; + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegator_shares?: string; + /** description defines the description terms for the validator. */ + description?: DescriptionAmino; + /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ + unbonding_height?: string; + /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ + unbonding_time?: string; + /** commission defines the commission parameters. */ + commission?: CommissionAmino; + /** min_self_delegation is the validator's self declared minimum self delegation. */ + min_self_delegation?: string; +} +export interface ValidatorAminoMsg { + type: "cosmos-sdk/Validator"; + value: ValidatorAmino; +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface ValidatorSDKType { + operator_address: string; + consensus_pubkey?: AnySDKType | undefined; + jailed: boolean; + status: BondStatus; + tokens: string; + delegator_shares: string; + description: DescriptionSDKType; + unbonding_height: bigint; + unbonding_time: Date; + commission: CommissionSDKType; + min_self_delegation: string; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddresses { + addresses: string[]; +} +export interface ValAddressesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses"; + value: Uint8Array; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddressesAmino { + addresses?: string[]; +} +export interface ValAddressesAminoMsg { + type: "cosmos-sdk/ValAddresses"; + value: ValAddressesAmino; +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddressesSDKType { + addresses: string[]; +} +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPair { + delegatorAddress: string; + validatorAddress: string; +} +export interface DVPairProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVPair"; + value: Uint8Array; +} +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPairAmino { + delegator_address?: string; + validator_address?: string; +} +export interface DVPairAminoMsg { + type: "cosmos-sdk/DVPair"; + value: DVPairAmino; +} +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPairSDKType { + delegator_address: string; + validator_address: string; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairs { + pairs: DVPair[]; +} +export interface DVPairsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVPairs"; + value: Uint8Array; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairsAmino { + pairs?: DVPairAmino[]; +} +export interface DVPairsAminoMsg { + type: "cosmos-sdk/DVPairs"; + value: DVPairsAmino; +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairsSDKType { + pairs: DVPairSDKType[]; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTriplet { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; +} +export interface DVVTripletProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet"; + value: Uint8Array; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTripletAmino { + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; +} +export interface DVVTripletAminoMsg { + type: "cosmos-sdk/DVVTriplet"; + value: DVVTripletAmino; +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTripletSDKType { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTriplets { + triplets: DVVTriplet[]; +} +export interface DVVTripletsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets"; + value: Uint8Array; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTripletsAmino { + triplets?: DVVTripletAmino[]; +} +export interface DVVTripletsAminoMsg { + type: "cosmos-sdk/DVVTriplets"; + value: DVVTripletsAmino; +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTripletsSDKType { + triplets: DVVTripletSDKType[]; +} +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface Delegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the bech32-encoded address of the validator. */ + validatorAddress: string; + /** shares define the delegation shares received. */ + shares: string; +} +export interface DelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Delegation"; + value: Uint8Array; +} +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface DelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string; + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string; + /** shares define the delegation shares received. */ + shares?: string; +} +export interface DelegationAminoMsg { + type: "cosmos-sdk/Delegation"; + value: DelegationAmino; +} +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface DelegationSDKType { + delegator_address: string; + validator_address: string; + shares: string; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the bech32-encoded address of the validator. */ + validatorAddress: string; + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntry[]; +} +export interface UnbondingDelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation"; + value: Uint8Array; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string; + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string; + /** entries are the unbonding delegation entries. */ + entries?: UnbondingDelegationEntryAmino[]; +} +export interface UnbondingDelegationAminoMsg { + type: "cosmos-sdk/UnbondingDelegation"; + value: UnbondingDelegationAmino; +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegationSDKType { + delegator_address: string; + validator_address: string; + entries: UnbondingDelegationEntrySDKType[]; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + /** creation_height is the height which the unbonding took place. */ + creationHeight: bigint; + /** completion_time is the unix time for unbonding completion. */ + completionTime: Date; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initialBalance: string; + /** balance defines the tokens to receive at completion. */ + balance: string; +} +export interface UnbondingDelegationEntryProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry"; + value: Uint8Array; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntryAmino { + /** creation_height is the height which the unbonding took place. */ + creation_height?: string; + /** completion_time is the unix time for unbonding completion. */ + completion_time?: string; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initial_balance?: string; + /** balance defines the tokens to receive at completion. */ + balance?: string; +} +export interface UnbondingDelegationEntryAminoMsg { + type: "cosmos-sdk/UnbondingDelegationEntry"; + value: UnbondingDelegationEntryAmino; +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntrySDKType { + creation_height: bigint; + completion_time: Date; + initial_balance: string; + balance: string; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntry { + /** creation_height defines the height which the redelegation took place. */ + creationHeight: bigint; + /** completion_time defines the unix time for redelegation completion. */ + completionTime: Date; + /** initial_balance defines the initial balance when redelegation started. */ + initialBalance: string; + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + sharesDst: string; +} +export interface RedelegationEntryProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry"; + value: Uint8Array; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntryAmino { + /** creation_height defines the height which the redelegation took place. */ + creation_height?: string; + /** completion_time defines the unix time for redelegation completion. */ + completion_time?: string; + /** initial_balance defines the initial balance when redelegation started. */ + initial_balance?: string; + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + shares_dst?: string; +} +export interface RedelegationEntryAminoMsg { + type: "cosmos-sdk/RedelegationEntry"; + value: RedelegationEntryAmino; +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntrySDKType { + creation_height: bigint; + completion_time: Date; + initial_balance: string; + shares_dst: string; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface Redelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_src_address is the validator redelegation source operator address. */ + validatorSrcAddress: string; + /** validator_dst_address is the validator redelegation destination operator address. */ + validatorDstAddress: string; + /** entries are the redelegation entries. */ + entries: RedelegationEntry[]; +} +export interface RedelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Redelegation"; + value: Uint8Array; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface RedelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string; + /** validator_src_address is the validator redelegation source operator address. */ + validator_src_address?: string; + /** validator_dst_address is the validator redelegation destination operator address. */ + validator_dst_address?: string; + /** entries are the redelegation entries. */ + entries?: RedelegationEntryAmino[]; +} +export interface RedelegationAminoMsg { + type: "cosmos-sdk/Redelegation"; + value: RedelegationAmino; +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface RedelegationSDKType { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; + entries: RedelegationEntrySDKType[]; +} +/** Params defines the parameters for the staking module. */ +export interface Params { + /** unbonding_time is the time duration of unbonding. */ + unbondingTime: Duration; + /** max_validators is the maximum number of validators. */ + maxValidators: number; + /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ + maxEntries: number; + /** historical_entries is the number of historical entries to persist. */ + historicalEntries: number; + /** bond_denom defines the bondable coin denomination. */ + bondDenom: string; + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + minCommissionRate: string; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the staking module. */ +export interface ParamsAmino { + /** unbonding_time is the time duration of unbonding. */ + unbonding_time?: DurationAmino; + /** max_validators is the maximum number of validators. */ + max_validators?: number; + /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ + max_entries?: number; + /** historical_entries is the number of historical entries to persist. */ + historical_entries?: number; + /** bond_denom defines the bondable coin denomination. */ + bond_denom?: string; + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + min_commission_rate?: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the staking module. */ +export interface ParamsSDKType { + unbonding_time: DurationSDKType; + max_validators: number; + max_entries: number; + historical_entries: number; + bond_denom: string; + min_commission_rate: string; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponse { + delegation: Delegation; + balance: Coin; +} +export interface DelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse"; + value: Uint8Array; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponseAmino { + delegation?: DelegationAmino; + balance?: CoinAmino; +} +export interface DelegationResponseAminoMsg { + type: "cosmos-sdk/DelegationResponse"; + value: DelegationResponseAmino; +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponseSDKType { + delegation: DelegationSDKType; + balance: CoinSDKType; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponse { + redelegationEntry: RedelegationEntry; + balance: string; +} +export interface RedelegationEntryResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse"; + value: Uint8Array; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponseAmino { + redelegation_entry?: RedelegationEntryAmino; + balance?: string; +} +export interface RedelegationEntryResponseAminoMsg { + type: "cosmos-sdk/RedelegationEntryResponse"; + value: RedelegationEntryResponseAmino; +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponseSDKType { + redelegation_entry: RedelegationEntrySDKType; + balance: string; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponse { + redelegation: Redelegation; + entries: RedelegationEntryResponse[]; +} +export interface RedelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse"; + value: Uint8Array; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponseAmino { + redelegation?: RedelegationAmino; + entries?: RedelegationEntryResponseAmino[]; +} +export interface RedelegationResponseAminoMsg { + type: "cosmos-sdk/RedelegationResponse"; + value: RedelegationResponseAmino; +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponseSDKType { + redelegation: RedelegationSDKType; + entries: RedelegationEntryResponseSDKType[]; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface Pool { + notBondedTokens: string; + bondedTokens: string; +} +export interface PoolProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.Pool"; + value: Uint8Array; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface PoolAmino { + not_bonded_tokens: string; + bonded_tokens: string; +} +export interface PoolAminoMsg { + type: "cosmos-sdk/Pool"; + value: PoolAmino; +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface PoolSDKType { + not_bonded_tokens: string; + bonded_tokens: string; +} +function createBaseHistoricalInfo(): HistoricalInfo { + return { + header: Header.fromPartial({}), + valset: [] + }; +} +export const HistoricalInfo = { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + encode(message: HistoricalInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.valset) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.valset.push(Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HistoricalInfo { + const message = createBaseHistoricalInfo(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.valset = object.valset?.map(e => Validator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HistoricalInfoAmino): HistoricalInfo { + const message = createBaseHistoricalInfo(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + message.valset = object.valset?.map(e => Validator.fromAmino(e)) || []; + return message; + }, + toAmino(message: HistoricalInfo): HistoricalInfoAmino { + const obj: any = {}; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + if (message.valset) { + obj.valset = message.valset.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.valset = message.valset; + } + return obj; + }, + fromAminoMsg(object: HistoricalInfoAminoMsg): HistoricalInfo { + return HistoricalInfo.fromAmino(object.value); + }, + toAminoMsg(message: HistoricalInfo): HistoricalInfoAminoMsg { + return { + type: "cosmos-sdk/HistoricalInfo", + value: HistoricalInfo.toAmino(message) + }; + }, + fromProtoMsg(message: HistoricalInfoProtoMsg): HistoricalInfo { + return HistoricalInfo.decode(message.value); + }, + toProto(message: HistoricalInfo): Uint8Array { + return HistoricalInfo.encode(message).finish(); + }, + toProtoMsg(message: HistoricalInfo): HistoricalInfoProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + value: HistoricalInfo.encode(message).finish() + }; + } +}; +function createBaseCommissionRates(): CommissionRates { + return { + rate: "", + maxRate: "", + maxChangeRate: "" + }; +} +export const CommissionRates = { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rate !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.rate, 18).atomics); + } + if (message.maxRate !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.maxRate, 18).atomics); + } + if (message.maxChangeRate !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.maxChangeRate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommissionRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommissionRates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.maxRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.maxChangeRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommissionRates { + const message = createBaseCommissionRates(); + message.rate = object.rate ?? ""; + message.maxRate = object.maxRate ?? ""; + message.maxChangeRate = object.maxChangeRate ?? ""; + return message; + }, + fromAmino(object: CommissionRatesAmino): CommissionRates { + const message = createBaseCommissionRates(); + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.max_rate !== undefined && object.max_rate !== null) { + message.maxRate = object.max_rate; + } + if (object.max_change_rate !== undefined && object.max_change_rate !== null) { + message.maxChangeRate = object.max_change_rate; + } + return message; + }, + toAmino(message: CommissionRates): CommissionRatesAmino { + const obj: any = {}; + obj.rate = message.rate === "" ? undefined : message.rate; + obj.max_rate = message.maxRate === "" ? undefined : message.maxRate; + obj.max_change_rate = message.maxChangeRate === "" ? undefined : message.maxChangeRate; + return obj; + }, + fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates { + return CommissionRates.fromAmino(object.value); + }, + toAminoMsg(message: CommissionRates): CommissionRatesAminoMsg { + return { + type: "cosmos-sdk/CommissionRates", + value: CommissionRates.toAmino(message) + }; + }, + fromProtoMsg(message: CommissionRatesProtoMsg): CommissionRates { + return CommissionRates.decode(message.value); + }, + toProto(message: CommissionRates): Uint8Array { + return CommissionRates.encode(message).finish(); + }, + toProtoMsg(message: CommissionRates): CommissionRatesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + value: CommissionRates.encode(message).finish() + }; + } +}; +function createBaseCommission(): Commission { + return { + commissionRates: CommissionRates.fromPartial({}), + updateTime: new Date() + }; +} +export const Commission = { + typeUrl: "/cosmos.staking.v1beta1.Commission", + encode(message: Commission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.commissionRates !== undefined) { + CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); + } + if (message.updateTime !== undefined) { + Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Commission { + const message = createBaseCommission(); + message.commissionRates = object.commissionRates !== undefined && object.commissionRates !== null ? CommissionRates.fromPartial(object.commissionRates) : undefined; + message.updateTime = object.updateTime ?? undefined; + return message; + }, + fromAmino(object: CommissionAmino): Commission { + const message = createBaseCommission(); + if (object.commission_rates !== undefined && object.commission_rates !== null) { + message.commissionRates = CommissionRates.fromAmino(object.commission_rates); + } + if (object.update_time !== undefined && object.update_time !== null) { + message.updateTime = fromTimestamp(Timestamp.fromAmino(object.update_time)); + } + return message; + }, + toAmino(message: Commission): CommissionAmino { + const obj: any = {}; + obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; + return obj; + }, + fromAminoMsg(object: CommissionAminoMsg): Commission { + return Commission.fromAmino(object.value); + }, + toAminoMsg(message: Commission): CommissionAminoMsg { + return { + type: "cosmos-sdk/Commission", + value: Commission.toAmino(message) + }; + }, + fromProtoMsg(message: CommissionProtoMsg): Commission { + return Commission.decode(message.value); + }, + toProto(message: Commission): Uint8Array { + return Commission.encode(message).finish(); + }, + toProtoMsg(message: Commission): CommissionProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Commission", + value: Commission.encode(message).finish() + }; + } +}; +function createBaseDescription(): Description { + return { + moniker: "", + identity: "", + website: "", + securityContact: "", + details: "" + }; +} +export const Description = { + typeUrl: "/cosmos.staking.v1beta1.Description", + encode(message: Description, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moniker !== "") { + writer.uint32(10).string(message.moniker); + } + if (message.identity !== "") { + writer.uint32(18).string(message.identity); + } + if (message.website !== "") { + writer.uint32(26).string(message.website); + } + if (message.securityContact !== "") { + writer.uint32(34).string(message.securityContact); + } + if (message.details !== "") { + writer.uint32(42).string(message.details); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Description { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Description { + const message = createBaseDescription(); + message.moniker = object.moniker ?? ""; + message.identity = object.identity ?? ""; + message.website = object.website ?? ""; + message.securityContact = object.securityContact ?? ""; + message.details = object.details ?? ""; + return message; + }, + fromAmino(object: DescriptionAmino): Description { + const message = createBaseDescription(); + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } + if (object.security_contact !== undefined && object.security_contact !== null) { + message.securityContact = object.security_contact; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } + return message; + }, + toAmino(message: Description): DescriptionAmino { + const obj: any = {}; + obj.moniker = message.moniker === "" ? undefined : message.moniker; + obj.identity = message.identity === "" ? undefined : message.identity; + obj.website = message.website === "" ? undefined : message.website; + obj.security_contact = message.securityContact === "" ? undefined : message.securityContact; + obj.details = message.details === "" ? undefined : message.details; + return obj; + }, + fromAminoMsg(object: DescriptionAminoMsg): Description { + return Description.fromAmino(object.value); + }, + toAminoMsg(message: Description): DescriptionAminoMsg { + return { + type: "cosmos-sdk/Description", + value: Description.toAmino(message) + }; + }, + fromProtoMsg(message: DescriptionProtoMsg): Description { + return Description.decode(message.value); + }, + toProto(message: Description): Uint8Array { + return Description.encode(message).finish(); + }, + toProtoMsg(message: Description): DescriptionProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Description", + value: Description.encode(message).finish() + }; + } +}; +function createBaseValidator(): Validator { + return { + operatorAddress: "", + consensusPubkey: undefined, + jailed: false, + status: 0, + tokens: "", + delegatorShares: "", + description: Description.fromPartial({}), + unbondingHeight: BigInt(0), + unbondingTime: new Date(), + commission: Commission.fromPartial({}), + minSelfDelegation: "" + }; +} +export const Validator = { + typeUrl: "/cosmos.staking.v1beta1.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + if (message.consensusPubkey !== undefined) { + Any.encode(message.consensusPubkey as Any, writer.uint32(18).fork()).ldelim(); + } + if (message.jailed === true) { + writer.uint32(24).bool(message.jailed); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + if (message.tokens !== "") { + writer.uint32(42).string(message.tokens); + } + if (message.delegatorShares !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.delegatorShares, 18).atomics); + } + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(58).fork()).ldelim(); + } + if (message.unbondingHeight !== BigInt(0)) { + writer.uint32(64).int64(message.unbondingHeight); + } + if (message.unbondingTime !== undefined) { + Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim(); + } + if (message.commission !== undefined) { + Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(90).string(message.minSelfDelegation); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any; + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = reader.int32() as any; + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.description = Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64(); + break; + case 9: + message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.commission = Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Validator { + const message = createBaseValidator(); + message.operatorAddress = object.operatorAddress ?? ""; + message.consensusPubkey = object.consensusPubkey !== undefined && object.consensusPubkey !== null ? Any.fromPartial(object.consensusPubkey) : undefined; + message.jailed = object.jailed ?? false; + message.status = object.status ?? 0; + message.tokens = object.tokens ?? ""; + message.delegatorShares = object.delegatorShares ?? ""; + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.unbondingHeight = object.unbondingHeight !== undefined && object.unbondingHeight !== null ? BigInt(object.unbondingHeight.toString()) : BigInt(0); + message.unbondingTime = object.unbondingTime ?? undefined; + message.commission = object.commission !== undefined && object.commission !== null ? Commission.fromPartial(object.commission) : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.consensus_pubkey !== undefined && object.consensus_pubkey !== null) { + message.consensusPubkey = encodePubkey(object.consensus_pubkey); + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } + if (object.delegator_shares !== undefined && object.delegator_shares !== null) { + message.delegatorShares = object.delegator_shares; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.unbonding_height !== undefined && object.unbonding_height !== null) { + message.unbondingHeight = BigInt(object.unbonding_height); + } + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = fromTimestamp(Timestamp.fromAmino(object.unbonding_time)); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress; + obj.consensus_pubkey = message.consensusPubkey ? decodePubkey(message.consensusPubkey) : undefined; + obj.jailed = message.jailed === false ? undefined : message.jailed; + obj.status = message.status === 0 ? undefined : message.status; + obj.tokens = message.tokens === "" ? undefined : message.tokens; + obj.delegator_shares = message.delegatorShares === "" ? undefined : message.delegatorShares; + obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.unbonding_height = message.unbondingHeight !== BigInt(0) ? message.unbondingHeight.toString() : undefined; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : undefined; + obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; + obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + toAminoMsg(message: Validator): ValidatorAminoMsg { + return { + type: "cosmos-sdk/Validator", + value: Validator.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Validator", + value: Validator.encode(message).finish() + }; + } +}; +function createBaseValAddresses(): ValAddresses { + return { + addresses: [] + }; +} +export const ValAddresses = { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + encode(message: ValAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.addresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValAddresses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValAddresses { + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: ValAddressesAmino): ValAddresses { + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: ValAddresses): ValAddressesAmino { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } + return obj; + }, + fromAminoMsg(object: ValAddressesAminoMsg): ValAddresses { + return ValAddresses.fromAmino(object.value); + }, + toAminoMsg(message: ValAddresses): ValAddressesAminoMsg { + return { + type: "cosmos-sdk/ValAddresses", + value: ValAddresses.toAmino(message) + }; + }, + fromProtoMsg(message: ValAddressesProtoMsg): ValAddresses { + return ValAddresses.decode(message.value); + }, + toProto(message: ValAddresses): Uint8Array { + return ValAddresses.encode(message).finish(); + }, + toProtoMsg(message: ValAddresses): ValAddressesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + value: ValAddresses.encode(message).finish() + }; + } +}; +function createBaseDVPair(): DVPair { + return { + delegatorAddress: "", + validatorAddress: "" + }; +} +export const DVPair = { + typeUrl: "/cosmos.staking.v1beta1.DVPair", + encode(message: DVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DVPair { + const message = createBaseDVPair(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: DVPairAmino): DVPair { + const message = createBaseDVPair(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: DVPair): DVPairAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: DVPairAminoMsg): DVPair { + return DVPair.fromAmino(object.value); + }, + toAminoMsg(message: DVPair): DVPairAminoMsg { + return { + type: "cosmos-sdk/DVPair", + value: DVPair.toAmino(message) + }; + }, + fromProtoMsg(message: DVPairProtoMsg): DVPair { + return DVPair.decode(message.value); + }, + toProto(message: DVPair): Uint8Array { + return DVPair.encode(message).finish(); + }, + toProtoMsg(message: DVPair): DVPairProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVPair", + value: DVPair.encode(message).finish() + }; + } +}; +function createBaseDVPairs(): DVPairs { + return { + pairs: [] + }; +} +export const DVPairs = { + typeUrl: "/cosmos.staking.v1beta1.DVPairs", + encode(message: DVPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pairs) { + DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVPairs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairs.push(DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DVPairs { + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DVPairsAmino): DVPairs { + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: DVPairs): DVPairsAmino { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map(e => e ? DVPair.toAmino(e) : undefined); + } else { + obj.pairs = message.pairs; + } + return obj; + }, + fromAminoMsg(object: DVPairsAminoMsg): DVPairs { + return DVPairs.fromAmino(object.value); + }, + toAminoMsg(message: DVPairs): DVPairsAminoMsg { + return { + type: "cosmos-sdk/DVPairs", + value: DVPairs.toAmino(message) + }; + }, + fromProtoMsg(message: DVPairsProtoMsg): DVPairs { + return DVPairs.decode(message.value); + }, + toProto(message: DVPairs): Uint8Array { + return DVPairs.encode(message).finish(); + }, + toProtoMsg(message: DVPairs): DVPairsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVPairs", + value: DVPairs.encode(message).finish() + }; + } +}; +function createBaseDVVTriplet(): DVVTriplet { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "" + }; +} +export const DVVTriplet = { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + encode(message: DVVTriplet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVVTriplet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DVVTriplet { + const message = createBaseDVVTriplet(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + return message; + }, + fromAmino(object: DVVTripletAmino): DVVTriplet { + const message = createBaseDVVTriplet(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + return message; + }, + toAmino(message: DVVTriplet): DVVTripletAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress; + obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress; + return obj; + }, + fromAminoMsg(object: DVVTripletAminoMsg): DVVTriplet { + return DVVTriplet.fromAmino(object.value); + }, + toAminoMsg(message: DVVTriplet): DVVTripletAminoMsg { + return { + type: "cosmos-sdk/DVVTriplet", + value: DVVTriplet.toAmino(message) + }; + }, + fromProtoMsg(message: DVVTripletProtoMsg): DVVTriplet { + return DVVTriplet.decode(message.value); + }, + toProto(message: DVVTriplet): Uint8Array { + return DVVTriplet.encode(message).finish(); + }, + toProtoMsg(message: DVVTriplet): DVVTripletProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + value: DVVTriplet.encode(message).finish() + }; + } +}; +function createBaseDVVTriplets(): DVVTriplets { + return { + triplets: [] + }; +} +export const DVVTriplets = { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + encode(message: DVVTriplets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.triplets) { + DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDVVTriplets(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.triplets.push(DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DVVTriplets { + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DVVTripletsAmino): DVVTriplets { + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || []; + return message; + }, + toAmino(message: DVVTriplets): DVVTripletsAmino { + const obj: any = {}; + if (message.triplets) { + obj.triplets = message.triplets.map(e => e ? DVVTriplet.toAmino(e) : undefined); + } else { + obj.triplets = message.triplets; + } + return obj; + }, + fromAminoMsg(object: DVVTripletsAminoMsg): DVVTriplets { + return DVVTriplets.fromAmino(object.value); + }, + toAminoMsg(message: DVVTriplets): DVVTripletsAminoMsg { + return { + type: "cosmos-sdk/DVVTriplets", + value: DVVTriplets.toAmino(message) + }; + }, + fromProtoMsg(message: DVVTripletsProtoMsg): DVVTriplets { + return DVVTriplets.decode(message.value); + }, + toProto(message: DVVTriplets): Uint8Array { + return DVVTriplets.encode(message).finish(); + }, + toProtoMsg(message: DVVTriplets): DVVTripletsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + value: DVVTriplets.encode(message).finish() + }; + } +}; +function createBaseDelegation(): Delegation { + return { + delegatorAddress: "", + validatorAddress: "", + shares: "" + }; +} +export const Delegation = { + typeUrl: "/cosmos.staking.v1beta1.Delegation", + encode(message: Delegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.shares !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.shares, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Delegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.shares = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Delegation { + const message = createBaseDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.shares = object.shares ?? ""; + return message; + }, + fromAmino(object: DelegationAmino): Delegation { + const message = createBaseDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } + return message; + }, + toAmino(message: Delegation): DelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.shares = message.shares === "" ? undefined : message.shares; + return obj; + }, + fromAminoMsg(object: DelegationAminoMsg): Delegation { + return Delegation.fromAmino(object.value); + }, + toAminoMsg(message: Delegation): DelegationAminoMsg { + return { + type: "cosmos-sdk/Delegation", + value: Delegation.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationProtoMsg): Delegation { + return Delegation.decode(message.value); + }, + toProto(message: Delegation): Uint8Array { + return Delegation.encode(message).finish(); + }, + toProtoMsg(message: Delegation): DelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Delegation", + value: Delegation.encode(message).finish() + }; + } +}; +function createBaseUnbondingDelegation(): UnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + entries: [] + }; +} +export const UnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + encode(message: UnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + for (const v of message.entries) { + UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbondingDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnbondingDelegation { + const message = createBaseUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { + const message = createBaseUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: UnbondingDelegation): UnbondingDelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.entries) { + obj.entries = message.entries.map(e => e ? UnbondingDelegationEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: UnbondingDelegationAminoMsg): UnbondingDelegation { + return UnbondingDelegation.fromAmino(object.value); + }, + toAminoMsg(message: UnbondingDelegation): UnbondingDelegationAminoMsg { + return { + type: "cosmos-sdk/UnbondingDelegation", + value: UnbondingDelegation.toAmino(message) + }; + }, + fromProtoMsg(message: UnbondingDelegationProtoMsg): UnbondingDelegation { + return UnbondingDelegation.decode(message.value); + }, + toProto(message: UnbondingDelegation): Uint8Array { + return UnbondingDelegation.encode(message).finish(); + }, + toProtoMsg(message: UnbondingDelegation): UnbondingDelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + value: UnbondingDelegation.encode(message).finish() + }; + } +}; +function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: "", + balance: "" + }; +} +export const UnbondingDelegationEntry = { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + encode(message: UnbondingDelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbondingDelegationEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry(); + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.balance = object.balance ?? ""; + return message; + }, + fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; + }, + toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { + const obj: any = {}; + obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance; + obj.balance = message.balance === "" ? undefined : message.balance; + return obj; + }, + fromAminoMsg(object: UnbondingDelegationEntryAminoMsg): UnbondingDelegationEntry { + return UnbondingDelegationEntry.fromAmino(object.value); + }, + toAminoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryAminoMsg { + return { + type: "cosmos-sdk/UnbondingDelegationEntry", + value: UnbondingDelegationEntry.toAmino(message) + }; + }, + fromProtoMsg(message: UnbondingDelegationEntryProtoMsg): UnbondingDelegationEntry { + return UnbondingDelegationEntry.decode(message.value); + }, + toProto(message: UnbondingDelegationEntry): Uint8Array { + return UnbondingDelegationEntry.encode(message).finish(); + }, + toProtoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + value: UnbondingDelegationEntry.encode(message).finish() + }; + } +}; +function createBaseRedelegationEntry(): RedelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: "", + sharesDst: "" + }; +} +export const RedelegationEntry = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + encode(message: RedelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.sharesDst !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.sharesDst, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64(); + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RedelegationEntry { + const message = createBaseRedelegationEntry(); + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.sharesDst = object.sharesDst ?? ""; + return message; + }, + fromAmino(object: RedelegationEntryAmino): RedelegationEntry { + const message = createBaseRedelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.shares_dst !== undefined && object.shares_dst !== null) { + message.sharesDst = object.shares_dst; + } + return message; + }, + toAmino(message: RedelegationEntry): RedelegationEntryAmino { + const obj: any = {}; + obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance; + obj.shares_dst = message.sharesDst === "" ? undefined : message.sharesDst; + return obj; + }, + fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { + return RedelegationEntry.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationEntry): RedelegationEntryAminoMsg { + return { + type: "cosmos-sdk/RedelegationEntry", + value: RedelegationEntry.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationEntryProtoMsg): RedelegationEntry { + return RedelegationEntry.decode(message.value); + }, + toProto(message: RedelegationEntry): Uint8Array { + return RedelegationEntry.encode(message).finish(); + }, + toProtoMsg(message: RedelegationEntry): RedelegationEntryProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + value: RedelegationEntry.encode(message).finish() + }; + } +}; +function createBaseRedelegation(): Redelegation { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + entries: [] + }; +} +export const Redelegation = { + typeUrl: "/cosmos.staking.v1beta1.Redelegation", + encode(message: Redelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + for (const v of message.entries) { + RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Redelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.entries.push(RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Redelegation { + const message = createBaseRedelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.entries = object.entries?.map(e => RedelegationEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RedelegationAmino): Redelegation { + const message = createBaseRedelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + message.entries = object.entries?.map(e => RedelegationEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: Redelegation): RedelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress; + obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress; + if (message.entries) { + obj.entries = message.entries.map(e => e ? RedelegationEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: RedelegationAminoMsg): Redelegation { + return Redelegation.fromAmino(object.value); + }, + toAminoMsg(message: Redelegation): RedelegationAminoMsg { + return { + type: "cosmos-sdk/Redelegation", + value: Redelegation.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationProtoMsg): Redelegation { + return Redelegation.decode(message.value); + }, + toProto(message: Redelegation): Uint8Array { + return Redelegation.encode(message).finish(); + }, + toProtoMsg(message: Redelegation): RedelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Redelegation", + value: Redelegation.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + unbondingTime: Duration.fromPartial({}), + maxValidators: 0, + maxEntries: 0, + historicalEntries: 0, + bondDenom: "", + minCommissionRate: "" + }; +} +export const Params = { + typeUrl: "/cosmos.staking.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbondingTime !== undefined) { + Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); + } + if (message.maxValidators !== 0) { + writer.uint32(16).uint32(message.maxValidators); + } + if (message.maxEntries !== 0) { + writer.uint32(24).uint32(message.maxEntries); + } + if (message.historicalEntries !== 0) { + writer.uint32(32).uint32(message.historicalEntries); + } + if (message.bondDenom !== "") { + writer.uint32(42).string(message.bondDenom); + } + if (message.minCommissionRate !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.minCommissionRate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingTime = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + case 6: + message.minCommissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.unbondingTime = object.unbondingTime !== undefined && object.unbondingTime !== null ? Duration.fromPartial(object.unbondingTime) : undefined; + message.maxValidators = object.maxValidators ?? 0; + message.maxEntries = object.maxEntries ?? 0; + message.historicalEntries = object.historicalEntries ?? 0; + message.bondDenom = object.bondDenom ?? ""; + message.minCommissionRate = object.minCommissionRate ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = Duration.fromAmino(object.unbonding_time); + } + if (object.max_validators !== undefined && object.max_validators !== null) { + message.maxValidators = object.max_validators; + } + if (object.max_entries !== undefined && object.max_entries !== null) { + message.maxEntries = object.max_entries; + } + if (object.historical_entries !== undefined && object.historical_entries !== null) { + message.historicalEntries = object.historical_entries; + } + if (object.bond_denom !== undefined && object.bond_denom !== null) { + message.bondDenom = object.bond_denom; + } + if (object.min_commission_rate !== undefined && object.min_commission_rate !== null) { + message.minCommissionRate = object.min_commission_rate; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : undefined; + obj.max_validators = message.maxValidators === 0 ? undefined : message.maxValidators; + obj.max_entries = message.maxEntries === 0 ? undefined : message.maxEntries; + obj.historical_entries = message.historicalEntries === 0 ? undefined : message.historicalEntries; + obj.bond_denom = message.bondDenom === "" ? undefined : message.bondDenom; + obj.min_commission_rate = message.minCommissionRate === "" ? undefined : message.minCommissionRate; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseDelegationResponse(): DelegationResponse { + return { + delegation: Delegation.fromPartial({}), + balance: Coin.fromPartial({}) + }; +} +export const DelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + encode(message: DelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegation !== undefined) { + Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelegationResponse { + const message = createBaseDelegationResponse(); + message.delegation = object.delegation !== undefined && object.delegation !== null ? Delegation.fromPartial(object.delegation) : undefined; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: DelegationResponseAmino): DelegationResponse { + const message = createBaseDelegationResponse(); + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromAmino(object.delegation); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: DelegationResponse): DelegationResponseAmino { + const obj: any = {}; + obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : undefined; + obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + return obj; + }, + fromAminoMsg(object: DelegationResponseAminoMsg): DelegationResponse { + return DelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: DelegationResponse): DelegationResponseAminoMsg { + return { + type: "cosmos-sdk/DelegationResponse", + value: DelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: DelegationResponseProtoMsg): DelegationResponse { + return DelegationResponse.decode(message.value); + }, + toProto(message: DelegationResponse): Uint8Array { + return DelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: DelegationResponse): DelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + value: DelegationResponse.encode(message).finish() + }; + } +}; +function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { + return { + redelegationEntry: RedelegationEntry.fromPartial({}), + balance: "" + }; +} +export const RedelegationEntryResponse = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + encode(message: RedelegationEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.redelegationEntry !== undefined) { + RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationEntryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse(); + message.redelegationEntry = object.redelegationEntry !== undefined && object.redelegationEntry !== null ? RedelegationEntry.fromPartial(object.redelegationEntry) : undefined; + message.balance = object.balance ?? ""; + return message; + }, + fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse(); + if (object.redelegation_entry !== undefined && object.redelegation_entry !== null) { + message.redelegationEntry = RedelegationEntry.fromAmino(object.redelegation_entry); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; + }, + toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { + const obj: any = {}; + obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : undefined; + obj.balance = message.balance === "" ? undefined : message.balance; + return obj; + }, + fromAminoMsg(object: RedelegationEntryResponseAminoMsg): RedelegationEntryResponse { + return RedelegationEntryResponse.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseAminoMsg { + return { + type: "cosmos-sdk/RedelegationEntryResponse", + value: RedelegationEntryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationEntryResponseProtoMsg): RedelegationEntryResponse { + return RedelegationEntryResponse.decode(message.value); + }, + toProto(message: RedelegationEntryResponse): Uint8Array { + return RedelegationEntryResponse.encode(message).finish(); + }, + toProtoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + value: RedelegationEntryResponse.encode(message).finish() + }; + } +}; +function createBaseRedelegationResponse(): RedelegationResponse { + return { + redelegation: Redelegation.fromPartial({}), + entries: [] + }; +} +export const RedelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + encode(message: RedelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.redelegation !== undefined) { + Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.entries) { + RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = Redelegation.decode(reader, reader.uint32()); + break; + case 2: + message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RedelegationResponse { + const message = createBaseRedelegationResponse(); + message.redelegation = object.redelegation !== undefined && object.redelegation !== null ? Redelegation.fromPartial(object.redelegation) : undefined; + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RedelegationResponseAmino): RedelegationResponse { + const message = createBaseRedelegationResponse(); + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromAmino(object.redelegation); + } + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: RedelegationResponse): RedelegationResponseAmino { + const obj: any = {}; + obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : undefined; + if (message.entries) { + obj.entries = message.entries.map(e => e ? RedelegationEntryResponse.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: RedelegationResponseAminoMsg): RedelegationResponse { + return RedelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: RedelegationResponse): RedelegationResponseAminoMsg { + return { + type: "cosmos-sdk/RedelegationResponse", + value: RedelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: RedelegationResponseProtoMsg): RedelegationResponse { + return RedelegationResponse.decode(message.value); + }, + toProto(message: RedelegationResponse): Uint8Array { + return RedelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: RedelegationResponse): RedelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + value: RedelegationResponse.encode(message).finish() + }; + } +}; +function createBasePool(): Pool { + return { + notBondedTokens: "", + bondedTokens: "" + }; +} +export const Pool = { + typeUrl: "/cosmos.staking.v1beta1.Pool", + encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.notBondedTokens !== "") { + writer.uint32(10).string(message.notBondedTokens); + } + if (message.bondedTokens !== "") { + writer.uint32(18).string(message.bondedTokens); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Pool { + const message = createBasePool(); + message.notBondedTokens = object.notBondedTokens ?? ""; + message.bondedTokens = object.bondedTokens ?? ""; + return message; + }, + fromAmino(object: PoolAmino): Pool { + const message = createBasePool(); + if (object.not_bonded_tokens !== undefined && object.not_bonded_tokens !== null) { + message.notBondedTokens = object.not_bonded_tokens; + } + if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { + message.bondedTokens = object.bonded_tokens; + } + return message; + }, + toAmino(message: Pool): PoolAmino { + const obj: any = {}; + obj.not_bonded_tokens = message.notBondedTokens ?? ""; + obj.bonded_tokens = message.bondedTokens ?? ""; + return obj; + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value); + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: "cosmos-sdk/Pool", + value: Pool.toAmino(message) + }; + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value); + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish(); + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.Pool", + value: Pool.encode(message).finish() + }; + } +}; +export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + default: + return data; + } +}; +export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino): Any => { + return encodePubkey(content); +}; +export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { + return decodePubkey(content); +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.amino.ts new file mode 100644 index 00000000..15942672 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.amino.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; +export const AminoConverter = { + "/cosmos.staking.v1beta1.MsgCreateValidator": { + aminoType: "cosmos-sdk/MsgCreateValidator", + toAmino: MsgCreateValidator.toAmino, + fromAmino: MsgCreateValidator.fromAmino + }, + "/cosmos.staking.v1beta1.MsgEditValidator": { + aminoType: "cosmos-sdk/MsgEditValidator", + toAmino: MsgEditValidator.toAmino, + fromAmino: MsgEditValidator.fromAmino + }, + "/cosmos.staking.v1beta1.MsgDelegate": { + aminoType: "cosmos-sdk/MsgDelegate", + toAmino: MsgDelegate.toAmino, + fromAmino: MsgDelegate.fromAmino + }, + "/cosmos.staking.v1beta1.MsgBeginRedelegate": { + aminoType: "cosmos-sdk/MsgBeginRedelegate", + toAmino: MsgBeginRedelegate.toAmino, + fromAmino: MsgBeginRedelegate.fromAmino + }, + "/cosmos.staking.v1beta1.MsgUndelegate": { + aminoType: "cosmos-sdk/MsgUndelegate", + toAmino: MsgUndelegate.toAmino, + fromAmino: MsgUndelegate.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.registry.ts new file mode 100644 index 00000000..a8e1a9d0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.registry.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.encode(value).finish() + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.encode(value).finish() + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.encode(value).finish() + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.encode(value).finish() + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.encode(value).finish() + }; + } + }, + withTypeUrl: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value + }; + } + }, + fromPartial: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.fromPartial(value) + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.fromPartial(value) + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.fromPartial(value) + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.fromPartial(value) + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..a5ed2913 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,62 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse } from "./tx"; +/** Msg defines the staking Msg service. */ +export interface Msg { + /** CreateValidator defines a method for creating a new validator. */ + createValidator(request: MsgCreateValidator): Promise; + /** EditValidator defines a method for editing an existing validator. */ + editValidator(request: MsgEditValidator): Promise; + /** + * Delegate defines a method for performing a delegation of coins + * from a delegator to a validator. + */ + delegate(request: MsgDelegate): Promise; + /** + * BeginRedelegate defines a method for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ + beginRedelegate(request: MsgBeginRedelegate): Promise; + /** + * Undelegate defines a method for performing an undelegation from a + * delegate and a validator. + */ + undelegate(request: MsgUndelegate): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createValidator = this.createValidator.bind(this); + this.editValidator = this.editValidator.bind(this); + this.delegate = this.delegate.bind(this); + this.beginRedelegate = this.beginRedelegate.bind(this); + this.undelegate = this.undelegate.bind(this); + } + createValidator(request: MsgCreateValidator): Promise { + const data = MsgCreateValidator.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data); + return promise.then(data => MsgCreateValidatorResponse.decode(new BinaryReader(data))); + } + editValidator(request: MsgEditValidator): Promise { + const data = MsgEditValidator.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data); + return promise.then(data => MsgEditValidatorResponse.decode(new BinaryReader(data))); + } + delegate(request: MsgDelegate): Promise { + const data = MsgDelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data); + return promise.then(data => MsgDelegateResponse.decode(new BinaryReader(data))); + } + beginRedelegate(request: MsgBeginRedelegate): Promise { + const data = MsgBeginRedelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data); + return promise.then(data => MsgBeginRedelegateResponse.decode(new BinaryReader(data))); + } + undelegate(request: MsgUndelegate): Promise { + const data = MsgUndelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); + return promise.then(data => MsgUndelegateResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.ts new file mode 100644 index 00000000..0eff8b54 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/staking/v1beta1/tx.ts @@ -0,0 +1,1139 @@ +//@ts-nocheck +import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType } from "./staking"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { Decimal } from "@cosmjs/math"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { Pubkey } from "@cosmjs/amino"; +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidator { + description: Description; + commission: CommissionRates; + minSelfDelegation: string; + delegatorAddress: string; + validatorAddress: string; + pubkey?: Any | undefined; + value: Coin; +} +export interface MsgCreateValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator"; + value: Uint8Array; +} +export type MsgCreateValidatorEncoded = Omit & { + pubkey?: AnyProtoMsg | undefined; +}; +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidatorAmino { + description?: DescriptionAmino; + commission?: CommissionRatesAmino; + min_self_delegation?: string; + delegator_address?: string; + validator_address?: string; + pubkey?: AnyAmino; + value?: CoinAmino; +} +export interface MsgCreateValidatorAminoMsg { + type: "cosmos-sdk/MsgCreateValidator"; + value: MsgCreateValidatorAmino; +} +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidatorSDKType { + description: DescriptionSDKType; + commission: CommissionRatesSDKType; + min_self_delegation: string; + delegator_address: string; + validator_address: string; + pubkey?: AnySDKType | undefined; + value: CoinSDKType; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponse {} +export interface MsgCreateValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse"; + value: Uint8Array; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponseAmino {} +export interface MsgCreateValidatorResponseAminoMsg { + type: "cosmos-sdk/MsgCreateValidatorResponse"; + value: MsgCreateValidatorResponseAmino; +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponseSDKType {} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidator { + description: Description; + validatorAddress: string; + /** + * We pass a reference to the new commission rate and min self delegation as + * it's not mandatory to update. If not updated, the deserialized rate will be + * zero with no way to distinguish if an update was intended. + * REF: #2373 + */ + commissionRate: string; + minSelfDelegation: string; +} +export interface MsgEditValidatorProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator"; + value: Uint8Array; +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidatorAmino { + description?: DescriptionAmino; + validator_address?: string; + /** + * We pass a reference to the new commission rate and min self delegation as + * it's not mandatory to update. If not updated, the deserialized rate will be + * zero with no way to distinguish if an update was intended. + * REF: #2373 + */ + commission_rate?: string; + min_self_delegation?: string; +} +export interface MsgEditValidatorAminoMsg { + type: "cosmos-sdk/MsgEditValidator"; + value: MsgEditValidatorAmino; +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidatorSDKType { + description: DescriptionSDKType; + validator_address: string; + commission_rate: string; + min_self_delegation: string; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponse {} +export interface MsgEditValidatorResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse"; + value: Uint8Array; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponseAmino {} +export interface MsgEditValidatorResponseAminoMsg { + type: "cosmos-sdk/MsgEditValidatorResponse"; + value: MsgEditValidatorResponseAmino; +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponseSDKType {} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegate { + delegatorAddress: string; + validatorAddress: string; + amount: Coin; +} +export interface MsgDelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate"; + value: Uint8Array; +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegateAmino { + delegator_address?: string; + validator_address?: string; + amount?: CoinAmino; +} +export interface MsgDelegateAminoMsg { + type: "cosmos-sdk/MsgDelegate"; + value: MsgDelegateAmino; +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegateSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponse {} +export interface MsgDelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse"; + value: Uint8Array; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponseAmino {} +export interface MsgDelegateResponseAminoMsg { + type: "cosmos-sdk/MsgDelegateResponse"; + value: MsgDelegateResponseAmino; +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponseSDKType {} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegate { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; + amount: Coin; +} +export interface MsgBeginRedelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate"; + value: Uint8Array; +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegateAmino { + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; + amount?: CoinAmino; +} +export interface MsgBeginRedelegateAminoMsg { + type: "cosmos-sdk/MsgBeginRedelegate"; + value: MsgBeginRedelegateAmino; +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegateSDKType { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; + amount: CoinSDKType; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponse { + completionTime: Date; +} +export interface MsgBeginRedelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse"; + value: Uint8Array; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponseAmino { + completion_time?: string; +} +export interface MsgBeginRedelegateResponseAminoMsg { + type: "cosmos-sdk/MsgBeginRedelegateResponse"; + value: MsgBeginRedelegateResponseAmino; +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponseSDKType { + completion_time: Date; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegate { + delegatorAddress: string; + validatorAddress: string; + amount: Coin; +} +export interface MsgUndelegateProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate"; + value: Uint8Array; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegateAmino { + delegator_address?: string; + validator_address?: string; + amount?: CoinAmino; +} +export interface MsgUndelegateAminoMsg { + type: "cosmos-sdk/MsgUndelegate"; + value: MsgUndelegateAmino; +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegateSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponse { + completionTime: Date; +} +export interface MsgUndelegateResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse"; + value: Uint8Array; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponseAmino { + completion_time?: string; +} +export interface MsgUndelegateResponseAminoMsg { + type: "cosmos-sdk/MsgUndelegateResponse"; + value: MsgUndelegateResponseAmino; +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponseSDKType { + completion_time: Date; +} +function createBaseMsgCreateValidator(): MsgCreateValidator { + return { + description: Description.fromPartial({}), + commission: CommissionRates.fromPartial({}), + minSelfDelegation: "", + delegatorAddress: "", + validatorAddress: "", + pubkey: undefined, + value: Coin.fromPartial({}) + }; +} +export const MsgCreateValidator = { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + encode(message: MsgCreateValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.commission !== undefined) { + CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(26).string(message.minSelfDelegation); + } + if (message.delegatorAddress !== "") { + writer.uint32(34).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(42).string(message.validatorAddress); + } + if (message.pubkey !== undefined) { + Any.encode(message.pubkey as Any, writer.uint32(50).fork()).ldelim(); + } + if (message.value !== undefined) { + Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any; + break; + case 7: + message.value = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateValidator { + const message = createBaseMsgCreateValidator(); + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.commission = object.commission !== undefined && object.commission !== null ? CommissionRates.fromPartial(object.commission) : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.pubkey = object.pubkey !== undefined && object.pubkey !== null ? Any.fromPartial(object.pubkey) : undefined; + message.value = object.value !== undefined && object.value !== null ? Coin.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { + const message = createBaseMsgCreateValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = encodePubkey(object.pubkey); + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromAmino(object.value); + } + return message; + }, + toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { + const obj: any = {}; + obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : undefined; + obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined; + obj.value = message.value ? Coin.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { + return MsgCreateValidator.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateValidator): MsgCreateValidatorAminoMsg { + return { + type: "cosmos-sdk/MsgCreateValidator", + value: MsgCreateValidator.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateValidatorProtoMsg): MsgCreateValidator { + return MsgCreateValidator.decode(message.value); + }, + toProto(message: MsgCreateValidator): Uint8Array { + return MsgCreateValidator.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateValidator): MsgCreateValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.encode(message).finish() + }; + } +}; +function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { + return {}; +} +export const MsgCreateValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + encode(_: MsgCreateValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse(); + return message; + }, + fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse(); + return message; + }, + toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateValidatorResponseAminoMsg): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateValidatorResponse): MsgCreateValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateValidatorResponse", + value: MsgCreateValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateValidatorResponseProtoMsg): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.decode(message.value); + }, + toProto(message: MsgCreateValidatorResponse): Uint8Array { + return MsgCreateValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateValidatorResponse): MsgCreateValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + value: MsgCreateValidatorResponse.encode(message).finish() + }; + } +}; +function createBaseMsgEditValidator(): MsgEditValidator { + return { + description: Description.fromPartial({}), + validatorAddress: "", + commissionRate: "", + minSelfDelegation: "" + }; +} +export const MsgEditValidator = { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + encode(message: MsgEditValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.commissionRate !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.commissionRate, 18).atomics); + } + if (message.minSelfDelegation !== "") { + writer.uint32(34).string(message.minSelfDelegation); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEditValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgEditValidator { + const message = createBaseMsgEditValidator(); + message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; + message.validatorAddress = object.validatorAddress ?? ""; + message.commissionRate = object.commissionRate ?? ""; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + return message; + }, + fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { + const message = createBaseMsgEditValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.commission_rate !== undefined && object.commission_rate !== null) { + message.commissionRate = object.commission_rate; + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; + }, + toAmino(message: MsgEditValidator): MsgEditValidatorAmino { + const obj: any = {}; + obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.commission_rate = message.commissionRate === "" ? undefined : message.commissionRate; + obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; + return obj; + }, + fromAminoMsg(object: MsgEditValidatorAminoMsg): MsgEditValidator { + return MsgEditValidator.fromAmino(object.value); + }, + toAminoMsg(message: MsgEditValidator): MsgEditValidatorAminoMsg { + return { + type: "cosmos-sdk/MsgEditValidator", + value: MsgEditValidator.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEditValidatorProtoMsg): MsgEditValidator { + return MsgEditValidator.decode(message.value); + }, + toProto(message: MsgEditValidator): Uint8Array { + return MsgEditValidator.encode(message).finish(); + }, + toProtoMsg(message: MsgEditValidator): MsgEditValidatorProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.encode(message).finish() + }; + } +}; +function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { + return {}; +} +export const MsgEditValidatorResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + encode(_: MsgEditValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEditValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse(); + return message; + }, + fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse(); + return message; + }, + toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgEditValidatorResponseAminoMsg): MsgEditValidatorResponse { + return MsgEditValidatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgEditValidatorResponse): MsgEditValidatorResponseAminoMsg { + return { + type: "cosmos-sdk/MsgEditValidatorResponse", + value: MsgEditValidatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEditValidatorResponseProtoMsg): MsgEditValidatorResponse { + return MsgEditValidatorResponse.decode(message.value); + }, + toProto(message: MsgEditValidatorResponse): Uint8Array { + return MsgEditValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEditValidatorResponse): MsgEditValidatorResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + value: MsgEditValidatorResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDelegate(): MsgDelegate { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgDelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + encode(message: MsgDelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDelegate { + const message = createBaseMsgDelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgDelegateAmino): MsgDelegate { + const message = createBaseMsgDelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgDelegate): MsgDelegateAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { + return MsgDelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgDelegate): MsgDelegateAminoMsg { + return { + type: "cosmos-sdk/MsgDelegate", + value: MsgDelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDelegateProtoMsg): MsgDelegate { + return MsgDelegate.decode(message.value); + }, + toProto(message: MsgDelegate): Uint8Array { + return MsgDelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegate): MsgDelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.encode(message).finish() + }; + } +}; +function createBaseMsgDelegateResponse(): MsgDelegateResponse { + return {}; +} +export const MsgDelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + encode(_: MsgDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse(); + return message; + }, + fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse(); + return message; + }, + toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDelegateResponseAminoMsg): MsgDelegateResponse { + return MsgDelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDelegateResponse): MsgDelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgDelegateResponse", + value: MsgDelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDelegateResponseProtoMsg): MsgDelegateResponse { + return MsgDelegateResponse.decode(message.value); + }, + toProto(message: MsgDelegateResponse): Uint8Array { + return MsgDelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegateResponse): MsgDelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + value: MsgDelegateResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { + return { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgBeginRedelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + encode(message: MsgBeginRedelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginRedelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgBeginRedelegate): MsgBeginRedelegateAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress; + obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateAminoMsg { + return { + type: "cosmos-sdk/MsgBeginRedelegate", + value: MsgBeginRedelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBeginRedelegateProtoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.decode(message.value); + }, + toProto(message: MsgBeginRedelegate): Uint8Array { + return MsgBeginRedelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.encode(message).finish() + }; + } +}; +function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { + return { + completionTime: new Date() + }; +} +export const MsgBeginRedelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + encode(message: MsgBeginRedelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBeginRedelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse(); + message.completionTime = object.completionTime ?? undefined; + return message; + }, + fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; + }, + toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { + const obj: any = {}; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgBeginRedelegateResponse", + value: MsgBeginRedelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBeginRedelegateResponseProtoMsg): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.decode(message.value); + }, + toProto(message: MsgBeginRedelegateResponse): Uint8Array { + return MsgBeginRedelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + value: MsgBeginRedelegateResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUndelegate(): MsgUndelegate { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgUndelegate = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + encode(message: MsgUndelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUndelegate { + const message = createBaseMsgUndelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgUndelegateAmino): MsgUndelegate { + const message = createBaseMsgUndelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgUndelegate): MsgUndelegateAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { + return MsgUndelegate.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegate): MsgUndelegateAminoMsg { + return { + type: "cosmos-sdk/MsgUndelegate", + value: MsgUndelegate.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateProtoMsg): MsgUndelegate { + return MsgUndelegate.decode(message.value); + }, + toProto(message: MsgUndelegate): Uint8Array { + return MsgUndelegate.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegate): MsgUndelegateProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.encode(message).finish() + }; + } +}; +function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { + return { + completionTime: new Date() + }; +} +export const MsgUndelegateResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + encode(message: MsgUndelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUndelegateResponse { + const message = createBaseMsgUndelegateResponse(); + message.completionTime = object.completionTime ?? undefined; + return message; + }, + fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { + const message = createBaseMsgUndelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; + }, + toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { + const obj: any = {}; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUndelegateResponse", + value: MsgUndelegateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateResponseProtoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.decode(message.value); + }, + toProto(message: MsgUndelegateResponse): Uint8Array { + return MsgUndelegateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + value: MsgUndelegateResponse.encode(message).finish() + }; + } +}; +export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + default: + return data; + } +}; +export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino): Any => { + return encodePubkey(content); +}; +export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { + return decodePubkey(content); +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/tx/signing/v1beta1/signing.ts b/dydxjs/packages/dydxjs/src/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 00000000..b98573ab --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,655 @@ +//@ts-nocheck +import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../../crypto/multisig/v1beta1/multisig"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * SignMode represents a signing mode with its own security guarantees. + * + * This enum should be considered a registry of all known sign modes + * in the Cosmos ecosystem. Apps are not expected to support all known + * sign modes. Apps that would like to support custom sign modes are + * encouraged to open a small PR against this file to add a new case + * to this SignMode enum describing their sign mode so that different + * apps have a consistent version of this enum. + */ +export enum SignMode { + /** + * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + * rejected. + */ + SIGN_MODE_UNSPECIFIED = 0, + /** + * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + * verified with raw bytes from Tx. + */ + SIGN_MODE_DIRECT = 1, + /** + * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some + * human-readable textual representation on top of the binary representation + * from SIGN_MODE_DIRECT. It is currently not supported. + */ + SIGN_MODE_TEXTUAL = 2, + /** + * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + * require signers signing over other signers' `signer_info`. It also allows + * for adding Tips in transactions. + * + * Since: cosmos-sdk 0.46 + */ + SIGN_MODE_DIRECT_AUX = 3, + /** + * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + * Amino JSON and will be removed in the future. + */ + SIGN_MODE_LEGACY_AMINO_JSON = 127, + UNRECOGNIZED = -1, +} +export const SignModeSDKType = SignMode; +export const SignModeAmino = SignMode; +export function signModeFromJSON(object: any): SignMode { + switch (object) { + case 0: + case "SIGN_MODE_UNSPECIFIED": + return SignMode.SIGN_MODE_UNSPECIFIED; + case 1: + case "SIGN_MODE_DIRECT": + return SignMode.SIGN_MODE_DIRECT; + case 2: + case "SIGN_MODE_TEXTUAL": + return SignMode.SIGN_MODE_TEXTUAL; + case 3: + case "SIGN_MODE_DIRECT_AUX": + return SignMode.SIGN_MODE_DIRECT_AUX; + case 127: + case "SIGN_MODE_LEGACY_AMINO_JSON": + return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; + case -1: + case "UNRECOGNIZED": + default: + return SignMode.UNRECOGNIZED; + } +} +export function signModeToJSON(object: SignMode): string { + switch (object) { + case SignMode.SIGN_MODE_UNSPECIFIED: + return "SIGN_MODE_UNSPECIFIED"; + case SignMode.SIGN_MODE_DIRECT: + return "SIGN_MODE_DIRECT"; + case SignMode.SIGN_MODE_TEXTUAL: + return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_DIRECT_AUX: + return "SIGN_MODE_DIRECT_AUX"; + case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: + return "SIGN_MODE_LEGACY_AMINO_JSON"; + case SignMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptors { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptor[]; +} +export interface SignatureDescriptorsProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors"; + value: Uint8Array; +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptorsAmino { + /** signatures are the signature descriptors */ + signatures?: SignatureDescriptorAmino[]; +} +export interface SignatureDescriptorsAminoMsg { + type: "cosmos-sdk/SignatureDescriptors"; + value: SignatureDescriptorsAmino; +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptorsSDKType { + signatures: SignatureDescriptorSDKType[]; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** public_key is the public key of the signer */ + publicKey?: Any; + data?: SignatureDescriptor_Data; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: bigint; +} +export interface SignatureDescriptorProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor"; + value: Uint8Array; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptorAmino { + /** public_key is the public key of the signer */ + public_key?: AnyAmino; + data?: SignatureDescriptor_DataAmino; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence?: string; +} +export interface SignatureDescriptorAminoMsg { + type: "cosmos-sdk/SignatureDescriptor"; + value: SignatureDescriptorAmino; +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptorSDKType { + public_key?: AnySDKType; + data?: SignatureDescriptor_DataSDKType; + sequence: bigint; +} +/** Data represents signature data */ +export interface SignatureDescriptor_Data { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_Single; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_Multi; +} +export interface SignatureDescriptor_DataProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Data"; + value: Uint8Array; +} +/** Data represents signature data */ +export interface SignatureDescriptor_DataAmino { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_SingleAmino; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_MultiAmino; +} +export interface SignatureDescriptor_DataAminoMsg { + type: "cosmos-sdk/Data"; + value: SignatureDescriptor_DataAmino; +} +/** Data represents signature data */ +export interface SignatureDescriptor_DataSDKType { + single?: SignatureDescriptor_Data_SingleSDKType; + multi?: SignatureDescriptor_Data_MultiSDKType; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** signature is the raw signature bytes */ + signature: Uint8Array; +} +export interface SignatureDescriptor_Data_SingleProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Single"; + value: Uint8Array; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_SingleAmino { + /** mode is the signing mode of the single signer */ + mode?: SignMode; + /** signature is the raw signature bytes */ + signature?: string; +} +export interface SignatureDescriptor_Data_SingleAminoMsg { + type: "cosmos-sdk/Single"; + value: SignatureDescriptor_Data_SingleAmino; +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_SingleSDKType { + mode: SignMode; + signature: Uint8Array; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_Data[]; +} +export interface SignatureDescriptor_Data_MultiProtoMsg { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi"; + value: Uint8Array; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_MultiAmino { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArrayAmino; + /** signatures is the signatures of the multi-signature */ + signatures?: SignatureDescriptor_DataAmino[]; +} +export interface SignatureDescriptor_Data_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: SignatureDescriptor_Data_MultiAmino; +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_MultiSDKType { + bitarray?: CompactBitArraySDKType; + signatures: SignatureDescriptor_DataSDKType[]; +} +function createBaseSignatureDescriptors(): SignatureDescriptors { + return { + signatures: [] + }; +} +export const SignatureDescriptors = { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + encode(message: SignatureDescriptors, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signatures) { + SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptors { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptors(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureDescriptors { + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromAmino(e)) || []; + return message; + }, + toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: SignatureDescriptorsAminoMsg): SignatureDescriptors { + return SignatureDescriptors.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptors): SignatureDescriptorsAminoMsg { + return { + type: "cosmos-sdk/SignatureDescriptors", + value: SignatureDescriptors.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptorsProtoMsg): SignatureDescriptors { + return SignatureDescriptors.decode(message.value); + }, + toProto(message: SignatureDescriptors): Uint8Array { + return SignatureDescriptors.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptors): SignatureDescriptorsProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + value: SignatureDescriptors.encode(message).finish() + }; + } +}; +function createBaseSignatureDescriptor(): SignatureDescriptor { + return { + publicKey: undefined, + data: undefined, + sequence: BigInt(0) + }; +} +export const SignatureDescriptor = { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + encode(message: SignatureDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureDescriptor { + const message = createBaseSignatureDescriptor(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.data = object.data !== undefined && object.data !== null ? SignatureDescriptor_Data.fromPartial(object.data) : undefined; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { + const message = createBaseSignatureDescriptor(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromAmino(object.data); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: SignatureDescriptor): SignatureDescriptorAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.data = message.data ? SignatureDescriptor_Data.toAmino(message.data) : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptorAminoMsg): SignatureDescriptor { + return SignatureDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor): SignatureDescriptorAminoMsg { + return { + type: "cosmos-sdk/SignatureDescriptor", + value: SignatureDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptorProtoMsg): SignatureDescriptor { + return SignatureDescriptor.decode(message.value); + }, + toProto(message: SignatureDescriptor): Uint8Array { + return SignatureDescriptor.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor): SignatureDescriptorProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + value: SignatureDescriptor.encode(message).finish() + }; + } +}; +function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { + return { + single: undefined, + multi: undefined + }; +} +export const SignatureDescriptor_Data = { + typeUrl: "/cosmos.tx.signing.v1beta1.Data", + encode(message: SignatureDescriptor_Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.single !== undefined) { + SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data(); + message.single = object.single !== undefined && object.single !== null ? SignatureDescriptor_Data_Single.fromPartial(object.single) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) : undefined; + return message; + }, + fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data(); + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromAmino(object.multi); + } + return message; + }, + toAmino(message: SignatureDescriptor_Data): SignatureDescriptor_DataAmino { + const obj: any = {}; + obj.single = message.single ? SignatureDescriptor_Data_Single.toAmino(message.single) : undefined; + obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toAmino(message.multi) : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_DataAminoMsg): SignatureDescriptor_Data { + return SignatureDescriptor_Data.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data): SignatureDescriptor_DataAminoMsg { + return { + type: "cosmos-sdk/Data", + value: SignatureDescriptor_Data.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_DataProtoMsg): SignatureDescriptor_Data { + return SignatureDescriptor_Data.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data): Uint8Array { + return SignatureDescriptor_Data.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data): SignatureDescriptor_DataProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Data", + value: SignatureDescriptor_Data.encode(message).finish() + }; + } +}; +function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_Single { + return { + mode: 0, + signature: new Uint8Array() + }; +} +export const SignatureDescriptor_Data_Single = { + typeUrl: "/cosmos.tx.signing.v1beta1.Single", + encode(message: SignatureDescriptor_Data_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.signature.length !== 0) { + writer.uint32(18).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data_Single(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single(); + message.mode = object.mode ?? 0; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAmino { + const obj: any = {}; + obj.mode = message.mode === 0 ? undefined : message.mode; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_Data_SingleAminoMsg): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAminoMsg { + return { + type: "cosmos-sdk/Single", + value: SignatureDescriptor_Data_Single.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_Data_SingleProtoMsg): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data_Single): Uint8Array { + return SignatureDescriptor_Data_Single.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Single", + value: SignatureDescriptor_Data_Single.encode(message).finish() + }; + } +}; +function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { + return { + bitarray: undefined, + signatures: [] + }; +} +export const SignatureDescriptor_Data_Multi = { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + encode(message: SignatureDescriptor_Data_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signatures) { + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureDescriptor_Data_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureDescriptor_Data_Multi { + const message = createBaseSignatureDescriptor_Data_Multi(); + message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SignatureDescriptor_Data_MultiAmino): SignatureDescriptor_Data_Multi { + const message = createBaseSignatureDescriptor_Data_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromAmino(e)) || []; + return message; + }, + toAmino(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAmino { + const obj: any = {}; + obj.bitarray = message.bitarray ? CompactBitArray.toAmino(message.bitarray) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor_Data.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: SignatureDescriptor_Data_MultiAminoMsg): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.fromAmino(object.value); + }, + toAminoMsg(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: SignatureDescriptor_Data_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureDescriptor_Data_MultiProtoMsg): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.decode(message.value); + }, + toProto(message: SignatureDescriptor_Data_Multi): Uint8Array { + return SignatureDescriptor_Data_Multi.encode(message).finish(); + }, + toProtoMsg(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiProtoMsg { + return { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + value: SignatureDescriptor_Data_Multi.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/service.rpc.Service.ts b/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/service.rpc.Service.ts new file mode 100644 index 00000000..f52a7913 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/service.rpc.Service.ts @@ -0,0 +1,79 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse } from "./service"; +/** Service defines a gRPC service for interacting with transactions. */ +export interface Service { + /** Simulate simulates executing a transaction for estimating gas usage. */ + simulate(request: SimulateRequest): Promise; + /** GetTx fetches a tx by hash. */ + getTx(request: GetTxRequest): Promise; + /** BroadcastTx broadcast transaction. */ + broadcastTx(request: BroadcastTxRequest): Promise; + /** GetTxsEvent fetches txs by event. */ + getTxsEvent(request: GetTxsEventRequest): Promise; + /** + * GetBlockWithTxs fetches a block with decoded txs. + * + * Since: cosmos-sdk 0.45.2 + */ + getBlockWithTxs(request: GetBlockWithTxsRequest): Promise; +} +export class ServiceClientImpl implements Service { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.simulate = this.simulate.bind(this); + this.getTx = this.getTx.bind(this); + this.broadcastTx = this.broadcastTx.bind(this); + this.getTxsEvent = this.getTxsEvent.bind(this); + this.getBlockWithTxs = this.getBlockWithTxs.bind(this); + } + simulate(request: SimulateRequest): Promise { + const data = SimulateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "Simulate", data); + return promise.then(data => SimulateResponse.decode(new BinaryReader(data))); + } + getTx(request: GetTxRequest): Promise { + const data = GetTxRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTx", data); + return promise.then(data => GetTxResponse.decode(new BinaryReader(data))); + } + broadcastTx(request: BroadcastTxRequest): Promise { + const data = BroadcastTxRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "BroadcastTx", data); + return promise.then(data => BroadcastTxResponse.decode(new BinaryReader(data))); + } + getTxsEvent(request: GetTxsEventRequest): Promise { + const data = GetTxsEventRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); + return promise.then(data => GetTxsEventResponse.decode(new BinaryReader(data))); + } + getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { + const data = GetBlockWithTxsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetBlockWithTxs", data); + return promise.then(data => GetBlockWithTxsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new ServiceClientImpl(rpc); + return { + simulate(request: SimulateRequest): Promise { + return queryService.simulate(request); + }, + getTx(request: GetTxRequest): Promise { + return queryService.getTx(request); + }, + broadcastTx(request: BroadcastTxRequest): Promise { + return queryService.broadcastTx(request); + }, + getTxsEvent(request: GetTxsEventRequest): Promise { + return queryService.getTxsEvent(request); + }, + getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { + return queryService.getBlockWithTxs(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/service.ts b/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/service.ts new file mode 100644 index 00000000..b8647070 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/service.ts @@ -0,0 +1,1329 @@ +//@ts-nocheck +import { Tx, TxAmino, TxSDKType } from "./tx"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { TxResponse, TxResponseAmino, TxResponseSDKType, GasInfo, GasInfoAmino, GasInfoSDKType, Result, ResultAmino, ResultSDKType } from "../../base/abci/v1beta1/abci"; +import { BlockID, BlockIDAmino, BlockIDSDKType } from "../../../tendermint/types/types"; +import { Block, BlockAmino, BlockSDKType } from "../../../tendermint/types/block"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** OrderBy defines the sorting order */ +export enum OrderBy { + /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ + ORDER_BY_UNSPECIFIED = 0, + /** ORDER_BY_ASC - ORDER_BY_ASC defines ascending order */ + ORDER_BY_ASC = 1, + /** ORDER_BY_DESC - ORDER_BY_DESC defines descending order */ + ORDER_BY_DESC = 2, + UNRECOGNIZED = -1, +} +export const OrderBySDKType = OrderBy; +export const OrderByAmino = OrderBy; +export function orderByFromJSON(object: any): OrderBy { + switch (object) { + case 0: + case "ORDER_BY_UNSPECIFIED": + return OrderBy.ORDER_BY_UNSPECIFIED; + case 1: + case "ORDER_BY_ASC": + return OrderBy.ORDER_BY_ASC; + case 2: + case "ORDER_BY_DESC": + return OrderBy.ORDER_BY_DESC; + case -1: + case "UNRECOGNIZED": + default: + return OrderBy.UNRECOGNIZED; + } +} +export function orderByToJSON(object: OrderBy): string { + switch (object) { + case OrderBy.ORDER_BY_UNSPECIFIED: + return "ORDER_BY_UNSPECIFIED"; + case OrderBy.ORDER_BY_ASC: + return "ORDER_BY_ASC"; + case OrderBy.ORDER_BY_DESC: + return "ORDER_BY_DESC"; + case OrderBy.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. */ +export enum BroadcastMode { + /** BROADCAST_MODE_UNSPECIFIED - zero-value for mode ordering */ + BROADCAST_MODE_UNSPECIFIED = 0, + /** + * BROADCAST_MODE_BLOCK - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + * the tx to be committed in a block. + */ + BROADCAST_MODE_BLOCK = 1, + /** + * BROADCAST_MODE_SYNC - BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + * a CheckTx execution response only. + */ + BROADCAST_MODE_SYNC = 2, + /** + * BROADCAST_MODE_ASYNC - BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + * immediately. + */ + BROADCAST_MODE_ASYNC = 3, + UNRECOGNIZED = -1, +} +export const BroadcastModeSDKType = BroadcastMode; +export const BroadcastModeAmino = BroadcastMode; +export function broadcastModeFromJSON(object: any): BroadcastMode { + switch (object) { + case 0: + case "BROADCAST_MODE_UNSPECIFIED": + return BroadcastMode.BROADCAST_MODE_UNSPECIFIED; + case 1: + case "BROADCAST_MODE_BLOCK": + return BroadcastMode.BROADCAST_MODE_BLOCK; + case 2: + case "BROADCAST_MODE_SYNC": + return BroadcastMode.BROADCAST_MODE_SYNC; + case 3: + case "BROADCAST_MODE_ASYNC": + return BroadcastMode.BROADCAST_MODE_ASYNC; + case -1: + case "UNRECOGNIZED": + default: + return BroadcastMode.UNRECOGNIZED; + } +} +export function broadcastModeToJSON(object: BroadcastMode): string { + switch (object) { + case BroadcastMode.BROADCAST_MODE_UNSPECIFIED: + return "BROADCAST_MODE_UNSPECIFIED"; + case BroadcastMode.BROADCAST_MODE_BLOCK: + return "BROADCAST_MODE_BLOCK"; + case BroadcastMode.BROADCAST_MODE_SYNC: + return "BROADCAST_MODE_SYNC"; + case BroadcastMode.BROADCAST_MODE_ASYNC: + return "BROADCAST_MODE_ASYNC"; + case BroadcastMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequest { + /** events is the list of transaction event type. */ + events: string[]; + /** pagination defines a pagination for the request. */ + pagination?: PageRequest; + orderBy: OrderBy; +} +export interface GetTxsEventRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest"; + value: Uint8Array; +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequestAmino { + /** events is the list of transaction event type. */ + events?: string[]; + /** pagination defines a pagination for the request. */ + pagination?: PageRequestAmino; + order_by?: OrderBy; +} +export interface GetTxsEventRequestAminoMsg { + type: "cosmos-sdk/GetTxsEventRequest"; + value: GetTxsEventRequestAmino; +} +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequestSDKType { + events: string[]; + pagination?: PageRequestSDKType; + order_by: OrderBy; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponse { + /** txs is the list of queried transactions. */ + txs: Tx[]; + /** tx_responses is the list of queried TxResponses. */ + txResponses: TxResponse[]; + /** pagination defines a pagination for the response. */ + pagination?: PageResponse; +} +export interface GetTxsEventResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse"; + value: Uint8Array; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponseAmino { + /** txs is the list of queried transactions. */ + txs?: TxAmino[]; + /** tx_responses is the list of queried TxResponses. */ + tx_responses?: TxResponseAmino[]; + /** pagination defines a pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface GetTxsEventResponseAminoMsg { + type: "cosmos-sdk/GetTxsEventResponse"; + value: GetTxsEventResponseAmino; +} +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponseSDKType { + txs: TxSDKType[]; + tx_responses: TxResponseSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; + mode: BroadcastMode; +} +export interface BroadcastTxRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest"; + value: Uint8Array; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequestAmino { + /** tx_bytes is the raw transaction. */ + tx_bytes?: string; + mode?: BroadcastMode; +} +export interface BroadcastTxRequestAminoMsg { + type: "cosmos-sdk/BroadcastTxRequest"; + value: BroadcastTxRequestAmino; +} +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequestSDKType { + tx_bytes: Uint8Array; + mode: BroadcastMode; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponse { + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} +export interface BroadcastTxResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; + value: Uint8Array; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponseAmino { + /** tx_response is the queried TxResponses. */ + tx_response?: TxResponseAmino; +} +export interface BroadcastTxResponseAminoMsg { + type: "cosmos-sdk/BroadcastTxResponse"; + value: BroadcastTxResponseAmino; +} +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponseSDKType { + tx_response?: TxResponseSDKType; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequest { + /** + * tx is the transaction to simulate. + * Deprecated. Send raw tx bytes instead. + */ + /** @deprecated */ + tx?: Tx; + /** + * tx_bytes is the raw transaction. + * + * Since: cosmos-sdk 0.43 + */ + txBytes: Uint8Array; +} +export interface SimulateRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest"; + value: Uint8Array; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequestAmino { + /** + * tx is the transaction to simulate. + * Deprecated. Send raw tx bytes instead. + */ + /** @deprecated */ + tx?: TxAmino; + /** + * tx_bytes is the raw transaction. + * + * Since: cosmos-sdk 0.43 + */ + tx_bytes?: string; +} +export interface SimulateRequestAminoMsg { + type: "cosmos-sdk/SimulateRequest"; + value: SimulateRequestAmino; +} +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequestSDKType { + /** @deprecated */ + tx?: TxSDKType; + tx_bytes: Uint8Array; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponse { + /** gas_info is the information about gas used in the simulation. */ + gasInfo?: GasInfo; + /** result is the result of the simulation. */ + result?: Result; +} +export interface SimulateResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; + value: Uint8Array; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponseAmino { + /** gas_info is the information about gas used in the simulation. */ + gas_info?: GasInfoAmino; + /** result is the result of the simulation. */ + result?: ResultAmino; +} +export interface SimulateResponseAminoMsg { + type: "cosmos-sdk/SimulateResponse"; + value: SimulateResponseAmino; +} +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponseSDKType { + gas_info?: GasInfoSDKType; + result?: ResultSDKType; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequest { + /** hash is the tx hash to query, encoded as a hex string. */ + hash: string; +} +export interface GetTxRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest"; + value: Uint8Array; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequestAmino { + /** hash is the tx hash to query, encoded as a hex string. */ + hash?: string; +} +export interface GetTxRequestAminoMsg { + type: "cosmos-sdk/GetTxRequest"; + value: GetTxRequestAmino; +} +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequestSDKType { + hash: string; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponse { + /** tx is the queried transaction. */ + tx?: Tx; + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} +export interface GetTxResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; + value: Uint8Array; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponseAmino { + /** tx is the queried transaction. */ + tx?: TxAmino; + /** tx_response is the queried TxResponses. */ + tx_response?: TxResponseAmino; +} +export interface GetTxResponseAminoMsg { + type: "cosmos-sdk/GetTxResponse"; + value: GetTxResponseAmino; +} +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponseSDKType { + tx?: TxSDKType; + tx_response?: TxResponseSDKType; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequest { + /** height is the height of the block to query. */ + height: bigint; + /** pagination defines a pagination for the request. */ + pagination?: PageRequest; +} +export interface GetBlockWithTxsRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; + value: Uint8Array; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestAmino { + /** height is the height of the block to query. */ + height?: string; + /** pagination defines a pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface GetBlockWithTxsRequestAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsRequest"; + value: GetBlockWithTxsRequestAmino; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestSDKType { + height: bigint; + pagination?: PageRequestSDKType; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponse { + /** txs are the transactions in the block. */ + txs: Tx[]; + blockId?: BlockID; + block?: Block; + /** pagination defines a pagination for the response. */ + pagination?: PageResponse; +} +export interface GetBlockWithTxsResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; + value: Uint8Array; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseAmino { + /** txs are the transactions in the block. */ + txs?: TxAmino[]; + block_id?: BlockIDAmino; + block?: BlockAmino; + /** pagination defines a pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface GetBlockWithTxsResponseAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsResponse"; + value: GetBlockWithTxsResponseAmino; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseSDKType { + txs: TxSDKType[]; + block_id?: BlockIDSDKType; + block?: BlockSDKType; + pagination?: PageResponseSDKType; +} +function createBaseGetTxsEventRequest(): GetTxsEventRequest { + return { + events: [], + pagination: undefined, + orderBy: 0 + }; +} +export const GetTxsEventRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + encode(message: GetTxsEventRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.events) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.orderBy !== 0) { + writer.uint32(24).int32(message.orderBy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxsEventRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(reader.string()); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + case 3: + message.orderBy = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetTxsEventRequest { + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + message.orderBy = object.orderBy ?? 0; + return message; + }, + fromAmino(object: GetTxsEventRequestAmino): GetTxsEventRequest { + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.order_by !== undefined && object.order_by !== null) { + message.orderBy = object.order_by; + } + return message; + }, + toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e); + } else { + obj.events = message.events; + } + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + obj.order_by = message.orderBy === 0 ? undefined : message.orderBy; + return obj; + }, + fromAminoMsg(object: GetTxsEventRequestAminoMsg): GetTxsEventRequest { + return GetTxsEventRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetTxsEventRequest): GetTxsEventRequestAminoMsg { + return { + type: "cosmos-sdk/GetTxsEventRequest", + value: GetTxsEventRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxsEventRequestProtoMsg): GetTxsEventRequest { + return GetTxsEventRequest.decode(message.value); + }, + toProto(message: GetTxsEventRequest): Uint8Array { + return GetTxsEventRequest.encode(message).finish(); + }, + toProtoMsg(message: GetTxsEventRequest): GetTxsEventRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + value: GetTxsEventRequest.encode(message).finish() + }; + } +}; +function createBaseGetTxsEventResponse(): GetTxsEventResponse { + return { + txs: [], + txResponses: [], + pagination: undefined + }; +} +export const GetTxsEventResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + encode(message: GetTxsEventResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.txResponses) { + TxResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxsEventResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.txResponses.push(TxResponse.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetTxsEventResponse { + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map(e => Tx.fromPartial(e)) || []; + message.txResponses = object.txResponses?.map(e => TxResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetTxsEventResponseAmino): GetTxsEventResponse { + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + message.txResponses = object.tx_responses?.map(e => TxResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetTxsEventResponse): GetTxsEventResponseAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + if (message.txResponses) { + obj.tx_responses = message.txResponses.map(e => e ? TxResponse.toAmino(e) : undefined); + } else { + obj.tx_responses = message.txResponses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetTxsEventResponseAminoMsg): GetTxsEventResponse { + return GetTxsEventResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetTxsEventResponse): GetTxsEventResponseAminoMsg { + return { + type: "cosmos-sdk/GetTxsEventResponse", + value: GetTxsEventResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxsEventResponseProtoMsg): GetTxsEventResponse { + return GetTxsEventResponse.decode(message.value); + }, + toProto(message: GetTxsEventResponse): Uint8Array { + return GetTxsEventResponse.encode(message).finish(); + }, + toProtoMsg(message: GetTxsEventResponse): GetTxsEventResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + value: GetTxsEventResponse.encode(message).finish() + }; + } +}; +function createBaseBroadcastTxRequest(): BroadcastTxRequest { + return { + txBytes: new Uint8Array(), + mode: 0 + }; +} +export const BroadcastTxRequest = { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + encode(message: BroadcastTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + if (message.mode !== 0) { + writer.uint32(16).int32(message.mode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBroadcastTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + case 2: + message.mode = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + message.mode = object.mode ?? 0; + return message; + }, + fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; + }, + toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + obj.mode = message.mode === 0 ? undefined : message.mode; + return obj; + }, + fromAminoMsg(object: BroadcastTxRequestAminoMsg): BroadcastTxRequest { + return BroadcastTxRequest.fromAmino(object.value); + }, + toAminoMsg(message: BroadcastTxRequest): BroadcastTxRequestAminoMsg { + return { + type: "cosmos-sdk/BroadcastTxRequest", + value: BroadcastTxRequest.toAmino(message) + }; + }, + fromProtoMsg(message: BroadcastTxRequestProtoMsg): BroadcastTxRequest { + return BroadcastTxRequest.decode(message.value); + }, + toProto(message: BroadcastTxRequest): Uint8Array { + return BroadcastTxRequest.encode(message).finish(); + }, + toProtoMsg(message: BroadcastTxRequest): BroadcastTxRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + value: BroadcastTxRequest.encode(message).finish() + }; + } +}; +function createBaseBroadcastTxResponse(): BroadcastTxResponse { + return { + txResponse: undefined + }; +} +export const BroadcastTxResponse = { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + encode(message: BroadcastTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBroadcastTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; + return message; + }, + fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; + }, + toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { + const obj: any = {}; + obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; + return obj; + }, + fromAminoMsg(object: BroadcastTxResponseAminoMsg): BroadcastTxResponse { + return BroadcastTxResponse.fromAmino(object.value); + }, + toAminoMsg(message: BroadcastTxResponse): BroadcastTxResponseAminoMsg { + return { + type: "cosmos-sdk/BroadcastTxResponse", + value: BroadcastTxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: BroadcastTxResponseProtoMsg): BroadcastTxResponse { + return BroadcastTxResponse.decode(message.value); + }, + toProto(message: BroadcastTxResponse): Uint8Array { + return BroadcastTxResponse.encode(message).finish(); + }, + toProtoMsg(message: BroadcastTxResponse): BroadcastTxResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + value: BroadcastTxResponse.encode(message).finish() + }; + } +}; +function createBaseSimulateRequest(): SimulateRequest { + return { + tx: undefined, + txBytes: new Uint8Array() + }; +} +export const SimulateRequest = { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + encode(message: SimulateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txBytes.length !== 0) { + writer.uint32(18).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SimulateRequest { + const message = createBaseSimulateRequest(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: SimulateRequestAmino): SimulateRequest { + const message = createBaseSimulateRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: SimulateRequest): SimulateRequestAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: SimulateRequestAminoMsg): SimulateRequest { + return SimulateRequest.fromAmino(object.value); + }, + toAminoMsg(message: SimulateRequest): SimulateRequestAminoMsg { + return { + type: "cosmos-sdk/SimulateRequest", + value: SimulateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: SimulateRequestProtoMsg): SimulateRequest { + return SimulateRequest.decode(message.value); + }, + toProto(message: SimulateRequest): Uint8Array { + return SimulateRequest.encode(message).finish(); + }, + toProtoMsg(message: SimulateRequest): SimulateRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + value: SimulateRequest.encode(message).finish() + }; + } +}; +function createBaseSimulateResponse(): SimulateResponse { + return { + gasInfo: undefined, + result: undefined + }; +} +export const SimulateResponse = { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + encode(message: SimulateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimulateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimulateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SimulateResponse { + const message = createBaseSimulateResponse(); + message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; + message.result = object.result !== undefined && object.result !== null ? Result.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: SimulateResponseAmino): SimulateResponse { + const message = createBaseSimulateResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; + }, + toAmino(message: SimulateResponse): SimulateResponseAmino { + const obj: any = {}; + obj.gas_info = message.gasInfo ? GasInfo.toAmino(message.gasInfo) : undefined; + obj.result = message.result ? Result.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: SimulateResponseAminoMsg): SimulateResponse { + return SimulateResponse.fromAmino(object.value); + }, + toAminoMsg(message: SimulateResponse): SimulateResponseAminoMsg { + return { + type: "cosmos-sdk/SimulateResponse", + value: SimulateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SimulateResponseProtoMsg): SimulateResponse { + return SimulateResponse.decode(message.value); + }, + toProto(message: SimulateResponse): Uint8Array { + return SimulateResponse.encode(message).finish(); + }, + toProtoMsg(message: SimulateResponse): SimulateResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + value: SimulateResponse.encode(message).finish() + }; + } +}; +function createBaseGetTxRequest(): GetTxRequest { + return { + hash: "" + }; +} +export const GetTxRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + encode(message: GetTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetTxRequest { + const message = createBaseGetTxRequest(); + message.hash = object.hash ?? ""; + return message; + }, + fromAmino(object: GetTxRequestAmino): GetTxRequest { + const message = createBaseGetTxRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; + }, + toAmino(message: GetTxRequest): GetTxRequestAmino { + const obj: any = {}; + obj.hash = message.hash === "" ? undefined : message.hash; + return obj; + }, + fromAminoMsg(object: GetTxRequestAminoMsg): GetTxRequest { + return GetTxRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetTxRequest): GetTxRequestAminoMsg { + return { + type: "cosmos-sdk/GetTxRequest", + value: GetTxRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxRequestProtoMsg): GetTxRequest { + return GetTxRequest.decode(message.value); + }, + toProto(message: GetTxRequest): Uint8Array { + return GetTxRequest.encode(message).finish(); + }, + toProtoMsg(message: GetTxRequest): GetTxRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + value: GetTxRequest.encode(message).finish() + }; + } +}; +function createBaseGetTxResponse(): GetTxResponse { + return { + tx: undefined, + txResponse: undefined + }; +} +export const GetTxResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + encode(message: GetTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetTxResponse { + const message = createBaseGetTxResponse(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; + return message; + }, + fromAmino(object: GetTxResponseAmino): GetTxResponse { + const message = createBaseGetTxResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; + }, + toAmino(message: GetTxResponse): GetTxResponseAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; + return obj; + }, + fromAminoMsg(object: GetTxResponseAminoMsg): GetTxResponse { + return GetTxResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetTxResponse): GetTxResponseAminoMsg { + return { + type: "cosmos-sdk/GetTxResponse", + value: GetTxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetTxResponseProtoMsg): GetTxResponse { + return GetTxResponse.decode(message.value); + }, + toProto(message: GetTxResponse): Uint8Array { + return GetTxResponse.encode(message).finish(); + }, + toProtoMsg(message: GetTxResponse): GetTxResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + value: GetTxResponse.encode(message).finish() + }; + } +}; +function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { + return { + height: BigInt(0), + pagination: undefined + }; +} +export const GetBlockWithTxsRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + encode(message: GetBlockWithTxsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsRequestAmino): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsRequestAminoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsRequestProtoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.decode(message.value); + }, + toProto(message: GetBlockWithTxsRequest): Uint8Array { + return GetBlockWithTxsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.encode(message).finish() + }; + } +}; +function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { + return { + txs: [], + blockId: undefined, + block: undefined, + pagination: undefined + }; +} +export const GetBlockWithTxsResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + encode(message: GetBlockWithTxsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim(); + } + if (message.block !== undefined) { + Block.encode(message.block, writer.uint32(26).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 3: + message.block = Block.decode(reader, reader.uint32()); + break; + case 4: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromPartial(e)) || []; + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.block = object.block !== undefined && object.block !== null ? Block.fromPartial(object.block) : undefined; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsResponseAmino): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromAmino(object.block); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = message.txs; + } + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block = message.block ? Block.toAmino(message.block) : undefined; + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsResponseAminoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsResponseProtoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.decode(message.value); + }, + toProto(message: GetBlockWithTxsResponse): Uint8Array { + return GetBlockWithTxsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 00000000..6ec88190 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,2023 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { SignMode } from "../signing/v1beta1/signing"; +import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../crypto/multisig/v1beta1/multisig"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** Tx is the standard type used for broadcasting transactions. */ +export interface Tx { + /** body is the processable content of the transaction */ + body?: TxBody; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +export interface TxProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Tx"; + value: Uint8Array; +} +/** Tx is the standard type used for broadcasting transactions. */ +export interface TxAmino { + /** body is the processable content of the transaction */ + body?: TxBodyAmino; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + auth_info?: AuthInfoAmino; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures?: string[]; +} +export interface TxAminoMsg { + type: "cosmos-sdk/Tx"; + value: TxAmino; +} +/** Tx is the standard type used for broadcasting transactions. */ +export interface TxSDKType { + body?: TxBodySDKType; + auth_info?: AuthInfoSDKType; + signatures: Uint8Array[]; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} +export interface TxRawProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxRaw"; + value: Uint8Array; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRawAmino { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + body_bytes?: string; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + auth_info_bytes?: string; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures?: string[]; +} +export interface TxRawAminoMsg { + type: "cosmos-sdk/TxRaw"; + value: TxRawAmino; +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRawSDKType { + body_bytes: Uint8Array; + auth_info_bytes: Uint8Array; + signatures: Uint8Array[]; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array; + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chainId: string; + /** account_number is the account number of the account in state */ + accountNumber: bigint; +} +export interface SignDocProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignDoc"; + value: Uint8Array; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDocAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes?: string; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + auth_info_bytes?: string; + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chain_id?: string; + /** account_number is the account number of the account in state */ + account_number?: string; +} +export interface SignDocAminoMsg { + type: "cosmos-sdk/SignDoc"; + value: SignDocAmino; +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDocSDKType { + body_bytes: Uint8Array; + auth_info_bytes: Uint8Array; + chain_id: string; + account_number: bigint; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAux { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** public_key is the public key of the signing account. */ + publicKey?: Any; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chainId: string; + /** account_number is the account number of the account in state. */ + accountNumber: bigint; + /** sequence is the sequence number of the signing account. */ + sequence: bigint; + /** + * Tip is the optional tip used for meta-transactions. It should be left + * empty if the signer is not the tipper for this transaction. + */ + tip?: Tip; +} +export interface SignDocDirectAuxProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux"; + value: Uint8Array; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes?: string; + /** public_key is the public key of the signing account. */ + public_key?: AnyAmino; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chain_id?: string; + /** account_number is the account number of the account in state. */ + account_number?: string; + /** sequence is the sequence number of the signing account. */ + sequence?: string; + /** + * Tip is the optional tip used for meta-transactions. It should be left + * empty if the signer is not the tipper for this transaction. + */ + tip?: TipAmino; +} +export interface SignDocDirectAuxAminoMsg { + type: "cosmos-sdk/SignDocDirectAux"; + value: SignDocDirectAuxAmino; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxSDKType { + body_bytes: Uint8Array; + public_key?: AnySDKType; + chain_id: string; + account_number: bigint; + sequence: bigint; + tip?: TipSDKType; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBody { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[]; + /** + * memo is any arbitrary note/comment to be added to the transaction. + * WARNING: in clients, any publicly exposed text should not be called memo, + * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeoutHeight: bigint; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[]; +} +export interface TxBodyProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxBody"; + value: Uint8Array; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBodyAmino { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages?: AnyAmino[]; + /** + * memo is any arbitrary note/comment to be added to the transaction. + * WARNING: in clients, any publicly exposed text should not be called memo, + * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + */ + memo?: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeout_height?: string; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extension_options?: AnyAmino[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + non_critical_extension_options?: AnyAmino[]; +} +export interface TxBodyAminoMsg { + type: "cosmos-sdk/TxBody"; + value: TxBodyAmino; +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBodySDKType { + messages: AnySDKType[]; + memo: string; + timeout_height: bigint; + extension_options: AnySDKType[]; + non_critical_extension_options: AnySDKType[]; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * of the signers. This can be estimated via simulation. + */ + fee?: Fee; + /** + * Tip is the optional tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ + tip?: Tip; +} +export interface AuthInfoProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo"; + value: Uint8Array; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfoAmino { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signer_infos?: SignerInfoAmino[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * of the signers. This can be estimated via simulation. + */ + fee?: FeeAmino; + /** + * Tip is the optional tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ + tip?: TipAmino; +} +export interface AuthInfoAminoMsg { + type: "cosmos-sdk/AuthInfo"; + value: AuthInfoAmino; +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfoSDKType { + signer_infos: SignerInfoSDKType[]; + fee?: FeeSDKType; + tip?: TipSDKType; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: bigint; +} +export interface SignerInfoProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo"; + value: Uint8Array; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfoAmino { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + public_key?: AnyAmino; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + mode_info?: ModeInfoAmino; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence?: string; +} +export interface SignerInfoAminoMsg { + type: "cosmos-sdk/SignerInfo"; + value: SignerInfoAmino; +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfoSDKType { + public_key?: AnySDKType; + mode_info?: ModeInfoSDKType; + sequence: bigint; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfo { + /** single represents a single signer */ + single?: ModeInfo_Single; + /** multi represents a nested multisig signer */ + multi?: ModeInfo_Multi; +} +export interface ModeInfoProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo"; + value: Uint8Array; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfoAmino { + /** single represents a single signer */ + single?: ModeInfo_SingleAmino; + /** multi represents a nested multisig signer */ + multi?: ModeInfo_MultiAmino; +} +export interface ModeInfoAminoMsg { + type: "cosmos-sdk/ModeInfo"; + value: ModeInfoAmino; +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfoSDKType { + single?: ModeInfo_SingleSDKType; + multi?: ModeInfo_MultiSDKType; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; +} +export interface ModeInfo_SingleProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Single"; + value: Uint8Array; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_SingleAmino { + /** mode is the signing mode of the single signer */ + mode?: SignMode; +} +export interface ModeInfo_SingleAminoMsg { + type: "cosmos-sdk/Single"; + value: ModeInfo_SingleAmino; +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_SingleSDKType { + mode: SignMode; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[]; +} +export interface ModeInfo_MultiProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Multi"; + value: Uint8Array; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_MultiAmino { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArrayAmino; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + mode_infos?: ModeInfoAmino[]; +} +export interface ModeInfo_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: ModeInfo_MultiAmino; +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_MultiSDKType { + bitarray?: CompactBitArraySDKType; + mode_infos: ModeInfoSDKType[]; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** amount is the amount of coins to be paid as a fee */ + amount: Coin[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: bigint; + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer: string; + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter: string; +} +export interface FeeProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Fee"; + value: Uint8Array; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface FeeAmino { + /** amount is the amount of coins to be paid as a fee */ + amount?: CoinAmino[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gas_limit?: string; + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer?: string; + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter?: string; +} +export interface FeeAminoMsg { + type: "cosmos-sdk/Fee"; + value: FeeAmino; +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface FeeSDKType { + amount: CoinSDKType[]; + gas_limit: bigint; + payer: string; + granter: string; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface Tip { + /** amount is the amount of the tip */ + amount: Coin[]; + /** tipper is the address of the account paying for the tip */ + tipper: string; +} +export interface TipProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Tip"; + value: Uint8Array; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface TipAmino { + /** amount is the amount of the tip */ + amount?: CoinAmino[]; + /** tipper is the address of the account paying for the tip */ + tipper?: string; +} +export interface TipAminoMsg { + type: "cosmos-sdk/Tip"; + value: TipAmino; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface TipSDKType { + amount: CoinSDKType[]; + tipper: string; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerData { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address: string; + /** + * sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + signDoc?: SignDocDirectAux; + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** sig is the signature of the sign doc. */ + sig: Uint8Array; +} +export interface AuxSignerDataProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData"; + value: Uint8Array; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataAmino { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address?: string; + /** + * sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + sign_doc?: SignDocDirectAuxAmino; + /** mode is the signing mode of the single signer */ + mode?: SignMode; + /** sig is the signature of the sign doc. */ + sig?: string; +} +export interface AuxSignerDataAminoMsg { + type: "cosmos-sdk/AuxSignerData"; + value: AuxSignerDataAmino; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataSDKType { + address: string; + sign_doc?: SignDocDirectAuxSDKType; + mode: SignMode; + sig: Uint8Array; +} +function createBaseTx(): Tx { + return { + body: undefined, + authInfo: undefined, + signatures: [] + }; +} +export const Tx = { + typeUrl: "/cosmos.tx.v1beta1.Tx", + encode(message: Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.body !== undefined) { + TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); + } + if (message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Tx { + const message = createBaseTx(); + message.body = object.body !== undefined && object.body !== null ? TxBody.fromPartial(object.body) : undefined; + message.authInfo = object.authInfo !== undefined && object.authInfo !== null ? AuthInfo.fromPartial(object.authInfo) : undefined; + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: TxAmino): Tx { + const message = createBaseTx(); + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromAmino(object.body); + } + if (object.auth_info !== undefined && object.auth_info !== null) { + message.authInfo = AuthInfo.fromAmino(object.auth_info); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Tx): TxAmino { + const obj: any = {}; + obj.body = message.body ? TxBody.toAmino(message.body) : undefined; + obj.auth_info = message.authInfo ? AuthInfo.toAmino(message.authInfo) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: TxAminoMsg): Tx { + return Tx.fromAmino(object.value); + }, + toAminoMsg(message: Tx): TxAminoMsg { + return { + type: "cosmos-sdk/Tx", + value: Tx.toAmino(message) + }; + }, + fromProtoMsg(message: TxProtoMsg): Tx { + return Tx.decode(message.value); + }, + toProto(message: Tx): Uint8Array { + return Tx.encode(message).finish(); + }, + toProtoMsg(message: Tx): TxProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Tx", + value: Tx.encode(message).finish() + }; + } +}; +function createBaseTxRaw(): TxRaw { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + signatures: [] + }; +} +export const TxRaw = { + typeUrl: "/cosmos.tx.v1beta1.TxRaw", + encode(message: TxRaw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxRaw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxRaw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxRaw { + const message = createBaseTxRaw(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.signatures = object.signatures?.map(e => e) || []; + return message; + }, + fromAmino(object: TxRawAmino): TxRaw { + const message = createBaseTxRaw(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: TxRaw): TxRawAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e)); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: TxRawAminoMsg): TxRaw { + return TxRaw.fromAmino(object.value); + }, + toAminoMsg(message: TxRaw): TxRawAminoMsg { + return { + type: "cosmos-sdk/TxRaw", + value: TxRaw.toAmino(message) + }; + }, + fromProtoMsg(message: TxRawProtoMsg): TxRaw { + return TxRaw.decode(message.value); + }, + toProto(message: TxRaw): Uint8Array { + return TxRaw.encode(message).finish(); + }, + toProtoMsg(message: TxRaw): TxRawProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxRaw", + value: TxRaw.encode(message).finish() + }; + } +}; +function createBaseSignDoc(): SignDoc { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + chainId: "", + accountNumber: BigInt(0) + }; +} +export const SignDoc = { + typeUrl: "/cosmos.tx.v1beta1.SignDoc", + encode(message: SignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDoc { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDoc(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignDoc { + const message = createBaseSignDoc(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignDocAmino): SignDoc { + const message = createBaseSignDoc(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + return message; + }, + toAmino(message: SignDoc): SignDocAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignDocAminoMsg): SignDoc { + return SignDoc.fromAmino(object.value); + }, + toAminoMsg(message: SignDoc): SignDocAminoMsg { + return { + type: "cosmos-sdk/SignDoc", + value: SignDoc.toAmino(message) + }; + }, + fromProtoMsg(message: SignDocProtoMsg): SignDoc { + return SignDoc.decode(message.value); + }, + toProto(message: SignDoc): Uint8Array { + return SignDoc.encode(message).finish(); + }, + toProtoMsg(message: SignDoc): SignDocProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignDoc", + value: SignDoc.encode(message).finish() + }; + } +}; +function createBaseSignDocDirectAux(): SignDocDirectAux { + return { + bodyBytes: new Uint8Array(), + publicKey: undefined, + chainId: "", + accountNumber: BigInt(0), + sequence: BigInt(0), + tip: undefined + }; +} +export const SignDocDirectAux = { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + encode(message: SignDocDirectAux, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(18).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(40).uint64(message.sequence); + } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDocDirectAux { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDocDirectAux(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + case 5: + message.sequence = reader.uint64(); + break; + case 6: + message.tip = Tip.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; + return message; + }, + fromAmino(object: SignDocDirectAuxAmino): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; + }, + toAmino(message: SignDocDirectAux): SignDocDirectAuxAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; + return obj; + }, + fromAminoMsg(object: SignDocDirectAuxAminoMsg): SignDocDirectAux { + return SignDocDirectAux.fromAmino(object.value); + }, + toAminoMsg(message: SignDocDirectAux): SignDocDirectAuxAminoMsg { + return { + type: "cosmos-sdk/SignDocDirectAux", + value: SignDocDirectAux.toAmino(message) + }; + }, + fromProtoMsg(message: SignDocDirectAuxProtoMsg): SignDocDirectAux { + return SignDocDirectAux.decode(message.value); + }, + toProto(message: SignDocDirectAux): Uint8Array { + return SignDocDirectAux.encode(message).finish(); + }, + toProtoMsg(message: SignDocDirectAux): SignDocDirectAuxProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + value: SignDocDirectAux.encode(message).finish() + }; + } +}; +function createBaseTxBody(): TxBody { + return { + messages: [], + memo: "", + timeoutHeight: BigInt(0), + extensionOptions: [], + nonCriticalExtensionOptions: [] + }; +} +export const TxBody = { + typeUrl: "/cosmos.tx.v1beta1.TxBody", + encode(message: TxBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.memo !== "") { + writer.uint32(18).string(message.memo); + } + if (message.timeoutHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.timeoutHeight); + } + for (const v of message.extensionOptions) { + Any.encode(v!, writer.uint32(8186).fork()).ldelim(); + } + for (const v of message.nonCriticalExtensionOptions) { + Any.encode(v!, writer.uint32(16378).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxBody { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxBody(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64(); + break; + case 1023: + message.extensionOptions.push(Any.decode(reader, reader.uint32())); + break; + case 2047: + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxBody { + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.memo = object.memo ?? ""; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? BigInt(object.timeoutHeight.toString()) : BigInt(0); + message.extensionOptions = object.extensionOptions?.map(e => Any.fromPartial(e)) || []; + message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TxBodyAmino): TxBody { + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + message.extensionOptions = object.extension_options?.map(e => Any.fromAmino(e)) || []; + message.nonCriticalExtensionOptions = object.non_critical_extension_options?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: TxBody): TxBodyAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.memo = message.memo === "" ? undefined : message.memo; + obj.timeout_height = message.timeoutHeight !== BigInt(0) ? message.timeoutHeight.toString() : undefined; + if (message.extensionOptions) { + obj.extension_options = message.extensionOptions.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.extension_options = message.extensionOptions; + } + if (message.nonCriticalExtensionOptions) { + obj.non_critical_extension_options = message.nonCriticalExtensionOptions.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.non_critical_extension_options = message.nonCriticalExtensionOptions; + } + return obj; + }, + fromAminoMsg(object: TxBodyAminoMsg): TxBody { + return TxBody.fromAmino(object.value); + }, + toAminoMsg(message: TxBody): TxBodyAminoMsg { + return { + type: "cosmos-sdk/TxBody", + value: TxBody.toAmino(message) + }; + }, + fromProtoMsg(message: TxBodyProtoMsg): TxBody { + return TxBody.decode(message.value); + }, + toProto(message: TxBody): Uint8Array { + return TxBody.encode(message).finish(); + }, + toProtoMsg(message: TxBody): TxBodyProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxBody", + value: TxBody.encode(message).finish() + }; + } +}; +function createBaseAuthInfo(): AuthInfo { + return { + signerInfos: [], + fee: undefined, + tip: undefined + }; +} +export const AuthInfo = { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + encode(message: AuthInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signerInfos) { + SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fee !== undefined) { + Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); + } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuthInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); + break; + case 2: + message.fee = Fee.decode(reader, reader.uint32()); + break; + case 3: + message.tip = Tip.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AuthInfo { + const message = createBaseAuthInfo(); + message.signerInfos = object.signerInfos?.map(e => SignerInfo.fromPartial(e)) || []; + message.fee = object.fee !== undefined && object.fee !== null ? Fee.fromPartial(object.fee) : undefined; + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; + return message; + }, + fromAmino(object: AuthInfoAmino): AuthInfo { + const message = createBaseAuthInfo(); + message.signerInfos = object.signer_infos?.map(e => SignerInfo.fromAmino(e)) || []; + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; + }, + toAmino(message: AuthInfo): AuthInfoAmino { + const obj: any = {}; + if (message.signerInfos) { + obj.signer_infos = message.signerInfos.map(e => e ? SignerInfo.toAmino(e) : undefined); + } else { + obj.signer_infos = message.signerInfos; + } + obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; + return obj; + }, + fromAminoMsg(object: AuthInfoAminoMsg): AuthInfo { + return AuthInfo.fromAmino(object.value); + }, + toAminoMsg(message: AuthInfo): AuthInfoAminoMsg { + return { + type: "cosmos-sdk/AuthInfo", + value: AuthInfo.toAmino(message) + }; + }, + fromProtoMsg(message: AuthInfoProtoMsg): AuthInfo { + return AuthInfo.decode(message.value); + }, + toProto(message: AuthInfo): Uint8Array { + return AuthInfo.encode(message).finish(); + }, + toProtoMsg(message: AuthInfo): AuthInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + value: AuthInfo.encode(message).finish() + }; + } +}; +function createBaseSignerInfo(): SignerInfo { + return { + publicKey: undefined, + modeInfo: undefined, + sequence: BigInt(0) + }; +} +export const SignerInfo = { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + encode(message: SignerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignerInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignerInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignerInfo { + const message = createBaseSignerInfo(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.modeInfo = object.modeInfo !== undefined && object.modeInfo !== null ? ModeInfo.fromPartial(object.modeInfo) : undefined; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignerInfoAmino): SignerInfo { + const message = createBaseSignerInfo(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.mode_info !== undefined && object.mode_info !== null) { + message.modeInfo = ModeInfo.fromAmino(object.mode_info); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: SignerInfo): SignerInfoAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.mode_info = message.modeInfo ? ModeInfo.toAmino(message.modeInfo) : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignerInfoAminoMsg): SignerInfo { + return SignerInfo.fromAmino(object.value); + }, + toAminoMsg(message: SignerInfo): SignerInfoAminoMsg { + return { + type: "cosmos-sdk/SignerInfo", + value: SignerInfo.toAmino(message) + }; + }, + fromProtoMsg(message: SignerInfoProtoMsg): SignerInfo { + return SignerInfo.decode(message.value); + }, + toProto(message: SignerInfo): Uint8Array { + return SignerInfo.encode(message).finish(); + }, + toProtoMsg(message: SignerInfo): SignerInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + value: SignerInfo.encode(message).finish() + }; + } +}; +function createBaseModeInfo(): ModeInfo { + return { + single: undefined, + multi: undefined + }; +} +export const ModeInfo = { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + encode(message: ModeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.single !== undefined) { + ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = ModeInfo_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModeInfo { + const message = createBaseModeInfo(); + message.single = object.single !== undefined && object.single !== null ? ModeInfo_Single.fromPartial(object.single) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? ModeInfo_Multi.fromPartial(object.multi) : undefined; + return message; + }, + fromAmino(object: ModeInfoAmino): ModeInfo { + const message = createBaseModeInfo(); + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromAmino(object.multi); + } + return message; + }, + toAmino(message: ModeInfo): ModeInfoAmino { + const obj: any = {}; + obj.single = message.single ? ModeInfo_Single.toAmino(message.single) : undefined; + obj.multi = message.multi ? ModeInfo_Multi.toAmino(message.multi) : undefined; + return obj; + }, + fromAminoMsg(object: ModeInfoAminoMsg): ModeInfo { + return ModeInfo.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo): ModeInfoAminoMsg { + return { + type: "cosmos-sdk/ModeInfo", + value: ModeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfoProtoMsg): ModeInfo { + return ModeInfo.decode(message.value); + }, + toProto(message: ModeInfo): Uint8Array { + return ModeInfo.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo): ModeInfoProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + value: ModeInfo.encode(message).finish() + }; + } +}; +function createBaseModeInfo_Single(): ModeInfo_Single { + return { + mode: 0 + }; +} +export const ModeInfo_Single = { + typeUrl: "/cosmos.tx.v1beta1.Single", + encode(message: ModeInfo_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo_Single(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModeInfo_Single { + const message = createBaseModeInfo_Single(); + message.mode = object.mode ?? 0; + return message; + }, + fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { + const message = createBaseModeInfo_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; + }, + toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { + const obj: any = {}; + obj.mode = message.mode === 0 ? undefined : message.mode; + return obj; + }, + fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { + return ModeInfo_Single.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo_Single): ModeInfo_SingleAminoMsg { + return { + type: "cosmos-sdk/Single", + value: ModeInfo_Single.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfo_SingleProtoMsg): ModeInfo_Single { + return ModeInfo_Single.decode(message.value); + }, + toProto(message: ModeInfo_Single): Uint8Array { + return ModeInfo_Single.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo_Single): ModeInfo_SingleProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Single", + value: ModeInfo_Single.encode(message).finish() + }; + } +}; +function createBaseModeInfo_Multi(): ModeInfo_Multi { + return { + bitarray: undefined, + modeInfos: [] + }; +} +export const ModeInfo_Multi = { + typeUrl: "/cosmos.tx.v1beta1.Multi", + encode(message: ModeInfo_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.modeInfos) { + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModeInfo_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModeInfo_Multi { + const message = createBaseModeInfo_Multi(); + message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; + message.modeInfos = object.modeInfos?.map(e => ModeInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { + const message = createBaseModeInfo_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.modeInfos = object.mode_infos?.map(e => ModeInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModeInfo_Multi): ModeInfo_MultiAmino { + const obj: any = {}; + obj.bitarray = message.bitarray ? CompactBitArray.toAmino(message.bitarray) : undefined; + if (message.modeInfos) { + obj.mode_infos = message.modeInfos.map(e => e ? ModeInfo.toAmino(e) : undefined); + } else { + obj.mode_infos = message.modeInfos; + } + return obj; + }, + fromAminoMsg(object: ModeInfo_MultiAminoMsg): ModeInfo_Multi { + return ModeInfo_Multi.fromAmino(object.value); + }, + toAminoMsg(message: ModeInfo_Multi): ModeInfo_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: ModeInfo_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: ModeInfo_MultiProtoMsg): ModeInfo_Multi { + return ModeInfo_Multi.decode(message.value); + }, + toProto(message: ModeInfo_Multi): Uint8Array { + return ModeInfo_Multi.encode(message).finish(); + }, + toProtoMsg(message: ModeInfo_Multi): ModeInfo_MultiProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Multi", + value: ModeInfo_Multi.encode(message).finish() + }; + } +}; +function createBaseFee(): Fee { + return { + amount: [], + gasLimit: BigInt(0), + payer: "", + granter: "" + }; +} +export const Fee = { + typeUrl: "/cosmos.tx.v1beta1.Fee", + encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.gasLimit); + } + if (message.payer !== "") { + writer.uint32(26).string(message.payer); + } + if (message.granter !== "") { + writer.uint32(34).string(message.granter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.gasLimit = reader.uint64(); + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Fee { + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); + message.payer = object.payer ?? ""; + message.granter = object.granter ?? ""; + return message; + }, + fromAmino(object: FeeAmino): Fee { + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; + }, + toAmino(message: Fee): FeeAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit.toString() : undefined; + obj.payer = message.payer === "" ? undefined : message.payer; + obj.granter = message.granter === "" ? undefined : message.granter; + return obj; + }, + fromAminoMsg(object: FeeAminoMsg): Fee { + return Fee.fromAmino(object.value); + }, + toAminoMsg(message: Fee): FeeAminoMsg { + return { + type: "cosmos-sdk/Fee", + value: Fee.toAmino(message) + }; + }, + fromProtoMsg(message: FeeProtoMsg): Fee { + return Fee.decode(message.value); + }, + toProto(message: Fee): Uint8Array { + return Fee.encode(message).finish(); + }, + toProtoMsg(message: Fee): FeeProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Fee", + value: Fee.encode(message).finish() + }; + } +}; +function createBaseTip(): Tip { + return { + amount: [], + tipper: "" + }; +} +export const Tip = { + typeUrl: "/cosmos.tx.v1beta1.Tip", + encode(message: Tip, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tipper !== "") { + writer.uint32(18).string(message.tipper); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tip { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTip(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.tipper = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.tipper = object.tipper ?? ""; + return message; + }, + fromAmino(object: TipAmino): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.tipper !== undefined && object.tipper !== null) { + message.tipper = object.tipper; + } + return message; + }, + toAmino(message: Tip): TipAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.tipper = message.tipper === "" ? undefined : message.tipper; + return obj; + }, + fromAminoMsg(object: TipAminoMsg): Tip { + return Tip.fromAmino(object.value); + }, + toAminoMsg(message: Tip): TipAminoMsg { + return { + type: "cosmos-sdk/Tip", + value: Tip.toAmino(message) + }; + }, + fromProtoMsg(message: TipProtoMsg): Tip { + return Tip.decode(message.value); + }, + toProto(message: Tip): Uint8Array { + return Tip.encode(message).finish(); + }, + toProtoMsg(message: Tip): TipProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Tip", + value: Tip.encode(message).finish() + }; + } +}; +function createBaseAuxSignerData(): AuxSignerData { + return { + address: "", + signDoc: undefined, + mode: 0, + sig: new Uint8Array() + }; +} +export const AuxSignerData = { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + encode(message: AuxSignerData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.signDoc !== undefined) { + SignDocDirectAux.encode(message.signDoc, writer.uint32(18).fork()).ldelim(); + } + if (message.mode !== 0) { + writer.uint32(24).int32(message.mode); + } + if (message.sig.length !== 0) { + writer.uint32(34).bytes(message.sig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuxSignerData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuxSignerData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.signDoc = SignDocDirectAux.decode(reader, reader.uint32()); + break; + case 3: + message.mode = reader.int32() as any; + break; + case 4: + message.sig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AuxSignerData { + const message = createBaseAuxSignerData(); + message.address = object.address ?? ""; + message.signDoc = object.signDoc !== undefined && object.signDoc !== null ? SignDocDirectAux.fromPartial(object.signDoc) : undefined; + message.mode = object.mode ?? 0; + message.sig = object.sig ?? new Uint8Array(); + return message; + }, + fromAmino(object: AuxSignerDataAmino): AuxSignerData { + const message = createBaseAuxSignerData(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.sign_doc !== undefined && object.sign_doc !== null) { + message.signDoc = SignDocDirectAux.fromAmino(object.sign_doc); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + if (object.sig !== undefined && object.sig !== null) { + message.sig = bytesFromBase64(object.sig); + } + return message; + }, + toAmino(message: AuxSignerData): AuxSignerDataAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.sign_doc = message.signDoc ? SignDocDirectAux.toAmino(message.signDoc) : undefined; + obj.mode = message.mode === 0 ? undefined : message.mode; + obj.sig = message.sig ? base64FromBytes(message.sig) : undefined; + return obj; + }, + fromAminoMsg(object: AuxSignerDataAminoMsg): AuxSignerData { + return AuxSignerData.fromAmino(object.value); + }, + toAminoMsg(message: AuxSignerData): AuxSignerDataAminoMsg { + return { + type: "cosmos-sdk/AuxSignerData", + value: AuxSignerData.toAmino(message) + }; + }, + fromProtoMsg(message: AuxSignerDataProtoMsg): AuxSignerData { + return AuxSignerData.decode(message.value); + }, + toProto(message: AuxSignerData): Uint8Array { + return AuxSignerData.encode(message).finish(); + }, + toProtoMsg(message: AuxSignerData): AuxSignerDataProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + value: AuxSignerData.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..7080dc33 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/query.rpc.Query.ts @@ -0,0 +1,86 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; +/** Query defines the gRPC upgrade querier service. */ +export interface Query { + /** CurrentPlan queries the current upgrade plan. */ + currentPlan(request?: QueryCurrentPlanRequest): Promise; + /** AppliedPlan queries a previously applied upgrade plan by its name. */ + appliedPlan(request: QueryAppliedPlanRequest): Promise; + /** + * UpgradedConsensusState queries the consensus state that will serve + * as a trusted kernel for the next version of this chain. It will only be + * stored at the last height of this chain. + * UpgradedConsensusState RPC not supported with legacy querier + * This rpc is deprecated now that IBC has its own replacement + * (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + */ + upgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise; + /** + * ModuleVersions queries the list of module versions from state. + * + * Since: cosmos-sdk 0.43 + */ + moduleVersions(request: QueryModuleVersionsRequest): Promise; + /** Returns the account with authority to conduct upgrades */ + authority(request?: QueryAuthorityRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.currentPlan = this.currentPlan.bind(this); + this.appliedPlan = this.appliedPlan.bind(this); + this.upgradedConsensusState = this.upgradedConsensusState.bind(this); + this.moduleVersions = this.moduleVersions.bind(this); + this.authority = this.authority.bind(this); + } + currentPlan(request: QueryCurrentPlanRequest = {}): Promise { + const data = QueryCurrentPlanRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "CurrentPlan", data); + return promise.then(data => QueryCurrentPlanResponse.decode(new BinaryReader(data))); + } + appliedPlan(request: QueryAppliedPlanRequest): Promise { + const data = QueryAppliedPlanRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "AppliedPlan", data); + return promise.then(data => QueryAppliedPlanResponse.decode(new BinaryReader(data))); + } + upgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise { + const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "UpgradedConsensusState", data); + return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data))); + } + moduleVersions(request: QueryModuleVersionsRequest): Promise { + const data = QueryModuleVersionsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); + return promise.then(data => QueryModuleVersionsResponse.decode(new BinaryReader(data))); + } + authority(request: QueryAuthorityRequest = {}): Promise { + const data = QueryAuthorityRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "Authority", data); + return promise.then(data => QueryAuthorityResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + currentPlan(request?: QueryCurrentPlanRequest): Promise { + return queryService.currentPlan(request); + }, + appliedPlan(request: QueryAppliedPlanRequest): Promise { + return queryService.appliedPlan(request); + }, + upgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise { + return queryService.upgradedConsensusState(request); + }, + moduleVersions(request: QueryModuleVersionsRequest): Promise { + return queryService.moduleVersions(request); + }, + authority(request?: QueryAuthorityRequest): Promise { + return queryService.authority(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/query.ts b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/query.ts new file mode 100644 index 00000000..66f4dac9 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/query.ts @@ -0,0 +1,1000 @@ +//@ts-nocheck +import { Plan, PlanAmino, PlanSDKType, ModuleVersion, ModuleVersionAmino, ModuleVersionSDKType } from "./upgrade"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanRequest {} +export interface QueryCurrentPlanRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest"; + value: Uint8Array; +} +/** + * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanRequestAmino {} +export interface QueryCurrentPlanRequestAminoMsg { + type: "cosmos-sdk/QueryCurrentPlanRequest"; + value: QueryCurrentPlanRequestAmino; +} +/** + * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanRequestSDKType {} +/** + * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanResponse { + /** plan is the current upgrade plan. */ + plan?: Plan; +} +export interface QueryCurrentPlanResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse"; + value: Uint8Array; +} +/** + * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanResponseAmino { + /** plan is the current upgrade plan. */ + plan?: PlanAmino; +} +export interface QueryCurrentPlanResponseAminoMsg { + type: "cosmos-sdk/QueryCurrentPlanResponse"; + value: QueryCurrentPlanResponseAmino; +} +/** + * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanResponseSDKType { + plan?: PlanSDKType; +} +/** + * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanRequest { + /** name is the name of the applied plan to query for. */ + name: string; +} +export interface QueryAppliedPlanRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest"; + value: Uint8Array; +} +/** + * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanRequestAmino { + /** name is the name of the applied plan to query for. */ + name?: string; +} +export interface QueryAppliedPlanRequestAminoMsg { + type: "cosmos-sdk/QueryAppliedPlanRequest"; + value: QueryAppliedPlanRequestAmino; +} +/** + * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanRequestSDKType { + name: string; +} +/** + * QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanResponse { + /** height is the block height at which the plan was applied. */ + height: bigint; +} +export interface QueryAppliedPlanResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse"; + value: Uint8Array; +} +/** + * QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanResponseAmino { + /** height is the block height at which the plan was applied. */ + height?: string; +} +export interface QueryAppliedPlanResponseAminoMsg { + type: "cosmos-sdk/QueryAppliedPlanResponse"; + value: QueryAppliedPlanResponseAmino; +} +/** + * QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanResponseSDKType { + height: bigint; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState + * RPC method. + */ +/** @deprecated */ +export interface QueryUpgradedConsensusStateRequest { + /** + * last height of the current chain must be sent in request + * as this is the height under which next consensus state is stored + */ + lastHeight: bigint; +} +export interface QueryUpgradedConsensusStateRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState + * RPC method. + */ +/** @deprecated */ +export interface QueryUpgradedConsensusStateRequestAmino { + /** + * last height of the current chain must be sent in request + * as this is the height under which next consensus state is stored + */ + last_height?: string; +} +export interface QueryUpgradedConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradedConsensusStateRequest"; + value: QueryUpgradedConsensusStateRequestAmino; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState + * RPC method. + */ +/** @deprecated */ +export interface QueryUpgradedConsensusStateRequestSDKType { + last_height: bigint; +} +/** + * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState + * RPC method. + */ +/** @deprecated */ +export interface QueryUpgradedConsensusStateResponse { + /** Since: cosmos-sdk 0.43 */ + upgradedConsensusState: Uint8Array; +} +export interface QueryUpgradedConsensusStateResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState + * RPC method. + */ +/** @deprecated */ +export interface QueryUpgradedConsensusStateResponseAmino { + /** Since: cosmos-sdk 0.43 */ + upgraded_consensus_state?: string; +} +export interface QueryUpgradedConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradedConsensusStateResponse"; + value: QueryUpgradedConsensusStateResponseAmino; +} +/** + * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState + * RPC method. + */ +/** @deprecated */ +export interface QueryUpgradedConsensusStateResponseSDKType { + upgraded_consensus_state: Uint8Array; +} +/** + * QueryModuleVersionsRequest is the request type for the Query/ModuleVersions + * RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryModuleVersionsRequest { + /** + * module_name is a field to query a specific module + * consensus version from state. Leaving this empty will + * fetch the full list of module versions from state + */ + moduleName: string; +} +export interface QueryModuleVersionsRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest"; + value: Uint8Array; +} +/** + * QueryModuleVersionsRequest is the request type for the Query/ModuleVersions + * RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryModuleVersionsRequestAmino { + /** + * module_name is a field to query a specific module + * consensus version from state. Leaving this empty will + * fetch the full list of module versions from state + */ + module_name?: string; +} +export interface QueryModuleVersionsRequestAminoMsg { + type: "cosmos-sdk/QueryModuleVersionsRequest"; + value: QueryModuleVersionsRequestAmino; +} +/** + * QueryModuleVersionsRequest is the request type for the Query/ModuleVersions + * RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryModuleVersionsRequestSDKType { + module_name: string; +} +/** + * QueryModuleVersionsResponse is the response type for the Query/ModuleVersions + * RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryModuleVersionsResponse { + /** module_versions is a list of module names with their consensus versions. */ + moduleVersions: ModuleVersion[]; +} +export interface QueryModuleVersionsResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse"; + value: Uint8Array; +} +/** + * QueryModuleVersionsResponse is the response type for the Query/ModuleVersions + * RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryModuleVersionsResponseAmino { + /** module_versions is a list of module names with their consensus versions. */ + module_versions?: ModuleVersionAmino[]; +} +export interface QueryModuleVersionsResponseAminoMsg { + type: "cosmos-sdk/QueryModuleVersionsResponse"; + value: QueryModuleVersionsResponseAmino; +} +/** + * QueryModuleVersionsResponse is the response type for the Query/ModuleVersions + * RPC method. + * + * Since: cosmos-sdk 0.43 + */ +export interface QueryModuleVersionsResponseSDKType { + module_versions: ModuleVersionSDKType[]; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequest {} +export interface QueryAuthorityRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest"; + value: Uint8Array; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestAmino {} +export interface QueryAuthorityRequestAminoMsg { + type: "cosmos-sdk/QueryAuthorityRequest"; + value: QueryAuthorityRequestAmino; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestSDKType {} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponse { + address: string; +} +export interface QueryAuthorityResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse"; + value: Uint8Array; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseAmino { + address?: string; +} +export interface QueryAuthorityResponseAminoMsg { + type: "cosmos-sdk/QueryAuthorityResponse"; + value: QueryAuthorityResponseAmino; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseSDKType { + address: string; +} +function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { + return {}; +} +export const QueryCurrentPlanRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", + encode(_: QueryCurrentPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentPlanRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentPlanRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryCurrentPlanRequest { + const message = createBaseQueryCurrentPlanRequest(); + return message; + }, + fromAmino(_: QueryCurrentPlanRequestAmino): QueryCurrentPlanRequest { + const message = createBaseQueryCurrentPlanRequest(); + return message; + }, + toAmino(_: QueryCurrentPlanRequest): QueryCurrentPlanRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCurrentPlanRequestAminoMsg): QueryCurrentPlanRequest { + return QueryCurrentPlanRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCurrentPlanRequest): QueryCurrentPlanRequestAminoMsg { + return { + type: "cosmos-sdk/QueryCurrentPlanRequest", + value: QueryCurrentPlanRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCurrentPlanRequestProtoMsg): QueryCurrentPlanRequest { + return QueryCurrentPlanRequest.decode(message.value); + }, + toProto(message: QueryCurrentPlanRequest): Uint8Array { + return QueryCurrentPlanRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentPlanRequest): QueryCurrentPlanRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", + value: QueryCurrentPlanRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCurrentPlanResponse(): QueryCurrentPlanResponse { + return { + plan: undefined + }; +} +export const QueryCurrentPlanResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", + encode(message: QueryCurrentPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentPlanResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentPlanResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCurrentPlanResponse { + const message = createBaseQueryCurrentPlanResponse(); + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: QueryCurrentPlanResponseAmino): QueryCurrentPlanResponse { + const message = createBaseQueryCurrentPlanResponse(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: QueryCurrentPlanResponse): QueryCurrentPlanResponseAmino { + const obj: any = {}; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCurrentPlanResponseAminoMsg): QueryCurrentPlanResponse { + return QueryCurrentPlanResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCurrentPlanResponse): QueryCurrentPlanResponseAminoMsg { + return { + type: "cosmos-sdk/QueryCurrentPlanResponse", + value: QueryCurrentPlanResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCurrentPlanResponseProtoMsg): QueryCurrentPlanResponse { + return QueryCurrentPlanResponse.decode(message.value); + }, + toProto(message: QueryCurrentPlanResponse): Uint8Array { + return QueryCurrentPlanResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentPlanResponse): QueryCurrentPlanResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", + value: QueryCurrentPlanResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAppliedPlanRequest(): QueryAppliedPlanRequest { + return { + name: "" + }; +} +export const QueryAppliedPlanRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", + encode(message: QueryAppliedPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAppliedPlanRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAppliedPlanRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAppliedPlanRequest { + const message = createBaseQueryAppliedPlanRequest(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: QueryAppliedPlanRequestAmino): QueryAppliedPlanRequest { + const message = createBaseQueryAppliedPlanRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: QueryAppliedPlanRequest): QueryAppliedPlanRequestAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: QueryAppliedPlanRequestAminoMsg): QueryAppliedPlanRequest { + return QueryAppliedPlanRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAppliedPlanRequest): QueryAppliedPlanRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAppliedPlanRequest", + value: QueryAppliedPlanRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAppliedPlanRequestProtoMsg): QueryAppliedPlanRequest { + return QueryAppliedPlanRequest.decode(message.value); + }, + toProto(message: QueryAppliedPlanRequest): Uint8Array { + return QueryAppliedPlanRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAppliedPlanRequest): QueryAppliedPlanRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", + value: QueryAppliedPlanRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAppliedPlanResponse(): QueryAppliedPlanResponse { + return { + height: BigInt(0) + }; +} +export const QueryAppliedPlanResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", + encode(message: QueryAppliedPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAppliedPlanResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAppliedPlanResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAppliedPlanResponse { + const message = createBaseQueryAppliedPlanResponse(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryAppliedPlanResponseAmino): QueryAppliedPlanResponse { + const message = createBaseQueryAppliedPlanResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: QueryAppliedPlanResponse): QueryAppliedPlanResponseAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryAppliedPlanResponseAminoMsg): QueryAppliedPlanResponse { + return QueryAppliedPlanResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAppliedPlanResponse): QueryAppliedPlanResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAppliedPlanResponse", + value: QueryAppliedPlanResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAppliedPlanResponseProtoMsg): QueryAppliedPlanResponse { + return QueryAppliedPlanResponse.decode(message.value); + }, + toProto(message: QueryAppliedPlanResponse): Uint8Array { + return QueryAppliedPlanResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAppliedPlanResponse): QueryAppliedPlanResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", + value: QueryAppliedPlanResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { + return { + lastHeight: BigInt(0) + }; +} +export const QueryUpgradedConsensusStateRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", + encode(message: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastHeight !== BigInt(0)) { + writer.uint32(8).int64(message.lastHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradedConsensusStateRequest { + const message = createBaseQueryUpgradedConsensusStateRequest(); + message.lastHeight = object.lastHeight !== undefined && object.lastHeight !== null ? BigInt(object.lastHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { + const message = createBaseQueryUpgradedConsensusStateRequest(); + if (object.last_height !== undefined && object.last_height !== null) { + message.lastHeight = BigInt(object.last_height); + } + return message; + }, + toAmino(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { + const obj: any = {}; + obj.last_height = message.lastHeight !== BigInt(0) ? message.lastHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryUpgradedConsensusStateRequestAminoMsg): QueryUpgradedConsensusStateRequest { + return QueryUpgradedConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedConsensusStateRequest", + value: QueryUpgradedConsensusStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradedConsensusStateRequestProtoMsg): QueryUpgradedConsensusStateRequest { + return QueryUpgradedConsensusStateRequest.decode(message.value); + }, + toProto(message: QueryUpgradedConsensusStateRequest): Uint8Array { + return QueryUpgradedConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", + value: QueryUpgradedConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { + return { + upgradedConsensusState: new Uint8Array() + }; +} +export const QueryUpgradedConsensusStateResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", + encode(message: QueryUpgradedConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradedConsensusState.length !== 0) { + writer.uint32(18).bytes(message.upgradedConsensusState); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.upgradedConsensusState = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradedConsensusStateResponse { + const message = createBaseQueryUpgradedConsensusStateResponse(); + message.upgradedConsensusState = object.upgradedConsensusState ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = bytesFromBase64(object.upgraded_consensus_state); + } + return message; + }, + toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { + const obj: any = {}; + obj.upgraded_consensus_state = message.upgradedConsensusState ? base64FromBytes(message.upgradedConsensusState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUpgradedConsensusStateResponseAminoMsg): QueryUpgradedConsensusStateResponse { + return QueryUpgradedConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedConsensusStateResponse", + value: QueryUpgradedConsensusStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradedConsensusStateResponseProtoMsg): QueryUpgradedConsensusStateResponse { + return QueryUpgradedConsensusStateResponse.decode(message.value); + }, + toProto(message: QueryUpgradedConsensusStateResponse): Uint8Array { + return QueryUpgradedConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", + value: QueryUpgradedConsensusStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryModuleVersionsRequest(): QueryModuleVersionsRequest { + return { + moduleName: "" + }; +} +export const QueryModuleVersionsRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", + encode(message: QueryModuleVersionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleVersionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleVersionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleVersionsRequest { + const message = createBaseQueryModuleVersionsRequest(); + message.moduleName = object.moduleName ?? ""; + return message; + }, + fromAmino(object: QueryModuleVersionsRequestAmino): QueryModuleVersionsRequest { + const message = createBaseQueryModuleVersionsRequest(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + return message; + }, + toAmino(message: QueryModuleVersionsRequest): QueryModuleVersionsRequestAmino { + const obj: any = {}; + obj.module_name = message.moduleName === "" ? undefined : message.moduleName; + return obj; + }, + fromAminoMsg(object: QueryModuleVersionsRequestAminoMsg): QueryModuleVersionsRequest { + return QueryModuleVersionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleVersionsRequest): QueryModuleVersionsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryModuleVersionsRequest", + value: QueryModuleVersionsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleVersionsRequestProtoMsg): QueryModuleVersionsRequest { + return QueryModuleVersionsRequest.decode(message.value); + }, + toProto(message: QueryModuleVersionsRequest): Uint8Array { + return QueryModuleVersionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleVersionsRequest): QueryModuleVersionsRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", + value: QueryModuleVersionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryModuleVersionsResponse(): QueryModuleVersionsResponse { + return { + moduleVersions: [] + }; +} +export const QueryModuleVersionsResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", + encode(message: QueryModuleVersionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.moduleVersions) { + ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleVersionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleVersionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleVersions.push(ModuleVersion.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleVersionsResponse { + const message = createBaseQueryModuleVersionsResponse(); + message.moduleVersions = object.moduleVersions?.map(e => ModuleVersion.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryModuleVersionsResponseAmino): QueryModuleVersionsResponse { + const message = createBaseQueryModuleVersionsResponse(); + message.moduleVersions = object.module_versions?.map(e => ModuleVersion.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryModuleVersionsResponse): QueryModuleVersionsResponseAmino { + const obj: any = {}; + if (message.moduleVersions) { + obj.module_versions = message.moduleVersions.map(e => e ? ModuleVersion.toAmino(e) : undefined); + } else { + obj.module_versions = message.moduleVersions; + } + return obj; + }, + fromAminoMsg(object: QueryModuleVersionsResponseAminoMsg): QueryModuleVersionsResponse { + return QueryModuleVersionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleVersionsResponse): QueryModuleVersionsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryModuleVersionsResponse", + value: QueryModuleVersionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleVersionsResponseProtoMsg): QueryModuleVersionsResponse { + return QueryModuleVersionsResponse.decode(message.value); + }, + toProto(message: QueryModuleVersionsResponse): Uint8Array { + return QueryModuleVersionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleVersionsResponse): QueryModuleVersionsResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", + value: QueryModuleVersionsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAuthorityRequest(): QueryAuthorityRequest { + return {}; +} +export const QueryAuthorityRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + encode(_: QueryAuthorityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + fromAmino(_: QueryAuthorityRequestAmino): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + toAmino(_: QueryAuthorityRequest): QueryAuthorityRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAuthorityRequestAminoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityRequest", + value: QueryAuthorityRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityRequestProtoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.decode(message.value); + }, + toProto(message: QueryAuthorityRequest): Uint8Array { + return QueryAuthorityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + value: QueryAuthorityRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAuthorityResponse(): QueryAuthorityResponse { + return { + address: "" + }; +} +export const QueryAuthorityResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + encode(message: QueryAuthorityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAuthorityResponseAmino): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAuthorityResponse): QueryAuthorityResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAuthorityResponseAminoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityResponse", + value: QueryAuthorityResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityResponseProtoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.decode(message.value); + }, + toProto(message: QueryAuthorityResponse): Uint8Array { + return QueryAuthorityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + value: QueryAuthorityResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.amino.ts new file mode 100644 index 00000000..59e87c08 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const AminoConverter = { + "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgSoftwareUpgrade", + toAmino: MsgSoftwareUpgrade.toAmino, + fromAmino: MsgSoftwareUpgrade.fromAmino + }, + "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": { + aminoType: "cosmos-sdk/MsgCancelUpgrade", + toAmino: MsgCancelUpgrade.toAmino, + fromAmino: MsgCancelUpgrade.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.registry.ts new file mode 100644 index 00000000..019dde52 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", MsgSoftwareUpgrade], ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(value).finish() + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(value).finish() + }; + } + }, + withTypeUrl: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value + }; + } + }, + fromPartial: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.fromPartial(value) + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..a4db6d5c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,38 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSoftwareUpgrade, MsgSoftwareUpgradeResponse, MsgCancelUpgrade, MsgCancelUpgradeResponse } from "./tx"; +/** Msg defines the upgrade Msg service. */ +export interface Msg { + /** + * SoftwareUpgrade is a governance operation for initiating a software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + softwareUpgrade(request: MsgSoftwareUpgrade): Promise; + /** + * CancelUpgrade is a governance operation for cancelling a previously + * approvid software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + cancelUpgrade(request: MsgCancelUpgrade): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.softwareUpgrade = this.softwareUpgrade.bind(this); + this.cancelUpgrade = this.cancelUpgrade.bind(this); + } + softwareUpgrade(request: MsgSoftwareUpgrade): Promise { + const data = MsgSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); + return promise.then(data => MsgSoftwareUpgradeResponse.decode(new BinaryReader(data))); + } + cancelUpgrade(request: MsgCancelUpgrade): Promise { + const data = MsgCancelUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); + return promise.then(data => MsgCancelUpgradeResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 00000000..c84bbdd3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,390 @@ +//@ts-nocheck +import { Plan, PlanAmino, PlanSDKType } from "./upgrade"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgrade { + /** authority is the address of the governance account. */ + authority: string; + /** plan is the upgrade plan. */ + plan: Plan; +} +export interface MsgSoftwareUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeAmino { + /** authority is the address of the governance account. */ + authority?: string; + /** plan is the upgrade plan. */ + plan?: PlanAmino; +} +export interface MsgSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgrade"; + value: MsgSoftwareUpgradeAmino; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeSDKType { + authority: string; + plan: PlanSDKType; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponse {} +export interface MsgSoftwareUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseAmino {} +export interface MsgSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse"; + value: MsgSoftwareUpgradeResponseAmino; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseSDKType {} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgrade { + /** authority is the address of the governance account. */ + authority: string; +} +export interface MsgCancelUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade"; + value: Uint8Array; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeAmino { + /** authority is the address of the governance account. */ + authority?: string; +} +export interface MsgCancelUpgradeAminoMsg { + type: "cosmos-sdk/MsgCancelUpgrade"; + value: MsgCancelUpgradeAmino; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeSDKType { + authority: string; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponse {} +export interface MsgCancelUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseAmino {} +export interface MsgCancelUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUpgradeResponse"; + value: MsgCancelUpgradeResponseAmino; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseSDKType {} +function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { + return { + authority: "", + plan: Plan.fromPartial({}) + }; +} +export const MsgSoftwareUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + encode(message: MsgSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + message.authority = object.authority ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: MsgSoftwareUpgradeAmino): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeAminoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeProtoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgSoftwareUpgrade): Uint8Array { + return MsgSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { + return {}; +} +export const MsgSoftwareUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + encode(_: MsgSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgSoftwareUpgradeResponseAmino): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeResponseAminoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeResponseProtoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgSoftwareUpgradeResponse): Uint8Array { + return MsgSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { + return { + authority: "" + }; +} +export const MsgCancelUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + encode(message: MsgCancelUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgCancelUpgradeAmino): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgCancelUpgrade): MsgCancelUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeAminoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgrade", + value: MsgCancelUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeProtoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.decode(message.value); + }, + toProto(message: MsgCancelUpgrade): Uint8Array { + return MsgCancelUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { + return {}; +} +export const MsgCancelUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + encode(_: MsgCancelUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + fromAmino(_: MsgCancelUpgradeResponseAmino): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + toAmino(_: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeResponseAminoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeResponseProtoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.decode(message.value); + }, + toProto(message: MsgCancelUpgradeResponse): Uint8Array { + return MsgCancelUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/upgrade.ts b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 00000000..c461c729 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,599 @@ +//@ts-nocheck +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + time: Date; + /** + * The height at which the upgrade must be performed. + * Only used if Time is not set. + */ + height: bigint; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgradedClientState?: Any; +} +export interface PlanProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.Plan"; + value: Uint8Array; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanAmino { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name?: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + time?: string; + /** + * The height at which the upgrade must be performed. + * Only used if Time is not set. + */ + height?: string; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info?: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgraded_client_state?: AnyAmino; +} +export interface PlanAminoMsg { + type: "cosmos-sdk/Plan"; + value: PlanAmino; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanSDKType { + name: string; + /** @deprecated */ + time: Date; + height: bigint; + info: string; + /** @deprecated */ + upgraded_client_state?: AnySDKType; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + title: string; + description: string; + plan: Plan; +} +export interface SoftwareUpgradeProposalProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposalAmino { + title?: string; + description?: string; + plan?: PlanAmino; +} +export interface SoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/SoftwareUpgradeProposal"; + value: SoftwareUpgradeProposalAmino; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposalSDKType { + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + title: string; + description: string; + plan: PlanSDKType; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + title: string; + description: string; +} +export interface CancelSoftwareUpgradeProposalProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposalAmino { + title?: string; + description?: string; +} +export interface CancelSoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; + value: CancelSoftwareUpgradeProposalAmino; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposalSDKType { + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + title: string; + description: string; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: bigint; +} +export interface ModuleVersionProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion"; + value: Uint8Array; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionAmino { + /** name of the app module */ + name?: string; + /** consensus version of the app module */ + version?: string; +} +export interface ModuleVersionAminoMsg { + type: "cosmos-sdk/ModuleVersion"; + value: ModuleVersionAmino; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionSDKType { + name: string; + version: bigint; +} +function createBasePlan(): Plan { + return { + name: "", + time: new Date(), + height: BigInt(0), + info: "", + upgradedClientState: undefined + }; +} +export const Plan = { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + encode(message: Plan, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.info = object.info ?? ""; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: PlanAmino): Plan { + const message = createBasePlan(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: Plan): PlanAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.info = message.info === "" ? undefined : message.info; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + return obj; + }, + fromAminoMsg(object: PlanAminoMsg): Plan { + return Plan.fromAmino(object.value); + }, + toAminoMsg(message: Plan): PlanAminoMsg { + return { + type: "cosmos-sdk/Plan", + value: Plan.toAmino(message) + }; + }, + fromProtoMsg(message: PlanProtoMsg): Plan { + return Plan.decode(message.value); + }, + toProto(message: Plan): Uint8Array { + return Plan.encode(message).finish(); + }, + toProtoMsg(message: Plan): PlanProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + value: Plan.encode(message).finish() + }; + } +}; +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { + $typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + title: "", + description: "", + plan: Plan.fromPartial({}) + }; +} +export const SoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + encode(message: SoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + return obj; + }, + fromAminoMsg(object: SoftwareUpgradeProposalAminoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SoftwareUpgradeProposalProtoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: SoftwareUpgradeProposal): Uint8Array { + return SoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { + $typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + title: "", + description: "" + }; +} +export const CancelSoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + encode(message: CancelSoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: CancelSoftwareUpgradeProposalAmino): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: CancelSoftwareUpgradeProposalAminoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CancelSoftwareUpgradeProposalProtoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: CancelSoftwareUpgradeProposal): Uint8Array { + return CancelSoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +function createBaseModuleVersion(): ModuleVersion { + return { + name: "", + version: BigInt(0) + }; +} +export const ModuleVersion = { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + encode(message: ModuleVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== BigInt(0)) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ModuleVersionAmino): ModuleVersion { + const message = createBaseModuleVersion(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + return message; + }, + toAmino(message: ModuleVersion): ModuleVersionAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { + return ModuleVersion.fromAmino(object.value); + }, + toAminoMsg(message: ModuleVersion): ModuleVersionAminoMsg { + return { + type: "cosmos-sdk/ModuleVersion", + value: ModuleVersion.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleVersionProtoMsg): ModuleVersion { + return ModuleVersion.decode(message.value); + }, + toProto(message: ModuleVersion): Uint8Array { + return ModuleVersion.encode(message).finish(); + }, + toProtoMsg(message: ModuleVersion): ModuleVersionProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + value: ModuleVersion.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.amino.ts new file mode 100644 index 00000000..b918e6d3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +export const AminoConverter = { + "/cosmos.vesting.v1beta1.MsgCreateVestingAccount": { + aminoType: "cosmos-sdk/MsgCreateVestingAccount", + toAmino: MsgCreateVestingAccount.toAmino, + fromAmino: MsgCreateVestingAccount.fromAmino + }, + "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount": { + aminoType: "cosmos-sdk/MsgCreatePermanentLockedAccount", + toAmino: MsgCreatePermanentLockedAccount.toAmino, + fromAmino: MsgCreatePermanentLockedAccount.fromAmino + }, + "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount": { + aminoType: "cosmos-sdk/MsgCreatePeriodicVestingAccount", + toAmino: MsgCreatePeriodicVestingAccount.toAmino, + fromAmino: MsgCreatePeriodicVestingAccount.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.registry.ts new file mode 100644 index 00000000..9942916a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.vesting.v1beta1.MsgCreateVestingAccount", MsgCreateVestingAccount], ["/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", MsgCreatePermanentLockedAccount], ["/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", MsgCreatePeriodicVestingAccount]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createVestingAccount(value: MsgCreateVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.encode(value).finish() + }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.encode(value).finish() + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.encode(value).finish() + }; + } + }, + withTypeUrl: { + createVestingAccount(value: MsgCreateVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value + }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value + }; + } + }, + fromPartial: { + createVestingAccount(value: MsgCreateVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.fromPartial(value) + }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.fromPartial(value) + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..8359d9cd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,46 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateVestingAccount, MsgCreateVestingAccountResponse, MsgCreatePermanentLockedAccount, MsgCreatePermanentLockedAccountResponse, MsgCreatePeriodicVestingAccount, MsgCreatePeriodicVestingAccountResponse } from "./tx"; +/** Msg defines the bank Msg service. */ +export interface Msg { + /** + * CreateVestingAccount defines a method that enables creating a vesting + * account. + */ + createVestingAccount(request: MsgCreateVestingAccount): Promise; + /** + * CreatePermanentLockedAccount defines a method that enables creating a permanent + * locked account. + */ + createPermanentLockedAccount(request: MsgCreatePermanentLockedAccount): Promise; + /** + * CreatePeriodicVestingAccount defines a method that enables creating a + * periodic vesting account. + */ + createPeriodicVestingAccount(request: MsgCreatePeriodicVestingAccount): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createVestingAccount = this.createVestingAccount.bind(this); + this.createPermanentLockedAccount = this.createPermanentLockedAccount.bind(this); + this.createPeriodicVestingAccount = this.createPeriodicVestingAccount.bind(this); + } + createVestingAccount(request: MsgCreateVestingAccount): Promise { + const data = MsgCreateVestingAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); + return promise.then(data => MsgCreateVestingAccountResponse.decode(new BinaryReader(data))); + } + createPermanentLockedAccount(request: MsgCreatePermanentLockedAccount): Promise { + const data = MsgCreatePermanentLockedAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePermanentLockedAccount", data); + return promise.then(data => MsgCreatePermanentLockedAccountResponse.decode(new BinaryReader(data))); + } + createPeriodicVestingAccount(request: MsgCreatePeriodicVestingAccount): Promise { + const data = MsgCreatePeriodicVestingAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePeriodicVestingAccount", data); + return promise.then(data => MsgCreatePeriodicVestingAccountResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.ts b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.ts new file mode 100644 index 00000000..78f90c98 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/tx.ts @@ -0,0 +1,658 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Period, PeriodAmino, PeriodSDKType } from "./vesting"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; + endTime: bigint; + delayed: boolean; +} +export interface MsgCreateVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccountAmino { + from_address?: string; + to_address?: string; + amount?: CoinAmino[]; + end_time?: string; + delayed?: boolean; +} +export interface MsgCreateVestingAccountAminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccount"; + value: MsgCreateVestingAccountAmino; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccountSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; + end_time: bigint; + delayed: boolean; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponse {} +export interface MsgCreateVestingAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse"; + value: Uint8Array; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponseAmino {} +export interface MsgCreateVestingAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccountResponse"; + value: MsgCreateVestingAccountResponseAmino; +} +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponseSDKType {} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + */ +export interface MsgCreatePermanentLockedAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +export interface MsgCreatePermanentLockedAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount"; + value: Uint8Array; +} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + */ +export interface MsgCreatePermanentLockedAccountAmino { + from_address?: string; + to_address?: string; + amount?: CoinAmino[]; +} +export interface MsgCreatePermanentLockedAccountAminoMsg { + type: "cosmos-sdk/MsgCreatePermanentLockedAccount"; + value: MsgCreatePermanentLockedAccountAmino; +} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + */ +export interface MsgCreatePermanentLockedAccountSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; +} +/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +export interface MsgCreatePermanentLockedAccountResponse {} +export interface MsgCreatePermanentLockedAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse"; + value: Uint8Array; +} +/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +export interface MsgCreatePermanentLockedAccountResponseAmino {} +export interface MsgCreatePermanentLockedAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreatePermanentLockedAccountResponse"; + value: MsgCreatePermanentLockedAccountResponseAmino; +} +/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +export interface MsgCreatePermanentLockedAccountResponseSDKType {} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreatePeriodicVestingAccount { + fromAddress: string; + toAddress: string; + startTime: bigint; + vestingPeriods: Period[]; +} +export interface MsgCreatePeriodicVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreatePeriodicVestingAccountAmino { + from_address?: string; + to_address?: string; + start_time?: string; + vesting_periods?: PeriodAmino[]; +} +export interface MsgCreatePeriodicVestingAccountAminoMsg { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccount"; + value: MsgCreatePeriodicVestingAccountAmino; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreatePeriodicVestingAccountSDKType { + from_address: string; + to_address: string; + start_time: bigint; + vesting_periods: PeriodSDKType[]; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + */ +export interface MsgCreatePeriodicVestingAccountResponse {} +export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + */ +export interface MsgCreatePeriodicVestingAccountResponseAmino {} +export interface MsgCreatePeriodicVestingAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccountResponse"; + value: MsgCreatePeriodicVestingAccountResponseAmino; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + */ +export interface MsgCreatePeriodicVestingAccountResponseSDKType {} +function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { + return { + fromAddress: "", + toAddress: "", + amount: [], + endTime: BigInt(0), + delayed: false + }; +} +export const MsgCreateVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + encode(message: MsgCreateVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.endTime !== BigInt(0)) { + writer.uint32(32).int64(message.endTime); + } + if (message.delayed === true) { + writer.uint32(40).bool(message.delayed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.endTime = reader.int64(); + break; + case 5: + message.delayed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); + message.delayed = object.delayed ?? false; + return message; + }, + fromAmino(object: MsgCreateVestingAccountAmino): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + if (object.delayed !== undefined && object.delayed !== null) { + message.delayed = object.delayed; + } + return message; + }, + toAmino(message: MsgCreateVestingAccount): MsgCreateVestingAccountAmino { + const obj: any = {}; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.end_time = message.endTime !== BigInt(0) ? message.endTime.toString() : undefined; + obj.delayed = message.delayed === false ? undefined : message.delayed; + return obj; + }, + fromAminoMsg(object: MsgCreateVestingAccountAminoMsg): MsgCreateVestingAccount { + return MsgCreateVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateVestingAccount): MsgCreateVestingAccountAminoMsg { + return { + type: "cosmos-sdk/MsgCreateVestingAccount", + value: MsgCreateVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateVestingAccountProtoMsg): MsgCreateVestingAccount { + return MsgCreateVestingAccount.decode(message.value); + }, + toProto(message: MsgCreateVestingAccount): Uint8Array { + return MsgCreateVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateVestingAccount): MsgCreateVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.encode(message).finish() + }; + } +}; +function createBaseMsgCreateVestingAccountResponse(): MsgCreateVestingAccountResponse { + return {}; +} +export const MsgCreateVestingAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", + encode(_: MsgCreateVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateVestingAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse(); + return message; + }, + fromAmino(_: MsgCreateVestingAccountResponseAmino): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse(); + return message; + }, + toAmino(_: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateVestingAccountResponseAminoMsg): MsgCreateVestingAccountResponse { + return MsgCreateVestingAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateVestingAccountResponse", + value: MsgCreateVestingAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateVestingAccountResponseProtoMsg): MsgCreateVestingAccountResponse { + return MsgCreateVestingAccountResponse.decode(message.value); + }, + toProto(message: MsgCreateVestingAccountResponse): Uint8Array { + return MsgCreateVestingAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", + value: MsgCreateVestingAccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePermanentLockedAccount(): MsgCreatePermanentLockedAccount { + return { + fromAddress: "", + toAddress: "", + amount: [] + }; +} +export const MsgCreatePermanentLockedAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + encode(message: MsgCreatePermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePermanentLockedAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreatePermanentLockedAccount { + const message = createBaseMsgCreatePermanentLockedAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCreatePermanentLockedAccountAmino): MsgCreatePermanentLockedAccount { + const message = createBaseMsgCreatePermanentLockedAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountAmino { + const obj: any = {}; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgCreatePermanentLockedAccountAminoMsg): MsgCreatePermanentLockedAccount { + return MsgCreatePermanentLockedAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePermanentLockedAccountProtoMsg): MsgCreatePermanentLockedAccount { + return MsgCreatePermanentLockedAccount.decode(message.value); + }, + toProto(message: MsgCreatePermanentLockedAccount): Uint8Array { + return MsgCreatePermanentLockedAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePermanentLockedAccountResponse(): MsgCreatePermanentLockedAccountResponse { + return {}; +} +export const MsgCreatePermanentLockedAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + encode(_: MsgCreatePermanentLockedAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreatePermanentLockedAccountResponse { + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + return message; + }, + fromAmino(_: MsgCreatePermanentLockedAccountResponseAmino): MsgCreatePermanentLockedAccountResponse { + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + return message; + }, + toAmino(_: MsgCreatePermanentLockedAccountResponse): MsgCreatePermanentLockedAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreatePermanentLockedAccountResponseAminoMsg): MsgCreatePermanentLockedAccountResponse { + return MsgCreatePermanentLockedAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePermanentLockedAccountResponse): MsgCreatePermanentLockedAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePermanentLockedAccountResponse", + value: MsgCreatePermanentLockedAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePermanentLockedAccountResponseProtoMsg): MsgCreatePermanentLockedAccountResponse { + return MsgCreatePermanentLockedAccountResponse.decode(message.value); + }, + toProto(message: MsgCreatePermanentLockedAccountResponse): Uint8Array { + return MsgCreatePermanentLockedAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePermanentLockedAccountResponse): MsgCreatePermanentLockedAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + value: MsgCreatePermanentLockedAccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAccount { + return { + fromAddress: "", + toAddress: "", + startTime: BigInt(0), + vestingPeriods: [] + }; +} +export const MsgCreatePeriodicVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + encode(message: MsgCreatePeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(24).int64(message.startTime); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePeriodicVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.startTime = reader.int64(); + break; + case 4: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreatePeriodicVestingAccount { + const message = createBaseMsgCreatePeriodicVestingAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); + message.vestingPeriods = object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCreatePeriodicVestingAccountAmino): MsgCreatePeriodicVestingAccount { + const message = createBaseMsgCreatePeriodicVestingAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + message.vestingPeriods = object.vesting_periods?.map(e => Period.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountAmino { + const obj: any = {}; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime.toString() : undefined; + if (message.vestingPeriods) { + obj.vesting_periods = message.vestingPeriods.map(e => e ? Period.toAmino(e) : undefined); + } else { + obj.vesting_periods = message.vestingPeriods; + } + return obj; + }, + fromAminoMsg(object: MsgCreatePeriodicVestingAccountAminoMsg): MsgCreatePeriodicVestingAccount { + return MsgCreatePeriodicVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePeriodicVestingAccountProtoMsg): MsgCreatePeriodicVestingAccount { + return MsgCreatePeriodicVestingAccount.decode(message.value); + }, + toProto(message: MsgCreatePeriodicVestingAccount): Uint8Array { + return MsgCreatePeriodicVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePeriodicVestingAccountResponse(): MsgCreatePeriodicVestingAccountResponse { + return {}; +} +export const MsgCreatePeriodicVestingAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + encode(_: MsgCreatePeriodicVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreatePeriodicVestingAccountResponse { + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); + return message; + }, + fromAmino(_: MsgCreatePeriodicVestingAccountResponseAmino): MsgCreatePeriodicVestingAccountResponse { + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); + return message; + }, + toAmino(_: MsgCreatePeriodicVestingAccountResponse): MsgCreatePeriodicVestingAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreatePeriodicVestingAccountResponseAminoMsg): MsgCreatePeriodicVestingAccountResponse { + return MsgCreatePeriodicVestingAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePeriodicVestingAccountResponse): MsgCreatePeriodicVestingAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccountResponse", + value: MsgCreatePeriodicVestingAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePeriodicVestingAccountResponseProtoMsg): MsgCreatePeriodicVestingAccountResponse { + return MsgCreatePeriodicVestingAccountResponse.decode(message.value); + }, + toProto(message: MsgCreatePeriodicVestingAccountResponse): Uint8Array { + return MsgCreatePeriodicVestingAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePeriodicVestingAccountResponse): MsgCreatePeriodicVestingAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + value: MsgCreatePeriodicVestingAccountResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/vesting.ts b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/vesting.ts new file mode 100644 index 00000000..438ac8fd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos/vesting/v1beta1/vesting.ts @@ -0,0 +1,725 @@ +//@ts-nocheck +import { BaseAccount, BaseAccountAmino, BaseAccountSDKType } from "../../auth/v1beta1/auth"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccount { + baseAccount?: BaseAccount; + originalVesting: Coin[]; + delegatedFree: Coin[]; + delegatedVesting: Coin[]; + endTime: bigint; +} +export interface BaseVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount"; + value: Uint8Array; +} +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccountAmino { + base_account?: BaseAccountAmino; + original_vesting?: CoinAmino[]; + delegated_free?: CoinAmino[]; + delegated_vesting?: CoinAmino[]; + end_time?: string; +} +export interface BaseVestingAccountAminoMsg { + type: "cosmos-sdk/BaseVestingAccount"; + value: BaseVestingAccountAmino; +} +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccountSDKType { + base_account?: BaseAccountSDKType; + original_vesting: CoinSDKType[]; + delegated_free: CoinSDKType[]; + delegated_vesting: CoinSDKType[]; + end_time: bigint; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccount { + baseVestingAccount?: BaseVestingAccount; + startTime: bigint; +} +export interface ContinuousVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount"; + value: Uint8Array; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; + start_time?: string; +} +export interface ContinuousVestingAccountAminoMsg { + type: "cosmos-sdk/ContinuousVestingAccount"; + value: ContinuousVestingAccountAmino; +} +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccountSDKType { + base_vesting_account?: BaseVestingAccountSDKType; + start_time: bigint; +} +/** + * DelayedVestingAccount implements the VestingAccount interface. It vests all + * coins after a specific time, but non prior. In other words, it keeps them + * locked until a specified time. + */ +export interface DelayedVestingAccount { + baseVestingAccount?: BaseVestingAccount; +} +export interface DelayedVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount"; + value: Uint8Array; +} +/** + * DelayedVestingAccount implements the VestingAccount interface. It vests all + * coins after a specific time, but non prior. In other words, it keeps them + * locked until a specified time. + */ +export interface DelayedVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; +} +export interface DelayedVestingAccountAminoMsg { + type: "cosmos-sdk/DelayedVestingAccount"; + value: DelayedVestingAccountAmino; +} +/** + * DelayedVestingAccount implements the VestingAccount interface. It vests all + * coins after a specific time, but non prior. In other words, it keeps them + * locked until a specified time. + */ +export interface DelayedVestingAccountSDKType { + base_vesting_account?: BaseVestingAccountSDKType; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface Period { + length: bigint; + amount: Coin[]; +} +export interface PeriodProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.Period"; + value: Uint8Array; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface PeriodAmino { + length?: string; + amount?: CoinAmino[]; +} +export interface PeriodAminoMsg { + type: "cosmos-sdk/Period"; + value: PeriodAmino; +} +/** Period defines a length of time and amount of coins that will vest. */ +export interface PeriodSDKType { + length: bigint; + amount: CoinSDKType[]; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccount { + baseVestingAccount?: BaseVestingAccount; + startTime: bigint; + vestingPeriods: Period[]; +} +export interface PeriodicVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount"; + value: Uint8Array; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; + start_time?: string; + vesting_periods?: PeriodAmino[]; +} +export interface PeriodicVestingAccountAminoMsg { + type: "cosmos-sdk/PeriodicVestingAccount"; + value: PeriodicVestingAccountAmino; +} +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccountSDKType { + base_vesting_account?: BaseVestingAccountSDKType; + start_time: bigint; + vesting_periods: PeriodSDKType[]; +} +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + * + * Since: cosmos-sdk 0.43 + */ +export interface PermanentLockedAccount { + baseVestingAccount?: BaseVestingAccount; +} +export interface PermanentLockedAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount"; + value: Uint8Array; +} +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + * + * Since: cosmos-sdk 0.43 + */ +export interface PermanentLockedAccountAmino { + base_vesting_account?: BaseVestingAccountAmino; +} +export interface PermanentLockedAccountAminoMsg { + type: "cosmos-sdk/PermanentLockedAccount"; + value: PermanentLockedAccountAmino; +} +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + * + * Since: cosmos-sdk 0.43 + */ +export interface PermanentLockedAccountSDKType { + base_vesting_account?: BaseVestingAccountSDKType; +} +function createBaseBaseVestingAccount(): BaseVestingAccount { + return { + baseAccount: undefined, + originalVesting: [], + delegatedFree: [], + delegatedVesting: [], + endTime: BigInt(0) + }; +} +export const BaseVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount", + encode(message: BaseVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.originalVesting) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.delegatedFree) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.delegatedVesting) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.endTime !== BigInt(0)) { + writer.uint32(40).int64(message.endTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.originalVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.delegatedFree.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 5: + message.endTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BaseVestingAccount { + const message = createBaseBaseVestingAccount(); + message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; + message.originalVesting = object.originalVesting?.map(e => Coin.fromPartial(e)) || []; + message.delegatedFree = object.delegatedFree?.map(e => Coin.fromPartial(e)) || []; + message.delegatedVesting = object.delegatedVesting?.map(e => Coin.fromPartial(e)) || []; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BaseVestingAccountAmino): BaseVestingAccount { + const message = createBaseBaseVestingAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + message.originalVesting = object.original_vesting?.map(e => Coin.fromAmino(e)) || []; + message.delegatedFree = object.delegated_free?.map(e => Coin.fromAmino(e)) || []; + message.delegatedVesting = object.delegated_vesting?.map(e => Coin.fromAmino(e)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + return message; + }, + toAmino(message: BaseVestingAccount): BaseVestingAccountAmino { + const obj: any = {}; + obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; + if (message.originalVesting) { + obj.original_vesting = message.originalVesting.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.original_vesting = message.originalVesting; + } + if (message.delegatedFree) { + obj.delegated_free = message.delegatedFree.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.delegated_free = message.delegatedFree; + } + if (message.delegatedVesting) { + obj.delegated_vesting = message.delegatedVesting.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.delegated_vesting = message.delegatedVesting; + } + obj.end_time = message.endTime !== BigInt(0) ? message.endTime.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BaseVestingAccountAminoMsg): BaseVestingAccount { + return BaseVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: BaseVestingAccount): BaseVestingAccountAminoMsg { + return { + type: "cosmos-sdk/BaseVestingAccount", + value: BaseVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: BaseVestingAccountProtoMsg): BaseVestingAccount { + return BaseVestingAccount.decode(message.value); + }, + toProto(message: BaseVestingAccount): Uint8Array { + return BaseVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: BaseVestingAccount): BaseVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount", + value: BaseVestingAccount.encode(message).finish() + }; + } +}; +function createBaseContinuousVestingAccount(): ContinuousVestingAccount { + return { + baseVestingAccount: undefined, + startTime: BigInt(0) + }; +} +export const ContinuousVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount", + encode(message: ContinuousVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(16).int64(message.startTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContinuousVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContinuousVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ContinuousVestingAccountAmino): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + return message; + }, + toAmino(message: ContinuousVestingAccount): ContinuousVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ContinuousVestingAccountAminoMsg): ContinuousVestingAccount { + return ContinuousVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: ContinuousVestingAccount): ContinuousVestingAccountAminoMsg { + return { + type: "cosmos-sdk/ContinuousVestingAccount", + value: ContinuousVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: ContinuousVestingAccountProtoMsg): ContinuousVestingAccount { + return ContinuousVestingAccount.decode(message.value); + }, + toProto(message: ContinuousVestingAccount): Uint8Array { + return ContinuousVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: ContinuousVestingAccount): ContinuousVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount", + value: ContinuousVestingAccount.encode(message).finish() + }; + } +}; +function createBaseDelayedVestingAccount(): DelayedVestingAccount { + return { + baseVestingAccount: undefined + }; +} +export const DelayedVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount", + encode(message: DelayedVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelayedVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelayedVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + return message; + }, + fromAmino(object: DelayedVestingAccountAmino): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; + }, + toAmino(message: DelayedVestingAccount): DelayedVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + return obj; + }, + fromAminoMsg(object: DelayedVestingAccountAminoMsg): DelayedVestingAccount { + return DelayedVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: DelayedVestingAccount): DelayedVestingAccountAminoMsg { + return { + type: "cosmos-sdk/DelayedVestingAccount", + value: DelayedVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: DelayedVestingAccountProtoMsg): DelayedVestingAccount { + return DelayedVestingAccount.decode(message.value); + }, + toProto(message: DelayedVestingAccount): Uint8Array { + return DelayedVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: DelayedVestingAccount): DelayedVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount", + value: DelayedVestingAccount.encode(message).finish() + }; + } +}; +function createBasePeriod(): Period { + return { + length: BigInt(0), + amount: [] + }; +} +export const Period = { + typeUrl: "/cosmos.vesting.v1beta1.Period", + encode(message: Period, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.length !== BigInt(0)) { + writer.uint32(8).int64(message.length); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Period { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriod(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.length = reader.int64(); + break; + case 2: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Period { + const message = createBasePeriod(); + message.length = object.length !== undefined && object.length !== null ? BigInt(object.length.toString()) : BigInt(0); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PeriodAmino): Period { + const message = createBasePeriod(); + if (object.length !== undefined && object.length !== null) { + message.length = BigInt(object.length); + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Period): PeriodAmino { + const obj: any = {}; + obj.length = message.length !== BigInt(0) ? message.length.toString() : undefined; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: PeriodAminoMsg): Period { + return Period.fromAmino(object.value); + }, + toAminoMsg(message: Period): PeriodAminoMsg { + return { + type: "cosmos-sdk/Period", + value: Period.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodProtoMsg): Period { + return Period.decode(message.value); + }, + toProto(message: Period): Uint8Array { + return Period.encode(message).finish(); + }, + toProtoMsg(message: Period): PeriodProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.Period", + value: Period.encode(message).finish() + }; + } +}; +function createBasePeriodicVestingAccount(): PeriodicVestingAccount { + return { + baseVestingAccount: undefined, + startTime: BigInt(0), + vestingPeriods: [] + }; +} +export const PeriodicVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount", + encode(message: PeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(16).int64(message.startTime); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriodicVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64(); + break; + case 3: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); + message.vestingPeriods = object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PeriodicVestingAccountAmino): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + message.vestingPeriods = object.vesting_periods?.map(e => Period.fromAmino(e)) || []; + return message; + }, + toAmino(message: PeriodicVestingAccount): PeriodicVestingAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime.toString() : undefined; + if (message.vestingPeriods) { + obj.vesting_periods = message.vestingPeriods.map(e => e ? Period.toAmino(e) : undefined); + } else { + obj.vesting_periods = message.vestingPeriods; + } + return obj; + }, + fromAminoMsg(object: PeriodicVestingAccountAminoMsg): PeriodicVestingAccount { + return PeriodicVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: PeriodicVestingAccount): PeriodicVestingAccountAminoMsg { + return { + type: "cosmos-sdk/PeriodicVestingAccount", + value: PeriodicVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodicVestingAccountProtoMsg): PeriodicVestingAccount { + return PeriodicVestingAccount.decode(message.value); + }, + toProto(message: PeriodicVestingAccount): Uint8Array { + return PeriodicVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: PeriodicVestingAccount): PeriodicVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount", + value: PeriodicVestingAccount.encode(message).finish() + }; + } +}; +function createBasePermanentLockedAccount(): PermanentLockedAccount { + return { + baseVestingAccount: undefined + }; +} +export const PermanentLockedAccount = { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount", + encode(message: PermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermanentLockedAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PermanentLockedAccount { + const message = createBasePermanentLockedAccount(); + message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; + return message; + }, + fromAmino(object: PermanentLockedAccountAmino): PermanentLockedAccount { + const message = createBasePermanentLockedAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; + }, + toAmino(message: PermanentLockedAccount): PermanentLockedAccountAmino { + const obj: any = {}; + obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; + return obj; + }, + fromAminoMsg(object: PermanentLockedAccountAminoMsg): PermanentLockedAccount { + return PermanentLockedAccount.fromAmino(object.value); + }, + toAminoMsg(message: PermanentLockedAccount): PermanentLockedAccountAminoMsg { + return { + type: "cosmos-sdk/PermanentLockedAccount", + value: PermanentLockedAccount.toAmino(message) + }; + }, + fromProtoMsg(message: PermanentLockedAccountProtoMsg): PermanentLockedAccount { + return PermanentLockedAccount.decode(message.value); + }, + toProto(message: PermanentLockedAccount): Uint8Array { + return PermanentLockedAccount.encode(message).finish(); + }, + toProtoMsg(message: PermanentLockedAccount): PermanentLockedAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount", + value: PermanentLockedAccount.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos_proto/bundle.ts b/dydxjs/packages/dydxjs/src/cosmos_proto/bundle.ts new file mode 100644 index 00000000..f7a3b192 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos_proto/bundle.ts @@ -0,0 +1,5 @@ +//@ts-nocheck +import * as _2 from "./cosmos"; +export const cosmos_proto = { + ..._2 +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmos_proto/cosmos.ts b/dydxjs/packages/dydxjs/src/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..e44cd3db --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmos_proto/cosmos.ts @@ -0,0 +1,349 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../binary"; +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} +export const ScalarTypeSDKType = ScalarType; +export const ScalarTypeAmino = ScalarType; +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} +export interface InterfaceDescriptorProtoMsg { + typeUrl: "/cosmos_proto.InterfaceDescriptor"; + value: Uint8Array; +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptorAmino { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name?: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description?: string; +} +export interface InterfaceDescriptorAminoMsg { + type: "/cosmos_proto.InterfaceDescriptor"; + value: InterfaceDescriptorAmino; +} +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptorSDKType { + name: string; + description: string; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} +export interface ScalarDescriptorProtoMsg { + typeUrl: "/cosmos_proto.ScalarDescriptor"; + value: Uint8Array; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptorAmino { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name?: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description?: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + field_type?: ScalarType[]; +} +export interface ScalarDescriptorAminoMsg { + type: "/cosmos_proto.ScalarDescriptor"; + value: ScalarDescriptorAmino; +} +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptorSDKType { + name: string; + description: string; + field_type: ScalarType[]; +} +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { + name: "", + description: "" + }; +} +export const InterfaceDescriptor = { + typeUrl: "/cosmos_proto.InterfaceDescriptor", + encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { + return InterfaceDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: InterfaceDescriptorProtoMsg): InterfaceDescriptor { + return InterfaceDescriptor.decode(message.value); + }, + toProto(message: InterfaceDescriptor): Uint8Array { + return InterfaceDescriptor.encode(message).finish(); + }, + toProtoMsg(message: InterfaceDescriptor): InterfaceDescriptorProtoMsg { + return { + typeUrl: "/cosmos_proto.InterfaceDescriptor", + value: InterfaceDescriptor.encode(message).finish() + }; + } +}; +function createBaseScalarDescriptor(): ScalarDescriptor { + return { + name: "", + description: "", + fieldType: [] + }; +} +export const ScalarDescriptor = { + typeUrl: "/cosmos_proto.ScalarDescriptor", + encode(message: ScalarDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map(e => e) || []; + return message; + }, + fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.fieldType = object.field_type?.map(e => e) || []; + return message; + }, + toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; + if (message.fieldType) { + obj.field_type = message.fieldType.map(e => e); + } else { + obj.field_type = message.fieldType; + } + return obj; + }, + fromAminoMsg(object: ScalarDescriptorAminoMsg): ScalarDescriptor { + return ScalarDescriptor.fromAmino(object.value); + }, + fromProtoMsg(message: ScalarDescriptorProtoMsg): ScalarDescriptor { + return ScalarDescriptor.decode(message.value); + }, + toProto(message: ScalarDescriptor): Uint8Array { + return ScalarDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ScalarDescriptor): ScalarDescriptorProtoMsg { + return { + typeUrl: "/cosmos_proto.ScalarDescriptor", + value: ScalarDescriptor.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/bundle.ts b/dydxjs/packages/dydxjs/src/cosmwasm/bundle.ts new file mode 100644 index 00000000..551cf932 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/bundle.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import * as _65 from "./wasm/v1/authz"; +import * as _66 from "./wasm/v1/genesis"; +import * as _67 from "./wasm/v1/ibc"; +import * as _68 from "./wasm/v1/proposal"; +import * as _69 from "./wasm/v1/query"; +import * as _70 from "./wasm/v1/tx"; +import * as _71 from "./wasm/v1/types"; +import * as _299 from "./wasm/v1/tx.amino"; +import * as _300 from "./wasm/v1/tx.registry"; +import * as _301 from "./wasm/v1/query.rpc.Query"; +import * as _302 from "./wasm/v1/tx.rpc.msg"; +import * as _409 from "./rpc.query"; +import * as _410 from "./rpc.tx"; +export namespace cosmwasm { + export namespace wasm { + export const v1 = { + ..._65, + ..._66, + ..._67, + ..._68, + ..._69, + ..._70, + ..._71, + ..._299, + ..._300, + ..._301, + ..._302 + }; + } + export const ClientFactory = { + ..._409, + ..._410 + }; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/client.ts b/dydxjs/packages/dydxjs/src/cosmwasm/client.ts new file mode 100644 index 00000000..a790e0c6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/client.ts @@ -0,0 +1,46 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmwasmWasmV1TxRegistry from "./wasm/v1/tx.registry"; +import * as cosmwasmWasmV1TxAmino from "./wasm/v1/tx.amino"; +export const cosmwasmAminoConverters = { + ...cosmwasmWasmV1TxAmino.AminoConverter +}; +export const cosmwasmProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmwasmWasmV1TxRegistry.registry]; +export const getSigningCosmwasmClientOptions = ({ + defaultTypes = defaultRegistryTypes +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...cosmwasmProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...cosmwasmAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningCosmwasmClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningCosmwasmClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/rpc.query.ts b/dydxjs/packages/dydxjs/src/cosmwasm/rpc.query.ts new file mode 100644 index 00000000..a404da86 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/rpc.query.ts @@ -0,0 +1,57 @@ +//@ts-nocheck +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + group: { + v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + cosmwasm: { + wasm: { + v1: (await import("./wasm/v1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/rpc.tx.ts b/dydxjs/packages/dydxjs/src/cosmwasm/rpc.tx.ts new file mode 100644 index 00000000..67cf77ab --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/rpc.tx.ts @@ -0,0 +1,43 @@ +//@ts-nocheck +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + group: { + v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + vesting: { + v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + cosmwasm: { + wasm: { + v1: new (await import("./wasm/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/authz.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/authz.ts new file mode 100644 index 00000000..b28afd6c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/authz.ts @@ -0,0 +1,1125 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorization { + $typeUrl?: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; + /** Grants for contract executions */ + grants: ContractGrant[]; +} +export interface ContractExecutionAuthorizationProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; + value: Uint8Array; +} +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorizationAmino { + /** Grants for contract executions */ + grants?: ContractGrantAmino[]; +} +export interface ContractExecutionAuthorizationAminoMsg { + type: "wasm/ContractExecutionAuthorization"; + value: ContractExecutionAuthorizationAmino; +} +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorizationSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; + grants: ContractGrantSDKType[]; +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorization { + $typeUrl?: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; + /** Grants for contract migrations */ + grants: ContractGrant[]; +} +export interface ContractMigrationAuthorizationProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; + value: Uint8Array; +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorizationAmino { + /** Grants for contract migrations */ + grants?: ContractGrantAmino[]; +} +export interface ContractMigrationAuthorizationAminoMsg { + type: "wasm/ContractMigrationAuthorization"; + value: ContractMigrationAuthorizationAmino; +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorizationSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; + grants: ContractGrantSDKType[]; +} +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrant { + /** Contract is the bech32 address of the smart contract */ + contract: string; + /** + * Limit defines execution limits that are enforced and updated when the grant + * is applied. When the limit lapsed the grant is removed. + */ + limit?: MaxCallsLimit | MaxFundsLimit | CombinedLimit | Any | undefined; + /** + * Filter define more fine-grained control on the message payload passed + * to the contract in the operation. When no filter applies on execution, the + * operation is prohibited. + */ + filter?: AllowAllMessagesFilter | AcceptedMessageKeysFilter | AcceptedMessagesFilter | Any | undefined; +} +export interface ContractGrantProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractGrant"; + value: Uint8Array; +} +export type ContractGrantEncoded = Omit & { + /** + * Limit defines execution limits that are enforced and updated when the grant + * is applied. When the limit lapsed the grant is removed. + */ + limit?: MaxCallsLimitProtoMsg | MaxFundsLimitProtoMsg | CombinedLimitProtoMsg | AnyProtoMsg | undefined; + /** + * Filter define more fine-grained control on the message payload passed + * to the contract in the operation. When no filter applies on execution, the + * operation is prohibited. + */ + filter?: AllowAllMessagesFilterProtoMsg | AcceptedMessageKeysFilterProtoMsg | AcceptedMessagesFilterProtoMsg | AnyProtoMsg | undefined; +}; +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrantAmino { + /** Contract is the bech32 address of the smart contract */ + contract?: string; + /** + * Limit defines execution limits that are enforced and updated when the grant + * is applied. When the limit lapsed the grant is removed. + */ + limit?: AnyAmino; + /** + * Filter define more fine-grained control on the message payload passed + * to the contract in the operation. When no filter applies on execution, the + * operation is prohibited. + */ + filter?: AnyAmino; +} +export interface ContractGrantAminoMsg { + type: "wasm/ContractGrant"; + value: ContractGrantAmino; +} +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrantSDKType { + contract: string; + limit?: MaxCallsLimitSDKType | MaxFundsLimitSDKType | CombinedLimitSDKType | AnySDKType | undefined; + filter?: AllowAllMessagesFilterSDKType | AcceptedMessageKeysFilterSDKType | AcceptedMessagesFilterSDKType | AnySDKType | undefined; +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimit { + $typeUrl?: "/cosmwasm.wasm.v1.MaxCallsLimit"; + /** Remaining number that is decremented on each execution */ + remaining: bigint; +} +export interface MaxCallsLimitProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit"; + value: Uint8Array; +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimitAmino { + /** Remaining number that is decremented on each execution */ + remaining?: string; +} +export interface MaxCallsLimitAminoMsg { + type: "wasm/MaxCallsLimit"; + value: MaxCallsLimitAmino; +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimitSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.MaxCallsLimit"; + remaining: bigint; +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimit { + $typeUrl?: "/cosmwasm.wasm.v1.MaxFundsLimit"; + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: Coin[]; +} +export interface MaxFundsLimitProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit"; + value: Uint8Array; +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimitAmino { + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts?: CoinAmino[]; +} +export interface MaxFundsLimitAminoMsg { + type: "wasm/MaxFundsLimit"; + value: MaxFundsLimitAmino; +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimitSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.MaxFundsLimit"; + amounts: CoinSDKType[]; +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimit { + $typeUrl?: "/cosmwasm.wasm.v1.CombinedLimit"; + /** Remaining number that is decremented on each execution */ + callsRemaining: bigint; + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: Coin[]; +} +export interface CombinedLimitProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CombinedLimit"; + value: Uint8Array; +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimitAmino { + /** Remaining number that is decremented on each execution */ + calls_remaining?: string; + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts?: CoinAmino[]; +} +export interface CombinedLimitAminoMsg { + type: "wasm/CombinedLimit"; + value: CombinedLimitAmino; +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimitSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.CombinedLimit"; + calls_remaining: bigint; + amounts: CoinSDKType[]; +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilter { + $typeUrl?: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; +} +export interface AllowAllMessagesFilterProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; + value: Uint8Array; +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilterAmino {} +export interface AllowAllMessagesFilterAminoMsg { + type: "wasm/AllowAllMessagesFilter"; + value: AllowAllMessagesFilterAmino; +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilterSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilter { + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; + /** Messages is the list of unique keys */ + keys: string[]; +} +export interface AcceptedMessageKeysFilterProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; + value: Uint8Array; +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilterAmino { + /** Messages is the list of unique keys */ + keys?: string[]; +} +export interface AcceptedMessageKeysFilterAminoMsg { + type: "wasm/AcceptedMessageKeysFilter"; + value: AcceptedMessageKeysFilterAmino; +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilterSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; + keys: string[]; +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilter { + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; + /** Messages is the list of raw contract messages */ + messages: Uint8Array[]; +} +export interface AcceptedMessagesFilterProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; + value: Uint8Array; +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilterAmino { + /** Messages is the list of raw contract messages */ + messages?: any[]; +} +export interface AcceptedMessagesFilterAminoMsg { + type: "wasm/AcceptedMessagesFilter"; + value: AcceptedMessagesFilterAmino; +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilterSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; + messages: Uint8Array[]; +} +function createBaseContractExecutionAuthorization(): ContractExecutionAuthorization { + return { + $typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", + grants: [] + }; +} +export const ContractExecutionAuthorization = { + typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", + encode(message: ContractExecutionAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractExecutionAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractExecutionAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(ContractGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractExecutionAuthorization { + const message = createBaseContractExecutionAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ContractExecutionAuthorizationAmino): ContractExecutionAuthorization { + const message = createBaseContractExecutionAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromAmino(e)) || []; + return message; + }, + toAmino(message: ContractExecutionAuthorization): ContractExecutionAuthorizationAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? ContractGrant.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: ContractExecutionAuthorizationAminoMsg): ContractExecutionAuthorization { + return ContractExecutionAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: ContractExecutionAuthorization): ContractExecutionAuthorizationAminoMsg { + return { + type: "wasm/ContractExecutionAuthorization", + value: ContractExecutionAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: ContractExecutionAuthorizationProtoMsg): ContractExecutionAuthorization { + return ContractExecutionAuthorization.decode(message.value); + }, + toProto(message: ContractExecutionAuthorization): Uint8Array { + return ContractExecutionAuthorization.encode(message).finish(); + }, + toProtoMsg(message: ContractExecutionAuthorization): ContractExecutionAuthorizationProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", + value: ContractExecutionAuthorization.encode(message).finish() + }; + } +}; +function createBaseContractMigrationAuthorization(): ContractMigrationAuthorization { + return { + $typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", + grants: [] + }; +} +export const ContractMigrationAuthorization = { + typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", + encode(message: ContractMigrationAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractMigrationAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractMigrationAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(ContractGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractMigrationAuthorization { + const message = createBaseContractMigrationAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ContractMigrationAuthorizationAmino): ContractMigrationAuthorization { + const message = createBaseContractMigrationAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromAmino(e)) || []; + return message; + }, + toAmino(message: ContractMigrationAuthorization): ContractMigrationAuthorizationAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? ContractGrant.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: ContractMigrationAuthorizationAminoMsg): ContractMigrationAuthorization { + return ContractMigrationAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: ContractMigrationAuthorization): ContractMigrationAuthorizationAminoMsg { + return { + type: "wasm/ContractMigrationAuthorization", + value: ContractMigrationAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: ContractMigrationAuthorizationProtoMsg): ContractMigrationAuthorization { + return ContractMigrationAuthorization.decode(message.value); + }, + toProto(message: ContractMigrationAuthorization): Uint8Array { + return ContractMigrationAuthorization.encode(message).finish(); + }, + toProtoMsg(message: ContractMigrationAuthorization): ContractMigrationAuthorizationProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", + value: ContractMigrationAuthorization.encode(message).finish() + }; + } +}; +function createBaseContractGrant(): ContractGrant { + return { + contract: "", + limit: undefined, + filter: undefined + }; +} +export const ContractGrant = { + typeUrl: "/cosmwasm.wasm.v1.ContractGrant", + encode(message: ContractGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contract !== "") { + writer.uint32(10).string(message.contract); + } + if (message.limit !== undefined) { + Any.encode(message.limit as Any, writer.uint32(18).fork()).ldelim(); + } + if (message.filter !== undefined) { + Any.encode(message.filter as Any, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contract = reader.string(); + break; + case 2: + message.limit = ContractAuthzLimitX_InterfaceDecoder(reader) as Any; + break; + case 3: + message.filter = ContractAuthzFilterX_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractGrant { + const message = createBaseContractGrant(); + message.contract = object.contract ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? Any.fromPartial(object.limit) : undefined; + message.filter = object.filter !== undefined && object.filter !== null ? Any.fromPartial(object.filter) : undefined; + return message; + }, + fromAmino(object: ContractGrantAmino): ContractGrant { + const message = createBaseContractGrant(); + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = ContractAuthzLimitX_FromAmino(object.limit); + } + if (object.filter !== undefined && object.filter !== null) { + message.filter = ContractAuthzFilterX_FromAmino(object.filter); + } + return message; + }, + toAmino(message: ContractGrant): ContractGrantAmino { + const obj: any = {}; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.limit = message.limit ? ContractAuthzLimitX_ToAmino(message.limit as Any) : undefined; + obj.filter = message.filter ? ContractAuthzFilterX_ToAmino(message.filter as Any) : undefined; + return obj; + }, + fromAminoMsg(object: ContractGrantAminoMsg): ContractGrant { + return ContractGrant.fromAmino(object.value); + }, + toAminoMsg(message: ContractGrant): ContractGrantAminoMsg { + return { + type: "wasm/ContractGrant", + value: ContractGrant.toAmino(message) + }; + }, + fromProtoMsg(message: ContractGrantProtoMsg): ContractGrant { + return ContractGrant.decode(message.value); + }, + toProto(message: ContractGrant): Uint8Array { + return ContractGrant.encode(message).finish(); + }, + toProtoMsg(message: ContractGrant): ContractGrantProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractGrant", + value: ContractGrant.encode(message).finish() + }; + } +}; +function createBaseMaxCallsLimit(): MaxCallsLimit { + return { + $typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit", + remaining: BigInt(0) + }; +} +export const MaxCallsLimit = { + typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit", + encode(message: MaxCallsLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.remaining !== BigInt(0)) { + writer.uint32(8).uint64(message.remaining); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MaxCallsLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMaxCallsLimit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.remaining = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MaxCallsLimit { + const message = createBaseMaxCallsLimit(); + message.remaining = object.remaining !== undefined && object.remaining !== null ? BigInt(object.remaining.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MaxCallsLimitAmino): MaxCallsLimit { + const message = createBaseMaxCallsLimit(); + if (object.remaining !== undefined && object.remaining !== null) { + message.remaining = BigInt(object.remaining); + } + return message; + }, + toAmino(message: MaxCallsLimit): MaxCallsLimitAmino { + const obj: any = {}; + obj.remaining = message.remaining !== BigInt(0) ? message.remaining.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MaxCallsLimitAminoMsg): MaxCallsLimit { + return MaxCallsLimit.fromAmino(object.value); + }, + toAminoMsg(message: MaxCallsLimit): MaxCallsLimitAminoMsg { + return { + type: "wasm/MaxCallsLimit", + value: MaxCallsLimit.toAmino(message) + }; + }, + fromProtoMsg(message: MaxCallsLimitProtoMsg): MaxCallsLimit { + return MaxCallsLimit.decode(message.value); + }, + toProto(message: MaxCallsLimit): Uint8Array { + return MaxCallsLimit.encode(message).finish(); + }, + toProtoMsg(message: MaxCallsLimit): MaxCallsLimitProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit", + value: MaxCallsLimit.encode(message).finish() + }; + } +}; +function createBaseMaxFundsLimit(): MaxFundsLimit { + return { + $typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit", + amounts: [] + }; +} +export const MaxFundsLimit = { + typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit", + encode(message: MaxFundsLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amounts) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MaxFundsLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMaxFundsLimit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amounts.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MaxFundsLimit { + const message = createBaseMaxFundsLimit(); + message.amounts = object.amounts?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MaxFundsLimitAmino): MaxFundsLimit { + const message = createBaseMaxFundsLimit(); + message.amounts = object.amounts?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MaxFundsLimit): MaxFundsLimitAmino { + const obj: any = {}; + if (message.amounts) { + obj.amounts = message.amounts.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amounts = message.amounts; + } + return obj; + }, + fromAminoMsg(object: MaxFundsLimitAminoMsg): MaxFundsLimit { + return MaxFundsLimit.fromAmino(object.value); + }, + toAminoMsg(message: MaxFundsLimit): MaxFundsLimitAminoMsg { + return { + type: "wasm/MaxFundsLimit", + value: MaxFundsLimit.toAmino(message) + }; + }, + fromProtoMsg(message: MaxFundsLimitProtoMsg): MaxFundsLimit { + return MaxFundsLimit.decode(message.value); + }, + toProto(message: MaxFundsLimit): Uint8Array { + return MaxFundsLimit.encode(message).finish(); + }, + toProtoMsg(message: MaxFundsLimit): MaxFundsLimitProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit", + value: MaxFundsLimit.encode(message).finish() + }; + } +}; +function createBaseCombinedLimit(): CombinedLimit { + return { + $typeUrl: "/cosmwasm.wasm.v1.CombinedLimit", + callsRemaining: BigInt(0), + amounts: [] + }; +} +export const CombinedLimit = { + typeUrl: "/cosmwasm.wasm.v1.CombinedLimit", + encode(message: CombinedLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.callsRemaining !== BigInt(0)) { + writer.uint32(8).uint64(message.callsRemaining); + } + for (const v of message.amounts) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CombinedLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCombinedLimit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.callsRemaining = reader.uint64(); + break; + case 2: + message.amounts.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CombinedLimit { + const message = createBaseCombinedLimit(); + message.callsRemaining = object.callsRemaining !== undefined && object.callsRemaining !== null ? BigInt(object.callsRemaining.toString()) : BigInt(0); + message.amounts = object.amounts?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CombinedLimitAmino): CombinedLimit { + const message = createBaseCombinedLimit(); + if (object.calls_remaining !== undefined && object.calls_remaining !== null) { + message.callsRemaining = BigInt(object.calls_remaining); + } + message.amounts = object.amounts?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CombinedLimit): CombinedLimitAmino { + const obj: any = {}; + obj.calls_remaining = message.callsRemaining !== BigInt(0) ? message.callsRemaining.toString() : undefined; + if (message.amounts) { + obj.amounts = message.amounts.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amounts = message.amounts; + } + return obj; + }, + fromAminoMsg(object: CombinedLimitAminoMsg): CombinedLimit { + return CombinedLimit.fromAmino(object.value); + }, + toAminoMsg(message: CombinedLimit): CombinedLimitAminoMsg { + return { + type: "wasm/CombinedLimit", + value: CombinedLimit.toAmino(message) + }; + }, + fromProtoMsg(message: CombinedLimitProtoMsg): CombinedLimit { + return CombinedLimit.decode(message.value); + }, + toProto(message: CombinedLimit): Uint8Array { + return CombinedLimit.encode(message).finish(); + }, + toProtoMsg(message: CombinedLimit): CombinedLimitProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CombinedLimit", + value: CombinedLimit.encode(message).finish() + }; + } +}; +function createBaseAllowAllMessagesFilter(): AllowAllMessagesFilter { + return { + $typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter" + }; +} +export const AllowAllMessagesFilter = { + typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter", + encode(_: AllowAllMessagesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllowAllMessagesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllowAllMessagesFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): AllowAllMessagesFilter { + const message = createBaseAllowAllMessagesFilter(); + return message; + }, + fromAmino(_: AllowAllMessagesFilterAmino): AllowAllMessagesFilter { + const message = createBaseAllowAllMessagesFilter(); + return message; + }, + toAmino(_: AllowAllMessagesFilter): AllowAllMessagesFilterAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: AllowAllMessagesFilterAminoMsg): AllowAllMessagesFilter { + return AllowAllMessagesFilter.fromAmino(object.value); + }, + toAminoMsg(message: AllowAllMessagesFilter): AllowAllMessagesFilterAminoMsg { + return { + type: "wasm/AllowAllMessagesFilter", + value: AllowAllMessagesFilter.toAmino(message) + }; + }, + fromProtoMsg(message: AllowAllMessagesFilterProtoMsg): AllowAllMessagesFilter { + return AllowAllMessagesFilter.decode(message.value); + }, + toProto(message: AllowAllMessagesFilter): Uint8Array { + return AllowAllMessagesFilter.encode(message).finish(); + }, + toProtoMsg(message: AllowAllMessagesFilter): AllowAllMessagesFilterProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter", + value: AllowAllMessagesFilter.encode(message).finish() + }; + } +}; +function createBaseAcceptedMessageKeysFilter(): AcceptedMessageKeysFilter { + return { + $typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter", + keys: [] + }; +} +export const AcceptedMessageKeysFilter = { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter", + encode(message: AcceptedMessageKeysFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.keys) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AcceptedMessageKeysFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptedMessageKeysFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keys.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AcceptedMessageKeysFilter { + const message = createBaseAcceptedMessageKeysFilter(); + message.keys = object.keys?.map(e => e) || []; + return message; + }, + fromAmino(object: AcceptedMessageKeysFilterAmino): AcceptedMessageKeysFilter { + const message = createBaseAcceptedMessageKeysFilter(); + message.keys = object.keys?.map(e => e) || []; + return message; + }, + toAmino(message: AcceptedMessageKeysFilter): AcceptedMessageKeysFilterAmino { + const obj: any = {}; + if (message.keys) { + obj.keys = message.keys.map(e => e); + } else { + obj.keys = message.keys; + } + return obj; + }, + fromAminoMsg(object: AcceptedMessageKeysFilterAminoMsg): AcceptedMessageKeysFilter { + return AcceptedMessageKeysFilter.fromAmino(object.value); + }, + toAminoMsg(message: AcceptedMessageKeysFilter): AcceptedMessageKeysFilterAminoMsg { + return { + type: "wasm/AcceptedMessageKeysFilter", + value: AcceptedMessageKeysFilter.toAmino(message) + }; + }, + fromProtoMsg(message: AcceptedMessageKeysFilterProtoMsg): AcceptedMessageKeysFilter { + return AcceptedMessageKeysFilter.decode(message.value); + }, + toProto(message: AcceptedMessageKeysFilter): Uint8Array { + return AcceptedMessageKeysFilter.encode(message).finish(); + }, + toProtoMsg(message: AcceptedMessageKeysFilter): AcceptedMessageKeysFilterProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter", + value: AcceptedMessageKeysFilter.encode(message).finish() + }; + } +}; +function createBaseAcceptedMessagesFilter(): AcceptedMessagesFilter { + return { + $typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter", + messages: [] + }; +} +export const AcceptedMessagesFilter = { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter", + encode(message: AcceptedMessagesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AcceptedMessagesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptedMessagesFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AcceptedMessagesFilter { + const message = createBaseAcceptedMessagesFilter(); + message.messages = object.messages?.map(e => e) || []; + return message; + }, + fromAmino(object: AcceptedMessagesFilterAmino): AcceptedMessagesFilter { + const message = createBaseAcceptedMessagesFilter(); + message.messages = object.messages?.map(e => toUtf8(JSON.stringify(e))) || []; + return message; + }, + toAmino(message: AcceptedMessagesFilter): AcceptedMessagesFilterAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => JSON.parse(fromUtf8(e))); + } else { + obj.messages = message.messages; + } + return obj; + }, + fromAminoMsg(object: AcceptedMessagesFilterAminoMsg): AcceptedMessagesFilter { + return AcceptedMessagesFilter.fromAmino(object.value); + }, + toAminoMsg(message: AcceptedMessagesFilter): AcceptedMessagesFilterAminoMsg { + return { + type: "wasm/AcceptedMessagesFilter", + value: AcceptedMessagesFilter.toAmino(message) + }; + }, + fromProtoMsg(message: AcceptedMessagesFilterProtoMsg): AcceptedMessagesFilter { + return AcceptedMessagesFilter.decode(message.value); + }, + toProto(message: AcceptedMessagesFilter): Uint8Array { + return AcceptedMessagesFilter.encode(message).finish(); + }, + toProtoMsg(message: AcceptedMessagesFilter): AcceptedMessagesFilterProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter", + value: AcceptedMessagesFilter.encode(message).finish() + }; + } +}; +export const ContractAuthzLimitX_InterfaceDecoder = (input: BinaryReader | Uint8Array): MaxCallsLimit | MaxFundsLimit | CombinedLimit | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmwasm.wasm.v1.MaxCallsLimit": + return MaxCallsLimit.decode(data.value); + case "/cosmwasm.wasm.v1.MaxFundsLimit": + return MaxFundsLimit.decode(data.value); + case "/cosmwasm.wasm.v1.CombinedLimit": + return CombinedLimit.decode(data.value); + default: + return data; + } +}; +export const ContractAuthzLimitX_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "wasm/MaxCallsLimit": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit", + value: MaxCallsLimit.encode(MaxCallsLimit.fromPartial(MaxCallsLimit.fromAmino(content.value))).finish() + }); + case "wasm/MaxFundsLimit": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit", + value: MaxFundsLimit.encode(MaxFundsLimit.fromPartial(MaxFundsLimit.fromAmino(content.value))).finish() + }); + case "wasm/CombinedLimit": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.CombinedLimit", + value: CombinedLimit.encode(CombinedLimit.fromPartial(CombinedLimit.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const ContractAuthzLimitX_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmwasm.wasm.v1.MaxCallsLimit": + return { + type: "wasm/MaxCallsLimit", + value: MaxCallsLimit.toAmino(MaxCallsLimit.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.MaxFundsLimit": + return { + type: "wasm/MaxFundsLimit", + value: MaxFundsLimit.toAmino(MaxFundsLimit.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.CombinedLimit": + return { + type: "wasm/CombinedLimit", + value: CombinedLimit.toAmino(CombinedLimit.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; +export const ContractAuthzFilterX_InterfaceDecoder = (input: BinaryReader | Uint8Array): AllowAllMessagesFilter | AcceptedMessageKeysFilter | AcceptedMessagesFilter | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmwasm.wasm.v1.AllowAllMessagesFilter": + return AllowAllMessagesFilter.decode(data.value); + case "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter": + return AcceptedMessageKeysFilter.decode(data.value); + case "/cosmwasm.wasm.v1.AcceptedMessagesFilter": + return AcceptedMessagesFilter.decode(data.value); + default: + return data; + } +}; +export const ContractAuthzFilterX_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "wasm/AllowAllMessagesFilter": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter", + value: AllowAllMessagesFilter.encode(AllowAllMessagesFilter.fromPartial(AllowAllMessagesFilter.fromAmino(content.value))).finish() + }); + case "wasm/AcceptedMessageKeysFilter": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter", + value: AcceptedMessageKeysFilter.encode(AcceptedMessageKeysFilter.fromPartial(AcceptedMessageKeysFilter.fromAmino(content.value))).finish() + }); + case "wasm/AcceptedMessagesFilter": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter", + value: AcceptedMessagesFilter.encode(AcceptedMessagesFilter.fromPartial(AcceptedMessagesFilter.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const ContractAuthzFilterX_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmwasm.wasm.v1.AllowAllMessagesFilter": + return { + type: "wasm/AllowAllMessagesFilter", + value: AllowAllMessagesFilter.toAmino(AllowAllMessagesFilter.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter": + return { + type: "wasm/AcceptedMessageKeysFilter", + value: AcceptedMessageKeysFilter.toAmino(AcceptedMessageKeysFilter.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.AcceptedMessagesFilter": + return { + type: "wasm/AcceptedMessagesFilter", + value: AcceptedMessagesFilter.toAmino(AcceptedMessagesFilter.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/genesis.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/genesis.ts new file mode 100644 index 00000000..f38b8b95 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/genesis.ts @@ -0,0 +1,522 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType, CodeInfo, CodeInfoAmino, CodeInfoSDKType, ContractInfo, ContractInfoAmino, ContractInfoSDKType, Model, ModelAmino, ModelSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** GenesisState - genesis state of x/wasm */ +export interface GenesisState { + params: Params; + codes: Code[]; + contracts: Contract[]; + sequences: Sequence[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateAmino { + params?: ParamsAmino; + codes?: CodeAmino[]; + contracts?: ContractAmino[]; + sequences?: SequenceAmino[]; +} +export interface GenesisStateAminoMsg { + type: "wasm/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + codes: CodeSDKType[]; + contracts: ContractSDKType[]; + sequences: SequenceSDKType[]; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface Code { + codeId: bigint; + codeInfo: CodeInfo; + codeBytes: Uint8Array; + /** Pinned to wasmvm cache */ + pinned: boolean; +} +export interface CodeProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Code"; + value: Uint8Array; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface CodeAmino { + code_id?: string; + code_info?: CodeInfoAmino; + code_bytes?: string; + /** Pinned to wasmvm cache */ + pinned?: boolean; +} +export interface CodeAminoMsg { + type: "wasm/Code"; + value: CodeAmino; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface CodeSDKType { + code_id: bigint; + code_info: CodeInfoSDKType; + code_bytes: Uint8Array; + pinned: boolean; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface Contract { + contractAddress: string; + contractInfo: ContractInfo; + contractState: Model[]; + contractCodeHistory: ContractCodeHistoryEntry[]; +} +export interface ContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Contract"; + value: Uint8Array; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface ContractAmino { + contract_address?: string; + contract_info?: ContractInfoAmino; + contract_state?: ModelAmino[]; + contract_code_history?: ContractCodeHistoryEntryAmino[]; +} +export interface ContractAminoMsg { + type: "wasm/Contract"; + value: ContractAmino; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface ContractSDKType { + contract_address: string; + contract_info: ContractInfoSDKType; + contract_state: ModelSDKType[]; + contract_code_history: ContractCodeHistoryEntrySDKType[]; +} +/** Sequence key and value of an id generation counter */ +export interface Sequence { + idKey: Uint8Array; + value: bigint; +} +export interface SequenceProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Sequence"; + value: Uint8Array; +} +/** Sequence key and value of an id generation counter */ +export interface SequenceAmino { + id_key?: string; + value?: string; +} +export interface SequenceAminoMsg { + type: "wasm/Sequence"; + value: SequenceAmino; +} +/** Sequence key and value of an id generation counter */ +export interface SequenceSDKType { + id_key: Uint8Array; + value: bigint; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + codes: [], + contracts: [], + sequences: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmwasm.wasm.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.codes) { + Code.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.contracts) { + Contract.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.sequences) { + Sequence.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.codes.push(Code.decode(reader, reader.uint32())); + break; + case 3: + message.contracts.push(Contract.decode(reader, reader.uint32())); + break; + case 4: + message.sequences.push(Sequence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.codes = object.codes?.map(e => Code.fromPartial(e)) || []; + message.contracts = object.contracts?.map(e => Contract.fromPartial(e)) || []; + message.sequences = object.sequences?.map(e => Sequence.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.codes = object.codes?.map(e => Code.fromAmino(e)) || []; + message.contracts = object.contracts?.map(e => Contract.fromAmino(e)) || []; + message.sequences = object.sequences?.map(e => Sequence.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.codes) { + obj.codes = message.codes.map(e => e ? Code.toAmino(e) : undefined); + } else { + obj.codes = message.codes; + } + if (message.contracts) { + obj.contracts = message.contracts.map(e => e ? Contract.toAmino(e) : undefined); + } else { + obj.contracts = message.contracts; + } + if (message.sequences) { + obj.sequences = message.sequences.map(e => e ? Sequence.toAmino(e) : undefined); + } else { + obj.sequences = message.sequences; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "wasm/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseCode(): Code { + return { + codeId: BigInt(0), + codeInfo: CodeInfo.fromPartial({}), + codeBytes: new Uint8Array(), + pinned: false + }; +} +export const Code = { + typeUrl: "/cosmwasm.wasm.v1.Code", + encode(message: Code, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.codeInfo !== undefined) { + CodeInfo.encode(message.codeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.codeBytes.length !== 0) { + writer.uint32(26).bytes(message.codeBytes); + } + if (message.pinned === true) { + writer.uint32(32).bool(message.pinned); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Code { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.codeInfo = CodeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.codeBytes = reader.bytes(); + break; + case 4: + message.pinned = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Code { + const message = createBaseCode(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.codeInfo = object.codeInfo !== undefined && object.codeInfo !== null ? CodeInfo.fromPartial(object.codeInfo) : undefined; + message.codeBytes = object.codeBytes ?? new Uint8Array(); + message.pinned = object.pinned ?? false; + return message; + }, + fromAmino(object: CodeAmino): Code { + const message = createBaseCode(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfo.fromAmino(object.code_info); + } + if (object.code_bytes !== undefined && object.code_bytes !== null) { + message.codeBytes = bytesFromBase64(object.code_bytes); + } + if (object.pinned !== undefined && object.pinned !== null) { + message.pinned = object.pinned; + } + return message; + }, + toAmino(message: Code): CodeAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : undefined; + obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; + obj.pinned = message.pinned === false ? undefined : message.pinned; + return obj; + }, + fromAminoMsg(object: CodeAminoMsg): Code { + return Code.fromAmino(object.value); + }, + toAminoMsg(message: Code): CodeAminoMsg { + return { + type: "wasm/Code", + value: Code.toAmino(message) + }; + }, + fromProtoMsg(message: CodeProtoMsg): Code { + return Code.decode(message.value); + }, + toProto(message: Code): Uint8Array { + return Code.encode(message).finish(); + }, + toProtoMsg(message: Code): CodeProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.Code", + value: Code.encode(message).finish() + }; + } +}; +function createBaseContract(): Contract { + return { + contractAddress: "", + contractInfo: ContractInfo.fromPartial({}), + contractState: [], + contractCodeHistory: [] + }; +} +export const Contract = { + typeUrl: "/cosmwasm.wasm.v1.Contract", + encode(message: Contract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.contractState) { + Model.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.contractCodeHistory) { + ContractCodeHistoryEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Contract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); + break; + case 3: + message.contractState.push(Model.decode(reader, reader.uint32())); + break; + case 4: + message.contractCodeHistory.push(ContractCodeHistoryEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Contract { + const message = createBaseContract(); + message.contractAddress = object.contractAddress ?? ""; + message.contractInfo = object.contractInfo !== undefined && object.contractInfo !== null ? ContractInfo.fromPartial(object.contractInfo) : undefined; + message.contractState = object.contractState?.map(e => Model.fromPartial(e)) || []; + message.contractCodeHistory = object.contractCodeHistory?.map(e => ContractCodeHistoryEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ContractAmino): Contract { + const message = createBaseContract(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + message.contractState = object.contract_state?.map(e => Model.fromAmino(e)) || []; + message.contractCodeHistory = object.contract_code_history?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: Contract): ContractAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + if (message.contractState) { + obj.contract_state = message.contractState.map(e => e ? Model.toAmino(e) : undefined); + } else { + obj.contract_state = message.contractState; + } + if (message.contractCodeHistory) { + obj.contract_code_history = message.contractCodeHistory.map(e => e ? ContractCodeHistoryEntry.toAmino(e) : undefined); + } else { + obj.contract_code_history = message.contractCodeHistory; + } + return obj; + }, + fromAminoMsg(object: ContractAminoMsg): Contract { + return Contract.fromAmino(object.value); + }, + toAminoMsg(message: Contract): ContractAminoMsg { + return { + type: "wasm/Contract", + value: Contract.toAmino(message) + }; + }, + fromProtoMsg(message: ContractProtoMsg): Contract { + return Contract.decode(message.value); + }, + toProto(message: Contract): Uint8Array { + return Contract.encode(message).finish(); + }, + toProtoMsg(message: Contract): ContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.Contract", + value: Contract.encode(message).finish() + }; + } +}; +function createBaseSequence(): Sequence { + return { + idKey: new Uint8Array(), + value: BigInt(0) + }; +} +export const Sequence = { + typeUrl: "/cosmwasm.wasm.v1.Sequence", + encode(message: Sequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.idKey.length !== 0) { + writer.uint32(10).bytes(message.idKey); + } + if (message.value !== BigInt(0)) { + writer.uint32(16).uint64(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Sequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSequence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.idKey = reader.bytes(); + break; + case 2: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Sequence { + const message = createBaseSequence(); + message.idKey = object.idKey ?? new Uint8Array(); + message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SequenceAmino): Sequence { + const message = createBaseSequence(); + if (object.id_key !== undefined && object.id_key !== null) { + message.idKey = bytesFromBase64(object.id_key); + } + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + return message; + }, + toAmino(message: Sequence): SequenceAmino { + const obj: any = {}; + obj.id_key = message.idKey ? base64FromBytes(message.idKey) : undefined; + obj.value = message.value !== BigInt(0) ? message.value.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SequenceAminoMsg): Sequence { + return Sequence.fromAmino(object.value); + }, + toAminoMsg(message: Sequence): SequenceAminoMsg { + return { + type: "wasm/Sequence", + value: Sequence.toAmino(message) + }; + }, + fromProtoMsg(message: SequenceProtoMsg): Sequence { + return Sequence.decode(message.value); + }, + toProto(message: Sequence): Uint8Array { + return Sequence.encode(message).finish(); + }, + toProtoMsg(message: Sequence): SequenceProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.Sequence", + value: Sequence.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/ibc.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/ibc.ts new file mode 100644 index 00000000..a0c5fd03 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/ibc.ts @@ -0,0 +1,252 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** MsgIBCSend */ +export interface MsgIBCSend { + /** the channel by which the packet will be sent */ + channel: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: bigint; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: bigint; + /** + * Data is the payload to transfer. We must not make assumption what format or + * content is in here. + */ + data: Uint8Array; +} +export interface MsgIBCSendProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCSend"; + value: Uint8Array; +} +/** MsgIBCSend */ +export interface MsgIBCSendAmino { + /** the channel by which the packet will be sent */ + channel?: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeout_height?: string; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeout_timestamp?: string; + /** + * Data is the payload to transfer. We must not make assumption what format or + * content is in here. + */ + data?: string; +} +export interface MsgIBCSendAminoMsg { + type: "wasm/MsgIBCSend"; + value: MsgIBCSendAmino; +} +/** MsgIBCSend */ +export interface MsgIBCSendSDKType { + channel: string; + timeout_height: bigint; + timeout_timestamp: bigint; + data: Uint8Array; +} +/** MsgIBCCloseChannel port and channel need to be owned by the contract */ +export interface MsgIBCCloseChannel { + channel: string; +} +export interface MsgIBCCloseChannelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCCloseChannel"; + value: Uint8Array; +} +/** MsgIBCCloseChannel port and channel need to be owned by the contract */ +export interface MsgIBCCloseChannelAmino { + channel?: string; +} +export interface MsgIBCCloseChannelAminoMsg { + type: "wasm/MsgIBCCloseChannel"; + value: MsgIBCCloseChannelAmino; +} +/** MsgIBCCloseChannel port and channel need to be owned by the contract */ +export interface MsgIBCCloseChannelSDKType { + channel: string; +} +function createBaseMsgIBCSend(): MsgIBCSend { + return { + channel: "", + timeoutHeight: BigInt(0), + timeoutTimestamp: BigInt(0), + data: new Uint8Array() + }; +} +export const MsgIBCSend = { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCSend", + encode(message: MsgIBCSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.channel !== "") { + writer.uint32(18).string(message.channel); + } + if (message.timeoutHeight !== BigInt(0)) { + writer.uint32(32).uint64(message.timeoutHeight); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(40).uint64(message.timeoutTimestamp); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.channel = reader.string(); + break; + case 4: + message.timeoutHeight = reader.uint64(); + break; + case 5: + message.timeoutTimestamp = reader.uint64(); + break; + case 6: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgIBCSend { + const message = createBaseMsgIBCSend(); + message.channel = object.channel ?? ""; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? BigInt(object.timeoutHeight.toString()) : BigInt(0); + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgIBCSendAmino): MsgIBCSend { + const message = createBaseMsgIBCSend(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgIBCSend): MsgIBCSendAmino { + const obj: any = {}; + obj.channel = message.channel === "" ? undefined : message.channel; + obj.timeout_height = message.timeoutHeight !== BigInt(0) ? message.timeoutHeight.toString() : undefined; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp.toString() : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgIBCSendAminoMsg): MsgIBCSend { + return MsgIBCSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSend): MsgIBCSendAminoMsg { + return { + type: "wasm/MsgIBCSend", + value: MsgIBCSend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCSendProtoMsg): MsgIBCSend { + return MsgIBCSend.decode(message.value); + }, + toProto(message: MsgIBCSend): Uint8Array { + return MsgIBCSend.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSend): MsgIBCSendProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCSend", + value: MsgIBCSend.encode(message).finish() + }; + } +}; +function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { + return { + channel: "" + }; +} +export const MsgIBCCloseChannel = { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCCloseChannel", + encode(message: MsgIBCCloseChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.channel !== "") { + writer.uint32(18).string(message.channel); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCCloseChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCCloseChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.channel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgIBCCloseChannel { + const message = createBaseMsgIBCCloseChannel(); + message.channel = object.channel ?? ""; + return message; + }, + fromAmino(object: MsgIBCCloseChannelAmino): MsgIBCCloseChannel { + const message = createBaseMsgIBCCloseChannel(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + return message; + }, + toAmino(message: MsgIBCCloseChannel): MsgIBCCloseChannelAmino { + const obj: any = {}; + obj.channel = message.channel === "" ? undefined : message.channel; + return obj; + }, + fromAminoMsg(object: MsgIBCCloseChannelAminoMsg): MsgIBCCloseChannel { + return MsgIBCCloseChannel.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCCloseChannel): MsgIBCCloseChannelAminoMsg { + return { + type: "wasm/MsgIBCCloseChannel", + value: MsgIBCCloseChannel.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCCloseChannelProtoMsg): MsgIBCCloseChannel { + return MsgIBCCloseChannel.decode(message.value); + }, + toProto(message: MsgIBCCloseChannel): Uint8Array { + return MsgIBCCloseChannel.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCCloseChannel): MsgIBCCloseChannelProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCCloseChannel", + value: MsgIBCCloseChannel.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/proposal.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/proposal.ts new file mode 100644 index 00000000..5e6a6325 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/proposal.ts @@ -0,0 +1,2394 @@ +//@ts-nocheck +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +export interface StoreCodeProposal { + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface StoreCodeProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal"; + value: Uint8Array; +} +/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +export interface StoreCodeProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** UnpinCode code on upload, optional */ + unpin_code?: boolean; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface StoreCodeProposalAminoMsg { + type: "wasm/StoreCodeProposal"; + value: StoreCodeProposalAmino; +} +/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +export interface StoreCodeProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeProposal"; + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + unpin_code: boolean; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** + * InstantiateContractProposal gov proposal content type to instantiate a + * contract. + */ +export interface InstantiateContractProposal { + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContractProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface InstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal"; + value: Uint8Array; +} +/** + * InstantiateContractProposal gov proposal content type to instantiate a + * contract. + */ +export interface InstantiateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds?: CoinAmino[]; +} +export interface InstantiateContractProposalAminoMsg { + type: "wasm/InstantiateContractProposal"; + value: InstantiateContractProposalAmino; +} +/** + * InstantiateContractProposal gov proposal content type to instantiate a + * contract. + */ +export interface InstantiateContractProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContractProposal"; + title: string; + description: string; + run_as: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * InstantiateContract2Proposal gov proposal content type to instantiate + * contract 2 + */ +export interface InstantiateContract2Proposal { + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean; +} +export interface InstantiateContract2ProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; + value: Uint8Array; +} +/** + * InstantiateContract2Proposal gov proposal content type to instantiate + * contract 2 + */ +export interface InstantiateContract2ProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + run_as?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds?: CoinAmino[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt?: string; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fix_msg?: boolean; +} +export interface InstantiateContract2ProposalAminoMsg { + type: "wasm/InstantiateContract2Proposal"; + value: InstantiateContract2ProposalAmino; +} +/** + * InstantiateContract2Proposal gov proposal content type to instantiate + * contract 2 + */ +export interface InstantiateContract2ProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; + title: string; + description: string; + run_as: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + salt: Uint8Array; + fix_msg: boolean; +} +/** MigrateContractProposal gov proposal content type to migrate a contract. */ +export interface MigrateContractProposal { + $typeUrl?: "/cosmwasm.wasm.v1.MigrateContractProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: bigint; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MigrateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal"; + value: Uint8Array; +} +/** MigrateContractProposal gov proposal content type to migrate a contract. */ +export interface MigrateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** CodeID references the new WASM code */ + code_id?: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any; +} +export interface MigrateContractProposalAminoMsg { + type: "wasm/MigrateContractProposal"; + value: MigrateContractProposalAmino; +} +/** MigrateContractProposal gov proposal content type to migrate a contract. */ +export interface MigrateContractProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.MigrateContractProposal"; + title: string; + description: string; + contract: string; + code_id: bigint; + msg: Uint8Array; +} +/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +export interface SudoContractProposal { + $typeUrl?: "/cosmwasm.wasm.v1.SudoContractProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} +export interface SudoContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal"; + value: Uint8Array; +} +/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +export interface SudoContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg?: any; +} +export interface SudoContractProposalAminoMsg { + type: "wasm/SudoContractProposal"; + value: SudoContractProposalAmino; +} +/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +export interface SudoContractProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.SudoContractProposal"; + title: string; + description: string; + contract: string; + msg: Uint8Array; +} +/** + * ExecuteContractProposal gov proposal content type to call execute on a + * contract. + */ +export interface ExecuteContractProposal { + $typeUrl?: "/cosmwasm.wasm.v1.ExecuteContractProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as execute */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface ExecuteContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal"; + value: Uint8Array; +} +/** + * ExecuteContractProposal gov proposal content type to call execute on a + * contract. + */ +export interface ExecuteContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as execute */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds?: CoinAmino[]; +} +export interface ExecuteContractProposalAminoMsg { + type: "wasm/ExecuteContractProposal"; + value: ExecuteContractProposalAmino; +} +/** + * ExecuteContractProposal gov proposal content type to call execute on a + * contract. + */ +export interface ExecuteContractProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.ExecuteContractProposal"; + title: string; + description: string; + run_as: string; + contract: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +export interface UpdateAdminProposal { + $typeUrl?: "/cosmwasm.wasm.v1.UpdateAdminProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface UpdateAdminProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal"; + value: Uint8Array; +} +/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +export interface UpdateAdminProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** NewAdmin address to be set */ + new_admin?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface UpdateAdminProposalAminoMsg { + type: "wasm/UpdateAdminProposal"; + value: UpdateAdminProposalAmino; +} +/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +export interface UpdateAdminProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.UpdateAdminProposal"; + title: string; + description: string; + new_admin: string; + contract: string; +} +/** + * ClearAdminProposal gov proposal content type to clear the admin of a + * contract. + */ +export interface ClearAdminProposal { + $typeUrl?: "/cosmwasm.wasm.v1.ClearAdminProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface ClearAdminProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal"; + value: Uint8Array; +} +/** + * ClearAdminProposal gov proposal content type to clear the admin of a + * contract. + */ +export interface ClearAdminProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface ClearAdminProposalAminoMsg { + type: "wasm/ClearAdminProposal"; + value: ClearAdminProposalAmino; +} +/** + * ClearAdminProposal gov proposal content type to clear the admin of a + * contract. + */ +export interface ClearAdminProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.ClearAdminProposal"; + title: string; + description: string; + contract: string; +} +/** + * PinCodesProposal gov proposal content type to pin a set of code ids in the + * wasmvm cache. + */ +export interface PinCodesProposal { + $typeUrl?: "/cosmwasm.wasm.v1.PinCodesProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the new WASM codes */ + codeIds: bigint[]; +} +export interface PinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal"; + value: Uint8Array; +} +/** + * PinCodesProposal gov proposal content type to pin a set of code ids in the + * wasmvm cache. + */ +export interface PinCodesProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** CodeIDs references the new WASM codes */ + code_ids?: string[]; +} +export interface PinCodesProposalAminoMsg { + type: "wasm/PinCodesProposal"; + value: PinCodesProposalAmino; +} +/** + * PinCodesProposal gov proposal content type to pin a set of code ids in the + * wasmvm cache. + */ +export interface PinCodesProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.PinCodesProposal"; + title: string; + description: string; + code_ids: bigint[]; +} +/** + * UnpinCodesProposal gov proposal content type to unpin a set of code ids in + * the wasmvm cache. + */ +export interface UnpinCodesProposal { + $typeUrl?: "/cosmwasm.wasm.v1.UnpinCodesProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the WASM codes */ + codeIds: bigint[]; +} +export interface UnpinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal"; + value: Uint8Array; +} +/** + * UnpinCodesProposal gov proposal content type to unpin a set of code ids in + * the wasmvm cache. + */ +export interface UnpinCodesProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** CodeIDs references the WASM codes */ + code_ids?: string[]; +} +export interface UnpinCodesProposalAminoMsg { + type: "wasm/UnpinCodesProposal"; + value: UnpinCodesProposalAmino; +} +/** + * UnpinCodesProposal gov proposal content type to unpin a set of code ids in + * the wasmvm cache. + */ +export interface UnpinCodesProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.UnpinCodesProposal"; + title: string; + description: string; + code_ids: bigint[]; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdate { + /** CodeID is the reference to the stored WASM code to be updated */ + codeId: bigint; + /** InstantiatePermission to apply to the set of code ids */ + instantiatePermission: AccessConfig; +} +export interface AccessConfigUpdateProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate"; + value: Uint8Array; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateAmino { + /** CodeID is the reference to the stored WASM code to be updated */ + code_id?: string; + /** InstantiatePermission to apply to the set of code ids */ + instantiate_permission?: AccessConfigAmino; +} +export interface AccessConfigUpdateAminoMsg { + type: "wasm/AccessConfigUpdate"; + value: AccessConfigUpdateAmino; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateSDKType { + code_id: bigint; + instantiate_permission: AccessConfigSDKType; +} +/** + * UpdateInstantiateConfigProposal gov proposal content type to update + * instantiate config to a set of code ids. + */ +export interface UpdateInstantiateConfigProposal { + $typeUrl?: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** + * AccessConfigUpdate contains the list of code ids and the access config + * to be applied. + */ + accessConfigUpdates: AccessConfigUpdate[]; +} +export interface UpdateInstantiateConfigProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; + value: Uint8Array; +} +/** + * UpdateInstantiateConfigProposal gov proposal content type to update + * instantiate config to a set of code ids. + */ +export interface UpdateInstantiateConfigProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** + * AccessConfigUpdate contains the list of code ids and the access config + * to be applied. + */ + access_config_updates?: AccessConfigUpdateAmino[]; +} +export interface UpdateInstantiateConfigProposalAminoMsg { + type: "wasm/UpdateInstantiateConfigProposal"; + value: UpdateInstantiateConfigProposalAmino; +} +/** + * UpdateInstantiateConfigProposal gov proposal content type to update + * instantiate config to a set of code ids. + */ +export interface UpdateInstantiateConfigProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; + title: string; + description: string; + access_config_updates: AccessConfigUpdateSDKType[]; +} +/** + * StoreAndInstantiateContractProposal gov proposal content type to store + * and instantiate the contract. + */ +export interface StoreAndInstantiateContractProposal { + $typeUrl?: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface StoreAndInstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; + value: Uint8Array; +} +/** + * StoreAndInstantiateContractProposal gov proposal content type to store + * and instantiate the contract. + */ +export interface StoreAndInstantiateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** UnpinCode code on upload, optional */ + unpin_code?: boolean; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds?: CoinAmino[]; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface StoreAndInstantiateContractProposalAminoMsg { + type: "wasm/StoreAndInstantiateContractProposal"; + value: StoreAndInstantiateContractProposalAmino; +} +/** + * StoreAndInstantiateContractProposal gov proposal content type to store + * and instantiate the contract. + */ +export interface StoreAndInstantiateContractProposalSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + source: string; + builder: string; + code_hash: Uint8Array; +} +function createBaseStoreCodeProposal(): StoreCodeProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const StoreCodeProposal = { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + encode(message: StoreCodeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(58).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(64).bool(message.unpinCode); + } + if (message.source !== "") { + writer.uint32(74).string(message.source); + } + if (message.builder !== "") { + writer.uint32(82).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(90).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 7: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 8: + message.unpinCode = reader.bool(); + break; + case 9: + message.source = reader.string(); + break; + case 10: + message.builder = reader.string(); + break; + case 11: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreCodeProposal { + const message = createBaseStoreCodeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: StoreCodeProposalAmino): StoreCodeProposal { + const message = createBaseStoreCodeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: StoreCodeProposal): StoreCodeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode === false ? undefined : message.unpinCode; + obj.source = message.source === "" ? undefined : message.source; + obj.builder = message.builder === "" ? undefined : message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: StoreCodeProposalAminoMsg): StoreCodeProposal { + return StoreCodeProposal.fromAmino(object.value); + }, + toAminoMsg(message: StoreCodeProposal): StoreCodeProposalAminoMsg { + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: StoreCodeProposalProtoMsg): StoreCodeProposal { + return StoreCodeProposal.decode(message.value); + }, + toProto(message: StoreCodeProposal): Uint8Array { + return StoreCodeProposal.encode(message).finish(); + }, + toProtoMsg(message: StoreCodeProposal): StoreCodeProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(message).finish() + }; + } +}; +function createBaseInstantiateContractProposal(): InstantiateContractProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const InstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + encode(message: InstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InstantiateContractProposalAmino): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: InstantiateContractProposal): InstantiateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: InstantiateContractProposalAminoMsg): InstantiateContractProposal { + return InstantiateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: InstantiateContractProposal): InstantiateContractProposalAminoMsg { + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: InstantiateContractProposalProtoMsg): InstantiateContractProposal { + return InstantiateContractProposal.decode(message.value); + }, + toProto(message: InstantiateContractProposal): Uint8Array { + return InstantiateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: InstantiateContractProposal): InstantiateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(message).finish() + }; + } +}; +function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const InstantiateContract2Proposal = { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + encode(message: InstantiateContract2Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(74).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(80).bool(message.fixMsg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContract2Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContract2Proposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 9: + message.salt = reader.bytes(); + break; + case 10: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, + fromAmino(object: InstantiateContract2ProposalAmino): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; + }, + toAmino(message: InstantiateContract2Proposal): InstantiateContract2ProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; + obj.fix_msg = message.fixMsg === false ? undefined : message.fixMsg; + return obj; + }, + fromAminoMsg(object: InstantiateContract2ProposalAminoMsg): InstantiateContract2Proposal { + return InstantiateContract2Proposal.fromAmino(object.value); + }, + toAminoMsg(message: InstantiateContract2Proposal): InstantiateContract2ProposalAminoMsg { + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: InstantiateContract2ProposalProtoMsg): InstantiateContract2Proposal { + return InstantiateContract2Proposal.decode(message.value); + }, + toProto(message: InstantiateContract2Proposal): Uint8Array { + return InstantiateContract2Proposal.encode(message).finish(); + }, + toProtoMsg(message: InstantiateContract2Proposal): InstantiateContract2ProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(message).finish() + }; + } +}; +function createBaseMigrateContractProposal(): MigrateContractProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + title: "", + description: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MigrateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + encode(message: MigrateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(50).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MigrateContractProposal { + const message = createBaseMigrateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MigrateContractProposalAmino): MigrateContractProposal { + const message = createBaseMigrateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MigrateContractProposal): MigrateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MigrateContractProposalAminoMsg): MigrateContractProposal { + return MigrateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: MigrateContractProposal): MigrateContractProposalAminoMsg { + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MigrateContractProposalProtoMsg): MigrateContractProposal { + return MigrateContractProposal.decode(message.value); + }, + toProto(message: MigrateContractProposal): Uint8Array { + return MigrateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: MigrateContractProposal): MigrateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(message).finish() + }; + } +}; +function createBaseSudoContractProposal(): SudoContractProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + title: "", + description: "", + contract: "", + msg: new Uint8Array() + }; +} +export const SudoContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + encode(message: SudoContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SudoContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSudoContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SudoContractProposal { + const message = createBaseSudoContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: SudoContractProposalAmino): SudoContractProposal { + const message = createBaseSudoContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: SudoContractProposal): SudoContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: SudoContractProposalAminoMsg): SudoContractProposal { + return SudoContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: SudoContractProposal): SudoContractProposalAminoMsg { + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SudoContractProposalProtoMsg): SudoContractProposal { + return SudoContractProposal.decode(message.value); + }, + toProto(message: SudoContractProposal): Uint8Array { + return SudoContractProposal.encode(message).finish(); + }, + toProtoMsg(message: SudoContractProposal): SudoContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(message).finish() + }; + } +}; +function createBaseExecuteContractProposal(): ExecuteContractProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + title: "", + description: "", + runAs: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const ExecuteContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + encode(message: ExecuteContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExecuteContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecuteContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExecuteContractProposal { + const message = createBaseExecuteContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExecuteContractProposalAmino): ExecuteContractProposal { + const message = createBaseExecuteContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExecuteContractProposal): ExecuteContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: ExecuteContractProposalAminoMsg): ExecuteContractProposal { + return ExecuteContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: ExecuteContractProposal): ExecuteContractProposalAminoMsg { + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ExecuteContractProposalProtoMsg): ExecuteContractProposal { + return ExecuteContractProposal.decode(message.value); + }, + toProto(message: ExecuteContractProposal): Uint8Array { + return ExecuteContractProposal.encode(message).finish(); + }, + toProtoMsg(message: ExecuteContractProposal): ExecuteContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(message).finish() + }; + } +}; +function createBaseUpdateAdminProposal(): UpdateAdminProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + title: "", + description: "", + newAdmin: "", + contract: "" + }; +} +export const UpdateAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + encode(message: UpdateAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: UpdateAdminProposalAmino): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: UpdateAdminProposal): UpdateAdminProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: UpdateAdminProposalAminoMsg): UpdateAdminProposal { + return UpdateAdminProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateAdminProposal): UpdateAdminProposalAminoMsg { + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateAdminProposalProtoMsg): UpdateAdminProposal { + return UpdateAdminProposal.decode(message.value); + }, + toProto(message: UpdateAdminProposal): Uint8Array { + return UpdateAdminProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateAdminProposal): UpdateAdminProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(message).finish() + }; + } +}; +function createBaseClearAdminProposal(): ClearAdminProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + title: "", + description: "", + contract: "" + }; +} +export const ClearAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + encode(message: ClearAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClearAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClearAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClearAdminProposal { + const message = createBaseClearAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: ClearAdminProposalAmino): ClearAdminProposal { + const message = createBaseClearAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: ClearAdminProposal): ClearAdminProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: ClearAdminProposalAminoMsg): ClearAdminProposal { + return ClearAdminProposal.fromAmino(object.value); + }, + toAminoMsg(message: ClearAdminProposal): ClearAdminProposalAminoMsg { + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ClearAdminProposalProtoMsg): ClearAdminProposal { + return ClearAdminProposal.decode(message.value); + }, + toProto(message: ClearAdminProposal): Uint8Array { + return ClearAdminProposal.encode(message).finish(); + }, + toProtoMsg(message: ClearAdminProposal): ClearAdminProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(message).finish() + }; + } +}; +function createBasePinCodesProposal(): PinCodesProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + title: "", + description: "", + codeIds: [] + }; +} +export const PinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + encode(message: PinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PinCodesProposal { + const message = createBasePinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: PinCodesProposalAmino): PinCodesProposal { + const message = createBasePinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: PinCodesProposal): PinCodesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + return obj; + }, + fromAminoMsg(object: PinCodesProposalAminoMsg): PinCodesProposal { + return PinCodesProposal.fromAmino(object.value); + }, + toAminoMsg(message: PinCodesProposal): PinCodesProposalAminoMsg { + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(message) + }; + }, + fromProtoMsg(message: PinCodesProposalProtoMsg): PinCodesProposal { + return PinCodesProposal.decode(message.value); + }, + toProto(message: PinCodesProposal): Uint8Array { + return PinCodesProposal.encode(message).finish(); + }, + toProtoMsg(message: PinCodesProposal): PinCodesProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(message).finish() + }; + } +}; +function createBaseUnpinCodesProposal(): UnpinCodesProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + title: "", + description: "", + codeIds: [] + }; +} +export const UnpinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + encode(message: UnpinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnpinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnpinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: UnpinCodesProposalAmino): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: UnpinCodesProposal): UnpinCodesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + return obj; + }, + fromAminoMsg(object: UnpinCodesProposalAminoMsg): UnpinCodesProposal { + return UnpinCodesProposal.fromAmino(object.value); + }, + toAminoMsg(message: UnpinCodesProposal): UnpinCodesProposalAminoMsg { + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UnpinCodesProposalProtoMsg): UnpinCodesProposal { + return UnpinCodesProposal.decode(message.value); + }, + toProto(message: UnpinCodesProposal): Uint8Array { + return UnpinCodesProposal.encode(message).finish(); + }, + toProtoMsg(message: UnpinCodesProposal): UnpinCodesProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(message).finish() + }; + } +}; +function createBaseAccessConfigUpdate(): AccessConfigUpdate { + return { + codeId: BigInt(0), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const AccessConfigUpdate = { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate", + encode(message: AccessConfigUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfigUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfigUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccessConfigUpdate { + const message = createBaseAccessConfigUpdate(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: AccessConfigUpdateAmino): AccessConfigUpdate { + const message = createBaseAccessConfigUpdate(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: AccessConfigUpdate): AccessConfigUpdateAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: AccessConfigUpdateAminoMsg): AccessConfigUpdate { + return AccessConfigUpdate.fromAmino(object.value); + }, + toAminoMsg(message: AccessConfigUpdate): AccessConfigUpdateAminoMsg { + return { + type: "wasm/AccessConfigUpdate", + value: AccessConfigUpdate.toAmino(message) + }; + }, + fromProtoMsg(message: AccessConfigUpdateProtoMsg): AccessConfigUpdate { + return AccessConfigUpdate.decode(message.value); + }, + toProto(message: AccessConfigUpdate): Uint8Array { + return AccessConfigUpdate.encode(message).finish(); + }, + toProtoMsg(message: AccessConfigUpdate): AccessConfigUpdateProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate", + value: AccessConfigUpdate.encode(message).finish() + }; + } +}; +function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + title: "", + description: "", + accessConfigUpdates: [] + }; +} +export const UpdateInstantiateConfigProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + encode(message: UpdateInstantiateConfigProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.accessConfigUpdates) { + AccessConfigUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateInstantiateConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInstantiateConfigProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.accessConfigUpdates.push(AccessConfigUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.accessConfigUpdates = object.accessConfigUpdates?.map(e => AccessConfigUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateInstantiateConfigProposalAmino): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.accessConfigUpdates = object.access_config_updates?.map(e => AccessConfigUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.accessConfigUpdates) { + obj.access_config_updates = message.accessConfigUpdates.map(e => e ? AccessConfigUpdate.toAmino(e) : undefined); + } else { + obj.access_config_updates = message.accessConfigUpdates; + } + return obj; + }, + fromAminoMsg(object: UpdateInstantiateConfigProposalAminoMsg): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAminoMsg { + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateInstantiateConfigProposalProtoMsg): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.decode(message.value); + }, + toProto(message: UpdateInstantiateConfigProposal): Uint8Array { + return UpdateInstantiateConfigProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(message).finish() + }; + } +}; +function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateContractProposal { + return { + $typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const StoreAndInstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + encode(message: StoreAndInstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(48).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(58).string(message.admin); + } + if (message.label !== "") { + writer.uint32(66).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(74).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(90).string(message.source); + } + if (message.builder !== "") { + writer.uint32(98).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(106).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreAndInstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreAndInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 6: + message.unpinCode = reader.bool(); + break; + case 7: + message.admin = reader.string(); + break; + case 8: + message.label = reader.string(); + break; + case 9: + message.msg = reader.bytes(); + break; + case 10: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 11: + message.source = reader.string(); + break; + case 12: + message.builder = reader.string(); + break; + case 13: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: StoreAndInstantiateContractProposalAmino): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode === false ? undefined : message.unpinCode; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.source = message.source === "" ? undefined : message.source; + obj.builder = message.builder === "" ? undefined : message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: StoreAndInstantiateContractProposalAminoMsg): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAminoMsg { + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: StoreAndInstantiateContractProposalProtoMsg): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.decode(message.value); + }, + toProto(message: StoreAndInstantiateContractProposal): Uint8Array { + return StoreAndInstantiateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/query.rpc.Query.ts new file mode 100644 index 00000000..19e3d45f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/query.rpc.Query.ts @@ -0,0 +1,145 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse } from "./query"; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** ContractInfo gets the contract meta data */ + contractInfo(request: QueryContractInfoRequest): Promise; + /** ContractHistory gets the contract code history */ + contractHistory(request: QueryContractHistoryRequest): Promise; + /** ContractsByCode lists all smart contracts for a code id */ + contractsByCode(request: QueryContractsByCodeRequest): Promise; + /** AllContractState gets all raw store data for a single contract */ + allContractState(request: QueryAllContractStateRequest): Promise; + /** RawContractState gets single key from the raw store data of a contract */ + rawContractState(request: QueryRawContractStateRequest): Promise; + /** SmartContractState get smart query result from the contract */ + smartContractState(request: QuerySmartContractStateRequest): Promise; + /** Code gets the binary code and metadata for a singe wasm code */ + code(request: QueryCodeRequest): Promise; + /** Codes gets the metadata for all stored wasm codes */ + codes(request?: QueryCodesRequest): Promise; + /** PinnedCodes gets the pinned code ids */ + pinnedCodes(request?: QueryPinnedCodesRequest): Promise; + /** Params gets the module params */ + params(request?: QueryParamsRequest): Promise; + /** ContractsByCreator gets the contracts by creator */ + contractsByCreator(request: QueryContractsByCreatorRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.contractInfo = this.contractInfo.bind(this); + this.contractHistory = this.contractHistory.bind(this); + this.contractsByCode = this.contractsByCode.bind(this); + this.allContractState = this.allContractState.bind(this); + this.rawContractState = this.rawContractState.bind(this); + this.smartContractState = this.smartContractState.bind(this); + this.code = this.code.bind(this); + this.codes = this.codes.bind(this); + this.pinnedCodes = this.pinnedCodes.bind(this); + this.params = this.params.bind(this); + this.contractsByCreator = this.contractsByCreator.bind(this); + } + contractInfo(request: QueryContractInfoRequest): Promise { + const data = QueryContractInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractInfo", data); + return promise.then(data => QueryContractInfoResponse.decode(new BinaryReader(data))); + } + contractHistory(request: QueryContractHistoryRequest): Promise { + const data = QueryContractHistoryRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractHistory", data); + return promise.then(data => QueryContractHistoryResponse.decode(new BinaryReader(data))); + } + contractsByCode(request: QueryContractsByCodeRequest): Promise { + const data = QueryContractsByCodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractsByCode", data); + return promise.then(data => QueryContractsByCodeResponse.decode(new BinaryReader(data))); + } + allContractState(request: QueryAllContractStateRequest): Promise { + const data = QueryAllContractStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "AllContractState", data); + return promise.then(data => QueryAllContractStateResponse.decode(new BinaryReader(data))); + } + rawContractState(request: QueryRawContractStateRequest): Promise { + const data = QueryRawContractStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "RawContractState", data); + return promise.then(data => QueryRawContractStateResponse.decode(new BinaryReader(data))); + } + smartContractState(request: QuerySmartContractStateRequest): Promise { + const data = QuerySmartContractStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "SmartContractState", data); + return promise.then(data => QuerySmartContractStateResponse.decode(new BinaryReader(data))); + } + code(request: QueryCodeRequest): Promise { + const data = QueryCodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Code", data); + return promise.then(data => QueryCodeResponse.decode(new BinaryReader(data))); + } + codes(request: QueryCodesRequest = { + pagination: undefined + }): Promise { + const data = QueryCodesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Codes", data); + return promise.then(data => QueryCodesResponse.decode(new BinaryReader(data))); + } + pinnedCodes(request: QueryPinnedCodesRequest = { + pagination: undefined + }): Promise { + const data = QueryPinnedCodesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "PinnedCodes", data); + return promise.then(data => QueryPinnedCodesResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + contractsByCreator(request: QueryContractsByCreatorRequest): Promise { + const data = QueryContractsByCreatorRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractsByCreator", data); + return promise.then(data => QueryContractsByCreatorResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + contractInfo(request: QueryContractInfoRequest): Promise { + return queryService.contractInfo(request); + }, + contractHistory(request: QueryContractHistoryRequest): Promise { + return queryService.contractHistory(request); + }, + contractsByCode(request: QueryContractsByCodeRequest): Promise { + return queryService.contractsByCode(request); + }, + allContractState(request: QueryAllContractStateRequest): Promise { + return queryService.allContractState(request); + }, + rawContractState(request: QueryRawContractStateRequest): Promise { + return queryService.rawContractState(request); + }, + smartContractState(request: QuerySmartContractStateRequest): Promise { + return queryService.smartContractState(request); + }, + code(request: QueryCodeRequest): Promise { + return queryService.code(request); + }, + codes(request?: QueryCodesRequest): Promise { + return queryService.codes(request); + }, + pinnedCodes(request?: QueryPinnedCodesRequest): Promise { + return queryService.pinnedCodes(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + contractsByCreator(request: QueryContractsByCreatorRequest): Promise { + return queryService.contractsByCreator(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/query.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/query.ts new file mode 100644 index 00000000..46514fd7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/query.ts @@ -0,0 +1,2508 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { ContractInfo, ContractInfoAmino, ContractInfoSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType, Model, ModelAmino, ModelSDKType, AccessConfig, AccessConfigAmino, AccessConfigSDKType, Params, ParamsAmino, ParamsSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequest { + /** address is the address of the contract to query */ + address: string; +} +export interface QueryContractInfoRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest"; + value: Uint8Array; +} +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequestAmino { + /** address is the address of the contract to query */ + address?: string; +} +export interface QueryContractInfoRequestAminoMsg { + type: "wasm/QueryContractInfoRequest"; + value: QueryContractInfoRequestAmino; +} +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequestSDKType { + address: string; +} +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponse { + /** address is the address of the contract */ + address: string; + contractInfo: ContractInfo; +} +export interface QueryContractInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse"; + value: Uint8Array; +} +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponseAmino { + /** address is the address of the contract */ + address?: string; + contract_info?: ContractInfoAmino; +} +export interface QueryContractInfoResponseAminoMsg { + type: "wasm/QueryContractInfoResponse"; + value: QueryContractInfoResponseAmino; +} +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponseSDKType { + address: string; + contract_info: ContractInfoSDKType; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequest { + /** address is the address of the contract to query */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractHistoryRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest"; + value: Uint8Array; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequestAmino { + /** address is the address of the contract to query */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractHistoryRequestAminoMsg { + type: "wasm/QueryContractHistoryRequest"; + value: QueryContractHistoryRequestAmino; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponse { + entries: ContractCodeHistoryEntry[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractHistoryResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse"; + value: Uint8Array; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponseAmino { + entries?: ContractCodeHistoryEntryAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractHistoryResponseAminoMsg { + type: "wasm/QueryContractHistoryResponse"; + value: QueryContractHistoryResponseAmino; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponseSDKType { + entries: ContractCodeHistoryEntrySDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequest { + /** grpc-gateway_out does not support Go style CodID */ + codeId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractsByCodeRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest"; + value: Uint8Array; +} +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequestAmino { + /** grpc-gateway_out does not support Go style CodID */ + code_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractsByCodeRequestAminoMsg { + type: "wasm/QueryContractsByCodeRequest"; + value: QueryContractsByCodeRequestAmino; +} +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequestSDKType { + code_id: bigint; + pagination?: PageRequestSDKType; +} +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponse { + /** contracts are a set of contract addresses */ + contracts: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractsByCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse"; + value: Uint8Array; +} +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponseAmino { + /** contracts are a set of contract addresses */ + contracts?: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractsByCodeResponseAminoMsg { + type: "wasm/QueryContractsByCodeResponse"; + value: QueryContractsByCodeResponseAmino; +} +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponseSDKType { + contracts: string[]; + pagination?: PageResponseSDKType; +} +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequest { + /** address is the address of the contract */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAllContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest"; + value: Uint8Array; +} +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequestAmino { + /** address is the address of the contract */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAllContractStateRequestAminoMsg { + type: "wasm/QueryAllContractStateRequest"; + value: QueryAllContractStateRequestAmino; +} +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponse { + models: Model[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryAllContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse"; + value: Uint8Array; +} +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponseAmino { + models?: ModelAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryAllContractStateResponseAminoMsg { + type: "wasm/QueryAllContractStateResponse"; + value: QueryAllContractStateResponseAmino; +} +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponseSDKType { + models: ModelSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequest { + /** address is the address of the contract */ + address: string; + queryData: Uint8Array; +} +export interface QueryRawContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest"; + value: Uint8Array; +} +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequestAmino { + /** address is the address of the contract */ + address?: string; + query_data?: string; +} +export interface QueryRawContractStateRequestAminoMsg { + type: "wasm/QueryRawContractStateRequest"; + value: QueryRawContractStateRequestAmino; +} +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequestSDKType { + address: string; + query_data: Uint8Array; +} +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponse { + /** Data contains the raw store data */ + data: Uint8Array; +} +export interface QueryRawContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse"; + value: Uint8Array; +} +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponseAmino { + /** Data contains the raw store data */ + data?: string; +} +export interface QueryRawContractStateResponseAminoMsg { + type: "wasm/QueryRawContractStateResponse"; + value: QueryRawContractStateResponseAmino; +} +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponseSDKType { + data: Uint8Array; +} +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequest { + /** address is the address of the contract */ + address: string; + /** QueryData contains the query data passed to the contract */ + queryData: Uint8Array; +} +export interface QuerySmartContractStateRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest"; + value: Uint8Array; +} +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequestAmino { + /** address is the address of the contract */ + address?: string; + /** QueryData contains the query data passed to the contract */ + query_data?: any; +} +export interface QuerySmartContractStateRequestAminoMsg { + type: "wasm/QuerySmartContractStateRequest"; + value: QuerySmartContractStateRequestAmino; +} +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequestSDKType { + address: string; + query_data: Uint8Array; +} +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponse { + /** Data contains the json data returned from the smart contract */ + data: Uint8Array; +} +export interface QuerySmartContractStateResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse"; + value: Uint8Array; +} +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponseAmino { + /** Data contains the json data returned from the smart contract */ + data?: any; +} +export interface QuerySmartContractStateResponseAminoMsg { + type: "wasm/QuerySmartContractStateResponse"; + value: QuerySmartContractStateResponseAmino; +} +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponseSDKType { + data: Uint8Array; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequest { + /** grpc-gateway_out does not support Go style CodID */ + codeId: bigint; +} +export interface QueryCodeRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest"; + value: Uint8Array; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequestAmino { + /** grpc-gateway_out does not support Go style CodID */ + code_id?: string; +} +export interface QueryCodeRequestAminoMsg { + type: "wasm/QueryCodeRequest"; + value: QueryCodeRequestAmino; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequestSDKType { + code_id: bigint; +} +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponse { + codeId: bigint; + creator: string; + dataHash: Uint8Array; + instantiatePermission: AccessConfig; +} +export interface CodeInfoResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse"; + value: Uint8Array; +} +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponseAmino { + code_id: string; + creator?: string; + data_hash?: string; + instantiate_permission?: AccessConfigAmino; +} +export interface CodeInfoResponseAminoMsg { + type: "wasm/CodeInfoResponse"; + value: CodeInfoResponseAmino; +} +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponseSDKType { + code_id: bigint; + creator: string; + data_hash: Uint8Array; + instantiate_permission: AccessConfigSDKType; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponse { + codeInfo?: CodeInfoResponse; + data: Uint8Array; +} +export interface QueryCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse"; + value: Uint8Array; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponseAmino { + code_info?: CodeInfoResponseAmino; + data: string; +} +export interface QueryCodeResponseAminoMsg { + type: "wasm/QueryCodeResponse"; + value: QueryCodeResponseAmino; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponseSDKType { + code_info?: CodeInfoResponseSDKType; + data: Uint8Array; +} +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryCodesRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest"; + value: Uint8Array; +} +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryCodesRequestAminoMsg { + type: "wasm/QueryCodesRequest"; + value: QueryCodesRequestAmino; +} +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponse { + codeInfos: CodeInfoResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse"; + value: Uint8Array; +} +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponseAmino { + code_infos?: CodeInfoResponseAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryCodesResponseAminoMsg { + type: "wasm/QueryCodesResponse"; + value: QueryCodesResponseAmino; +} +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponseSDKType { + code_infos: CodeInfoResponseSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes + * RPC method + */ +export interface QueryPinnedCodesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryPinnedCodesRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest"; + value: Uint8Array; +} +/** + * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes + * RPC method + */ +export interface QueryPinnedCodesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryPinnedCodesRequestAminoMsg { + type: "wasm/QueryPinnedCodesRequest"; + value: QueryPinnedCodesRequestAmino; +} +/** + * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes + * RPC method + */ +export interface QueryPinnedCodesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryPinnedCodesResponse is the response type for the + * Query/PinnedCodes RPC method + */ +export interface QueryPinnedCodesResponse { + codeIds: bigint[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryPinnedCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse"; + value: Uint8Array; +} +/** + * QueryPinnedCodesResponse is the response type for the + * Query/PinnedCodes RPC method + */ +export interface QueryPinnedCodesResponseAmino { + code_ids?: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryPinnedCodesResponseAminoMsg { + type: "wasm/QueryPinnedCodesResponse"; + value: QueryPinnedCodesResponseAmino; +} +/** + * QueryPinnedCodesResponse is the response type for the + * Query/PinnedCodes RPC method + */ +export interface QueryPinnedCodesResponseSDKType { + code_ids: bigint[]; + pagination?: PageResponseSDKType; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "wasm/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "wasm/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** + * QueryContractsByCreatorRequest is the request type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorRequest { + /** CreatorAddress is the address of contract creator */ + creatorAddress: string; + /** Pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryContractsByCreatorRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest"; + value: Uint8Array; +} +/** + * QueryContractsByCreatorRequest is the request type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorRequestAmino { + /** CreatorAddress is the address of contract creator */ + creator_address?: string; + /** Pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryContractsByCreatorRequestAminoMsg { + type: "wasm/QueryContractsByCreatorRequest"; + value: QueryContractsByCreatorRequestAmino; +} +/** + * QueryContractsByCreatorRequest is the request type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorRequestSDKType { + creator_address: string; + pagination?: PageRequestSDKType; +} +/** + * QueryContractsByCreatorResponse is the response type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorResponse { + /** ContractAddresses result set */ + contractAddresses: string[]; + /** Pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryContractsByCreatorResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse"; + value: Uint8Array; +} +/** + * QueryContractsByCreatorResponse is the response type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorResponseAmino { + /** ContractAddresses result set */ + contract_addresses?: string[]; + /** Pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryContractsByCreatorResponseAminoMsg { + type: "wasm/QueryContractsByCreatorResponse"; + value: QueryContractsByCreatorResponseAmino; +} +/** + * QueryContractsByCreatorResponse is the response type for the + * Query/ContractsByCreator RPC method. + */ +export interface QueryContractsByCreatorResponseSDKType { + contract_addresses: string[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { + return { + address: "" + }; +} +export const QueryContractInfoRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest", + encode(message: QueryContractInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractInfoRequest { + const message = createBaseQueryContractInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryContractInfoRequestAmino): QueryContractInfoRequest { + const message = createBaseQueryContractInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryContractInfoRequest): QueryContractInfoRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryContractInfoRequestAminoMsg): QueryContractInfoRequest { + return QueryContractInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractInfoRequest): QueryContractInfoRequestAminoMsg { + return { + type: "wasm/QueryContractInfoRequest", + value: QueryContractInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractInfoRequestProtoMsg): QueryContractInfoRequest { + return QueryContractInfoRequest.decode(message.value); + }, + toProto(message: QueryContractInfoRequest): Uint8Array { + return QueryContractInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractInfoRequest): QueryContractInfoRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest", + value: QueryContractInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { + return { + address: "", + contractInfo: ContractInfo.fromPartial({}) + }; +} +export const QueryContractInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse", + encode(message: QueryContractInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + message.address = object.address ?? ""; + message.contractInfo = object.contractInfo !== undefined && object.contractInfo !== null ? ContractInfo.fromPartial(object.contractInfo) : undefined; + return message; + }, + fromAmino(object: QueryContractInfoResponseAmino): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + return message; + }, + toAmino(message: QueryContractInfoResponse): QueryContractInfoResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractInfoResponseAminoMsg): QueryContractInfoResponse { + return QueryContractInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractInfoResponse): QueryContractInfoResponseAminoMsg { + return { + type: "wasm/QueryContractInfoResponse", + value: QueryContractInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractInfoResponseProtoMsg): QueryContractInfoResponse { + return QueryContractInfoResponse.decode(message.value); + }, + toProto(message: QueryContractInfoResponse): Uint8Array { + return QueryContractInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractInfoResponse): QueryContractInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse", + value: QueryContractInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryContractHistoryRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest", + encode(message: QueryContractHistoryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractHistoryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractHistoryRequestAmino): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractHistoryRequest): QueryContractHistoryRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractHistoryRequestAminoMsg): QueryContractHistoryRequest { + return QueryContractHistoryRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractHistoryRequest): QueryContractHistoryRequestAminoMsg { + return { + type: "wasm/QueryContractHistoryRequest", + value: QueryContractHistoryRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractHistoryRequestProtoMsg): QueryContractHistoryRequest { + return QueryContractHistoryRequest.decode(message.value); + }, + toProto(message: QueryContractHistoryRequest): Uint8Array { + return QueryContractHistoryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryRequest): QueryContractHistoryRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest", + value: QueryContractHistoryRequest.encode(message).finish() + }; + } +}; +function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse { + return { + entries: [], + pagination: undefined + }; +} +export const QueryContractHistoryResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse", + encode(message: QueryContractHistoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractHistoryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(ContractCodeHistoryEntry.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractHistoryResponseAmino): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractHistoryResponse): QueryContractHistoryResponseAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? ContractCodeHistoryEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractHistoryResponseAminoMsg): QueryContractHistoryResponse { + return QueryContractHistoryResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractHistoryResponse): QueryContractHistoryResponseAminoMsg { + return { + type: "wasm/QueryContractHistoryResponse", + value: QueryContractHistoryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractHistoryResponseProtoMsg): QueryContractHistoryResponse { + return QueryContractHistoryResponse.decode(message.value); + }, + toProto(message: QueryContractHistoryResponse): Uint8Array { + return QueryContractHistoryResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryResponse): QueryContractHistoryResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse", + value: QueryContractHistoryResponse.encode(message).finish() + }; + } +}; +function createBaseQueryContractsByCodeRequest(): QueryContractsByCodeRequest { + return { + codeId: BigInt(0), + pagination: undefined + }; +} +export const QueryContractsByCodeRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest", + encode(message: QueryContractsByCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractsByCodeRequest { + const message = createBaseQueryContractsByCodeRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCodeRequestAmino): QueryContractsByCodeRequest { + const message = createBaseQueryContractsByCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCodeRequestAminoMsg): QueryContractsByCodeRequest { + return QueryContractsByCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAminoMsg { + return { + type: "wasm/QueryContractsByCodeRequest", + value: QueryContractsByCodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCodeRequestProtoMsg): QueryContractsByCodeRequest { + return QueryContractsByCodeRequest.decode(message.value); + }, + toProto(message: QueryContractsByCodeRequest): Uint8Array { + return QueryContractsByCodeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest", + value: QueryContractsByCodeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryContractsByCodeResponse(): QueryContractsByCodeResponse { + return { + contracts: [], + pagination: undefined + }; +} +export const QueryContractsByCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse", + encode(message: QueryContractsByCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contracts) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contracts.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractsByCodeResponse { + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCodeResponseAmino): QueryContractsByCodeResponse { + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAmino { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e); + } else { + obj.contracts = message.contracts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCodeResponseAminoMsg): QueryContractsByCodeResponse { + return QueryContractsByCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAminoMsg { + return { + type: "wasm/QueryContractsByCodeResponse", + value: QueryContractsByCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCodeResponseProtoMsg): QueryContractsByCodeResponse { + return QueryContractsByCodeResponse.decode(message.value); + }, + toProto(message: QueryContractsByCodeResponse): Uint8Array { + return QueryContractsByCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse", + value: QueryContractsByCodeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllContractStateRequest(): QueryAllContractStateRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryAllContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest", + encode(message: QueryAllContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllContractStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllContractStateRequest { + const message = createBaseQueryAllContractStateRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllContractStateRequestAmino): QueryAllContractStateRequest { + const message = createBaseQueryAllContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllContractStateRequest): QueryAllContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllContractStateRequestAminoMsg): QueryAllContractStateRequest { + return QueryAllContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllContractStateRequest): QueryAllContractStateRequestAminoMsg { + return { + type: "wasm/QueryAllContractStateRequest", + value: QueryAllContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllContractStateRequestProtoMsg): QueryAllContractStateRequest { + return QueryAllContractStateRequest.decode(message.value); + }, + toProto(message: QueryAllContractStateRequest): Uint8Array { + return QueryAllContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllContractStateRequest): QueryAllContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest", + value: QueryAllContractStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllContractStateResponse(): QueryAllContractStateResponse { + return { + models: [], + pagination: undefined + }; +} +export const QueryAllContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse", + encode(message: QueryAllContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.models) { + Model.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllContractStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.models.push(Model.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllContractStateResponse { + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllContractStateResponseAmino): QueryAllContractStateResponse { + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllContractStateResponse): QueryAllContractStateResponseAmino { + const obj: any = {}; + if (message.models) { + obj.models = message.models.map(e => e ? Model.toAmino(e) : undefined); + } else { + obj.models = message.models; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllContractStateResponseAminoMsg): QueryAllContractStateResponse { + return QueryAllContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllContractStateResponse): QueryAllContractStateResponseAminoMsg { + return { + type: "wasm/QueryAllContractStateResponse", + value: QueryAllContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllContractStateResponseProtoMsg): QueryAllContractStateResponse { + return QueryAllContractStateResponse.decode(message.value); + }, + toProto(message: QueryAllContractStateResponse): Uint8Array { + return QueryAllContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllContractStateResponse): QueryAllContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse", + value: QueryAllContractStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRawContractStateRequest(): QueryRawContractStateRequest { + return { + address: "", + queryData: new Uint8Array() + }; +} +export const QueryRawContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest", + encode(message: QueryRawContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRawContractStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRawContractStateRequest { + const message = createBaseQueryRawContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryRawContractStateRequestAmino): QueryRawContractStateRequest { + const message = createBaseQueryRawContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = bytesFromBase64(object.query_data); + } + return message; + }, + toAmino(message: QueryRawContractStateRequest): QueryRawContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.query_data = message.queryData ? base64FromBytes(message.queryData) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRawContractStateRequestAminoMsg): QueryRawContractStateRequest { + return QueryRawContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRawContractStateRequest): QueryRawContractStateRequestAminoMsg { + return { + type: "wasm/QueryRawContractStateRequest", + value: QueryRawContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRawContractStateRequestProtoMsg): QueryRawContractStateRequest { + return QueryRawContractStateRequest.decode(message.value); + }, + toProto(message: QueryRawContractStateRequest): Uint8Array { + return QueryRawContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRawContractStateRequest): QueryRawContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest", + value: QueryRawContractStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRawContractStateResponse(): QueryRawContractStateResponse { + return { + data: new Uint8Array() + }; +} +export const QueryRawContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse", + encode(message: QueryRawContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRawContractStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRawContractStateResponse { + const message = createBaseQueryRawContractStateResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryRawContractStateResponseAmino): QueryRawContractStateResponse { + const message = createBaseQueryRawContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryRawContractStateResponse): QueryRawContractStateResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRawContractStateResponseAminoMsg): QueryRawContractStateResponse { + return QueryRawContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRawContractStateResponse): QueryRawContractStateResponseAminoMsg { + return { + type: "wasm/QueryRawContractStateResponse", + value: QueryRawContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRawContractStateResponseProtoMsg): QueryRawContractStateResponse { + return QueryRawContractStateResponse.decode(message.value); + }, + toProto(message: QueryRawContractStateResponse): Uint8Array { + return QueryRawContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRawContractStateResponse): QueryRawContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse", + value: QueryRawContractStateResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySmartContractStateRequest(): QuerySmartContractStateRequest { + return { + address: "", + queryData: new Uint8Array() + }; +} +export const QuerySmartContractStateRequest = { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest", + encode(message: QuerySmartContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySmartContractStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySmartContractStateRequest { + const message = createBaseQuerySmartContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySmartContractStateRequestAmino): QuerySmartContractStateRequest { + const message = createBaseQuerySmartContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = toUtf8(JSON.stringify(object.query_data)); + } + return message; + }, + toAmino(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.query_data = message.queryData ? JSON.parse(fromUtf8(message.queryData)) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySmartContractStateRequestAminoMsg): QuerySmartContractStateRequest { + return QuerySmartContractStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAminoMsg { + return { + type: "wasm/QuerySmartContractStateRequest", + value: QuerySmartContractStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySmartContractStateRequestProtoMsg): QuerySmartContractStateRequest { + return QuerySmartContractStateRequest.decode(message.value); + }, + toProto(message: QuerySmartContractStateRequest): Uint8Array { + return QuerySmartContractStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest", + value: QuerySmartContractStateRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySmartContractStateResponse(): QuerySmartContractStateResponse { + return { + data: new Uint8Array() + }; +} +export const QuerySmartContractStateResponse = { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse", + encode(message: QuerySmartContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySmartContractStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySmartContractStateResponse { + const message = createBaseQuerySmartContractStateResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySmartContractStateResponseAmino): QuerySmartContractStateResponse { + const message = createBaseQuerySmartContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = toUtf8(JSON.stringify(object.data)); + } + return message; + }, + toAmino(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAmino { + const obj: any = {}; + obj.data = message.data ? JSON.parse(fromUtf8(message.data)) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySmartContractStateResponseAminoMsg): QuerySmartContractStateResponse { + return QuerySmartContractStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAminoMsg { + return { + type: "wasm/QuerySmartContractStateResponse", + value: QuerySmartContractStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySmartContractStateResponseProtoMsg): QuerySmartContractStateResponse { + return QuerySmartContractStateResponse.decode(message.value); + }, + toProto(message: QuerySmartContractStateResponse): Uint8Array { + return QuerySmartContractStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse", + value: QuerySmartContractStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodeRequest(): QueryCodeRequest { + return { + codeId: BigInt(0) + }; +} +export const QueryCodeRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest", + encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeRequestAminoMsg): QueryCodeRequest { + return QueryCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeRequest): QueryCodeRequestAminoMsg { + return { + type: "wasm/QueryCodeRequest", + value: QueryCodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeRequestProtoMsg): QueryCodeRequest { + return QueryCodeRequest.decode(message.value); + }, + toProto(message: QueryCodeRequest): Uint8Array { + return QueryCodeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeRequest): QueryCodeRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest", + value: QueryCodeRequest.encode(message).finish() + }; + } +}; +function createBaseCodeInfoResponse(): CodeInfoResponse { + return { + codeId: BigInt(0), + creator: "", + dataHash: new Uint8Array(), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const CodeInfoResponse = { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse", + encode(message: CodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.dataHash.length !== 0) { + writer.uint32(26).bytes(message.dataHash); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.dataHash = reader.bytes(); + break; + case 6: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.dataHash = object.dataHash ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: CodeInfoResponseAmino): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: CodeInfoResponse): CodeInfoResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : "0"; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: CodeInfoResponseAminoMsg): CodeInfoResponse { + return CodeInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: CodeInfoResponse): CodeInfoResponseAminoMsg { + return { + type: "wasm/CodeInfoResponse", + value: CodeInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: CodeInfoResponseProtoMsg): CodeInfoResponse { + return CodeInfoResponse.decode(message.value); + }, + toProto(message: CodeInfoResponse): Uint8Array { + return CodeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: CodeInfoResponse): CodeInfoResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse", + value: CodeInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { + codeInfo: undefined, + data: new Uint8Array() + }; +} +export const QueryCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse", + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeInfo !== undefined) { + CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfo = CodeInfoResponse.decode(reader, reader.uint32()); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.codeInfo = object.codeInfo !== undefined && object.codeInfo !== null ? CodeInfoResponse.fromPartial(object.codeInfo) : undefined; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfoResponse.fromAmino(object.code_info); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { + const obj: any = {}; + obj.code_info = message.codeInfo ? CodeInfoResponse.toAmino(message.codeInfo) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : ""; + return obj; + }, + fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { + return QueryCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeResponse): QueryCodeResponseAminoMsg { + return { + type: "wasm/QueryCodeResponse", + value: QueryCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeResponseProtoMsg): QueryCodeResponse { + return QueryCodeResponse.decode(message.value); + }, + toProto(message: QueryCodeResponse): Uint8Array { + return QueryCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeResponse): QueryCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse", + value: QueryCodeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodesRequest(): QueryCodesRequest { + return { + pagination: undefined + }; +} +export const QueryCodesRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest", + encode(message: QueryCodesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodesRequest { + const message = createBaseQueryCodesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCodesRequestAmino): QueryCodesRequest { + const message = createBaseQueryCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCodesRequest): QueryCodesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodesRequestAminoMsg): QueryCodesRequest { + return QueryCodesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodesRequest): QueryCodesRequestAminoMsg { + return { + type: "wasm/QueryCodesRequest", + value: QueryCodesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodesRequestProtoMsg): QueryCodesRequest { + return QueryCodesRequest.decode(message.value); + }, + toProto(message: QueryCodesRequest): Uint8Array { + return QueryCodesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodesRequest): QueryCodesRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest", + value: QueryCodesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCodesResponse(): QueryCodesResponse { + return { + codeInfos: [], + pagination: undefined + }; +} +export const QueryCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse", + encode(message: QueryCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.codeInfos) { + CodeInfoResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfos.push(CodeInfoResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.codeInfos?.map(e => CodeInfoResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCodesResponseAmino): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.code_infos?.map(e => CodeInfoResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCodesResponse): QueryCodesResponseAmino { + const obj: any = {}; + if (message.codeInfos) { + obj.code_infos = message.codeInfos.map(e => e ? CodeInfoResponse.toAmino(e) : undefined); + } else { + obj.code_infos = message.codeInfos; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodesResponseAminoMsg): QueryCodesResponse { + return QueryCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodesResponse): QueryCodesResponseAminoMsg { + return { + type: "wasm/QueryCodesResponse", + value: QueryCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodesResponseProtoMsg): QueryCodesResponse { + return QueryCodesResponse.decode(message.value); + }, + toProto(message: QueryCodesResponse): Uint8Array { + return QueryCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodesResponse): QueryCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse", + value: QueryCodesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPinnedCodesRequest(): QueryPinnedCodesRequest { + return { + pagination: undefined + }; +} +export const QueryPinnedCodesRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest", + encode(message: QueryPinnedCodesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPinnedCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPinnedCodesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPinnedCodesRequest { + const message = createBaseQueryPinnedCodesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPinnedCodesRequestAmino): QueryPinnedCodesRequest { + const message = createBaseQueryPinnedCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPinnedCodesRequestAminoMsg): QueryPinnedCodesRequest { + return QueryPinnedCodesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAminoMsg { + return { + type: "wasm/QueryPinnedCodesRequest", + value: QueryPinnedCodesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPinnedCodesRequestProtoMsg): QueryPinnedCodesRequest { + return QueryPinnedCodesRequest.decode(message.value); + }, + toProto(message: QueryPinnedCodesRequest): Uint8Array { + return QueryPinnedCodesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest", + value: QueryPinnedCodesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPinnedCodesResponse(): QueryPinnedCodesResponse { + return { + codeIds: [], + pagination: undefined + }; +} +export const QueryPinnedCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse", + encode(message: QueryPinnedCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPinnedCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPinnedCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPinnedCodesResponse { + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPinnedCodesResponseAmino): QueryPinnedCodesResponse { + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAmino { + const obj: any = {}; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPinnedCodesResponseAminoMsg): QueryPinnedCodesResponse { + return QueryPinnedCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAminoMsg { + return { + type: "wasm/QueryPinnedCodesResponse", + value: QueryPinnedCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPinnedCodesResponseProtoMsg): QueryPinnedCodesResponse { + return QueryPinnedCodesResponse.decode(message.value); + }, + toProto(message: QueryPinnedCodesResponse): Uint8Array { + return QueryPinnedCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse", + value: QueryPinnedCodesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "wasm/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "wasm/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryContractsByCreatorRequest(): QueryContractsByCreatorRequest { + return { + creatorAddress: "", + pagination: undefined + }; +} +export const QueryContractsByCreatorRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest", + encode(message: QueryContractsByCreatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creatorAddress !== "") { + writer.uint32(10).string(message.creatorAddress); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCreatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCreatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creatorAddress = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractsByCreatorRequest { + const message = createBaseQueryContractsByCreatorRequest(); + message.creatorAddress = object.creatorAddress ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCreatorRequestAmino): QueryContractsByCreatorRequest { + const message = createBaseQueryContractsByCreatorRequest(); + if (object.creator_address !== undefined && object.creator_address !== null) { + message.creatorAddress = object.creator_address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAmino { + const obj: any = {}; + obj.creator_address = message.creatorAddress === "" ? undefined : message.creatorAddress; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCreatorRequestAminoMsg): QueryContractsByCreatorRequest { + return QueryContractsByCreatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAminoMsg { + return { + type: "wasm/QueryContractsByCreatorRequest", + value: QueryContractsByCreatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCreatorRequestProtoMsg): QueryContractsByCreatorRequest { + return QueryContractsByCreatorRequest.decode(message.value); + }, + toProto(message: QueryContractsByCreatorRequest): Uint8Array { + return QueryContractsByCreatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest", + value: QueryContractsByCreatorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryContractsByCreatorResponse(): QueryContractsByCreatorResponse { + return { + contractAddresses: [], + pagination: undefined + }; +} +export const QueryContractsByCreatorResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse", + encode(message: QueryContractsByCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contractAddresses) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCreatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddresses.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractsByCreatorResponse { + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contractAddresses?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryContractsByCreatorResponseAmino): QueryContractsByCreatorResponse { + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contract_addresses?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAmino { + const obj: any = {}; + if (message.contractAddresses) { + obj.contract_addresses = message.contractAddresses.map(e => e); + } else { + obj.contract_addresses = message.contractAddresses; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractsByCreatorResponseAminoMsg): QueryContractsByCreatorResponse { + return QueryContractsByCreatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAminoMsg { + return { + type: "wasm/QueryContractsByCreatorResponse", + value: QueryContractsByCreatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryContractsByCreatorResponseProtoMsg): QueryContractsByCreatorResponse { + return QueryContractsByCreatorResponse.decode(message.value); + }, + toProto(message: QueryContractsByCreatorResponse): Uint8Array { + return QueryContractsByCreatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse", + value: QueryContractsByCreatorResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.amino.ts new file mode 100644 index 00000000..0a140f68 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.amino.ts @@ -0,0 +1,39 @@ +//@ts-nocheck +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin } from "./tx"; +export const AminoConverter = { + "/cosmwasm.wasm.v1.MsgStoreCode": { + aminoType: "wasm/MsgStoreCode", + toAmino: MsgStoreCode.toAmino, + fromAmino: MsgStoreCode.fromAmino + }, + "/cosmwasm.wasm.v1.MsgInstantiateContract": { + aminoType: "wasm/MsgInstantiateContract", + toAmino: MsgInstantiateContract.toAmino, + fromAmino: MsgInstantiateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgInstantiateContract2": { + aminoType: "wasm/MsgInstantiateContract2", + toAmino: MsgInstantiateContract2.toAmino, + fromAmino: MsgInstantiateContract2.fromAmino + }, + "/cosmwasm.wasm.v1.MsgExecuteContract": { + aminoType: "wasm/MsgExecuteContract", + toAmino: MsgExecuteContract.toAmino, + fromAmino: MsgExecuteContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgMigrateContract": { + aminoType: "wasm/MsgMigrateContract", + toAmino: MsgMigrateContract.toAmino, + fromAmino: MsgMigrateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateAdmin": { + aminoType: "wasm/MsgUpdateAdmin", + toAmino: MsgUpdateAdmin.toAmino, + fromAmino: MsgUpdateAdmin.fromAmino + }, + "/cosmwasm.wasm.v1.MsgClearAdmin": { + aminoType: "wasm/MsgClearAdmin", + toAmino: MsgClearAdmin.toAmino, + fromAmino: MsgClearAdmin.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.registry.ts new file mode 100644 index 00000000..747909bf --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.registry.ts @@ -0,0 +1,143 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(value).finish() + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(value).finish() + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.encode(value).finish() + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.encode(value).finish() + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(value).finish() + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(value).finish() + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.encode(value).finish() + }; + } + }, + withTypeUrl: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value + }; + } + }, + fromPartial: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromPartial(value) + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.fromPartial(value) + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.fromPartial(value) + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial(value) + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromPartial(value) + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.fromPartial(value) + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..f8dd8d0e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.rpc.msg.ts @@ -0,0 +1,75 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse } from "./tx"; +/** Msg defines the wasm Msg service. */ +export interface Msg { + /** StoreCode to submit Wasm code to the system */ + storeCode(request: MsgStoreCode): Promise; + /** + * InstantiateContract creates a new smart contract instance for the given + * code id. + */ + instantiateContract(request: MsgInstantiateContract): Promise; + /** + * InstantiateContract2 creates a new smart contract instance for the given + * code id with a predictable address + */ + instantiateContract2(request: MsgInstantiateContract2): Promise; + /** Execute submits the given message data to a smart contract */ + executeContract(request: MsgExecuteContract): Promise; + /** Migrate runs a code upgrade/ downgrade for a smart contract */ + migrateContract(request: MsgMigrateContract): Promise; + /** UpdateAdmin sets a new admin for a smart contract */ + updateAdmin(request: MsgUpdateAdmin): Promise; + /** ClearAdmin removes any admin stored for a smart contract */ + clearAdmin(request: MsgClearAdmin): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.storeCode = this.storeCode.bind(this); + this.instantiateContract = this.instantiateContract.bind(this); + this.instantiateContract2 = this.instantiateContract2.bind(this); + this.executeContract = this.executeContract.bind(this); + this.migrateContract = this.migrateContract.bind(this); + this.updateAdmin = this.updateAdmin.bind(this); + this.clearAdmin = this.clearAdmin.bind(this); + } + storeCode(request: MsgStoreCode): Promise { + const data = MsgStoreCode.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreCode", data); + return promise.then(data => MsgStoreCodeResponse.decode(new BinaryReader(data))); + } + instantiateContract(request: MsgInstantiateContract): Promise { + const data = MsgInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "InstantiateContract", data); + return promise.then(data => MsgInstantiateContractResponse.decode(new BinaryReader(data))); + } + instantiateContract2(request: MsgInstantiateContract2): Promise { + const data = MsgInstantiateContract2.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "InstantiateContract2", data); + return promise.then(data => MsgInstantiateContract2Response.decode(new BinaryReader(data))); + } + executeContract(request: MsgExecuteContract): Promise { + const data = MsgExecuteContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "ExecuteContract", data); + return promise.then(data => MsgExecuteContractResponse.decode(new BinaryReader(data))); + } + migrateContract(request: MsgMigrateContract): Promise { + const data = MsgMigrateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "MigrateContract", data); + return promise.then(data => MsgMigrateContractResponse.decode(new BinaryReader(data))); + } + updateAdmin(request: MsgUpdateAdmin): Promise { + const data = MsgUpdateAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateAdmin", data); + return promise.then(data => MsgUpdateAdminResponse.decode(new BinaryReader(data))); + } + clearAdmin(request: MsgClearAdmin): Promise { + const data = MsgClearAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "ClearAdmin", data); + return promise.then(data => MsgClearAdminResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.ts new file mode 100644 index 00000000..24ac0780 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/tx.ts @@ -0,0 +1,1722 @@ +//@ts-nocheck +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCode { + /** Sender is the that actor that signed the messages */ + sender: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiatePermission?: AccessConfig; +} +export interface MsgStoreCodeProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode"; + value: Uint8Array; +} +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCodeAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiate_permission?: AccessConfigAmino; +} +export interface MsgStoreCodeAminoMsg { + type: "wasm/MsgStoreCode"; + value: MsgStoreCodeAmino; +} +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCodeSDKType { + sender: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse"; + value: Uint8Array; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Checksum is the sha256 hash of the stored code */ + checksum?: string; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "wasm/MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseSDKType { + code_id: bigint; + checksum: Uint8Array; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface MsgInstantiateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract"; + value: Uint8Array; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContractAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a contract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds?: CoinAmino[]; +} +export interface MsgInstantiateContractAminoMsg { + type: "wasm/MsgInstantiateContract"; + value: MsgInstantiateContractAmino; +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContractSDKType { + sender: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predicable address. + */ +export interface MsgInstantiateContract2 { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean; +} +export interface MsgInstantiateContract2ProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2"; + value: Uint8Array; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predicable address. + */ +export interface MsgInstantiateContract2Amino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a contract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds?: CoinAmino[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt?: string; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fix_msg?: boolean; +} +export interface MsgInstantiateContract2AminoMsg { + type: "wasm/MsgInstantiateContract2"; + value: MsgInstantiateContract2Amino; +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predicable address. + */ +export interface MsgInstantiateContract2SDKType { + sender: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + salt: Uint8Array; + fix_msg: boolean; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; + value: Uint8Array; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgInstantiateContractResponseAminoMsg { + type: "wasm/MsgInstantiateContractResponse"; + value: MsgInstantiateContractResponseAmino; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2Response { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContract2ResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response"; + value: Uint8Array; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2ResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgInstantiateContract2ResponseAminoMsg { + type: "wasm/MsgInstantiateContract2Response"; + value: MsgInstantiateContract2ResponseAmino; +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2ResponseSDKType { + address: string; + data: Uint8Array; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on execution */ + funds: Coin[]; +} +export interface MsgExecuteContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract"; + value: Uint8Array; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContractAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract */ + msg?: any; + /** Funds coins that are transferred to the contract on execution */ + funds?: CoinAmino[]; +} +export interface MsgExecuteContractAminoMsg { + type: "wasm/MsgExecuteContract"; + value: MsgExecuteContractAmino; +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContractSDKType { + sender: string; + contract: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgExecuteContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse"; + value: Uint8Array; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseAmino { + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgExecuteContractResponseAminoMsg { + type: "wasm/MsgExecuteContractResponse"; + value: MsgExecuteContractResponseAmino; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseSDKType { + data: Uint8Array; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: bigint; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MsgMigrateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract"; + value: Uint8Array; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** CodeID references the new WASM code */ + code_id?: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any; +} +export interface MsgMigrateContractAminoMsg { + type: "wasm/MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractSDKType { + sender: string; + contract: string; + code_id: bigint; + msg: Uint8Array; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponse { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: Uint8Array; +} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse"; + value: Uint8Array; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseAmino { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data?: string; +} +export interface MsgMigrateContractResponseAminoMsg { + type: "wasm/MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseSDKType { + data: Uint8Array; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateAdminProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin"; + value: Uint8Array; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** NewAdmin address to be set */ + new_admin?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface MsgUpdateAdminAminoMsg { + type: "wasm/MsgUpdateAdmin"; + value: MsgUpdateAdminAmino; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminSDKType { + sender: string; + new_admin: string; + contract: string; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponse {} +export interface MsgUpdateAdminResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseAmino {} +export interface MsgUpdateAdminResponseAminoMsg { + type: "wasm/MsgUpdateAdminResponse"; + value: MsgUpdateAdminResponseAmino; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseSDKType {} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgClearAdminProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin"; + value: Uint8Array; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface MsgClearAdminAminoMsg { + type: "wasm/MsgClearAdmin"; + value: MsgClearAdminAmino; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminSDKType { + sender: string; + contract: string; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponse {} +export interface MsgClearAdminResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse"; + value: Uint8Array; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseAmino {} +export interface MsgClearAdminResponseAminoMsg { + type: "wasm/MsgClearAdminResponse"; + value: MsgClearAdminResponseAmino; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + sender: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const MsgStoreCode = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.sender = object.sender ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: MsgStoreCode): MsgStoreCodeAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { + return { + type: "wasm/MsgStoreCode", + value: MsgStoreCode.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { + return MsgStoreCode.decode(message.value); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { + return { + type: "wasm/MsgStoreCodeResponse", + value: MsgStoreCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgInstantiateContract): MsgInstantiateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { + return MsgInstantiateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract): MsgInstantiateContractAminoMsg { + return { + type: "wasm/MsgInstantiateContract", + value: MsgInstantiateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractProtoMsg): MsgInstantiateContract { + return MsgInstantiateContract.decode(message.value); + }, + toProto(message: MsgInstantiateContract): Uint8Array { + return MsgInstantiateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const MsgInstantiateContract2 = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(58).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(64).bool(message.fixMsg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + message.salt = reader.bytes(); + break; + case 8: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, + fromAmino(object: MsgInstantiateContract2Amino): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; + }, + toAmino(message: MsgInstantiateContract2): MsgInstantiateContract2Amino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; + obj.fix_msg = message.fixMsg === false ? undefined : message.fixMsg; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2AminoMsg { + return { + type: "wasm/MsgInstantiateContract2", + value: MsgInstantiateContract2.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ProtoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.decode(message.value); + }, + toProto(message: MsgInstantiateContract2): Uint8Array { + return MsgInstantiateContract2.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2ProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.decode(message.value); + }, + toProto(message: MsgInstantiateContractResponse): Uint8Array { + return MsgInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContract2Response = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + encode(message: MsgInstantiateContract2Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2Response(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContract2ResponseAmino): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2ResponseAminoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ResponseProtoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.decode(message.value); + }, + toProto(message: MsgInstantiateContract2Response): Uint8Array { + return MsgInstantiateContract2Response.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { + sender: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgExecuteContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + case 5: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgExecuteContract): MsgExecuteContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { + return MsgExecuteContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContract): MsgExecuteContractAminoMsg { + return { + type: "wasm/MsgExecuteContract", + value: MsgExecuteContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractProtoMsg): MsgExecuteContract { + return MsgExecuteContract.decode(message.value); + }, + toProto(message: MsgExecuteContract): Uint8Array { + return MsgExecuteContract.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgExecuteContractResponse): MsgExecuteContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseAminoMsg { + return { + type: "wasm/MsgExecuteContractResponse", + value: MsgExecuteContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractResponseProtoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.decode(message.value); + }, + toProto(message: MsgExecuteContractResponse): Uint8Array { + return MsgExecuteContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + value: MsgExecuteContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + sender: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + return { + type: "wasm/MsgMigrateContract", + value: MsgMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { + return MsgMigrateContract.decode(message.value); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + return { + type: "wasm/MsgMigrateContractResponse", + value: MsgMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { + sender: "", + newAdmin: "", + contract: "" + }; +} +export const MsgUpdateAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.newAdmin !== "") { + writer.uint32(18).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.newAdmin = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + message.sender = object.sender ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgUpdateAdmin): MsgUpdateAdminAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdmin): MsgUpdateAdminAminoMsg { + return { + type: "wasm/MsgUpdateAdmin", + value: MsgUpdateAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminProtoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.decode(message.value); + }, + toProto(message: MsgUpdateAdmin): Uint8Array { + return MsgUpdateAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} +export const MsgUpdateAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateAdminResponse): MsgUpdateAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseAminoMsg { + return { + type: "wasm/MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateAdminResponse): Uint8Array { + return MsgUpdateAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { + sender: "", + contract: "" + }; +} +export const MsgClearAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgClearAdmin): MsgClearAdminAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { + return MsgClearAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdmin): MsgClearAdminAminoMsg { + return { + type: "wasm/MsgClearAdmin", + value: MsgClearAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminProtoMsg): MsgClearAdmin { + return MsgClearAdmin.decode(message.value); + }, + toProto(message: MsgClearAdmin): Uint8Array { + return MsgClearAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} +export const MsgClearAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + toAmino(_: MsgClearAdminResponse): MsgClearAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseAminoMsg { + return { + type: "wasm/MsgClearAdminResponse", + value: MsgClearAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminResponseProtoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.decode(message.value); + }, + toProto(message: MsgClearAdminResponse): Uint8Array { + return MsgClearAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + value: MsgClearAdminResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/types.ts b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/types.ts new file mode 100644 index 00000000..0bd98d37 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/cosmwasm/wasm/v1/types.ts @@ -0,0 +1,1147 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** AccessType permission types */ +export enum AccessType { + /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ + ACCESS_TYPE_UNSPECIFIED = 0, + /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ + ACCESS_TYPE_NOBODY = 1, + /** + * ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to a single address + * Deprecated: use AccessTypeAnyOfAddresses instead + */ + ACCESS_TYPE_ONLY_ADDRESS = 2, + /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ + ACCESS_TYPE_EVERYBODY = 3, + /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ + ACCESS_TYPE_ANY_OF_ADDRESSES = 4, + UNRECOGNIZED = -1, +} +export const AccessTypeSDKType = AccessType; +export const AccessTypeAmino = AccessType; +export function accessTypeFromJSON(object: any): AccessType { + switch (object) { + case 0: + case "ACCESS_TYPE_UNSPECIFIED": + return AccessType.ACCESS_TYPE_UNSPECIFIED; + case 1: + case "ACCESS_TYPE_NOBODY": + return AccessType.ACCESS_TYPE_NOBODY; + case 2: + case "ACCESS_TYPE_ONLY_ADDRESS": + return AccessType.ACCESS_TYPE_ONLY_ADDRESS; + case 3: + case "ACCESS_TYPE_EVERYBODY": + return AccessType.ACCESS_TYPE_EVERYBODY; + case 4: + case "ACCESS_TYPE_ANY_OF_ADDRESSES": + return AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES; + case -1: + case "UNRECOGNIZED": + default: + return AccessType.UNRECOGNIZED; + } +} +export function accessTypeToJSON(object: AccessType): string { + switch (object) { + case AccessType.ACCESS_TYPE_UNSPECIFIED: + return "ACCESS_TYPE_UNSPECIFIED"; + case AccessType.ACCESS_TYPE_NOBODY: + return "ACCESS_TYPE_NOBODY"; + case AccessType.ACCESS_TYPE_ONLY_ADDRESS: + return "ACCESS_TYPE_ONLY_ADDRESS"; + case AccessType.ACCESS_TYPE_EVERYBODY: + return "ACCESS_TYPE_EVERYBODY"; + case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: + return "ACCESS_TYPE_ANY_OF_ADDRESSES"; + case AccessType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ContractCodeHistoryOperationType actions that caused a code change */ +export enum ContractCodeHistoryOperationType { + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, + UNRECOGNIZED = -1, +} +export const ContractCodeHistoryOperationTypeSDKType = ContractCodeHistoryOperationType; +export const ContractCodeHistoryOperationTypeAmino = ContractCodeHistoryOperationType; +export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType { + switch (object) { + case 0: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED; + case 1: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT; + case 2: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE; + case 3: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS; + case -1: + case "UNRECOGNIZED": + default: + return ContractCodeHistoryOperationType.UNRECOGNIZED; + } +} +export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string { + switch (object) { + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"; + case ContractCodeHistoryOperationType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** AccessTypeParam */ +export interface AccessTypeParam { + value: AccessType; +} +export interface AccessTypeParamProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam"; + value: Uint8Array; +} +/** AccessTypeParam */ +export interface AccessTypeParamAmino { + value?: AccessType; +} +export interface AccessTypeParamAminoMsg { + type: "wasm/AccessTypeParam"; + value: AccessTypeParamAmino; +} +/** AccessTypeParam */ +export interface AccessTypeParamSDKType { + value: AccessType; +} +/** AccessConfig access control type. */ +export interface AccessConfig { + permission: AccessType; + /** + * Address + * Deprecated: replaced by addresses + */ + address: string; + addresses: string[]; +} +export interface AccessConfigProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig"; + value: Uint8Array; +} +/** AccessConfig access control type. */ +export interface AccessConfigAmino { + permission?: AccessType; + /** + * Address + * Deprecated: replaced by addresses + */ + address?: string; + addresses?: string[]; +} +export interface AccessConfigAminoMsg { + type: "wasm/AccessConfig"; + value: AccessConfigAmino; +} +/** AccessConfig access control type. */ +export interface AccessConfigSDKType { + permission: AccessType; + address: string; + addresses: string[]; +} +/** Params defines the set of wasm parameters. */ +export interface Params { + codeUploadAccess: AccessConfig; + instantiateDefaultPermission: AccessType; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of wasm parameters. */ +export interface ParamsAmino { + code_upload_access?: AccessConfigAmino; + instantiate_default_permission?: AccessType; +} +export interface ParamsAminoMsg { + type: "wasm/Params"; + value: ParamsAmino; +} +/** Params defines the set of wasm parameters. */ +export interface ParamsSDKType { + code_upload_access: AccessConfigSDKType; + instantiate_default_permission: AccessType; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfo { + /** CodeHash is the unique identifier created by wasmvm */ + codeHash: Uint8Array; + /** Creator address who initially stored the code */ + creator: string; + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiateConfig: AccessConfig; +} +export interface CodeInfoProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo"; + value: Uint8Array; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoAmino { + /** CodeHash is the unique identifier created by wasmvm */ + code_hash?: string; + /** Creator address who initially stored the code */ + creator?: string; + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiate_config?: AccessConfigAmino; +} +export interface CodeInfoAminoMsg { + type: "wasm/CodeInfo"; + value: CodeInfoAmino; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoSDKType { + code_hash: Uint8Array; + creator: string; + instantiate_config: AccessConfigSDKType; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfo { + /** CodeID is the reference to the stored Wasm code */ + codeId: bigint; + /** Creator address who initially instantiated the contract */ + creator: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPosition; + ibcPortId: string; + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: Any | undefined; +} +export interface ContractInfoProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; + value: Uint8Array; +} +export type ContractInfoEncoded = Omit & { + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyProtoMsg | undefined; +}; +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoAmino { + /** CodeID is the reference to the stored Wasm code */ + code_id?: string; + /** Creator address who initially instantiated the contract */ + creator?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Label is optional metadata to be stored with a contract instance. */ + label?: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPositionAmino; + ibc_port_id?: string; + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyAmino; +} +export interface ContractInfoAminoMsg { + type: "wasm/ContractInfo"; + value: ContractInfoAmino; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoSDKType { + code_id: bigint; + creator: string; + admin: string; + label: string; + created?: AbsoluteTxPositionSDKType; + ibc_port_id: string; + extension?: AnySDKType | undefined; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntry { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPosition; + msg: Uint8Array; +} +export interface ContractCodeHistoryEntryProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry"; + value: Uint8Array; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntryAmino { + operation?: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPositionAmino; + msg?: any; +} +export interface ContractCodeHistoryEntryAminoMsg { + type: "wasm/ContractCodeHistoryEntry"; + value: ContractCodeHistoryEntryAmino; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntrySDKType { + operation: ContractCodeHistoryOperationType; + code_id: bigint; + updated?: AbsoluteTxPositionSDKType; + msg: Uint8Array; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPosition { + /** BlockHeight is the block the contract was created at */ + blockHeight: bigint; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + txIndex: bigint; +} +export interface AbsoluteTxPositionProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition"; + value: Uint8Array; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPositionAmino { + /** BlockHeight is the block the contract was created at */ + block_height?: string; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + tx_index?: string; +} +export interface AbsoluteTxPositionAminoMsg { + type: "wasm/AbsoluteTxPosition"; + value: AbsoluteTxPositionAmino; +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPositionSDKType { + block_height: bigint; + tx_index: bigint; +} +/** Model is a struct that holds a KV pair */ +export interface Model { + /** hex-encode key to read it better (this is often ascii) */ + key: Uint8Array; + /** base64-encode raw value */ + value: Uint8Array; +} +export interface ModelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.Model"; + value: Uint8Array; +} +/** Model is a struct that holds a KV pair */ +export interface ModelAmino { + /** hex-encode key to read it better (this is often ascii) */ + key?: string; + /** base64-encode raw value */ + value?: string; +} +export interface ModelAminoMsg { + type: "wasm/Model"; + value: ModelAmino; +} +/** Model is a struct that holds a KV pair */ +export interface ModelSDKType { + key: Uint8Array; + value: Uint8Array; +} +function createBaseAccessTypeParam(): AccessTypeParam { + return { + value: 0 + }; +} +export const AccessTypeParam = { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam", + encode(message: AccessTypeParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessTypeParam { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessTypeParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccessTypeParam { + const message = createBaseAccessTypeParam(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: AccessTypeParamAmino): AccessTypeParam { + const message = createBaseAccessTypeParam(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: AccessTypeParam): AccessTypeParamAmino { + const obj: any = {}; + obj.value = message.value === 0 ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: AccessTypeParamAminoMsg): AccessTypeParam { + return AccessTypeParam.fromAmino(object.value); + }, + toAminoMsg(message: AccessTypeParam): AccessTypeParamAminoMsg { + return { + type: "wasm/AccessTypeParam", + value: AccessTypeParam.toAmino(message) + }; + }, + fromProtoMsg(message: AccessTypeParamProtoMsg): AccessTypeParam { + return AccessTypeParam.decode(message.value); + }, + toProto(message: AccessTypeParam): Uint8Array { + return AccessTypeParam.encode(message).finish(); + }, + toProtoMsg(message: AccessTypeParam): AccessTypeParamProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam", + value: AccessTypeParam.encode(message).finish() + }; + } +}; +function createBaseAccessConfig(): AccessConfig { + return { + permission: 0, + address: "", + addresses: [] + }; +} +export const AccessConfig = { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig", + encode(message: AccessConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.permission !== 0) { + writer.uint32(8).int32(message.permission); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + for (const v of message.addresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.permission = reader.int32() as any; + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccessConfig { + const message = createBaseAccessConfig(); + message.permission = object.permission ?? 0; + message.address = object.address ?? ""; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: AccessConfigAmino): AccessConfig { + const message = createBaseAccessConfig(); + if (object.permission !== undefined && object.permission !== null) { + message.permission = object.permission; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: AccessConfig): AccessConfigAmino { + const obj: any = {}; + obj.permission = message.permission === 0 ? undefined : message.permission; + obj.address = message.address === "" ? undefined : message.address; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } + return obj; + }, + fromAminoMsg(object: AccessConfigAminoMsg): AccessConfig { + return AccessConfig.fromAmino(object.value); + }, + toAminoMsg(message: AccessConfig): AccessConfigAminoMsg { + return { + type: "wasm/AccessConfig", + value: AccessConfig.toAmino(message) + }; + }, + fromProtoMsg(message: AccessConfigProtoMsg): AccessConfig { + return AccessConfig.decode(message.value); + }, + toProto(message: AccessConfig): Uint8Array { + return AccessConfig.encode(message).finish(); + }, + toProtoMsg(message: AccessConfig): AccessConfigProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessConfig", + value: AccessConfig.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + codeUploadAccess: AccessConfig.fromPartial({}), + instantiateDefaultPermission: 0 + }; +} +export const Params = { + typeUrl: "/cosmwasm.wasm.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeUploadAccess !== undefined) { + AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); + } + if (message.instantiateDefaultPermission !== 0) { + writer.uint32(16).int32(message.instantiateDefaultPermission); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeUploadAccess = AccessConfig.decode(reader, reader.uint32()); + break; + case 2: + message.instantiateDefaultPermission = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.codeUploadAccess = object.codeUploadAccess !== undefined && object.codeUploadAccess !== null ? AccessConfig.fromPartial(object.codeUploadAccess) : undefined; + message.instantiateDefaultPermission = object.instantiateDefaultPermission ?? 0; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.code_upload_access !== undefined && object.code_upload_access !== null) { + message.codeUploadAccess = AccessConfig.fromAmino(object.code_upload_access); + } + if (object.instantiate_default_permission !== undefined && object.instantiate_default_permission !== null) { + message.instantiateDefaultPermission = object.instantiate_default_permission; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess) : undefined; + obj.instantiate_default_permission = message.instantiateDefaultPermission === 0 ? undefined : message.instantiateDefaultPermission; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "wasm/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseCodeInfo(): CodeInfo { + return { + codeHash: new Uint8Array(), + creator: "", + instantiateConfig: AccessConfig.fromPartial({}) + }; +} +export const CodeInfo = { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo", + encode(message: CodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.instantiateConfig !== undefined) { + AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.creator = reader.string(); + break; + case 5: + message.instantiateConfig = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CodeInfo { + const message = createBaseCodeInfo(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.creator = object.creator ?? ""; + message.instantiateConfig = object.instantiateConfig !== undefined && object.instantiateConfig !== null ? AccessConfig.fromPartial(object.instantiateConfig) : undefined; + return message; + }, + fromAmino(object: CodeInfoAmino): CodeInfo { + const message = createBaseCodeInfo(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.instantiate_config !== undefined && object.instantiate_config !== null) { + message.instantiateConfig = AccessConfig.fromAmino(object.instantiate_config); + } + return message; + }, + toAmino(message: CodeInfo): CodeInfoAmino { + const obj: any = {}; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.instantiate_config = message.instantiateConfig ? AccessConfig.toAmino(message.instantiateConfig) : undefined; + return obj; + }, + fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { + return CodeInfo.fromAmino(object.value); + }, + toAminoMsg(message: CodeInfo): CodeInfoAminoMsg { + return { + type: "wasm/CodeInfo", + value: CodeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: CodeInfoProtoMsg): CodeInfo { + return CodeInfo.decode(message.value); + }, + toProto(message: CodeInfo): Uint8Array { + return CodeInfo.encode(message).finish(); + }, + toProtoMsg(message: CodeInfo): CodeInfoProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeInfo", + value: CodeInfo.encode(message).finish() + }; + } +}; +function createBaseContractInfo(): ContractInfo { + return { + codeId: BigInt(0), + creator: "", + admin: "", + label: "", + created: undefined, + ibcPortId: "", + extension: undefined + }; +} +export const ContractInfo = { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo", + encode(message: ContractInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.admin !== "") { + writer.uint32(26).string(message.admin); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.created !== undefined) { + AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim(); + } + if (message.ibcPortId !== "") { + writer.uint32(50).string(message.ibcPortId); + } + if (message.extension !== undefined) { + Any.encode(message.extension as Any, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.admin = reader.string(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.created = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 6: + message.ibcPortId = reader.string(); + break; + case 7: + message.extension = ContractInfoExtension_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractInfo { + const message = createBaseContractInfo(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.created = object.created !== undefined && object.created !== null ? AbsoluteTxPosition.fromPartial(object.created) : undefined; + message.ibcPortId = object.ibcPortId ?? ""; + message.extension = object.extension !== undefined && object.extension !== null ? Any.fromPartial(object.extension) : undefined; + return message; + }, + fromAmino(object: ContractInfoAmino): ContractInfo { + const message = createBaseContractInfo(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromAmino(object.created); + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = ContractInfoExtension_FromAmino(object.extension); + } + return message; + }, + toAmino(message: ContractInfo): ContractInfoAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.label = message.label === "" ? undefined : message.label; + obj.created = message.created ? AbsoluteTxPosition.toAmino(message.created) : undefined; + obj.ibc_port_id = message.ibcPortId === "" ? undefined : message.ibcPortId; + obj.extension = message.extension ? ContractInfoExtension_ToAmino(message.extension as Any) : undefined; + return obj; + }, + fromAminoMsg(object: ContractInfoAminoMsg): ContractInfo { + return ContractInfo.fromAmino(object.value); + }, + toAminoMsg(message: ContractInfo): ContractInfoAminoMsg { + return { + type: "wasm/ContractInfo", + value: ContractInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ContractInfoProtoMsg): ContractInfo { + return ContractInfo.decode(message.value); + }, + toProto(message: ContractInfo): Uint8Array { + return ContractInfo.encode(message).finish(); + }, + toProtoMsg(message: ContractInfo): ContractInfoProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractInfo", + value: ContractInfo.encode(message).finish() + }; + } +}; +function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { + return { + operation: 0, + codeId: BigInt(0), + updated: undefined, + msg: new Uint8Array() + }; +} +export const ContractCodeHistoryEntry = { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry", + encode(message: ContractCodeHistoryEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operation !== 0) { + writer.uint32(8).int32(message.operation); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(16).uint64(message.codeId); + } + if (message.updated !== undefined) { + AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim(); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractCodeHistoryEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractCodeHistoryEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operation = reader.int32() as any; + break; + case 2: + message.codeId = reader.uint64(); + break; + case 3: + message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + message.operation = object.operation ?? 0; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.updated = object.updated !== undefined && object.updated !== null ? AbsoluteTxPosition.fromPartial(object.updated) : undefined; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + if (object.operation !== undefined && object.operation !== null) { + message.operation = object.operation; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromAmino(object.updated); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAmino { + const obj: any = {}; + obj.operation = message.operation === 0 ? undefined : message.operation; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.updated = message.updated ? AbsoluteTxPosition.toAmino(message.updated) : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: ContractCodeHistoryEntryAminoMsg): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.fromAmino(object.value); + }, + toAminoMsg(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAminoMsg { + return { + type: "wasm/ContractCodeHistoryEntry", + value: ContractCodeHistoryEntry.toAmino(message) + }; + }, + fromProtoMsg(message: ContractCodeHistoryEntryProtoMsg): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.decode(message.value); + }, + toProto(message: ContractCodeHistoryEntry): Uint8Array { + return ContractCodeHistoryEntry.encode(message).finish(); + }, + toProtoMsg(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry", + value: ContractCodeHistoryEntry.encode(message).finish() + }; + } +}; +function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { + return { + blockHeight: BigInt(0), + txIndex: BigInt(0) + }; +} +export const AbsoluteTxPosition = { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition", + encode(message: AbsoluteTxPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.blockHeight); + } + if (message.txIndex !== BigInt(0)) { + writer.uint32(16).uint64(message.txIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AbsoluteTxPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAbsoluteTxPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + case 2: + message.txIndex = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.txIndex = object.txIndex !== undefined && object.txIndex !== null ? BigInt(object.txIndex.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AbsoluteTxPositionAmino): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = BigInt(object.tx_index); + } + return message; + }, + toAmino(message: AbsoluteTxPosition): AbsoluteTxPositionAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; + obj.tx_index = message.txIndex !== BigInt(0) ? message.txIndex.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AbsoluteTxPositionAminoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.fromAmino(object.value); + }, + toAminoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionAminoMsg { + return { + type: "wasm/AbsoluteTxPosition", + value: AbsoluteTxPosition.toAmino(message) + }; + }, + fromProtoMsg(message: AbsoluteTxPositionProtoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.decode(message.value); + }, + toProto(message: AbsoluteTxPosition): Uint8Array { + return AbsoluteTxPosition.encode(message).finish(); + }, + toProtoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition", + value: AbsoluteTxPosition.encode(message).finish() + }; + } +}; +function createBaseModel(): Model { + return { + key: new Uint8Array(), + value: new Uint8Array() + }; +} +export const Model = { + typeUrl: "/cosmwasm.wasm.v1.Model", + encode(message: Model, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Model { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Model { + const message = createBaseModel(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: ModelAmino): Model { + const message = createBaseModel(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: Model): ModelAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: ModelAminoMsg): Model { + return Model.fromAmino(object.value); + }, + toAminoMsg(message: Model): ModelAminoMsg { + return { + type: "wasm/Model", + value: Model.toAmino(message) + }; + }, + fromProtoMsg(message: ModelProtoMsg): Model { + return Model.decode(message.value); + }, + toProto(message: Model): Uint8Array { + return Model.encode(message).finish(); + }, + toProtoMsg(message: Model): ModelProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.Model", + value: Model.encode(message).finish() + }; + } +}; +export const ContractInfoExtension_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + default: + return data; + } +}; +export const ContractInfoExtension_FromAmino = (content: AnyAmino): Any => { + return Any.fromAmino(content); +}; +export const ContractInfoExtension_ToAmino = (content: Any) => { + return Any.toAmino(content); +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/accountplus/accountplus.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/accountplus/accountplus.ts new file mode 100644 index 00000000..e01c9504 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/accountplus/accountplus.ts @@ -0,0 +1,213 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Account State */ +export interface AccountState { + address: string; + timestampNonceDetails: TimestampNonceDetails; +} +export interface AccountStateProtoMsg { + typeUrl: "/dydxprotocol.accountplus.AccountState"; + value: Uint8Array; +} +/** Account State */ +export interface AccountStateAmino { + address?: string; + timestamp_nonce_details?: TimestampNonceDetailsAmino; +} +export interface AccountStateAminoMsg { + type: "/dydxprotocol.accountplus.AccountState"; + value: AccountStateAmino; +} +/** Account State */ +export interface AccountStateSDKType { + address: string; + timestamp_nonce_details: TimestampNonceDetailsSDKType; +} +/** Timestamp nonce details */ +export interface TimestampNonceDetails { + /** unsorted list of n most recent timestamp nonces */ + timestampNonces: bigint[]; + /** max timestamp nonce that was ejected from list above */ + maxEjectedNonce: bigint; +} +export interface TimestampNonceDetailsProtoMsg { + typeUrl: "/dydxprotocol.accountplus.TimestampNonceDetails"; + value: Uint8Array; +} +/** Timestamp nonce details */ +export interface TimestampNonceDetailsAmino { + /** unsorted list of n most recent timestamp nonces */ + timestamp_nonces?: string[]; + /** max timestamp nonce that was ejected from list above */ + max_ejected_nonce?: string; +} +export interface TimestampNonceDetailsAminoMsg { + type: "/dydxprotocol.accountplus.TimestampNonceDetails"; + value: TimestampNonceDetailsAmino; +} +/** Timestamp nonce details */ +export interface TimestampNonceDetailsSDKType { + timestamp_nonces: bigint[]; + max_ejected_nonce: bigint; +} +function createBaseAccountState(): AccountState { + return { + address: "", + timestampNonceDetails: TimestampNonceDetails.fromPartial({}) + }; +} +export const AccountState = { + typeUrl: "/dydxprotocol.accountplus.AccountState", + encode(message: AccountState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.timestampNonceDetails !== undefined) { + TimestampNonceDetails.encode(message.timestampNonceDetails, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.timestampNonceDetails = TimestampNonceDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccountState { + const message = createBaseAccountState(); + message.address = object.address ?? ""; + message.timestampNonceDetails = object.timestampNonceDetails !== undefined && object.timestampNonceDetails !== null ? TimestampNonceDetails.fromPartial(object.timestampNonceDetails) : undefined; + return message; + }, + fromAmino(object: AccountStateAmino): AccountState { + const message = createBaseAccountState(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.timestamp_nonce_details !== undefined && object.timestamp_nonce_details !== null) { + message.timestampNonceDetails = TimestampNonceDetails.fromAmino(object.timestamp_nonce_details); + } + return message; + }, + toAmino(message: AccountState): AccountStateAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.timestamp_nonce_details = message.timestampNonceDetails ? TimestampNonceDetails.toAmino(message.timestampNonceDetails) : undefined; + return obj; + }, + fromAminoMsg(object: AccountStateAminoMsg): AccountState { + return AccountState.fromAmino(object.value); + }, + fromProtoMsg(message: AccountStateProtoMsg): AccountState { + return AccountState.decode(message.value); + }, + toProto(message: AccountState): Uint8Array { + return AccountState.encode(message).finish(); + }, + toProtoMsg(message: AccountState): AccountStateProtoMsg { + return { + typeUrl: "/dydxprotocol.accountplus.AccountState", + value: AccountState.encode(message).finish() + }; + } +}; +function createBaseTimestampNonceDetails(): TimestampNonceDetails { + return { + timestampNonces: [], + maxEjectedNonce: BigInt(0) + }; +} +export const TimestampNonceDetails = { + typeUrl: "/dydxprotocol.accountplus.TimestampNonceDetails", + encode(message: TimestampNonceDetails, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.timestampNonces) { + writer.uint64(v); + } + writer.ldelim(); + if (message.maxEjectedNonce !== BigInt(0)) { + writer.uint32(16).uint64(message.maxEjectedNonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TimestampNonceDetails { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestampNonceDetails(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.timestampNonces.push(reader.uint64()); + } + } else { + message.timestampNonces.push(reader.uint64()); + } + break; + case 2: + message.maxEjectedNonce = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TimestampNonceDetails { + const message = createBaseTimestampNonceDetails(); + message.timestampNonces = object.timestampNonces?.map(e => BigInt(e.toString())) || []; + message.maxEjectedNonce = object.maxEjectedNonce !== undefined && object.maxEjectedNonce !== null ? BigInt(object.maxEjectedNonce.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TimestampNonceDetailsAmino): TimestampNonceDetails { + const message = createBaseTimestampNonceDetails(); + message.timestampNonces = object.timestamp_nonces?.map(e => BigInt(e)) || []; + if (object.max_ejected_nonce !== undefined && object.max_ejected_nonce !== null) { + message.maxEjectedNonce = BigInt(object.max_ejected_nonce); + } + return message; + }, + toAmino(message: TimestampNonceDetails): TimestampNonceDetailsAmino { + const obj: any = {}; + if (message.timestampNonces) { + obj.timestamp_nonces = message.timestampNonces.map(e => e.toString()); + } else { + obj.timestamp_nonces = message.timestampNonces; + } + obj.max_ejected_nonce = message.maxEjectedNonce !== BigInt(0) ? message.maxEjectedNonce.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TimestampNonceDetailsAminoMsg): TimestampNonceDetails { + return TimestampNonceDetails.fromAmino(object.value); + }, + fromProtoMsg(message: TimestampNonceDetailsProtoMsg): TimestampNonceDetails { + return TimestampNonceDetails.decode(message.value); + }, + toProto(message: TimestampNonceDetails): Uint8Array { + return TimestampNonceDetails.encode(message).finish(); + }, + toProtoMsg(message: TimestampNonceDetails): TimestampNonceDetailsProtoMsg { + return { + typeUrl: "/dydxprotocol.accountplus.TimestampNonceDetails", + value: TimestampNonceDetails.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/accountplus/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/accountplus/genesis.ts new file mode 100644 index 00000000..8c36ff12 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/accountplus/genesis.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { AccountState, AccountStateAmino, AccountStateSDKType } from "./accountplus"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Module genesis state */ +export interface GenesisState { + accounts: AccountState[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.accountplus.GenesisState"; + value: Uint8Array; +} +/** Module genesis state */ +export interface GenesisStateAmino { + accounts?: AccountStateAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.accountplus.GenesisState"; + value: GenesisStateAmino; +} +/** Module genesis state */ +export interface GenesisStateSDKType { + accounts: AccountStateSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + accounts: [] + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.accountplus.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + AccountState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(AccountState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.accounts = object.accounts?.map(e => AccountState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.accounts = object.accounts?.map(e => AccountState.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? AccountState.toAmino(e) : undefined); + } else { + obj.accounts = message.accounts; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.accountplus.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/affiliates.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/affiliates.ts new file mode 100644 index 00000000..517eb15c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/affiliates.ts @@ -0,0 +1,225 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** AffiliateTiers defines the affiliate tiers. */ +export interface AffiliateTiers { + /** All affiliate tiers */ + tiers: AffiliateTiers_Tier[]; +} +export interface AffiliateTiersProtoMsg { + typeUrl: "/dydxprotocol.affiliates.AffiliateTiers"; + value: Uint8Array; +} +/** AffiliateTiers defines the affiliate tiers. */ +export interface AffiliateTiersAmino { + /** All affiliate tiers */ + tiers?: AffiliateTiers_TierAmino[]; +} +export interface AffiliateTiersAminoMsg { + type: "/dydxprotocol.affiliates.AffiliateTiers"; + value: AffiliateTiersAmino; +} +/** AffiliateTiers defines the affiliate tiers. */ +export interface AffiliateTiersSDKType { + tiers: AffiliateTiers_TierSDKType[]; +} +/** Tier defines an affiliate tier. */ +export interface AffiliateTiers_Tier { + /** Level of the tier */ + level: number; + /** Required all-time referred volume in quote quantums. */ + reqReferredVolume: bigint; + /** Required currently staked native tokens (in whole coins). */ + reqStakedWholeCoins: number; + /** Taker fee share in parts-per-million. */ + takerFeeSharePpm: number; +} +export interface AffiliateTiers_TierProtoMsg { + typeUrl: "/dydxprotocol.affiliates.Tier"; + value: Uint8Array; +} +/** Tier defines an affiliate tier. */ +export interface AffiliateTiers_TierAmino { + /** Level of the tier */ + level?: number; + /** Required all-time referred volume in quote quantums. */ + req_referred_volume?: string; + /** Required currently staked native tokens (in whole coins). */ + req_staked_whole_coins?: number; + /** Taker fee share in parts-per-million. */ + taker_fee_share_ppm?: number; +} +export interface AffiliateTiers_TierAminoMsg { + type: "/dydxprotocol.affiliates.Tier"; + value: AffiliateTiers_TierAmino; +} +/** Tier defines an affiliate tier. */ +export interface AffiliateTiers_TierSDKType { + level: number; + req_referred_volume: bigint; + req_staked_whole_coins: number; + taker_fee_share_ppm: number; +} +function createBaseAffiliateTiers(): AffiliateTiers { + return { + tiers: [] + }; +} +export const AffiliateTiers = { + typeUrl: "/dydxprotocol.affiliates.AffiliateTiers", + encode(message: AffiliateTiers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.tiers) { + AffiliateTiers_Tier.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AffiliateTiers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateTiers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tiers.push(AffiliateTiers_Tier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AffiliateTiers { + const message = createBaseAffiliateTiers(); + message.tiers = object.tiers?.map(e => AffiliateTiers_Tier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AffiliateTiersAmino): AffiliateTiers { + const message = createBaseAffiliateTiers(); + message.tiers = object.tiers?.map(e => AffiliateTiers_Tier.fromAmino(e)) || []; + return message; + }, + toAmino(message: AffiliateTiers): AffiliateTiersAmino { + const obj: any = {}; + if (message.tiers) { + obj.tiers = message.tiers.map(e => e ? AffiliateTiers_Tier.toAmino(e) : undefined); + } else { + obj.tiers = message.tiers; + } + return obj; + }, + fromAminoMsg(object: AffiliateTiersAminoMsg): AffiliateTiers { + return AffiliateTiers.fromAmino(object.value); + }, + fromProtoMsg(message: AffiliateTiersProtoMsg): AffiliateTiers { + return AffiliateTiers.decode(message.value); + }, + toProto(message: AffiliateTiers): Uint8Array { + return AffiliateTiers.encode(message).finish(); + }, + toProtoMsg(message: AffiliateTiers): AffiliateTiersProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.AffiliateTiers", + value: AffiliateTiers.encode(message).finish() + }; + } +}; +function createBaseAffiliateTiers_Tier(): AffiliateTiers_Tier { + return { + level: 0, + reqReferredVolume: BigInt(0), + reqStakedWholeCoins: 0, + takerFeeSharePpm: 0 + }; +} +export const AffiliateTiers_Tier = { + typeUrl: "/dydxprotocol.affiliates.Tier", + encode(message: AffiliateTiers_Tier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.level !== 0) { + writer.uint32(8).uint32(message.level); + } + if (message.reqReferredVolume !== BigInt(0)) { + writer.uint32(16).uint64(message.reqReferredVolume); + } + if (message.reqStakedWholeCoins !== 0) { + writer.uint32(24).uint32(message.reqStakedWholeCoins); + } + if (message.takerFeeSharePpm !== 0) { + writer.uint32(32).uint32(message.takerFeeSharePpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AffiliateTiers_Tier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateTiers_Tier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.level = reader.uint32(); + break; + case 2: + message.reqReferredVolume = reader.uint64(); + break; + case 3: + message.reqStakedWholeCoins = reader.uint32(); + break; + case 4: + message.takerFeeSharePpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AffiliateTiers_Tier { + const message = createBaseAffiliateTiers_Tier(); + message.level = object.level ?? 0; + message.reqReferredVolume = object.reqReferredVolume !== undefined && object.reqReferredVolume !== null ? BigInt(object.reqReferredVolume.toString()) : BigInt(0); + message.reqStakedWholeCoins = object.reqStakedWholeCoins ?? 0; + message.takerFeeSharePpm = object.takerFeeSharePpm ?? 0; + return message; + }, + fromAmino(object: AffiliateTiers_TierAmino): AffiliateTiers_Tier { + const message = createBaseAffiliateTiers_Tier(); + if (object.level !== undefined && object.level !== null) { + message.level = object.level; + } + if (object.req_referred_volume !== undefined && object.req_referred_volume !== null) { + message.reqReferredVolume = BigInt(object.req_referred_volume); + } + if (object.req_staked_whole_coins !== undefined && object.req_staked_whole_coins !== null) { + message.reqStakedWholeCoins = object.req_staked_whole_coins; + } + if (object.taker_fee_share_ppm !== undefined && object.taker_fee_share_ppm !== null) { + message.takerFeeSharePpm = object.taker_fee_share_ppm; + } + return message; + }, + toAmino(message: AffiliateTiers_Tier): AffiliateTiers_TierAmino { + const obj: any = {}; + obj.level = message.level === 0 ? undefined : message.level; + obj.req_referred_volume = message.reqReferredVolume !== BigInt(0) ? message.reqReferredVolume.toString() : undefined; + obj.req_staked_whole_coins = message.reqStakedWholeCoins === 0 ? undefined : message.reqStakedWholeCoins; + obj.taker_fee_share_ppm = message.takerFeeSharePpm === 0 ? undefined : message.takerFeeSharePpm; + return obj; + }, + fromAminoMsg(object: AffiliateTiers_TierAminoMsg): AffiliateTiers_Tier { + return AffiliateTiers_Tier.fromAmino(object.value); + }, + fromProtoMsg(message: AffiliateTiers_TierProtoMsg): AffiliateTiers_Tier { + return AffiliateTiers_Tier.decode(message.value); + }, + toProto(message: AffiliateTiers_Tier): Uint8Array { + return AffiliateTiers_Tier.encode(message).finish(); + }, + toProtoMsg(message: AffiliateTiers_Tier): AffiliateTiers_TierProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.Tier", + value: AffiliateTiers_Tier.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/genesis.ts new file mode 100644 index 00000000..db12793f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/genesis.ts @@ -0,0 +1,66 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines generis state of `x/affiliates` */ +export interface GenesisState {} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.affiliates.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines generis state of `x/affiliates` */ +export interface GenesisStateAmino {} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.affiliates.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines generis state of `x/affiliates` */ +export interface GenesisStateSDKType {} +function createBaseGenesisState(): GenesisState { + return {}; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.affiliates.GenesisState", + encode(_: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GenesisState { + const message = createBaseGenesisState(); + return message; + }, + fromAmino(_: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + return message; + }, + toAmino(_: GenesisState): GenesisStateAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/query.rpc.Query.ts new file mode 100644 index 00000000..0b1ccf6b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/query.rpc.Query.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { AffiliateInfoRequest, AffiliateInfoResponse, ReferredByRequest, ReferredByResponse, AllAffiliateTiersRequest, AllAffiliateTiersResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Query AffiliateInfo returns the affiliate info for a given address. */ + affiliateInfo(request: AffiliateInfoRequest): Promise; + /** Query ReferredBy returns the affiliate that referred a given address. */ + referredBy(request: ReferredByRequest): Promise; + /** Query AllAffiliateTiers returns all affiliate tiers. */ + allAffiliateTiers(request?: AllAffiliateTiersRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.affiliateInfo = this.affiliateInfo.bind(this); + this.referredBy = this.referredBy.bind(this); + this.allAffiliateTiers = this.allAffiliateTiers.bind(this); + } + affiliateInfo(request: AffiliateInfoRequest): Promise { + const data = AffiliateInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.affiliates.Query", "AffiliateInfo", data); + return promise.then(data => AffiliateInfoResponse.decode(new BinaryReader(data))); + } + referredBy(request: ReferredByRequest): Promise { + const data = ReferredByRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.affiliates.Query", "ReferredBy", data); + return promise.then(data => ReferredByResponse.decode(new BinaryReader(data))); + } + allAffiliateTiers(request: AllAffiliateTiersRequest = {}): Promise { + const data = AllAffiliateTiersRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.affiliates.Query", "AllAffiliateTiers", data); + return promise.then(data => AllAffiliateTiersResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + affiliateInfo(request: AffiliateInfoRequest): Promise { + return queryService.affiliateInfo(request); + }, + referredBy(request: ReferredByRequest): Promise { + return queryService.referredBy(request); + }, + allAffiliateTiers(request?: AllAffiliateTiersRequest): Promise { + return queryService.allAffiliateTiers(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/query.ts new file mode 100644 index 00000000..11a76c2c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/query.ts @@ -0,0 +1,578 @@ +//@ts-nocheck +import { AffiliateTiers, AffiliateTiersAmino, AffiliateTiersSDKType } from "./affiliates"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * AffiliateInfoRequest is the request type for the Query/AffiliateInfo RPC + * method. + */ +export interface AffiliateInfoRequest { + address: string; +} +export interface AffiliateInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.affiliates.AffiliateInfoRequest"; + value: Uint8Array; +} +/** + * AffiliateInfoRequest is the request type for the Query/AffiliateInfo RPC + * method. + */ +export interface AffiliateInfoRequestAmino { + address?: string; +} +export interface AffiliateInfoRequestAminoMsg { + type: "/dydxprotocol.affiliates.AffiliateInfoRequest"; + value: AffiliateInfoRequestAmino; +} +/** + * AffiliateInfoRequest is the request type for the Query/AffiliateInfo RPC + * method. + */ +export interface AffiliateInfoRequestSDKType { + address: string; +} +/** + * AffiliateInfoResponse is the response type for the Query/AffiliateInfo RPC + * method. + */ +export interface AffiliateInfoResponse { + /** The affiliate's tier. */ + tier: number; + /** The affiliate's taker fee share in parts-per-million. */ + feeSharePpm: number; + /** The affiliate's all-time referred volume in quote quantums. */ + referredVolume: Uint8Array; + /** The affiliate's currently staked native tokens (in whole coins). */ + stakedAmount: Uint8Array; +} +export interface AffiliateInfoResponseProtoMsg { + typeUrl: "/dydxprotocol.affiliates.AffiliateInfoResponse"; + value: Uint8Array; +} +/** + * AffiliateInfoResponse is the response type for the Query/AffiliateInfo RPC + * method. + */ +export interface AffiliateInfoResponseAmino { + /** The affiliate's tier. */ + tier?: number; + /** The affiliate's taker fee share in parts-per-million. */ + fee_share_ppm?: number; + /** The affiliate's all-time referred volume in quote quantums. */ + referred_volume?: string; + /** The affiliate's currently staked native tokens (in whole coins). */ + staked_amount?: string; +} +export interface AffiliateInfoResponseAminoMsg { + type: "/dydxprotocol.affiliates.AffiliateInfoResponse"; + value: AffiliateInfoResponseAmino; +} +/** + * AffiliateInfoResponse is the response type for the Query/AffiliateInfo RPC + * method. + */ +export interface AffiliateInfoResponseSDKType { + tier: number; + fee_share_ppm: number; + referred_volume: Uint8Array; + staked_amount: Uint8Array; +} +/** ReferredByRequest is the request type for the Query/ReferredBy RPC method. */ +export interface ReferredByRequest { + /** The address to query. */ + address: string; +} +export interface ReferredByRequestProtoMsg { + typeUrl: "/dydxprotocol.affiliates.ReferredByRequest"; + value: Uint8Array; +} +/** ReferredByRequest is the request type for the Query/ReferredBy RPC method. */ +export interface ReferredByRequestAmino { + /** The address to query. */ + address?: string; +} +export interface ReferredByRequestAminoMsg { + type: "/dydxprotocol.affiliates.ReferredByRequest"; + value: ReferredByRequestAmino; +} +/** ReferredByRequest is the request type for the Query/ReferredBy RPC method. */ +export interface ReferredByRequestSDKType { + address: string; +} +/** ReferredByResponse is the response type for the Query/ReferredBy RPC method. */ +export interface ReferredByResponse { + /** The affiliate's address that referred the queried address. */ + affiliateAddress: string; +} +export interface ReferredByResponseProtoMsg { + typeUrl: "/dydxprotocol.affiliates.ReferredByResponse"; + value: Uint8Array; +} +/** ReferredByResponse is the response type for the Query/ReferredBy RPC method. */ +export interface ReferredByResponseAmino { + /** The affiliate's address that referred the queried address. */ + affiliate_address?: string; +} +export interface ReferredByResponseAminoMsg { + type: "/dydxprotocol.affiliates.ReferredByResponse"; + value: ReferredByResponseAmino; +} +/** ReferredByResponse is the response type for the Query/ReferredBy RPC method. */ +export interface ReferredByResponseSDKType { + affiliate_address: string; +} +/** + * AllAffiliateTiersRequest is the request type for the Query/AllAffiliateTiers + * RPC method. + */ +export interface AllAffiliateTiersRequest {} +export interface AllAffiliateTiersRequestProtoMsg { + typeUrl: "/dydxprotocol.affiliates.AllAffiliateTiersRequest"; + value: Uint8Array; +} +/** + * AllAffiliateTiersRequest is the request type for the Query/AllAffiliateTiers + * RPC method. + */ +export interface AllAffiliateTiersRequestAmino {} +export interface AllAffiliateTiersRequestAminoMsg { + type: "/dydxprotocol.affiliates.AllAffiliateTiersRequest"; + value: AllAffiliateTiersRequestAmino; +} +/** + * AllAffiliateTiersRequest is the request type for the Query/AllAffiliateTiers + * RPC method. + */ +export interface AllAffiliateTiersRequestSDKType {} +/** + * AllAffiliateTiersResponse is the response type for the + * Query/AllAffiliateTiers RPC method. + */ +export interface AllAffiliateTiersResponse { + /** All affiliate tiers information. */ + tiers: AffiliateTiers; +} +export interface AllAffiliateTiersResponseProtoMsg { + typeUrl: "/dydxprotocol.affiliates.AllAffiliateTiersResponse"; + value: Uint8Array; +} +/** + * AllAffiliateTiersResponse is the response type for the + * Query/AllAffiliateTiers RPC method. + */ +export interface AllAffiliateTiersResponseAmino { + /** All affiliate tiers information. */ + tiers?: AffiliateTiersAmino; +} +export interface AllAffiliateTiersResponseAminoMsg { + type: "/dydxprotocol.affiliates.AllAffiliateTiersResponse"; + value: AllAffiliateTiersResponseAmino; +} +/** + * AllAffiliateTiersResponse is the response type for the + * Query/AllAffiliateTiers RPC method. + */ +export interface AllAffiliateTiersResponseSDKType { + tiers: AffiliateTiersSDKType; +} +function createBaseAffiliateInfoRequest(): AffiliateInfoRequest { + return { + address: "" + }; +} +export const AffiliateInfoRequest = { + typeUrl: "/dydxprotocol.affiliates.AffiliateInfoRequest", + encode(message: AffiliateInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AffiliateInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AffiliateInfoRequest { + const message = createBaseAffiliateInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: AffiliateInfoRequestAmino): AffiliateInfoRequest { + const message = createBaseAffiliateInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: AffiliateInfoRequest): AffiliateInfoRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: AffiliateInfoRequestAminoMsg): AffiliateInfoRequest { + return AffiliateInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: AffiliateInfoRequestProtoMsg): AffiliateInfoRequest { + return AffiliateInfoRequest.decode(message.value); + }, + toProto(message: AffiliateInfoRequest): Uint8Array { + return AffiliateInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: AffiliateInfoRequest): AffiliateInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.AffiliateInfoRequest", + value: AffiliateInfoRequest.encode(message).finish() + }; + } +}; +function createBaseAffiliateInfoResponse(): AffiliateInfoResponse { + return { + tier: 0, + feeSharePpm: 0, + referredVolume: new Uint8Array(), + stakedAmount: new Uint8Array() + }; +} +export const AffiliateInfoResponse = { + typeUrl: "/dydxprotocol.affiliates.AffiliateInfoResponse", + encode(message: AffiliateInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tier !== 0) { + writer.uint32(8).uint32(message.tier); + } + if (message.feeSharePpm !== 0) { + writer.uint32(16).uint32(message.feeSharePpm); + } + if (message.referredVolume.length !== 0) { + writer.uint32(26).bytes(message.referredVolume); + } + if (message.stakedAmount.length !== 0) { + writer.uint32(34).bytes(message.stakedAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AffiliateInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tier = reader.uint32(); + break; + case 2: + message.feeSharePpm = reader.uint32(); + break; + case 3: + message.referredVolume = reader.bytes(); + break; + case 4: + message.stakedAmount = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AffiliateInfoResponse { + const message = createBaseAffiliateInfoResponse(); + message.tier = object.tier ?? 0; + message.feeSharePpm = object.feeSharePpm ?? 0; + message.referredVolume = object.referredVolume ?? new Uint8Array(); + message.stakedAmount = object.stakedAmount ?? new Uint8Array(); + return message; + }, + fromAmino(object: AffiliateInfoResponseAmino): AffiliateInfoResponse { + const message = createBaseAffiliateInfoResponse(); + if (object.tier !== undefined && object.tier !== null) { + message.tier = object.tier; + } + if (object.fee_share_ppm !== undefined && object.fee_share_ppm !== null) { + message.feeSharePpm = object.fee_share_ppm; + } + if (object.referred_volume !== undefined && object.referred_volume !== null) { + message.referredVolume = bytesFromBase64(object.referred_volume); + } + if (object.staked_amount !== undefined && object.staked_amount !== null) { + message.stakedAmount = bytesFromBase64(object.staked_amount); + } + return message; + }, + toAmino(message: AffiliateInfoResponse): AffiliateInfoResponseAmino { + const obj: any = {}; + obj.tier = message.tier === 0 ? undefined : message.tier; + obj.fee_share_ppm = message.feeSharePpm === 0 ? undefined : message.feeSharePpm; + obj.referred_volume = message.referredVolume ? base64FromBytes(message.referredVolume) : undefined; + obj.staked_amount = message.stakedAmount ? base64FromBytes(message.stakedAmount) : undefined; + return obj; + }, + fromAminoMsg(object: AffiliateInfoResponseAminoMsg): AffiliateInfoResponse { + return AffiliateInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: AffiliateInfoResponseProtoMsg): AffiliateInfoResponse { + return AffiliateInfoResponse.decode(message.value); + }, + toProto(message: AffiliateInfoResponse): Uint8Array { + return AffiliateInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: AffiliateInfoResponse): AffiliateInfoResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.AffiliateInfoResponse", + value: AffiliateInfoResponse.encode(message).finish() + }; + } +}; +function createBaseReferredByRequest(): ReferredByRequest { + return { + address: "" + }; +} +export const ReferredByRequest = { + typeUrl: "/dydxprotocol.affiliates.ReferredByRequest", + encode(message: ReferredByRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ReferredByRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReferredByRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ReferredByRequest { + const message = createBaseReferredByRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: ReferredByRequestAmino): ReferredByRequest { + const message = createBaseReferredByRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: ReferredByRequest): ReferredByRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: ReferredByRequestAminoMsg): ReferredByRequest { + return ReferredByRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ReferredByRequestProtoMsg): ReferredByRequest { + return ReferredByRequest.decode(message.value); + }, + toProto(message: ReferredByRequest): Uint8Array { + return ReferredByRequest.encode(message).finish(); + }, + toProtoMsg(message: ReferredByRequest): ReferredByRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.ReferredByRequest", + value: ReferredByRequest.encode(message).finish() + }; + } +}; +function createBaseReferredByResponse(): ReferredByResponse { + return { + affiliateAddress: "" + }; +} +export const ReferredByResponse = { + typeUrl: "/dydxprotocol.affiliates.ReferredByResponse", + encode(message: ReferredByResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.affiliateAddress !== "") { + writer.uint32(10).string(message.affiliateAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ReferredByResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReferredByResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.affiliateAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ReferredByResponse { + const message = createBaseReferredByResponse(); + message.affiliateAddress = object.affiliateAddress ?? ""; + return message; + }, + fromAmino(object: ReferredByResponseAmino): ReferredByResponse { + const message = createBaseReferredByResponse(); + if (object.affiliate_address !== undefined && object.affiliate_address !== null) { + message.affiliateAddress = object.affiliate_address; + } + return message; + }, + toAmino(message: ReferredByResponse): ReferredByResponseAmino { + const obj: any = {}; + obj.affiliate_address = message.affiliateAddress === "" ? undefined : message.affiliateAddress; + return obj; + }, + fromAminoMsg(object: ReferredByResponseAminoMsg): ReferredByResponse { + return ReferredByResponse.fromAmino(object.value); + }, + fromProtoMsg(message: ReferredByResponseProtoMsg): ReferredByResponse { + return ReferredByResponse.decode(message.value); + }, + toProto(message: ReferredByResponse): Uint8Array { + return ReferredByResponse.encode(message).finish(); + }, + toProtoMsg(message: ReferredByResponse): ReferredByResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.ReferredByResponse", + value: ReferredByResponse.encode(message).finish() + }; + } +}; +function createBaseAllAffiliateTiersRequest(): AllAffiliateTiersRequest { + return {}; +} +export const AllAffiliateTiersRequest = { + typeUrl: "/dydxprotocol.affiliates.AllAffiliateTiersRequest", + encode(_: AllAffiliateTiersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllAffiliateTiersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllAffiliateTiersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): AllAffiliateTiersRequest { + const message = createBaseAllAffiliateTiersRequest(); + return message; + }, + fromAmino(_: AllAffiliateTiersRequestAmino): AllAffiliateTiersRequest { + const message = createBaseAllAffiliateTiersRequest(); + return message; + }, + toAmino(_: AllAffiliateTiersRequest): AllAffiliateTiersRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: AllAffiliateTiersRequestAminoMsg): AllAffiliateTiersRequest { + return AllAffiliateTiersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: AllAffiliateTiersRequestProtoMsg): AllAffiliateTiersRequest { + return AllAffiliateTiersRequest.decode(message.value); + }, + toProto(message: AllAffiliateTiersRequest): Uint8Array { + return AllAffiliateTiersRequest.encode(message).finish(); + }, + toProtoMsg(message: AllAffiliateTiersRequest): AllAffiliateTiersRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.AllAffiliateTiersRequest", + value: AllAffiliateTiersRequest.encode(message).finish() + }; + } +}; +function createBaseAllAffiliateTiersResponse(): AllAffiliateTiersResponse { + return { + tiers: AffiliateTiers.fromPartial({}) + }; +} +export const AllAffiliateTiersResponse = { + typeUrl: "/dydxprotocol.affiliates.AllAffiliateTiersResponse", + encode(message: AllAffiliateTiersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tiers !== undefined) { + AffiliateTiers.encode(message.tiers, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllAffiliateTiersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllAffiliateTiersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tiers = AffiliateTiers.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllAffiliateTiersResponse { + const message = createBaseAllAffiliateTiersResponse(); + message.tiers = object.tiers !== undefined && object.tiers !== null ? AffiliateTiers.fromPartial(object.tiers) : undefined; + return message; + }, + fromAmino(object: AllAffiliateTiersResponseAmino): AllAffiliateTiersResponse { + const message = createBaseAllAffiliateTiersResponse(); + if (object.tiers !== undefined && object.tiers !== null) { + message.tiers = AffiliateTiers.fromAmino(object.tiers); + } + return message; + }, + toAmino(message: AllAffiliateTiersResponse): AllAffiliateTiersResponseAmino { + const obj: any = {}; + obj.tiers = message.tiers ? AffiliateTiers.toAmino(message.tiers) : undefined; + return obj; + }, + fromAminoMsg(object: AllAffiliateTiersResponseAminoMsg): AllAffiliateTiersResponse { + return AllAffiliateTiersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: AllAffiliateTiersResponseProtoMsg): AllAffiliateTiersResponse { + return AllAffiliateTiersResponse.decode(message.value); + }, + toProto(message: AllAffiliateTiersResponse): Uint8Array { + return AllAffiliateTiersResponse.encode(message).finish(); + }, + toProtoMsg(message: AllAffiliateTiersResponse): AllAffiliateTiersResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.AllAffiliateTiersResponse", + value: AllAffiliateTiersResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.amino.ts new file mode 100644 index 00000000..62ab8148 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgRegisterAffiliate, MsgUpdateAffiliateTiers } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.affiliates.MsgRegisterAffiliate": { + aminoType: "/dydxprotocol.affiliates.MsgRegisterAffiliate", + toAmino: MsgRegisterAffiliate.toAmino, + fromAmino: MsgRegisterAffiliate.fromAmino + }, + "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers": { + aminoType: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", + toAmino: MsgUpdateAffiliateTiers.toAmino, + fromAmino: MsgUpdateAffiliateTiers.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.registry.ts new file mode 100644 index 00000000..c09d82f7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterAffiliate, MsgUpdateAffiliateTiers } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.affiliates.MsgRegisterAffiliate", MsgRegisterAffiliate], ["/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", MsgUpdateAffiliateTiers]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerAffiliate(value: MsgRegisterAffiliate) { + return { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliate", + value: MsgRegisterAffiliate.encode(value).finish() + }; + }, + updateAffiliateTiers(value: MsgUpdateAffiliateTiers) { + return { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", + value: MsgUpdateAffiliateTiers.encode(value).finish() + }; + } + }, + withTypeUrl: { + registerAffiliate(value: MsgRegisterAffiliate) { + return { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliate", + value + }; + }, + updateAffiliateTiers(value: MsgUpdateAffiliateTiers) { + return { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", + value + }; + } + }, + fromPartial: { + registerAffiliate(value: MsgRegisterAffiliate) { + return { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliate", + value: MsgRegisterAffiliate.fromPartial(value) + }; + }, + updateAffiliateTiers(value: MsgUpdateAffiliateTiers) { + return { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", + value: MsgUpdateAffiliateTiers.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.rpc.msg.ts new file mode 100644 index 00000000..12152155 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.rpc.msg.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgRegisterAffiliate, MsgRegisterAffiliateResponse, MsgUpdateAffiliateTiers, MsgUpdateAffiliateTiersResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** RegisterAffiliate registers a referee-affiliate relationship */ + registerAffiliate(request: MsgRegisterAffiliate): Promise; + /** UpdateAffiliateTiers updates affiliate tiers */ + updateAffiliateTiers(request: MsgUpdateAffiliateTiers): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.registerAffiliate = this.registerAffiliate.bind(this); + this.updateAffiliateTiers = this.updateAffiliateTiers.bind(this); + } + registerAffiliate(request: MsgRegisterAffiliate): Promise { + const data = MsgRegisterAffiliate.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.affiliates.Msg", "RegisterAffiliate", data); + return promise.then(data => MsgRegisterAffiliateResponse.decode(new BinaryReader(data))); + } + updateAffiliateTiers(request: MsgUpdateAffiliateTiers): Promise { + const data = MsgUpdateAffiliateTiers.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.affiliates.Msg", "UpdateAffiliateTiers", data); + return promise.then(data => MsgUpdateAffiliateTiersResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.ts new file mode 100644 index 00000000..75d2b800 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/affiliates/tx.ts @@ -0,0 +1,335 @@ +//@ts-nocheck +import { AffiliateTiers, AffiliateTiersAmino, AffiliateTiersSDKType } from "./affiliates"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Message to register a referee-affiliate relationship */ +export interface MsgRegisterAffiliate { + /** Address of the referee */ + referee: string; + /** Address of the affiliate */ + affiliate: string; +} +export interface MsgRegisterAffiliateProtoMsg { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliate"; + value: Uint8Array; +} +/** Message to register a referee-affiliate relationship */ +export interface MsgRegisterAffiliateAmino { + /** Address of the referee */ + referee?: string; + /** Address of the affiliate */ + affiliate?: string; +} +export interface MsgRegisterAffiliateAminoMsg { + type: "/dydxprotocol.affiliates.MsgRegisterAffiliate"; + value: MsgRegisterAffiliateAmino; +} +/** Message to register a referee-affiliate relationship */ +export interface MsgRegisterAffiliateSDKType { + referee: string; + affiliate: string; +} +/** Response to MsgRegisterAffiliate */ +export interface MsgRegisterAffiliateResponse {} +export interface MsgRegisterAffiliateResponseProtoMsg { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliateResponse"; + value: Uint8Array; +} +/** Response to MsgRegisterAffiliate */ +export interface MsgRegisterAffiliateResponseAmino {} +export interface MsgRegisterAffiliateResponseAminoMsg { + type: "/dydxprotocol.affiliates.MsgRegisterAffiliateResponse"; + value: MsgRegisterAffiliateResponseAmino; +} +/** Response to MsgRegisterAffiliate */ +export interface MsgRegisterAffiliateResponseSDKType {} +/** Message to update affiliate tiers */ +export interface MsgUpdateAffiliateTiers { + /** Authority sending this message. Will be sent by gov */ + authority: string; + /** Updated affiliate tiers information */ + tiers?: AffiliateTiers; +} +export interface MsgUpdateAffiliateTiersProtoMsg { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers"; + value: Uint8Array; +} +/** Message to update affiliate tiers */ +export interface MsgUpdateAffiliateTiersAmino { + /** Authority sending this message. Will be sent by gov */ + authority?: string; + /** Updated affiliate tiers information */ + tiers?: AffiliateTiersAmino; +} +export interface MsgUpdateAffiliateTiersAminoMsg { + type: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers"; + value: MsgUpdateAffiliateTiersAmino; +} +/** Message to update affiliate tiers */ +export interface MsgUpdateAffiliateTiersSDKType { + authority: string; + tiers?: AffiliateTiersSDKType; +} +/** Response to MsgUpdateAffiliateTiers */ +export interface MsgUpdateAffiliateTiersResponse {} +export interface MsgUpdateAffiliateTiersResponseProtoMsg { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse"; + value: Uint8Array; +} +/** Response to MsgUpdateAffiliateTiers */ +export interface MsgUpdateAffiliateTiersResponseAmino {} +export interface MsgUpdateAffiliateTiersResponseAminoMsg { + type: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse"; + value: MsgUpdateAffiliateTiersResponseAmino; +} +/** Response to MsgUpdateAffiliateTiers */ +export interface MsgUpdateAffiliateTiersResponseSDKType {} +function createBaseMsgRegisterAffiliate(): MsgRegisterAffiliate { + return { + referee: "", + affiliate: "" + }; +} +export const MsgRegisterAffiliate = { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliate", + encode(message: MsgRegisterAffiliate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.referee !== "") { + writer.uint32(10).string(message.referee); + } + if (message.affiliate !== "") { + writer.uint32(18).string(message.affiliate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterAffiliate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAffiliate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.referee = reader.string(); + break; + case 2: + message.affiliate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRegisterAffiliate { + const message = createBaseMsgRegisterAffiliate(); + message.referee = object.referee ?? ""; + message.affiliate = object.affiliate ?? ""; + return message; + }, + fromAmino(object: MsgRegisterAffiliateAmino): MsgRegisterAffiliate { + const message = createBaseMsgRegisterAffiliate(); + if (object.referee !== undefined && object.referee !== null) { + message.referee = object.referee; + } + if (object.affiliate !== undefined && object.affiliate !== null) { + message.affiliate = object.affiliate; + } + return message; + }, + toAmino(message: MsgRegisterAffiliate): MsgRegisterAffiliateAmino { + const obj: any = {}; + obj.referee = message.referee === "" ? undefined : message.referee; + obj.affiliate = message.affiliate === "" ? undefined : message.affiliate; + return obj; + }, + fromAminoMsg(object: MsgRegisterAffiliateAminoMsg): MsgRegisterAffiliate { + return MsgRegisterAffiliate.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterAffiliateProtoMsg): MsgRegisterAffiliate { + return MsgRegisterAffiliate.decode(message.value); + }, + toProto(message: MsgRegisterAffiliate): Uint8Array { + return MsgRegisterAffiliate.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterAffiliate): MsgRegisterAffiliateProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliate", + value: MsgRegisterAffiliate.encode(message).finish() + }; + } +}; +function createBaseMsgRegisterAffiliateResponse(): MsgRegisterAffiliateResponse { + return {}; +} +export const MsgRegisterAffiliateResponse = { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliateResponse", + encode(_: MsgRegisterAffiliateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterAffiliateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAffiliateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRegisterAffiliateResponse { + const message = createBaseMsgRegisterAffiliateResponse(); + return message; + }, + fromAmino(_: MsgRegisterAffiliateResponseAmino): MsgRegisterAffiliateResponse { + const message = createBaseMsgRegisterAffiliateResponse(); + return message; + }, + toAmino(_: MsgRegisterAffiliateResponse): MsgRegisterAffiliateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRegisterAffiliateResponseAminoMsg): MsgRegisterAffiliateResponse { + return MsgRegisterAffiliateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterAffiliateResponseProtoMsg): MsgRegisterAffiliateResponse { + return MsgRegisterAffiliateResponse.decode(message.value); + }, + toProto(message: MsgRegisterAffiliateResponse): Uint8Array { + return MsgRegisterAffiliateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterAffiliateResponse): MsgRegisterAffiliateResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.MsgRegisterAffiliateResponse", + value: MsgRegisterAffiliateResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAffiliateTiers(): MsgUpdateAffiliateTiers { + return { + authority: "", + tiers: undefined + }; +} +export const MsgUpdateAffiliateTiers = { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", + encode(message: MsgUpdateAffiliateTiers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.tiers !== undefined) { + AffiliateTiers.encode(message.tiers, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAffiliateTiers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAffiliateTiers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.tiers = AffiliateTiers.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateAffiliateTiers { + const message = createBaseMsgUpdateAffiliateTiers(); + message.authority = object.authority ?? ""; + message.tiers = object.tiers !== undefined && object.tiers !== null ? AffiliateTiers.fromPartial(object.tiers) : undefined; + return message; + }, + fromAmino(object: MsgUpdateAffiliateTiersAmino): MsgUpdateAffiliateTiers { + const message = createBaseMsgUpdateAffiliateTiers(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.tiers !== undefined && object.tiers !== null) { + message.tiers = AffiliateTiers.fromAmino(object.tiers); + } + return message; + }, + toAmino(message: MsgUpdateAffiliateTiers): MsgUpdateAffiliateTiersAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.tiers = message.tiers ? AffiliateTiers.toAmino(message.tiers) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateAffiliateTiersAminoMsg): MsgUpdateAffiliateTiers { + return MsgUpdateAffiliateTiers.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateAffiliateTiersProtoMsg): MsgUpdateAffiliateTiers { + return MsgUpdateAffiliateTiers.decode(message.value); + }, + toProto(message: MsgUpdateAffiliateTiers): Uint8Array { + return MsgUpdateAffiliateTiers.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAffiliateTiers): MsgUpdateAffiliateTiersProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers", + value: MsgUpdateAffiliateTiers.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAffiliateTiersResponse(): MsgUpdateAffiliateTiersResponse { + return {}; +} +export const MsgUpdateAffiliateTiersResponse = { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse", + encode(_: MsgUpdateAffiliateTiersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAffiliateTiersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAffiliateTiersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateAffiliateTiersResponse { + const message = createBaseMsgUpdateAffiliateTiersResponse(); + return message; + }, + fromAmino(_: MsgUpdateAffiliateTiersResponseAmino): MsgUpdateAffiliateTiersResponse { + const message = createBaseMsgUpdateAffiliateTiersResponse(); + return message; + }, + toAmino(_: MsgUpdateAffiliateTiersResponse): MsgUpdateAffiliateTiersResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateAffiliateTiersResponseAminoMsg): MsgUpdateAffiliateTiersResponse { + return MsgUpdateAffiliateTiersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateAffiliateTiersResponseProtoMsg): MsgUpdateAffiliateTiersResponse { + return MsgUpdateAffiliateTiersResponse.decode(message.value); + }, + toProto(message: MsgUpdateAffiliateTiersResponse): Uint8Array { + return MsgUpdateAffiliateTiersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAffiliateTiersResponse): MsgUpdateAffiliateTiersResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse", + value: MsgUpdateAffiliateTiersResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/assets/asset.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/asset.ts new file mode 100644 index 00000000..a256f1a0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/asset.ts @@ -0,0 +1,239 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Asset defines a single exchangable asset. */ +export interface Asset { + /** Unique, sequentially-generated. */ + id: number; + /** + * The human readable symbol of the `Asset` (e.g. `USDC`, `ATOM`). + * Must be uppercase, unique and correspond to the canonical symbol of the + * full coin. + */ + symbol: string; + /** + * The name of base denomination unit of the `Asset` (e.g. `uatom`, + * 'ibc/xxxxx'). Must be unique and match the `denom` used in the `sdk.Coin` + * type in the `x/bank` module. + */ + denom: string; + /** + * The exponent of converting one unit of `denom` to a full coin. + * For example, `name=USDC, denom=uusdc, denom_exponent=-6` defines that + * `1 uusdc = 10^(-6) USDC`. Note that `uusdc` refers to a `Coin` type in + * `x/bank`, where the prefix `u` means `micro` by convetion. `uusdc` is + * a different concept from a "quantum" defined by `atomic_resolution` below. + * To convert from an amount of `denom` to quantums: + * `quantums = denom_amount * 10^(denom_exponent - atomic_resolution)` + */ + denomExponent: number; + /** `true` if this `Asset` has a valid `MarketId` value. */ + hasMarket: boolean; + /** + * The `Id` of the `Market` associated with this `Asset`. It acts as the + * oracle price for the purposes of calculating collateral + * and margin requirements. + */ + marketId: number; + /** + * The exponent for converting an atomic amount (1 'quantum') + * to a full coin. For example, if `atomic_resolution = -8` + * then an `asset_position` with `base_quantums = 1e8` is equivalent to + * a position size of one full coin. + */ + atomicResolution: number; +} +export interface AssetProtoMsg { + typeUrl: "/dydxprotocol.assets.Asset"; + value: Uint8Array; +} +/** Asset defines a single exchangable asset. */ +export interface AssetAmino { + /** Unique, sequentially-generated. */ + id?: number; + /** + * The human readable symbol of the `Asset` (e.g. `USDC`, `ATOM`). + * Must be uppercase, unique and correspond to the canonical symbol of the + * full coin. + */ + symbol?: string; + /** + * The name of base denomination unit of the `Asset` (e.g. `uatom`, + * 'ibc/xxxxx'). Must be unique and match the `denom` used in the `sdk.Coin` + * type in the `x/bank` module. + */ + denom?: string; + /** + * The exponent of converting one unit of `denom` to a full coin. + * For example, `name=USDC, denom=uusdc, denom_exponent=-6` defines that + * `1 uusdc = 10^(-6) USDC`. Note that `uusdc` refers to a `Coin` type in + * `x/bank`, where the prefix `u` means `micro` by convetion. `uusdc` is + * a different concept from a "quantum" defined by `atomic_resolution` below. + * To convert from an amount of `denom` to quantums: + * `quantums = denom_amount * 10^(denom_exponent - atomic_resolution)` + */ + denom_exponent?: number; + /** `true` if this `Asset` has a valid `MarketId` value. */ + has_market?: boolean; + /** + * The `Id` of the `Market` associated with this `Asset`. It acts as the + * oracle price for the purposes of calculating collateral + * and margin requirements. + */ + market_id?: number; + /** + * The exponent for converting an atomic amount (1 'quantum') + * to a full coin. For example, if `atomic_resolution = -8` + * then an `asset_position` with `base_quantums = 1e8` is equivalent to + * a position size of one full coin. + */ + atomic_resolution?: number; +} +export interface AssetAminoMsg { + type: "/dydxprotocol.assets.Asset"; + value: AssetAmino; +} +/** Asset defines a single exchangable asset. */ +export interface AssetSDKType { + id: number; + symbol: string; + denom: string; + denom_exponent: number; + has_market: boolean; + market_id: number; + atomic_resolution: number; +} +function createBaseAsset(): Asset { + return { + id: 0, + symbol: "", + denom: "", + denomExponent: 0, + hasMarket: false, + marketId: 0, + atomicResolution: 0 + }; +} +export const Asset = { + typeUrl: "/dydxprotocol.assets.Asset", + encode(message: Asset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.denom !== "") { + writer.uint32(26).string(message.denom); + } + if (message.denomExponent !== 0) { + writer.uint32(32).sint32(message.denomExponent); + } + if (message.hasMarket === true) { + writer.uint32(40).bool(message.hasMarket); + } + if (message.marketId !== 0) { + writer.uint32(48).uint32(message.marketId); + } + if (message.atomicResolution !== 0) { + writer.uint32(56).sint32(message.atomicResolution); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Asset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.denom = reader.string(); + break; + case 4: + message.denomExponent = reader.sint32(); + break; + case 5: + message.hasMarket = reader.bool(); + break; + case 6: + message.marketId = reader.uint32(); + break; + case 7: + message.atomicResolution = reader.sint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Asset { + const message = createBaseAsset(); + message.id = object.id ?? 0; + message.symbol = object.symbol ?? ""; + message.denom = object.denom ?? ""; + message.denomExponent = object.denomExponent ?? 0; + message.hasMarket = object.hasMarket ?? false; + message.marketId = object.marketId ?? 0; + message.atomicResolution = object.atomicResolution ?? 0; + return message; + }, + fromAmino(object: AssetAmino): Asset { + const message = createBaseAsset(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.denom_exponent !== undefined && object.denom_exponent !== null) { + message.denomExponent = object.denom_exponent; + } + if (object.has_market !== undefined && object.has_market !== null) { + message.hasMarket = object.has_market; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.atomic_resolution !== undefined && object.atomic_resolution !== null) { + message.atomicResolution = object.atomic_resolution; + } + return message; + }, + toAmino(message: Asset): AssetAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.denom_exponent = message.denomExponent === 0 ? undefined : message.denomExponent; + obj.has_market = message.hasMarket === false ? undefined : message.hasMarket; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.atomic_resolution = message.atomicResolution === 0 ? undefined : message.atomicResolution; + return obj; + }, + fromAminoMsg(object: AssetAminoMsg): Asset { + return Asset.fromAmino(object.value); + }, + fromProtoMsg(message: AssetProtoMsg): Asset { + return Asset.decode(message.value); + }, + toProto(message: Asset): Uint8Array { + return Asset.encode(message).finish(); + }, + toProtoMsg(message: Asset): AssetProtoMsg { + return { + typeUrl: "/dydxprotocol.assets.Asset", + value: Asset.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/assets/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/genesis.ts new file mode 100644 index 00000000..850feccb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/genesis.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { Asset, AssetAmino, AssetSDKType } from "./asset"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the assets module's genesis state. */ +export interface GenesisState { + assets: Asset[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.assets.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the assets module's genesis state. */ +export interface GenesisStateAmino { + assets?: AssetAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.assets.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the assets module's genesis state. */ +export interface GenesisStateSDKType { + assets: AssetSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + assets: [] + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.assets.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.assets) { + Asset.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assets.push(Asset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.assets = object.assets?.map(e => Asset.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.assets = object.assets?.map(e => Asset.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.assets) { + obj.assets = message.assets.map(e => e ? Asset.toAmino(e) : undefined); + } else { + obj.assets = message.assets; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.assets.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/assets/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/query.rpc.Query.ts new file mode 100644 index 00000000..d1e17344 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/query.rpc.Query.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryAssetRequest, QueryAssetResponse, QueryAllAssetsRequest, QueryAllAssetsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a Asset by id. */ + asset(request: QueryAssetRequest): Promise; + /** Queries a list of Asset items. */ + allAssets(request?: QueryAllAssetsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.asset = this.asset.bind(this); + this.allAssets = this.allAssets.bind(this); + } + asset(request: QueryAssetRequest): Promise { + const data = QueryAssetRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.assets.Query", "Asset", data); + return promise.then(data => QueryAssetResponse.decode(new BinaryReader(data))); + } + allAssets(request: QueryAllAssetsRequest = { + pagination: undefined + }): Promise { + const data = QueryAllAssetsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.assets.Query", "AllAssets", data); + return promise.then(data => QueryAllAssetsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + asset(request: QueryAssetRequest): Promise { + return queryService.asset(request); + }, + allAssets(request?: QueryAllAssetsRequest): Promise { + return queryService.allAssets(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/assets/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/query.ts new file mode 100644 index 00000000..24e1f06f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/query.ts @@ -0,0 +1,353 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { Asset, AssetAmino, AssetSDKType } from "./asset"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Queries an Asset by id. */ +export interface QueryAssetRequest { + id: number; +} +export interface QueryAssetRequestProtoMsg { + typeUrl: "/dydxprotocol.assets.QueryAssetRequest"; + value: Uint8Array; +} +/** Queries an Asset by id. */ +export interface QueryAssetRequestAmino { + id?: number; +} +export interface QueryAssetRequestAminoMsg { + type: "/dydxprotocol.assets.QueryAssetRequest"; + value: QueryAssetRequestAmino; +} +/** Queries an Asset by id. */ +export interface QueryAssetRequestSDKType { + id: number; +} +/** QueryAssetResponse is response type for the Asset RPC method. */ +export interface QueryAssetResponse { + asset: Asset; +} +export interface QueryAssetResponseProtoMsg { + typeUrl: "/dydxprotocol.assets.QueryAssetResponse"; + value: Uint8Array; +} +/** QueryAssetResponse is response type for the Asset RPC method. */ +export interface QueryAssetResponseAmino { + asset?: AssetAmino; +} +export interface QueryAssetResponseAminoMsg { + type: "/dydxprotocol.assets.QueryAssetResponse"; + value: QueryAssetResponseAmino; +} +/** QueryAssetResponse is response type for the Asset RPC method. */ +export interface QueryAssetResponseSDKType { + asset: AssetSDKType; +} +/** Queries a list of Asset items. */ +export interface QueryAllAssetsRequest { + pagination?: PageRequest; +} +export interface QueryAllAssetsRequestProtoMsg { + typeUrl: "/dydxprotocol.assets.QueryAllAssetsRequest"; + value: Uint8Array; +} +/** Queries a list of Asset items. */ +export interface QueryAllAssetsRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllAssetsRequestAminoMsg { + type: "/dydxprotocol.assets.QueryAllAssetsRequest"; + value: QueryAllAssetsRequestAmino; +} +/** Queries a list of Asset items. */ +export interface QueryAllAssetsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryAllAssetsResponse is response type for the AllAssets RPC method. */ +export interface QueryAllAssetsResponse { + asset: Asset[]; + pagination?: PageResponse; +} +export interface QueryAllAssetsResponseProtoMsg { + typeUrl: "/dydxprotocol.assets.QueryAllAssetsResponse"; + value: Uint8Array; +} +/** QueryAllAssetsResponse is response type for the AllAssets RPC method. */ +export interface QueryAllAssetsResponseAmino { + asset?: AssetAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryAllAssetsResponseAminoMsg { + type: "/dydxprotocol.assets.QueryAllAssetsResponse"; + value: QueryAllAssetsResponseAmino; +} +/** QueryAllAssetsResponse is response type for the AllAssets RPC method. */ +export interface QueryAllAssetsResponseSDKType { + asset: AssetSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryAssetRequest(): QueryAssetRequest { + return { + id: 0 + }; +} +export const QueryAssetRequest = { + typeUrl: "/dydxprotocol.assets.QueryAssetRequest", + encode(message: QueryAssetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAssetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAssetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAssetRequest { + const message = createBaseQueryAssetRequest(); + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: QueryAssetRequestAmino): QueryAssetRequest { + const message = createBaseQueryAssetRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryAssetRequest): QueryAssetRequestAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryAssetRequestAminoMsg): QueryAssetRequest { + return QueryAssetRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAssetRequestProtoMsg): QueryAssetRequest { + return QueryAssetRequest.decode(message.value); + }, + toProto(message: QueryAssetRequest): Uint8Array { + return QueryAssetRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAssetRequest): QueryAssetRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.assets.QueryAssetRequest", + value: QueryAssetRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAssetResponse(): QueryAssetResponse { + return { + asset: Asset.fromPartial({}) + }; +} +export const QueryAssetResponse = { + typeUrl: "/dydxprotocol.assets.QueryAssetResponse", + encode(message: QueryAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.asset !== undefined) { + Asset.encode(message.asset, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAssetResponse { + const message = createBaseQueryAssetResponse(); + message.asset = object.asset !== undefined && object.asset !== null ? Asset.fromPartial(object.asset) : undefined; + return message; + }, + fromAmino(object: QueryAssetResponseAmino): QueryAssetResponse { + const message = createBaseQueryAssetResponse(); + if (object.asset !== undefined && object.asset !== null) { + message.asset = Asset.fromAmino(object.asset); + } + return message; + }, + toAmino(message: QueryAssetResponse): QueryAssetResponseAmino { + const obj: any = {}; + obj.asset = message.asset ? Asset.toAmino(message.asset) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAssetResponseAminoMsg): QueryAssetResponse { + return QueryAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAssetResponseProtoMsg): QueryAssetResponse { + return QueryAssetResponse.decode(message.value); + }, + toProto(message: QueryAssetResponse): Uint8Array { + return QueryAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAssetResponse): QueryAssetResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.assets.QueryAssetResponse", + value: QueryAssetResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllAssetsRequest(): QueryAllAssetsRequest { + return { + pagination: undefined + }; +} +export const QueryAllAssetsRequest = { + typeUrl: "/dydxprotocol.assets.QueryAllAssetsRequest", + encode(message: QueryAllAssetsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllAssetsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllAssetsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllAssetsRequest { + const message = createBaseQueryAllAssetsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllAssetsRequestAmino): QueryAllAssetsRequest { + const message = createBaseQueryAllAssetsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllAssetsRequest): QueryAllAssetsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllAssetsRequestAminoMsg): QueryAllAssetsRequest { + return QueryAllAssetsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllAssetsRequestProtoMsg): QueryAllAssetsRequest { + return QueryAllAssetsRequest.decode(message.value); + }, + toProto(message: QueryAllAssetsRequest): Uint8Array { + return QueryAllAssetsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllAssetsRequest): QueryAllAssetsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.assets.QueryAllAssetsRequest", + value: QueryAllAssetsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllAssetsResponse(): QueryAllAssetsResponse { + return { + asset: [], + pagination: undefined + }; +} +export const QueryAllAssetsResponse = { + typeUrl: "/dydxprotocol.assets.QueryAllAssetsResponse", + encode(message: QueryAllAssetsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.asset) { + Asset.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllAssetsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllAssetsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset.push(Asset.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllAssetsResponse { + const message = createBaseQueryAllAssetsResponse(); + message.asset = object.asset?.map(e => Asset.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllAssetsResponseAmino): QueryAllAssetsResponse { + const message = createBaseQueryAllAssetsResponse(); + message.asset = object.asset?.map(e => Asset.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllAssetsResponse): QueryAllAssetsResponseAmino { + const obj: any = {}; + if (message.asset) { + obj.asset = message.asset.map(e => e ? Asset.toAmino(e) : undefined); + } else { + obj.asset = message.asset; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllAssetsResponseAminoMsg): QueryAllAssetsResponse { + return QueryAllAssetsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllAssetsResponseProtoMsg): QueryAllAssetsResponse { + return QueryAllAssetsResponse.decode(message.value); + }, + toProto(message: QueryAllAssetsResponse): Uint8Array { + return QueryAllAssetsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllAssetsResponse): QueryAllAssetsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.assets.QueryAllAssetsResponse", + value: QueryAllAssetsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/assets/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/tx.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/assets/tx.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/blocktime.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/blocktime.ts new file mode 100644 index 00000000..e9e7b240 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/blocktime.ts @@ -0,0 +1,303 @@ +//@ts-nocheck +import { Timestamp } from "../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { toTimestamp, fromTimestamp } from "../../helpers"; +/** BlockInfo stores information about a block */ +export interface BlockInfo { + height: number; + timestamp: Date; +} +export interface BlockInfoProtoMsg { + typeUrl: "/dydxprotocol.blocktime.BlockInfo"; + value: Uint8Array; +} +/** BlockInfo stores information about a block */ +export interface BlockInfoAmino { + height?: number; + timestamp?: string; +} +export interface BlockInfoAminoMsg { + type: "/dydxprotocol.blocktime.BlockInfo"; + value: BlockInfoAmino; +} +/** BlockInfo stores information about a block */ +export interface BlockInfoSDKType { + height: number; + timestamp: Date; +} +/** AllDowntimeInfo stores information for all downtime durations. */ +export interface AllDowntimeInfo { + /** + * The downtime information for each tracked duration. Sorted by duration, + * ascending. (i.e. the same order as they appear in DowntimeParams). + */ + infos: AllDowntimeInfo_DowntimeInfo[]; +} +export interface AllDowntimeInfoProtoMsg { + typeUrl: "/dydxprotocol.blocktime.AllDowntimeInfo"; + value: Uint8Array; +} +/** AllDowntimeInfo stores information for all downtime durations. */ +export interface AllDowntimeInfoAmino { + /** + * The downtime information for each tracked duration. Sorted by duration, + * ascending. (i.e. the same order as they appear in DowntimeParams). + */ + infos?: AllDowntimeInfo_DowntimeInfoAmino[]; +} +export interface AllDowntimeInfoAminoMsg { + type: "/dydxprotocol.blocktime.AllDowntimeInfo"; + value: AllDowntimeInfoAmino; +} +/** AllDowntimeInfo stores information for all downtime durations. */ +export interface AllDowntimeInfoSDKType { + infos: AllDowntimeInfo_DowntimeInfoSDKType[]; +} +/** + * Stores information about downtime. block_info corresponds to the most + * recent block at which a downtime occurred. + */ +export interface AllDowntimeInfo_DowntimeInfo { + duration: Duration; + blockInfo: BlockInfo; +} +export interface AllDowntimeInfo_DowntimeInfoProtoMsg { + typeUrl: "/dydxprotocol.blocktime.DowntimeInfo"; + value: Uint8Array; +} +/** + * Stores information about downtime. block_info corresponds to the most + * recent block at which a downtime occurred. + */ +export interface AllDowntimeInfo_DowntimeInfoAmino { + duration?: DurationAmino; + block_info?: BlockInfoAmino; +} +export interface AllDowntimeInfo_DowntimeInfoAminoMsg { + type: "/dydxprotocol.blocktime.DowntimeInfo"; + value: AllDowntimeInfo_DowntimeInfoAmino; +} +/** + * Stores information about downtime. block_info corresponds to the most + * recent block at which a downtime occurred. + */ +export interface AllDowntimeInfo_DowntimeInfoSDKType { + duration: DurationSDKType; + block_info: BlockInfoSDKType; +} +function createBaseBlockInfo(): BlockInfo { + return { + height: 0, + timestamp: new Date() + }; +} +export const BlockInfo = { + typeUrl: "/dydxprotocol.blocktime.BlockInfo", + encode(message: BlockInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== 0) { + writer.uint32(8).uint32(message.height); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint32(); + break; + case 2: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockInfo { + const message = createBaseBlockInfo(); + message.height = object.height ?? 0; + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: BlockInfoAmino): BlockInfo { + const message = createBaseBlockInfo(); + if (object.height !== undefined && object.height !== null) { + message.height = object.height; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: BlockInfo): BlockInfoAmino { + const obj: any = {}; + obj.height = message.height === 0 ? undefined : message.height; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: BlockInfoAminoMsg): BlockInfo { + return BlockInfo.fromAmino(object.value); + }, + fromProtoMsg(message: BlockInfoProtoMsg): BlockInfo { + return BlockInfo.decode(message.value); + }, + toProto(message: BlockInfo): Uint8Array { + return BlockInfo.encode(message).finish(); + }, + toProtoMsg(message: BlockInfo): BlockInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.BlockInfo", + value: BlockInfo.encode(message).finish() + }; + } +}; +function createBaseAllDowntimeInfo(): AllDowntimeInfo { + return { + infos: [] + }; +} +export const AllDowntimeInfo = { + typeUrl: "/dydxprotocol.blocktime.AllDowntimeInfo", + encode(message: AllDowntimeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.infos) { + AllDowntimeInfo_DowntimeInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllDowntimeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllDowntimeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.infos.push(AllDowntimeInfo_DowntimeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllDowntimeInfo { + const message = createBaseAllDowntimeInfo(); + message.infos = object.infos?.map(e => AllDowntimeInfo_DowntimeInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AllDowntimeInfoAmino): AllDowntimeInfo { + const message = createBaseAllDowntimeInfo(); + message.infos = object.infos?.map(e => AllDowntimeInfo_DowntimeInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: AllDowntimeInfo): AllDowntimeInfoAmino { + const obj: any = {}; + if (message.infos) { + obj.infos = message.infos.map(e => e ? AllDowntimeInfo_DowntimeInfo.toAmino(e) : undefined); + } else { + obj.infos = message.infos; + } + return obj; + }, + fromAminoMsg(object: AllDowntimeInfoAminoMsg): AllDowntimeInfo { + return AllDowntimeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: AllDowntimeInfoProtoMsg): AllDowntimeInfo { + return AllDowntimeInfo.decode(message.value); + }, + toProto(message: AllDowntimeInfo): Uint8Array { + return AllDowntimeInfo.encode(message).finish(); + }, + toProtoMsg(message: AllDowntimeInfo): AllDowntimeInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.AllDowntimeInfo", + value: AllDowntimeInfo.encode(message).finish() + }; + } +}; +function createBaseAllDowntimeInfo_DowntimeInfo(): AllDowntimeInfo_DowntimeInfo { + return { + duration: Duration.fromPartial({}), + blockInfo: BlockInfo.fromPartial({}) + }; +} +export const AllDowntimeInfo_DowntimeInfo = { + typeUrl: "/dydxprotocol.blocktime.DowntimeInfo", + encode(message: AllDowntimeInfo_DowntimeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(10).fork()).ldelim(); + } + if (message.blockInfo !== undefined) { + BlockInfo.encode(message.blockInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllDowntimeInfo_DowntimeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllDowntimeInfo_DowntimeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.blockInfo = BlockInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllDowntimeInfo_DowntimeInfo { + const message = createBaseAllDowntimeInfo_DowntimeInfo(); + message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; + message.blockInfo = object.blockInfo !== undefined && object.blockInfo !== null ? BlockInfo.fromPartial(object.blockInfo) : undefined; + return message; + }, + fromAmino(object: AllDowntimeInfo_DowntimeInfoAmino): AllDowntimeInfo_DowntimeInfo { + const message = createBaseAllDowntimeInfo_DowntimeInfo(); + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.block_info !== undefined && object.block_info !== null) { + message.blockInfo = BlockInfo.fromAmino(object.block_info); + } + return message; + }, + toAmino(message: AllDowntimeInfo_DowntimeInfo): AllDowntimeInfo_DowntimeInfoAmino { + const obj: any = {}; + obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; + obj.block_info = message.blockInfo ? BlockInfo.toAmino(message.blockInfo) : undefined; + return obj; + }, + fromAminoMsg(object: AllDowntimeInfo_DowntimeInfoAminoMsg): AllDowntimeInfo_DowntimeInfo { + return AllDowntimeInfo_DowntimeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: AllDowntimeInfo_DowntimeInfoProtoMsg): AllDowntimeInfo_DowntimeInfo { + return AllDowntimeInfo_DowntimeInfo.decode(message.value); + }, + toProto(message: AllDowntimeInfo_DowntimeInfo): Uint8Array { + return AllDowntimeInfo_DowntimeInfo.encode(message).finish(); + }, + toProtoMsg(message: AllDowntimeInfo_DowntimeInfo): AllDowntimeInfo_DowntimeInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.DowntimeInfo", + value: AllDowntimeInfo_DowntimeInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/genesis.ts new file mode 100644 index 00000000..1b2db73d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/genesis.ts @@ -0,0 +1,86 @@ +//@ts-nocheck +import { DowntimeParams, DowntimeParamsAmino, DowntimeParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the blocktime module's genesis state. */ +export interface GenesisState { + params: DowntimeParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.blocktime.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the blocktime module's genesis state. */ +export interface GenesisStateAmino { + params?: DowntimeParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.blocktime.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the blocktime module's genesis state. */ +export interface GenesisStateSDKType { + params: DowntimeParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: DowntimeParams.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.blocktime.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + DowntimeParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = DowntimeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? DowntimeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = DowntimeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? DowntimeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/params.ts new file mode 100644 index 00000000..569dff54 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/params.ts @@ -0,0 +1,96 @@ +//@ts-nocheck +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** DowntimeParams defines the parameters for downtime. */ +export interface DowntimeParams { + /** + * Durations tracked for downtime. The durations must be sorted from + * shortest to longest and must all be positive. + */ + durations: Duration[]; +} +export interface DowntimeParamsProtoMsg { + typeUrl: "/dydxprotocol.blocktime.DowntimeParams"; + value: Uint8Array; +} +/** DowntimeParams defines the parameters for downtime. */ +export interface DowntimeParamsAmino { + /** + * Durations tracked for downtime. The durations must be sorted from + * shortest to longest and must all be positive. + */ + durations?: DurationAmino[]; +} +export interface DowntimeParamsAminoMsg { + type: "/dydxprotocol.blocktime.DowntimeParams"; + value: DowntimeParamsAmino; +} +/** DowntimeParams defines the parameters for downtime. */ +export interface DowntimeParamsSDKType { + durations: DurationSDKType[]; +} +function createBaseDowntimeParams(): DowntimeParams { + return { + durations: [] + }; +} +export const DowntimeParams = { + typeUrl: "/dydxprotocol.blocktime.DowntimeParams", + encode(message: DowntimeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.durations) { + Duration.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DowntimeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDowntimeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.durations.push(Duration.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DowntimeParams { + const message = createBaseDowntimeParams(); + message.durations = object.durations?.map(e => Duration.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DowntimeParamsAmino): DowntimeParams { + const message = createBaseDowntimeParams(); + message.durations = object.durations?.map(e => Duration.fromAmino(e)) || []; + return message; + }, + toAmino(message: DowntimeParams): DowntimeParamsAmino { + const obj: any = {}; + if (message.durations) { + obj.durations = message.durations.map(e => e ? Duration.toAmino(e) : undefined); + } else { + obj.durations = message.durations; + } + return obj; + }, + fromAminoMsg(object: DowntimeParamsAminoMsg): DowntimeParams { + return DowntimeParams.fromAmino(object.value); + }, + fromProtoMsg(message: DowntimeParamsProtoMsg): DowntimeParams { + return DowntimeParams.decode(message.value); + }, + toProto(message: DowntimeParams): Uint8Array { + return DowntimeParams.encode(message).finish(); + }, + toProtoMsg(message: DowntimeParams): DowntimeParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.DowntimeParams", + value: DowntimeParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/query.rpc.Query.ts new file mode 100644 index 00000000..b30f9ec0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/query.rpc.Query.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryDowntimeParamsRequest, QueryDowntimeParamsResponse, QueryPreviousBlockInfoRequest, QueryPreviousBlockInfoResponse, QueryAllDowntimeInfoRequest, QueryAllDowntimeInfoResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the DowntimeParams. */ + downtimeParams(request?: QueryDowntimeParamsRequest): Promise; + /** Queries the information of the previous block */ + previousBlockInfo(request?: QueryPreviousBlockInfoRequest): Promise; + /** Queries all recorded downtime info. */ + allDowntimeInfo(request?: QueryAllDowntimeInfoRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.downtimeParams = this.downtimeParams.bind(this); + this.previousBlockInfo = this.previousBlockInfo.bind(this); + this.allDowntimeInfo = this.allDowntimeInfo.bind(this); + } + downtimeParams(request: QueryDowntimeParamsRequest = {}): Promise { + const data = QueryDowntimeParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.blocktime.Query", "DowntimeParams", data); + return promise.then(data => QueryDowntimeParamsResponse.decode(new BinaryReader(data))); + } + previousBlockInfo(request: QueryPreviousBlockInfoRequest = {}): Promise { + const data = QueryPreviousBlockInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.blocktime.Query", "PreviousBlockInfo", data); + return promise.then(data => QueryPreviousBlockInfoResponse.decode(new BinaryReader(data))); + } + allDowntimeInfo(request: QueryAllDowntimeInfoRequest = {}): Promise { + const data = QueryAllDowntimeInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.blocktime.Query", "AllDowntimeInfo", data); + return promise.then(data => QueryAllDowntimeInfoResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + downtimeParams(request?: QueryDowntimeParamsRequest): Promise { + return queryService.downtimeParams(request); + }, + previousBlockInfo(request?: QueryPreviousBlockInfoRequest): Promise { + return queryService.previousBlockInfo(request); + }, + allDowntimeInfo(request?: QueryAllDowntimeInfoRequest): Promise { + return queryService.allDowntimeInfo(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/query.ts new file mode 100644 index 00000000..74149dc7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/query.ts @@ -0,0 +1,499 @@ +//@ts-nocheck +import { DowntimeParams, DowntimeParamsAmino, DowntimeParamsSDKType } from "./params"; +import { BlockInfo, BlockInfoAmino, BlockInfoSDKType, AllDowntimeInfo, AllDowntimeInfoAmino, AllDowntimeInfoSDKType } from "./blocktime"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * QueryDowntimeParamsRequest is a request type for the DowntimeParams + * RPC method. + */ +export interface QueryDowntimeParamsRequest {} +export interface QueryDowntimeParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.blocktime.QueryDowntimeParamsRequest"; + value: Uint8Array; +} +/** + * QueryDowntimeParamsRequest is a request type for the DowntimeParams + * RPC method. + */ +export interface QueryDowntimeParamsRequestAmino {} +export interface QueryDowntimeParamsRequestAminoMsg { + type: "/dydxprotocol.blocktime.QueryDowntimeParamsRequest"; + value: QueryDowntimeParamsRequestAmino; +} +/** + * QueryDowntimeParamsRequest is a request type for the DowntimeParams + * RPC method. + */ +export interface QueryDowntimeParamsRequestSDKType {} +/** + * QueryDowntimeParamsResponse is a response type for the DowntimeParams + * RPC method. + */ +export interface QueryDowntimeParamsResponse { + params: DowntimeParams; +} +export interface QueryDowntimeParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.blocktime.QueryDowntimeParamsResponse"; + value: Uint8Array; +} +/** + * QueryDowntimeParamsResponse is a response type for the DowntimeParams + * RPC method. + */ +export interface QueryDowntimeParamsResponseAmino { + params?: DowntimeParamsAmino; +} +export interface QueryDowntimeParamsResponseAminoMsg { + type: "/dydxprotocol.blocktime.QueryDowntimeParamsResponse"; + value: QueryDowntimeParamsResponseAmino; +} +/** + * QueryDowntimeParamsResponse is a response type for the DowntimeParams + * RPC method. + */ +export interface QueryDowntimeParamsResponseSDKType { + params: DowntimeParamsSDKType; +} +/** + * QueryPreviousBlockInfoRequest is a request type for the PreviousBlockInfo + * RPC method. + */ +export interface QueryPreviousBlockInfoRequest {} +export interface QueryPreviousBlockInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.blocktime.QueryPreviousBlockInfoRequest"; + value: Uint8Array; +} +/** + * QueryPreviousBlockInfoRequest is a request type for the PreviousBlockInfo + * RPC method. + */ +export interface QueryPreviousBlockInfoRequestAmino {} +export interface QueryPreviousBlockInfoRequestAminoMsg { + type: "/dydxprotocol.blocktime.QueryPreviousBlockInfoRequest"; + value: QueryPreviousBlockInfoRequestAmino; +} +/** + * QueryPreviousBlockInfoRequest is a request type for the PreviousBlockInfo + * RPC method. + */ +export interface QueryPreviousBlockInfoRequestSDKType {} +/** + * QueryPreviousBlockInfoResponse is a request type for the PreviousBlockInfo + * RPC method. + */ +export interface QueryPreviousBlockInfoResponse { + info?: BlockInfo; +} +export interface QueryPreviousBlockInfoResponseProtoMsg { + typeUrl: "/dydxprotocol.blocktime.QueryPreviousBlockInfoResponse"; + value: Uint8Array; +} +/** + * QueryPreviousBlockInfoResponse is a request type for the PreviousBlockInfo + * RPC method. + */ +export interface QueryPreviousBlockInfoResponseAmino { + info?: BlockInfoAmino; +} +export interface QueryPreviousBlockInfoResponseAminoMsg { + type: "/dydxprotocol.blocktime.QueryPreviousBlockInfoResponse"; + value: QueryPreviousBlockInfoResponseAmino; +} +/** + * QueryPreviousBlockInfoResponse is a request type for the PreviousBlockInfo + * RPC method. + */ +export interface QueryPreviousBlockInfoResponseSDKType { + info?: BlockInfoSDKType; +} +/** + * QueryAllDowntimeInfoRequest is a request type for the AllDowntimeInfo + * RPC method. + */ +export interface QueryAllDowntimeInfoRequest {} +export interface QueryAllDowntimeInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.blocktime.QueryAllDowntimeInfoRequest"; + value: Uint8Array; +} +/** + * QueryAllDowntimeInfoRequest is a request type for the AllDowntimeInfo + * RPC method. + */ +export interface QueryAllDowntimeInfoRequestAmino {} +export interface QueryAllDowntimeInfoRequestAminoMsg { + type: "/dydxprotocol.blocktime.QueryAllDowntimeInfoRequest"; + value: QueryAllDowntimeInfoRequestAmino; +} +/** + * QueryAllDowntimeInfoRequest is a request type for the AllDowntimeInfo + * RPC method. + */ +export interface QueryAllDowntimeInfoRequestSDKType {} +/** + * QueryAllDowntimeInfoResponse is a request type for the AllDowntimeInfo + * RPC method. + */ +export interface QueryAllDowntimeInfoResponse { + info?: AllDowntimeInfo; +} +export interface QueryAllDowntimeInfoResponseProtoMsg { + typeUrl: "/dydxprotocol.blocktime.QueryAllDowntimeInfoResponse"; + value: Uint8Array; +} +/** + * QueryAllDowntimeInfoResponse is a request type for the AllDowntimeInfo + * RPC method. + */ +export interface QueryAllDowntimeInfoResponseAmino { + info?: AllDowntimeInfoAmino; +} +export interface QueryAllDowntimeInfoResponseAminoMsg { + type: "/dydxprotocol.blocktime.QueryAllDowntimeInfoResponse"; + value: QueryAllDowntimeInfoResponseAmino; +} +/** + * QueryAllDowntimeInfoResponse is a request type for the AllDowntimeInfo + * RPC method. + */ +export interface QueryAllDowntimeInfoResponseSDKType { + info?: AllDowntimeInfoSDKType; +} +function createBaseQueryDowntimeParamsRequest(): QueryDowntimeParamsRequest { + return {}; +} +export const QueryDowntimeParamsRequest = { + typeUrl: "/dydxprotocol.blocktime.QueryDowntimeParamsRequest", + encode(_: QueryDowntimeParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDowntimeParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDowntimeParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryDowntimeParamsRequest { + const message = createBaseQueryDowntimeParamsRequest(); + return message; + }, + fromAmino(_: QueryDowntimeParamsRequestAmino): QueryDowntimeParamsRequest { + const message = createBaseQueryDowntimeParamsRequest(); + return message; + }, + toAmino(_: QueryDowntimeParamsRequest): QueryDowntimeParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryDowntimeParamsRequestAminoMsg): QueryDowntimeParamsRequest { + return QueryDowntimeParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDowntimeParamsRequestProtoMsg): QueryDowntimeParamsRequest { + return QueryDowntimeParamsRequest.decode(message.value); + }, + toProto(message: QueryDowntimeParamsRequest): Uint8Array { + return QueryDowntimeParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDowntimeParamsRequest): QueryDowntimeParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.QueryDowntimeParamsRequest", + value: QueryDowntimeParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDowntimeParamsResponse(): QueryDowntimeParamsResponse { + return { + params: DowntimeParams.fromPartial({}) + }; +} +export const QueryDowntimeParamsResponse = { + typeUrl: "/dydxprotocol.blocktime.QueryDowntimeParamsResponse", + encode(message: QueryDowntimeParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + DowntimeParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDowntimeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDowntimeParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = DowntimeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDowntimeParamsResponse { + const message = createBaseQueryDowntimeParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? DowntimeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryDowntimeParamsResponseAmino): QueryDowntimeParamsResponse { + const message = createBaseQueryDowntimeParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = DowntimeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryDowntimeParamsResponse): QueryDowntimeParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? DowntimeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDowntimeParamsResponseAminoMsg): QueryDowntimeParamsResponse { + return QueryDowntimeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDowntimeParamsResponseProtoMsg): QueryDowntimeParamsResponse { + return QueryDowntimeParamsResponse.decode(message.value); + }, + toProto(message: QueryDowntimeParamsResponse): Uint8Array { + return QueryDowntimeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDowntimeParamsResponse): QueryDowntimeParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.QueryDowntimeParamsResponse", + value: QueryDowntimeParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPreviousBlockInfoRequest(): QueryPreviousBlockInfoRequest { + return {}; +} +export const QueryPreviousBlockInfoRequest = { + typeUrl: "/dydxprotocol.blocktime.QueryPreviousBlockInfoRequest", + encode(_: QueryPreviousBlockInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPreviousBlockInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPreviousBlockInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryPreviousBlockInfoRequest { + const message = createBaseQueryPreviousBlockInfoRequest(); + return message; + }, + fromAmino(_: QueryPreviousBlockInfoRequestAmino): QueryPreviousBlockInfoRequest { + const message = createBaseQueryPreviousBlockInfoRequest(); + return message; + }, + toAmino(_: QueryPreviousBlockInfoRequest): QueryPreviousBlockInfoRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPreviousBlockInfoRequestAminoMsg): QueryPreviousBlockInfoRequest { + return QueryPreviousBlockInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPreviousBlockInfoRequestProtoMsg): QueryPreviousBlockInfoRequest { + return QueryPreviousBlockInfoRequest.decode(message.value); + }, + toProto(message: QueryPreviousBlockInfoRequest): Uint8Array { + return QueryPreviousBlockInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPreviousBlockInfoRequest): QueryPreviousBlockInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.QueryPreviousBlockInfoRequest", + value: QueryPreviousBlockInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPreviousBlockInfoResponse(): QueryPreviousBlockInfoResponse { + return { + info: undefined + }; +} +export const QueryPreviousBlockInfoResponse = { + typeUrl: "/dydxprotocol.blocktime.QueryPreviousBlockInfoResponse", + encode(message: QueryPreviousBlockInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + BlockInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPreviousBlockInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPreviousBlockInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = BlockInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPreviousBlockInfoResponse { + const message = createBaseQueryPreviousBlockInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? BlockInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryPreviousBlockInfoResponseAmino): QueryPreviousBlockInfoResponse { + const message = createBaseQueryPreviousBlockInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = BlockInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryPreviousBlockInfoResponse): QueryPreviousBlockInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? BlockInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPreviousBlockInfoResponseAminoMsg): QueryPreviousBlockInfoResponse { + return QueryPreviousBlockInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPreviousBlockInfoResponseProtoMsg): QueryPreviousBlockInfoResponse { + return QueryPreviousBlockInfoResponse.decode(message.value); + }, + toProto(message: QueryPreviousBlockInfoResponse): Uint8Array { + return QueryPreviousBlockInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPreviousBlockInfoResponse): QueryPreviousBlockInfoResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.QueryPreviousBlockInfoResponse", + value: QueryPreviousBlockInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllDowntimeInfoRequest(): QueryAllDowntimeInfoRequest { + return {}; +} +export const QueryAllDowntimeInfoRequest = { + typeUrl: "/dydxprotocol.blocktime.QueryAllDowntimeInfoRequest", + encode(_: QueryAllDowntimeInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllDowntimeInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllDowntimeInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAllDowntimeInfoRequest { + const message = createBaseQueryAllDowntimeInfoRequest(); + return message; + }, + fromAmino(_: QueryAllDowntimeInfoRequestAmino): QueryAllDowntimeInfoRequest { + const message = createBaseQueryAllDowntimeInfoRequest(); + return message; + }, + toAmino(_: QueryAllDowntimeInfoRequest): QueryAllDowntimeInfoRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllDowntimeInfoRequestAminoMsg): QueryAllDowntimeInfoRequest { + return QueryAllDowntimeInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllDowntimeInfoRequestProtoMsg): QueryAllDowntimeInfoRequest { + return QueryAllDowntimeInfoRequest.decode(message.value); + }, + toProto(message: QueryAllDowntimeInfoRequest): Uint8Array { + return QueryAllDowntimeInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllDowntimeInfoRequest): QueryAllDowntimeInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.QueryAllDowntimeInfoRequest", + value: QueryAllDowntimeInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllDowntimeInfoResponse(): QueryAllDowntimeInfoResponse { + return { + info: undefined + }; +} +export const QueryAllDowntimeInfoResponse = { + typeUrl: "/dydxprotocol.blocktime.QueryAllDowntimeInfoResponse", + encode(message: QueryAllDowntimeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + AllDowntimeInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllDowntimeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllDowntimeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = AllDowntimeInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllDowntimeInfoResponse { + const message = createBaseQueryAllDowntimeInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? AllDowntimeInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryAllDowntimeInfoResponseAmino): QueryAllDowntimeInfoResponse { + const message = createBaseQueryAllDowntimeInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = AllDowntimeInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryAllDowntimeInfoResponse): QueryAllDowntimeInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? AllDowntimeInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllDowntimeInfoResponseAminoMsg): QueryAllDowntimeInfoResponse { + return QueryAllDowntimeInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllDowntimeInfoResponseProtoMsg): QueryAllDowntimeInfoResponse { + return QueryAllDowntimeInfoResponse.decode(message.value); + }, + toProto(message: QueryAllDowntimeInfoResponse): Uint8Array { + return QueryAllDowntimeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllDowntimeInfoResponse): QueryAllDowntimeInfoResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.QueryAllDowntimeInfoResponse", + value: QueryAllDowntimeInfoResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.amino.ts new file mode 100644 index 00000000..5249cf52 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateDowntimeParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.blocktime.MsgUpdateDowntimeParams": { + aminoType: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams", + toAmino: MsgUpdateDowntimeParams.toAmino, + fromAmino: MsgUpdateDowntimeParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.registry.ts new file mode 100644 index 00000000..08eb0210 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateDowntimeParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.blocktime.MsgUpdateDowntimeParams", MsgUpdateDowntimeParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateDowntimeParams(value: MsgUpdateDowntimeParams) { + return { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams", + value: MsgUpdateDowntimeParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateDowntimeParams(value: MsgUpdateDowntimeParams) { + return { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams", + value + }; + } + }, + fromPartial: { + updateDowntimeParams(value: MsgUpdateDowntimeParams) { + return { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams", + value: MsgUpdateDowntimeParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.rpc.msg.ts new file mode 100644 index 00000000..087d077c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.rpc.msg.ts @@ -0,0 +1,21 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgUpdateDowntimeParams, MsgUpdateDowntimeParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** UpdateDowntimeParams updates the DowntimeParams in state. */ + updateDowntimeParams(request: MsgUpdateDowntimeParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateDowntimeParams = this.updateDowntimeParams.bind(this); + } + updateDowntimeParams(request: MsgUpdateDowntimeParams): Promise { + const data = MsgUpdateDowntimeParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.blocktime.Msg", "UpdateDowntimeParams", data); + return promise.then(data => MsgUpdateDowntimeParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.ts new file mode 100644 index 00000000..e76b024e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/blocktime/tx.ts @@ -0,0 +1,176 @@ +//@ts-nocheck +import { DowntimeParams, DowntimeParamsAmino, DowntimeParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgUpdateDowntimeParams is the Msg/UpdateDowntimeParams request type. */ +export interface MsgUpdateDowntimeParams { + authority: string; + /** Defines the parameters to update. All parameters must be supplied. */ + params: DowntimeParams; +} +export interface MsgUpdateDowntimeParamsProtoMsg { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams"; + value: Uint8Array; +} +/** MsgUpdateDowntimeParams is the Msg/UpdateDowntimeParams request type. */ +export interface MsgUpdateDowntimeParamsAmino { + authority?: string; + /** Defines the parameters to update. All parameters must be supplied. */ + params?: DowntimeParamsAmino; +} +export interface MsgUpdateDowntimeParamsAminoMsg { + type: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams"; + value: MsgUpdateDowntimeParamsAmino; +} +/** MsgUpdateDowntimeParams is the Msg/UpdateDowntimeParams request type. */ +export interface MsgUpdateDowntimeParamsSDKType { + authority: string; + params: DowntimeParamsSDKType; +} +/** + * MsgUpdateDowntimeParamsResponse is the Msg/UpdateDowntimeParams response + * type. + */ +export interface MsgUpdateDowntimeParamsResponse {} +export interface MsgUpdateDowntimeParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateDowntimeParamsResponse is the Msg/UpdateDowntimeParams response + * type. + */ +export interface MsgUpdateDowntimeParamsResponseAmino {} +export interface MsgUpdateDowntimeParamsResponseAminoMsg { + type: "/dydxprotocol.blocktime.MsgUpdateDowntimeParamsResponse"; + value: MsgUpdateDowntimeParamsResponseAmino; +} +/** + * MsgUpdateDowntimeParamsResponse is the Msg/UpdateDowntimeParams response + * type. + */ +export interface MsgUpdateDowntimeParamsResponseSDKType {} +function createBaseMsgUpdateDowntimeParams(): MsgUpdateDowntimeParams { + return { + authority: "", + params: DowntimeParams.fromPartial({}) + }; +} +export const MsgUpdateDowntimeParams = { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams", + encode(message: MsgUpdateDowntimeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + DowntimeParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDowntimeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDowntimeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = DowntimeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateDowntimeParams { + const message = createBaseMsgUpdateDowntimeParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? DowntimeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateDowntimeParamsAmino): MsgUpdateDowntimeParams { + const message = createBaseMsgUpdateDowntimeParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = DowntimeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateDowntimeParams): MsgUpdateDowntimeParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? DowntimeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateDowntimeParamsAminoMsg): MsgUpdateDowntimeParams { + return MsgUpdateDowntimeParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateDowntimeParamsProtoMsg): MsgUpdateDowntimeParams { + return MsgUpdateDowntimeParams.decode(message.value); + }, + toProto(message: MsgUpdateDowntimeParams): Uint8Array { + return MsgUpdateDowntimeParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDowntimeParams): MsgUpdateDowntimeParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParams", + value: MsgUpdateDowntimeParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateDowntimeParamsResponse(): MsgUpdateDowntimeParamsResponse { + return {}; +} +export const MsgUpdateDowntimeParamsResponse = { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParamsResponse", + encode(_: MsgUpdateDowntimeParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDowntimeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDowntimeParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateDowntimeParamsResponse { + const message = createBaseMsgUpdateDowntimeParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateDowntimeParamsResponseAmino): MsgUpdateDowntimeParamsResponse { + const message = createBaseMsgUpdateDowntimeParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateDowntimeParamsResponse): MsgUpdateDowntimeParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateDowntimeParamsResponseAminoMsg): MsgUpdateDowntimeParamsResponse { + return MsgUpdateDowntimeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateDowntimeParamsResponseProtoMsg): MsgUpdateDowntimeParamsResponse { + return MsgUpdateDowntimeParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateDowntimeParamsResponse): Uint8Array { + return MsgUpdateDowntimeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDowntimeParamsResponse): MsgUpdateDowntimeParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.blocktime.MsgUpdateDowntimeParamsResponse", + value: MsgUpdateDowntimeParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/bridge_event.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/bridge_event.ts new file mode 100644 index 00000000..a9013619 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/bridge_event.ts @@ -0,0 +1,139 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** BridgeEvent is a recognized event from the Ethereum blockchain. */ +export interface BridgeEvent { + /** The unique id of the Ethereum event log. */ + id: number; + /** The tokens bridged. */ + coin: Coin; + /** The account address or module address to bridge to. */ + address: string; + /** The Ethereum block height of the event. */ + ethBlockHeight: bigint; +} +export interface BridgeEventProtoMsg { + typeUrl: "/dydxprotocol.bridge.BridgeEvent"; + value: Uint8Array; +} +/** BridgeEvent is a recognized event from the Ethereum blockchain. */ +export interface BridgeEventAmino { + /** The unique id of the Ethereum event log. */ + id?: number; + /** The tokens bridged. */ + coin?: CoinAmino; + /** The account address or module address to bridge to. */ + address?: string; + /** The Ethereum block height of the event. */ + eth_block_height?: string; +} +export interface BridgeEventAminoMsg { + type: "/dydxprotocol.bridge.BridgeEvent"; + value: BridgeEventAmino; +} +/** BridgeEvent is a recognized event from the Ethereum blockchain. */ +export interface BridgeEventSDKType { + id: number; + coin: CoinSDKType; + address: string; + eth_block_height: bigint; +} +function createBaseBridgeEvent(): BridgeEvent { + return { + id: 0, + coin: Coin.fromPartial({}), + address: "", + ethBlockHeight: BigInt(0) + }; +} +export const BridgeEvent = { + typeUrl: "/dydxprotocol.bridge.BridgeEvent", + encode(message: BridgeEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); + } + if (message.address !== "") { + writer.uint32(26).string(message.address); + } + if (message.ethBlockHeight !== BigInt(0)) { + writer.uint32(32).uint64(message.ethBlockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BridgeEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBridgeEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.coin = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.address = reader.string(); + break; + case 4: + message.ethBlockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BridgeEvent { + const message = createBaseBridgeEvent(); + message.id = object.id ?? 0; + message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; + message.address = object.address ?? ""; + message.ethBlockHeight = object.ethBlockHeight !== undefined && object.ethBlockHeight !== null ? BigInt(object.ethBlockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BridgeEventAmino): BridgeEvent { + const message = createBaseBridgeEvent(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.eth_block_height !== undefined && object.eth_block_height !== null) { + message.ethBlockHeight = BigInt(object.eth_block_height); + } + return message; + }, + toAmino(message: BridgeEvent): BridgeEventAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + obj.address = message.address === "" ? undefined : message.address; + obj.eth_block_height = message.ethBlockHeight !== BigInt(0) ? message.ethBlockHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BridgeEventAminoMsg): BridgeEvent { + return BridgeEvent.fromAmino(object.value); + }, + fromProtoMsg(message: BridgeEventProtoMsg): BridgeEvent { + return BridgeEvent.decode(message.value); + }, + toProto(message: BridgeEvent): Uint8Array { + return BridgeEvent.encode(message).finish(); + }, + toProtoMsg(message: BridgeEvent): BridgeEventProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.BridgeEvent", + value: BridgeEvent.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/bridge_event_info.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/bridge_event_info.ts new file mode 100644 index 00000000..8b3d6eef --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/bridge_event_info.ts @@ -0,0 +1,119 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * BridgeEventInfo stores information about the most recently processed bridge + * event. + */ +export interface BridgeEventInfo { + /** + * The next event id (the last processed id plus one) of the logs from the + * Ethereum contract. + */ + nextId: number; + /** The Ethereum block height of the most recently processed bridge event. */ + ethBlockHeight: bigint; +} +export interface BridgeEventInfoProtoMsg { + typeUrl: "/dydxprotocol.bridge.BridgeEventInfo"; + value: Uint8Array; +} +/** + * BridgeEventInfo stores information about the most recently processed bridge + * event. + */ +export interface BridgeEventInfoAmino { + /** + * The next event id (the last processed id plus one) of the logs from the + * Ethereum contract. + */ + next_id?: number; + /** The Ethereum block height of the most recently processed bridge event. */ + eth_block_height?: string; +} +export interface BridgeEventInfoAminoMsg { + type: "/dydxprotocol.bridge.BridgeEventInfo"; + value: BridgeEventInfoAmino; +} +/** + * BridgeEventInfo stores information about the most recently processed bridge + * event. + */ +export interface BridgeEventInfoSDKType { + next_id: number; + eth_block_height: bigint; +} +function createBaseBridgeEventInfo(): BridgeEventInfo { + return { + nextId: 0, + ethBlockHeight: BigInt(0) + }; +} +export const BridgeEventInfo = { + typeUrl: "/dydxprotocol.bridge.BridgeEventInfo", + encode(message: BridgeEventInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextId !== 0) { + writer.uint32(8).uint32(message.nextId); + } + if (message.ethBlockHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.ethBlockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BridgeEventInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBridgeEventInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextId = reader.uint32(); + break; + case 2: + message.ethBlockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BridgeEventInfo { + const message = createBaseBridgeEventInfo(); + message.nextId = object.nextId ?? 0; + message.ethBlockHeight = object.ethBlockHeight !== undefined && object.ethBlockHeight !== null ? BigInt(object.ethBlockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BridgeEventInfoAmino): BridgeEventInfo { + const message = createBaseBridgeEventInfo(); + if (object.next_id !== undefined && object.next_id !== null) { + message.nextId = object.next_id; + } + if (object.eth_block_height !== undefined && object.eth_block_height !== null) { + message.ethBlockHeight = BigInt(object.eth_block_height); + } + return message; + }, + toAmino(message: BridgeEventInfo): BridgeEventInfoAmino { + const obj: any = {}; + obj.next_id = message.nextId === 0 ? undefined : message.nextId; + obj.eth_block_height = message.ethBlockHeight !== BigInt(0) ? message.ethBlockHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BridgeEventInfoAminoMsg): BridgeEventInfo { + return BridgeEventInfo.fromAmino(object.value); + }, + fromProtoMsg(message: BridgeEventInfoProtoMsg): BridgeEventInfo { + return BridgeEventInfo.decode(message.value); + }, + toProto(message: BridgeEventInfo): Uint8Array { + return BridgeEventInfo.encode(message).finish(); + }, + toProtoMsg(message: BridgeEventInfo): BridgeEventInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.BridgeEventInfo", + value: BridgeEventInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/genesis.ts new file mode 100644 index 00000000..dad0b6e6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/genesis.ts @@ -0,0 +1,144 @@ +//@ts-nocheck +import { EventParams, EventParamsAmino, EventParamsSDKType, ProposeParams, ProposeParamsAmino, ProposeParamsSDKType, SafetyParams, SafetyParamsAmino, SafetyParamsSDKType } from "./params"; +import { BridgeEventInfo, BridgeEventInfoAmino, BridgeEventInfoSDKType } from "./bridge_event_info"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the bridge module's genesis state. */ +export interface GenesisState { + /** The parameters of the module. */ + eventParams: EventParams; + proposeParams: ProposeParams; + safetyParams: SafetyParams; + /** + * Acknowledged event info that stores: + * - the next event ID to be added to consensus. + * - Ethereum block height of the most recently acknowledged bridge event. + */ + acknowledgedEventInfo: BridgeEventInfo; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.bridge.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the bridge module's genesis state. */ +export interface GenesisStateAmino { + /** The parameters of the module. */ + event_params?: EventParamsAmino; + propose_params?: ProposeParamsAmino; + safety_params?: SafetyParamsAmino; + /** + * Acknowledged event info that stores: + * - the next event ID to be added to consensus. + * - Ethereum block height of the most recently acknowledged bridge event. + */ + acknowledged_event_info?: BridgeEventInfoAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.bridge.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the bridge module's genesis state. */ +export interface GenesisStateSDKType { + event_params: EventParamsSDKType; + propose_params: ProposeParamsSDKType; + safety_params: SafetyParamsSDKType; + acknowledged_event_info: BridgeEventInfoSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + eventParams: EventParams.fromPartial({}), + proposeParams: ProposeParams.fromPartial({}), + safetyParams: SafetyParams.fromPartial({}), + acknowledgedEventInfo: BridgeEventInfo.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.bridge.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eventParams !== undefined) { + EventParams.encode(message.eventParams, writer.uint32(10).fork()).ldelim(); + } + if (message.proposeParams !== undefined) { + ProposeParams.encode(message.proposeParams, writer.uint32(18).fork()).ldelim(); + } + if (message.safetyParams !== undefined) { + SafetyParams.encode(message.safetyParams, writer.uint32(26).fork()).ldelim(); + } + if (message.acknowledgedEventInfo !== undefined) { + BridgeEventInfo.encode(message.acknowledgedEventInfo, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventParams = EventParams.decode(reader, reader.uint32()); + break; + case 2: + message.proposeParams = ProposeParams.decode(reader, reader.uint32()); + break; + case 3: + message.safetyParams = SafetyParams.decode(reader, reader.uint32()); + break; + case 4: + message.acknowledgedEventInfo = BridgeEventInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.eventParams = object.eventParams !== undefined && object.eventParams !== null ? EventParams.fromPartial(object.eventParams) : undefined; + message.proposeParams = object.proposeParams !== undefined && object.proposeParams !== null ? ProposeParams.fromPartial(object.proposeParams) : undefined; + message.safetyParams = object.safetyParams !== undefined && object.safetyParams !== null ? SafetyParams.fromPartial(object.safetyParams) : undefined; + message.acknowledgedEventInfo = object.acknowledgedEventInfo !== undefined && object.acknowledgedEventInfo !== null ? BridgeEventInfo.fromPartial(object.acknowledgedEventInfo) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.event_params !== undefined && object.event_params !== null) { + message.eventParams = EventParams.fromAmino(object.event_params); + } + if (object.propose_params !== undefined && object.propose_params !== null) { + message.proposeParams = ProposeParams.fromAmino(object.propose_params); + } + if (object.safety_params !== undefined && object.safety_params !== null) { + message.safetyParams = SafetyParams.fromAmino(object.safety_params); + } + if (object.acknowledged_event_info !== undefined && object.acknowledged_event_info !== null) { + message.acknowledgedEventInfo = BridgeEventInfo.fromAmino(object.acknowledged_event_info); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.event_params = message.eventParams ? EventParams.toAmino(message.eventParams) : undefined; + obj.propose_params = message.proposeParams ? ProposeParams.toAmino(message.proposeParams) : undefined; + obj.safety_params = message.safetyParams ? SafetyParams.toAmino(message.safetyParams) : undefined; + obj.acknowledged_event_info = message.acknowledgedEventInfo ? BridgeEventInfo.toAmino(message.acknowledgedEventInfo) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/params.ts new file mode 100644 index 00000000..f0dd8bac --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/params.ts @@ -0,0 +1,407 @@ +//@ts-nocheck +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * EventParams stores parameters about which events to recognize and which + * tokens to mint. + */ +export interface EventParams { + /** The denom of the token to mint. */ + denom: string; + /** The numerical chain ID of the Ethereum chain to query. */ + ethChainId: bigint; + /** The address of the Ethereum contract to monitor for logs. */ + ethAddress: string; +} +export interface EventParamsProtoMsg { + typeUrl: "/dydxprotocol.bridge.EventParams"; + value: Uint8Array; +} +/** + * EventParams stores parameters about which events to recognize and which + * tokens to mint. + */ +export interface EventParamsAmino { + /** The denom of the token to mint. */ + denom?: string; + /** The numerical chain ID of the Ethereum chain to query. */ + eth_chain_id?: string; + /** The address of the Ethereum contract to monitor for logs. */ + eth_address?: string; +} +export interface EventParamsAminoMsg { + type: "/dydxprotocol.bridge.EventParams"; + value: EventParamsAmino; +} +/** + * EventParams stores parameters about which events to recognize and which + * tokens to mint. + */ +export interface EventParamsSDKType { + denom: string; + eth_chain_id: bigint; + eth_address: string; +} +/** ProposeParams stores parameters for proposing to the module. */ +export interface ProposeParams { + /** + * The maximum number of bridge events to propose per block. + * Limits the number of events to propose in a single block + * in-order to smooth out the flow of events. + */ + maxBridgesPerBlock: number; + /** + * The minimum duration to wait between a finalized bridge and + * proposing it. This allows other validators to have enough time to + * also recognize its occurence. Therefore the bridge daemon should + * pool for new finalized events at least as often as this parameter. + */ + proposeDelayDuration: Duration; + /** + * Do not propose any events if a [0, 1_000_000) random number generator + * generates a number smaller than this number. + * Setting this parameter to 1_000_000 means always skipping proposing events. + */ + skipRatePpm: number; + /** + * Do not propose any events if the timestamp of the proposal block is + * behind the proposers' wall-clock by at least this duration. + */ + skipIfBlockDelayedByDuration: Duration; +} +export interface ProposeParamsProtoMsg { + typeUrl: "/dydxprotocol.bridge.ProposeParams"; + value: Uint8Array; +} +/** ProposeParams stores parameters for proposing to the module. */ +export interface ProposeParamsAmino { + /** + * The maximum number of bridge events to propose per block. + * Limits the number of events to propose in a single block + * in-order to smooth out the flow of events. + */ + max_bridges_per_block?: number; + /** + * The minimum duration to wait between a finalized bridge and + * proposing it. This allows other validators to have enough time to + * also recognize its occurence. Therefore the bridge daemon should + * pool for new finalized events at least as often as this parameter. + */ + propose_delay_duration?: DurationAmino; + /** + * Do not propose any events if a [0, 1_000_000) random number generator + * generates a number smaller than this number. + * Setting this parameter to 1_000_000 means always skipping proposing events. + */ + skip_rate_ppm?: number; + /** + * Do not propose any events if the timestamp of the proposal block is + * behind the proposers' wall-clock by at least this duration. + */ + skip_if_block_delayed_by_duration?: DurationAmino; +} +export interface ProposeParamsAminoMsg { + type: "/dydxprotocol.bridge.ProposeParams"; + value: ProposeParamsAmino; +} +/** ProposeParams stores parameters for proposing to the module. */ +export interface ProposeParamsSDKType { + max_bridges_per_block: number; + propose_delay_duration: DurationSDKType; + skip_rate_ppm: number; + skip_if_block_delayed_by_duration: DurationSDKType; +} +/** SafetyParams stores safety parameters for the module. */ +export interface SafetyParams { + /** True if bridging is disabled. */ + isDisabled: boolean; + /** + * The number of blocks that bridges accepted in-consensus will be pending + * until the minted tokens are granted. + */ + delayBlocks: number; +} +export interface SafetyParamsProtoMsg { + typeUrl: "/dydxprotocol.bridge.SafetyParams"; + value: Uint8Array; +} +/** SafetyParams stores safety parameters for the module. */ +export interface SafetyParamsAmino { + /** True if bridging is disabled. */ + is_disabled?: boolean; + /** + * The number of blocks that bridges accepted in-consensus will be pending + * until the minted tokens are granted. + */ + delay_blocks?: number; +} +export interface SafetyParamsAminoMsg { + type: "/dydxprotocol.bridge.SafetyParams"; + value: SafetyParamsAmino; +} +/** SafetyParams stores safety parameters for the module. */ +export interface SafetyParamsSDKType { + is_disabled: boolean; + delay_blocks: number; +} +function createBaseEventParams(): EventParams { + return { + denom: "", + ethChainId: BigInt(0), + ethAddress: "" + }; +} +export const EventParams = { + typeUrl: "/dydxprotocol.bridge.EventParams", + encode(message: EventParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.ethChainId !== BigInt(0)) { + writer.uint32(16).uint64(message.ethChainId); + } + if (message.ethAddress !== "") { + writer.uint32(26).string(message.ethAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.ethChainId = reader.uint64(); + break; + case 3: + message.ethAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventParams { + const message = createBaseEventParams(); + message.denom = object.denom ?? ""; + message.ethChainId = object.ethChainId !== undefined && object.ethChainId !== null ? BigInt(object.ethChainId.toString()) : BigInt(0); + message.ethAddress = object.ethAddress ?? ""; + return message; + }, + fromAmino(object: EventParamsAmino): EventParams { + const message = createBaseEventParams(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.eth_chain_id !== undefined && object.eth_chain_id !== null) { + message.ethChainId = BigInt(object.eth_chain_id); + } + if (object.eth_address !== undefined && object.eth_address !== null) { + message.ethAddress = object.eth_address; + } + return message; + }, + toAmino(message: EventParams): EventParamsAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.eth_chain_id = message.ethChainId !== BigInt(0) ? message.ethChainId.toString() : undefined; + obj.eth_address = message.ethAddress === "" ? undefined : message.ethAddress; + return obj; + }, + fromAminoMsg(object: EventParamsAminoMsg): EventParams { + return EventParams.fromAmino(object.value); + }, + fromProtoMsg(message: EventParamsProtoMsg): EventParams { + return EventParams.decode(message.value); + }, + toProto(message: EventParams): Uint8Array { + return EventParams.encode(message).finish(); + }, + toProtoMsg(message: EventParams): EventParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.EventParams", + value: EventParams.encode(message).finish() + }; + } +}; +function createBaseProposeParams(): ProposeParams { + return { + maxBridgesPerBlock: 0, + proposeDelayDuration: Duration.fromPartial({}), + skipRatePpm: 0, + skipIfBlockDelayedByDuration: Duration.fromPartial({}) + }; +} +export const ProposeParams = { + typeUrl: "/dydxprotocol.bridge.ProposeParams", + encode(message: ProposeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxBridgesPerBlock !== 0) { + writer.uint32(8).uint32(message.maxBridgesPerBlock); + } + if (message.proposeDelayDuration !== undefined) { + Duration.encode(message.proposeDelayDuration, writer.uint32(18).fork()).ldelim(); + } + if (message.skipRatePpm !== 0) { + writer.uint32(24).uint32(message.skipRatePpm); + } + if (message.skipIfBlockDelayedByDuration !== undefined) { + Duration.encode(message.skipIfBlockDelayedByDuration, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProposeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBridgesPerBlock = reader.uint32(); + break; + case 2: + message.proposeDelayDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.skipRatePpm = reader.uint32(); + break; + case 4: + message.skipIfBlockDelayedByDuration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProposeParams { + const message = createBaseProposeParams(); + message.maxBridgesPerBlock = object.maxBridgesPerBlock ?? 0; + message.proposeDelayDuration = object.proposeDelayDuration !== undefined && object.proposeDelayDuration !== null ? Duration.fromPartial(object.proposeDelayDuration) : undefined; + message.skipRatePpm = object.skipRatePpm ?? 0; + message.skipIfBlockDelayedByDuration = object.skipIfBlockDelayedByDuration !== undefined && object.skipIfBlockDelayedByDuration !== null ? Duration.fromPartial(object.skipIfBlockDelayedByDuration) : undefined; + return message; + }, + fromAmino(object: ProposeParamsAmino): ProposeParams { + const message = createBaseProposeParams(); + if (object.max_bridges_per_block !== undefined && object.max_bridges_per_block !== null) { + message.maxBridgesPerBlock = object.max_bridges_per_block; + } + if (object.propose_delay_duration !== undefined && object.propose_delay_duration !== null) { + message.proposeDelayDuration = Duration.fromAmino(object.propose_delay_duration); + } + if (object.skip_rate_ppm !== undefined && object.skip_rate_ppm !== null) { + message.skipRatePpm = object.skip_rate_ppm; + } + if (object.skip_if_block_delayed_by_duration !== undefined && object.skip_if_block_delayed_by_duration !== null) { + message.skipIfBlockDelayedByDuration = Duration.fromAmino(object.skip_if_block_delayed_by_duration); + } + return message; + }, + toAmino(message: ProposeParams): ProposeParamsAmino { + const obj: any = {}; + obj.max_bridges_per_block = message.maxBridgesPerBlock === 0 ? undefined : message.maxBridgesPerBlock; + obj.propose_delay_duration = message.proposeDelayDuration ? Duration.toAmino(message.proposeDelayDuration) : undefined; + obj.skip_rate_ppm = message.skipRatePpm === 0 ? undefined : message.skipRatePpm; + obj.skip_if_block_delayed_by_duration = message.skipIfBlockDelayedByDuration ? Duration.toAmino(message.skipIfBlockDelayedByDuration) : undefined; + return obj; + }, + fromAminoMsg(object: ProposeParamsAminoMsg): ProposeParams { + return ProposeParams.fromAmino(object.value); + }, + fromProtoMsg(message: ProposeParamsProtoMsg): ProposeParams { + return ProposeParams.decode(message.value); + }, + toProto(message: ProposeParams): Uint8Array { + return ProposeParams.encode(message).finish(); + }, + toProtoMsg(message: ProposeParams): ProposeParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.ProposeParams", + value: ProposeParams.encode(message).finish() + }; + } +}; +function createBaseSafetyParams(): SafetyParams { + return { + isDisabled: false, + delayBlocks: 0 + }; +} +export const SafetyParams = { + typeUrl: "/dydxprotocol.bridge.SafetyParams", + encode(message: SafetyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isDisabled === true) { + writer.uint32(8).bool(message.isDisabled); + } + if (message.delayBlocks !== 0) { + writer.uint32(16).uint32(message.delayBlocks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SafetyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSafetyParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isDisabled = reader.bool(); + break; + case 2: + message.delayBlocks = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SafetyParams { + const message = createBaseSafetyParams(); + message.isDisabled = object.isDisabled ?? false; + message.delayBlocks = object.delayBlocks ?? 0; + return message; + }, + fromAmino(object: SafetyParamsAmino): SafetyParams { + const message = createBaseSafetyParams(); + if (object.is_disabled !== undefined && object.is_disabled !== null) { + message.isDisabled = object.is_disabled; + } + if (object.delay_blocks !== undefined && object.delay_blocks !== null) { + message.delayBlocks = object.delay_blocks; + } + return message; + }, + toAmino(message: SafetyParams): SafetyParamsAmino { + const obj: any = {}; + obj.is_disabled = message.isDisabled === false ? undefined : message.isDisabled; + obj.delay_blocks = message.delayBlocks === 0 ? undefined : message.delayBlocks; + return obj; + }, + fromAminoMsg(object: SafetyParamsAminoMsg): SafetyParams { + return SafetyParams.fromAmino(object.value); + }, + fromProtoMsg(message: SafetyParamsProtoMsg): SafetyParams { + return SafetyParams.decode(message.value); + }, + toProto(message: SafetyParams): Uint8Array { + return SafetyParams.encode(message).finish(); + }, + toProtoMsg(message: SafetyParams): SafetyParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.SafetyParams", + value: SafetyParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/query.rpc.Query.ts new file mode 100644 index 00000000..e96728f2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/query.rpc.Query.ts @@ -0,0 +1,97 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryEventParamsRequest, QueryEventParamsResponse, QueryProposeParamsRequest, QueryProposeParamsResponse, QuerySafetyParamsRequest, QuerySafetyParamsResponse, QueryAcknowledgedEventInfoRequest, QueryAcknowledgedEventInfoResponse, QueryRecognizedEventInfoRequest, QueryRecognizedEventInfoResponse, QueryDelayedCompleteBridgeMessagesRequest, QueryDelayedCompleteBridgeMessagesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the EventParams. */ + eventParams(request?: QueryEventParamsRequest): Promise; + /** Queries the ProposeParams. */ + proposeParams(request?: QueryProposeParamsRequest): Promise; + /** Queries the SafetyParams. */ + safetyParams(request?: QuerySafetyParamsRequest): Promise; + /** + * Queries the AcknowledgedEventInfo. + * An "acknowledged" event is one that is in-consensus and has been stored + * in-state. + */ + acknowledgedEventInfo(request?: QueryAcknowledgedEventInfoRequest): Promise; + /** + * Queries the RecognizedEventInfo. + * A "recognized" event is one that is finalized on the Ethereum blockchain + * and has been identified by the queried node. It is not yet in-consensus. + */ + recognizedEventInfo(request?: QueryRecognizedEventInfoRequest): Promise; + /** + * Queries all `MsgCompleteBridge` messages that are delayed (not yet + * executed) and corresponding block heights at which they will execute. + */ + delayedCompleteBridgeMessages(request: QueryDelayedCompleteBridgeMessagesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.eventParams = this.eventParams.bind(this); + this.proposeParams = this.proposeParams.bind(this); + this.safetyParams = this.safetyParams.bind(this); + this.acknowledgedEventInfo = this.acknowledgedEventInfo.bind(this); + this.recognizedEventInfo = this.recognizedEventInfo.bind(this); + this.delayedCompleteBridgeMessages = this.delayedCompleteBridgeMessages.bind(this); + } + eventParams(request: QueryEventParamsRequest = {}): Promise { + const data = QueryEventParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Query", "EventParams", data); + return promise.then(data => QueryEventParamsResponse.decode(new BinaryReader(data))); + } + proposeParams(request: QueryProposeParamsRequest = {}): Promise { + const data = QueryProposeParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Query", "ProposeParams", data); + return promise.then(data => QueryProposeParamsResponse.decode(new BinaryReader(data))); + } + safetyParams(request: QuerySafetyParamsRequest = {}): Promise { + const data = QuerySafetyParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Query", "SafetyParams", data); + return promise.then(data => QuerySafetyParamsResponse.decode(new BinaryReader(data))); + } + acknowledgedEventInfo(request: QueryAcknowledgedEventInfoRequest = {}): Promise { + const data = QueryAcknowledgedEventInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Query", "AcknowledgedEventInfo", data); + return promise.then(data => QueryAcknowledgedEventInfoResponse.decode(new BinaryReader(data))); + } + recognizedEventInfo(request: QueryRecognizedEventInfoRequest = {}): Promise { + const data = QueryRecognizedEventInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Query", "RecognizedEventInfo", data); + return promise.then(data => QueryRecognizedEventInfoResponse.decode(new BinaryReader(data))); + } + delayedCompleteBridgeMessages(request: QueryDelayedCompleteBridgeMessagesRequest): Promise { + const data = QueryDelayedCompleteBridgeMessagesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Query", "DelayedCompleteBridgeMessages", data); + return promise.then(data => QueryDelayedCompleteBridgeMessagesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + eventParams(request?: QueryEventParamsRequest): Promise { + return queryService.eventParams(request); + }, + proposeParams(request?: QueryProposeParamsRequest): Promise { + return queryService.proposeParams(request); + }, + safetyParams(request?: QuerySafetyParamsRequest): Promise { + return queryService.safetyParams(request); + }, + acknowledgedEventInfo(request?: QueryAcknowledgedEventInfoRequest): Promise { + return queryService.acknowledgedEventInfo(request); + }, + recognizedEventInfo(request?: QueryRecognizedEventInfoRequest): Promise { + return queryService.recognizedEventInfo(request); + }, + delayedCompleteBridgeMessages(request: QueryDelayedCompleteBridgeMessagesRequest): Promise { + return queryService.delayedCompleteBridgeMessages(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/query.ts new file mode 100644 index 00000000..8c39154e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/query.ts @@ -0,0 +1,1081 @@ +//@ts-nocheck +import { EventParams, EventParamsAmino, EventParamsSDKType, ProposeParams, ProposeParamsAmino, ProposeParamsSDKType, SafetyParams, SafetyParamsAmino, SafetyParamsSDKType } from "./params"; +import { BridgeEventInfo, BridgeEventInfoAmino, BridgeEventInfoSDKType } from "./bridge_event_info"; +import { MsgCompleteBridge, MsgCompleteBridgeAmino, MsgCompleteBridgeSDKType } from "./tx"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryEventParamsRequest is a request type for the EventParams RPC method. */ +export interface QueryEventParamsRequest {} +export interface QueryEventParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryEventParamsRequest"; + value: Uint8Array; +} +/** QueryEventParamsRequest is a request type for the EventParams RPC method. */ +export interface QueryEventParamsRequestAmino {} +export interface QueryEventParamsRequestAminoMsg { + type: "/dydxprotocol.bridge.QueryEventParamsRequest"; + value: QueryEventParamsRequestAmino; +} +/** QueryEventParamsRequest is a request type for the EventParams RPC method. */ +export interface QueryEventParamsRequestSDKType {} +/** QueryEventParamsResponse is a response type for the EventParams RPC method. */ +export interface QueryEventParamsResponse { + params: EventParams; +} +export interface QueryEventParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryEventParamsResponse"; + value: Uint8Array; +} +/** QueryEventParamsResponse is a response type for the EventParams RPC method. */ +export interface QueryEventParamsResponseAmino { + params?: EventParamsAmino; +} +export interface QueryEventParamsResponseAminoMsg { + type: "/dydxprotocol.bridge.QueryEventParamsResponse"; + value: QueryEventParamsResponseAmino; +} +/** QueryEventParamsResponse is a response type for the EventParams RPC method. */ +export interface QueryEventParamsResponseSDKType { + params: EventParamsSDKType; +} +/** QueryProposeParamsRequest is a request type for the ProposeParams RPC method. */ +export interface QueryProposeParamsRequest {} +export interface QueryProposeParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryProposeParamsRequest"; + value: Uint8Array; +} +/** QueryProposeParamsRequest is a request type for the ProposeParams RPC method. */ +export interface QueryProposeParamsRequestAmino {} +export interface QueryProposeParamsRequestAminoMsg { + type: "/dydxprotocol.bridge.QueryProposeParamsRequest"; + value: QueryProposeParamsRequestAmino; +} +/** QueryProposeParamsRequest is a request type for the ProposeParams RPC method. */ +export interface QueryProposeParamsRequestSDKType {} +/** + * QueryProposeParamsResponse is a response type for the ProposeParams RPC + * method. + */ +export interface QueryProposeParamsResponse { + params: ProposeParams; +} +export interface QueryProposeParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryProposeParamsResponse"; + value: Uint8Array; +} +/** + * QueryProposeParamsResponse is a response type for the ProposeParams RPC + * method. + */ +export interface QueryProposeParamsResponseAmino { + params?: ProposeParamsAmino; +} +export interface QueryProposeParamsResponseAminoMsg { + type: "/dydxprotocol.bridge.QueryProposeParamsResponse"; + value: QueryProposeParamsResponseAmino; +} +/** + * QueryProposeParamsResponse is a response type for the ProposeParams RPC + * method. + */ +export interface QueryProposeParamsResponseSDKType { + params: ProposeParamsSDKType; +} +/** QuerySafetyParamsRequest is a request type for the SafetyParams RPC method. */ +export interface QuerySafetyParamsRequest {} +export interface QuerySafetyParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.bridge.QuerySafetyParamsRequest"; + value: Uint8Array; +} +/** QuerySafetyParamsRequest is a request type for the SafetyParams RPC method. */ +export interface QuerySafetyParamsRequestAmino {} +export interface QuerySafetyParamsRequestAminoMsg { + type: "/dydxprotocol.bridge.QuerySafetyParamsRequest"; + value: QuerySafetyParamsRequestAmino; +} +/** QuerySafetyParamsRequest is a request type for the SafetyParams RPC method. */ +export interface QuerySafetyParamsRequestSDKType {} +/** QuerySafetyParamsResponse is a response type for the SafetyParams RPC method. */ +export interface QuerySafetyParamsResponse { + params: SafetyParams; +} +export interface QuerySafetyParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.QuerySafetyParamsResponse"; + value: Uint8Array; +} +/** QuerySafetyParamsResponse is a response type for the SafetyParams RPC method. */ +export interface QuerySafetyParamsResponseAmino { + params?: SafetyParamsAmino; +} +export interface QuerySafetyParamsResponseAminoMsg { + type: "/dydxprotocol.bridge.QuerySafetyParamsResponse"; + value: QuerySafetyParamsResponseAmino; +} +/** QuerySafetyParamsResponse is a response type for the SafetyParams RPC method. */ +export interface QuerySafetyParamsResponseSDKType { + params: SafetyParamsSDKType; +} +/** + * QueryAcknowledgedEventInfoRequest is a request type for the + * AcknowledgedEventInfo RPC method. + */ +export interface QueryAcknowledgedEventInfoRequest {} +export interface QueryAcknowledgedEventInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoRequest"; + value: Uint8Array; +} +/** + * QueryAcknowledgedEventInfoRequest is a request type for the + * AcknowledgedEventInfo RPC method. + */ +export interface QueryAcknowledgedEventInfoRequestAmino {} +export interface QueryAcknowledgedEventInfoRequestAminoMsg { + type: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoRequest"; + value: QueryAcknowledgedEventInfoRequestAmino; +} +/** + * QueryAcknowledgedEventInfoRequest is a request type for the + * AcknowledgedEventInfo RPC method. + */ +export interface QueryAcknowledgedEventInfoRequestSDKType {} +/** + * QueryAcknowledgedEventInfoResponse is a response type for the + * AcknowledgedEventInfo RPC method. + */ +export interface QueryAcknowledgedEventInfoResponse { + info: BridgeEventInfo; +} +export interface QueryAcknowledgedEventInfoResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoResponse"; + value: Uint8Array; +} +/** + * QueryAcknowledgedEventInfoResponse is a response type for the + * AcknowledgedEventInfo RPC method. + */ +export interface QueryAcknowledgedEventInfoResponseAmino { + info?: BridgeEventInfoAmino; +} +export interface QueryAcknowledgedEventInfoResponseAminoMsg { + type: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoResponse"; + value: QueryAcknowledgedEventInfoResponseAmino; +} +/** + * QueryAcknowledgedEventInfoResponse is a response type for the + * AcknowledgedEventInfo RPC method. + */ +export interface QueryAcknowledgedEventInfoResponseSDKType { + info: BridgeEventInfoSDKType; +} +/** + * QueryRecognizedEventInfoRequest is a request type for the + * RecognizedEventInfo RPC method. + */ +export interface QueryRecognizedEventInfoRequest {} +export interface QueryRecognizedEventInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryRecognizedEventInfoRequest"; + value: Uint8Array; +} +/** + * QueryRecognizedEventInfoRequest is a request type for the + * RecognizedEventInfo RPC method. + */ +export interface QueryRecognizedEventInfoRequestAmino {} +export interface QueryRecognizedEventInfoRequestAminoMsg { + type: "/dydxprotocol.bridge.QueryRecognizedEventInfoRequest"; + value: QueryRecognizedEventInfoRequestAmino; +} +/** + * QueryRecognizedEventInfoRequest is a request type for the + * RecognizedEventInfo RPC method. + */ +export interface QueryRecognizedEventInfoRequestSDKType {} +/** + * QueryRecognizedEventInfoResponse is a response type for the + * RecognizedEventInfo RPC method. + */ +export interface QueryRecognizedEventInfoResponse { + info: BridgeEventInfo; +} +export interface QueryRecognizedEventInfoResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryRecognizedEventInfoResponse"; + value: Uint8Array; +} +/** + * QueryRecognizedEventInfoResponse is a response type for the + * RecognizedEventInfo RPC method. + */ +export interface QueryRecognizedEventInfoResponseAmino { + info?: BridgeEventInfoAmino; +} +export interface QueryRecognizedEventInfoResponseAminoMsg { + type: "/dydxprotocol.bridge.QueryRecognizedEventInfoResponse"; + value: QueryRecognizedEventInfoResponseAmino; +} +/** + * QueryRecognizedEventInfoResponse is a response type for the + * RecognizedEventInfo RPC method. + */ +export interface QueryRecognizedEventInfoResponseSDKType { + info: BridgeEventInfoSDKType; +} +/** + * QueryDelayedCompleteBridgeMessagesRequest is a request type for the + * DelayedCompleteBridgeMessages RPC method. + */ +export interface QueryDelayedCompleteBridgeMessagesRequest { + address: string; +} +export interface QueryDelayedCompleteBridgeMessagesRequestProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesRequest"; + value: Uint8Array; +} +/** + * QueryDelayedCompleteBridgeMessagesRequest is a request type for the + * DelayedCompleteBridgeMessages RPC method. + */ +export interface QueryDelayedCompleteBridgeMessagesRequestAmino { + address?: string; +} +export interface QueryDelayedCompleteBridgeMessagesRequestAminoMsg { + type: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesRequest"; + value: QueryDelayedCompleteBridgeMessagesRequestAmino; +} +/** + * QueryDelayedCompleteBridgeMessagesRequest is a request type for the + * DelayedCompleteBridgeMessages RPC method. + */ +export interface QueryDelayedCompleteBridgeMessagesRequestSDKType { + address: string; +} +/** + * QueryDelayedCompleteBridgeMessagesResponse is a response type for the + * DelayedCompleteBridgeMessages RPC method. + */ +export interface QueryDelayedCompleteBridgeMessagesResponse { + messages: DelayedCompleteBridgeMessage[]; +} +export interface QueryDelayedCompleteBridgeMessagesResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesResponse"; + value: Uint8Array; +} +/** + * QueryDelayedCompleteBridgeMessagesResponse is a response type for the + * DelayedCompleteBridgeMessages RPC method. + */ +export interface QueryDelayedCompleteBridgeMessagesResponseAmino { + messages?: DelayedCompleteBridgeMessageAmino[]; +} +export interface QueryDelayedCompleteBridgeMessagesResponseAminoMsg { + type: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesResponse"; + value: QueryDelayedCompleteBridgeMessagesResponseAmino; +} +/** + * QueryDelayedCompleteBridgeMessagesResponse is a response type for the + * DelayedCompleteBridgeMessages RPC method. + */ +export interface QueryDelayedCompleteBridgeMessagesResponseSDKType { + messages: DelayedCompleteBridgeMessageSDKType[]; +} +/** + * DelayedCompleteBridgeMessage is a message type for the response of + * DelayedCompleteBridgeMessages RPC method. It contains the message + * and the block height at which it will execute. + */ +export interface DelayedCompleteBridgeMessage { + message: MsgCompleteBridge; + blockHeight: number; +} +export interface DelayedCompleteBridgeMessageProtoMsg { + typeUrl: "/dydxprotocol.bridge.DelayedCompleteBridgeMessage"; + value: Uint8Array; +} +/** + * DelayedCompleteBridgeMessage is a message type for the response of + * DelayedCompleteBridgeMessages RPC method. It contains the message + * and the block height at which it will execute. + */ +export interface DelayedCompleteBridgeMessageAmino { + message?: MsgCompleteBridgeAmino; + block_height?: number; +} +export interface DelayedCompleteBridgeMessageAminoMsg { + type: "/dydxprotocol.bridge.DelayedCompleteBridgeMessage"; + value: DelayedCompleteBridgeMessageAmino; +} +/** + * DelayedCompleteBridgeMessage is a message type for the response of + * DelayedCompleteBridgeMessages RPC method. It contains the message + * and the block height at which it will execute. + */ +export interface DelayedCompleteBridgeMessageSDKType { + message: MsgCompleteBridgeSDKType; + block_height: number; +} +function createBaseQueryEventParamsRequest(): QueryEventParamsRequest { + return {}; +} +export const QueryEventParamsRequest = { + typeUrl: "/dydxprotocol.bridge.QueryEventParamsRequest", + encode(_: QueryEventParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEventParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEventParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryEventParamsRequest { + const message = createBaseQueryEventParamsRequest(); + return message; + }, + fromAmino(_: QueryEventParamsRequestAmino): QueryEventParamsRequest { + const message = createBaseQueryEventParamsRequest(); + return message; + }, + toAmino(_: QueryEventParamsRequest): QueryEventParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryEventParamsRequestAminoMsg): QueryEventParamsRequest { + return QueryEventParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEventParamsRequestProtoMsg): QueryEventParamsRequest { + return QueryEventParamsRequest.decode(message.value); + }, + toProto(message: QueryEventParamsRequest): Uint8Array { + return QueryEventParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEventParamsRequest): QueryEventParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryEventParamsRequest", + value: QueryEventParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEventParamsResponse(): QueryEventParamsResponse { + return { + params: EventParams.fromPartial({}) + }; +} +export const QueryEventParamsResponse = { + typeUrl: "/dydxprotocol.bridge.QueryEventParamsResponse", + encode(message: QueryEventParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + EventParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEventParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEventParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = EventParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEventParamsResponse { + const message = createBaseQueryEventParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? EventParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryEventParamsResponseAmino): QueryEventParamsResponse { + const message = createBaseQueryEventParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = EventParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryEventParamsResponse): QueryEventParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? EventParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEventParamsResponseAminoMsg): QueryEventParamsResponse { + return QueryEventParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEventParamsResponseProtoMsg): QueryEventParamsResponse { + return QueryEventParamsResponse.decode(message.value); + }, + toProto(message: QueryEventParamsResponse): Uint8Array { + return QueryEventParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEventParamsResponse): QueryEventParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryEventParamsResponse", + value: QueryEventParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposeParamsRequest(): QueryProposeParamsRequest { + return {}; +} +export const QueryProposeParamsRequest = { + typeUrl: "/dydxprotocol.bridge.QueryProposeParamsRequest", + encode(_: QueryProposeParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposeParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposeParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryProposeParamsRequest { + const message = createBaseQueryProposeParamsRequest(); + return message; + }, + fromAmino(_: QueryProposeParamsRequestAmino): QueryProposeParamsRequest { + const message = createBaseQueryProposeParamsRequest(); + return message; + }, + toAmino(_: QueryProposeParamsRequest): QueryProposeParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryProposeParamsRequestAminoMsg): QueryProposeParamsRequest { + return QueryProposeParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProposeParamsRequestProtoMsg): QueryProposeParamsRequest { + return QueryProposeParamsRequest.decode(message.value); + }, + toProto(message: QueryProposeParamsRequest): Uint8Array { + return QueryProposeParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposeParamsRequest): QueryProposeParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryProposeParamsRequest", + value: QueryProposeParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposeParamsResponse(): QueryProposeParamsResponse { + return { + params: ProposeParams.fromPartial({}) + }; +} +export const QueryProposeParamsResponse = { + typeUrl: "/dydxprotocol.bridge.QueryProposeParamsResponse", + encode(message: QueryProposeParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ProposeParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposeParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ProposeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposeParamsResponse { + const message = createBaseQueryProposeParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? ProposeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryProposeParamsResponseAmino): QueryProposeParamsResponse { + const message = createBaseQueryProposeParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = ProposeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryProposeParamsResponse): QueryProposeParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? ProposeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposeParamsResponseAminoMsg): QueryProposeParamsResponse { + return QueryProposeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProposeParamsResponseProtoMsg): QueryProposeParamsResponse { + return QueryProposeParamsResponse.decode(message.value); + }, + toProto(message: QueryProposeParamsResponse): Uint8Array { + return QueryProposeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposeParamsResponse): QueryProposeParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryProposeParamsResponse", + value: QueryProposeParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySafetyParamsRequest(): QuerySafetyParamsRequest { + return {}; +} +export const QuerySafetyParamsRequest = { + typeUrl: "/dydxprotocol.bridge.QuerySafetyParamsRequest", + encode(_: QuerySafetyParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySafetyParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySafetyParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QuerySafetyParamsRequest { + const message = createBaseQuerySafetyParamsRequest(); + return message; + }, + fromAmino(_: QuerySafetyParamsRequestAmino): QuerySafetyParamsRequest { + const message = createBaseQuerySafetyParamsRequest(); + return message; + }, + toAmino(_: QuerySafetyParamsRequest): QuerySafetyParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QuerySafetyParamsRequestAminoMsg): QuerySafetyParamsRequest { + return QuerySafetyParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySafetyParamsRequestProtoMsg): QuerySafetyParamsRequest { + return QuerySafetyParamsRequest.decode(message.value); + }, + toProto(message: QuerySafetyParamsRequest): Uint8Array { + return QuerySafetyParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySafetyParamsRequest): QuerySafetyParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QuerySafetyParamsRequest", + value: QuerySafetyParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySafetyParamsResponse(): QuerySafetyParamsResponse { + return { + params: SafetyParams.fromPartial({}) + }; +} +export const QuerySafetyParamsResponse = { + typeUrl: "/dydxprotocol.bridge.QuerySafetyParamsResponse", + encode(message: QuerySafetyParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + SafetyParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySafetyParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySafetyParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = SafetyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySafetyParamsResponse { + const message = createBaseQuerySafetyParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? SafetyParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QuerySafetyParamsResponseAmino): QuerySafetyParamsResponse { + const message = createBaseQuerySafetyParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = SafetyParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QuerySafetyParamsResponse): QuerySafetyParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? SafetyParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySafetyParamsResponseAminoMsg): QuerySafetyParamsResponse { + return QuerySafetyParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySafetyParamsResponseProtoMsg): QuerySafetyParamsResponse { + return QuerySafetyParamsResponse.decode(message.value); + }, + toProto(message: QuerySafetyParamsResponse): Uint8Array { + return QuerySafetyParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySafetyParamsResponse): QuerySafetyParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QuerySafetyParamsResponse", + value: QuerySafetyParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAcknowledgedEventInfoRequest(): QueryAcknowledgedEventInfoRequest { + return {}; +} +export const QueryAcknowledgedEventInfoRequest = { + typeUrl: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoRequest", + encode(_: QueryAcknowledgedEventInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAcknowledgedEventInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAcknowledgedEventInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAcknowledgedEventInfoRequest { + const message = createBaseQueryAcknowledgedEventInfoRequest(); + return message; + }, + fromAmino(_: QueryAcknowledgedEventInfoRequestAmino): QueryAcknowledgedEventInfoRequest { + const message = createBaseQueryAcknowledgedEventInfoRequest(); + return message; + }, + toAmino(_: QueryAcknowledgedEventInfoRequest): QueryAcknowledgedEventInfoRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAcknowledgedEventInfoRequestAminoMsg): QueryAcknowledgedEventInfoRequest { + return QueryAcknowledgedEventInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAcknowledgedEventInfoRequestProtoMsg): QueryAcknowledgedEventInfoRequest { + return QueryAcknowledgedEventInfoRequest.decode(message.value); + }, + toProto(message: QueryAcknowledgedEventInfoRequest): Uint8Array { + return QueryAcknowledgedEventInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAcknowledgedEventInfoRequest): QueryAcknowledgedEventInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoRequest", + value: QueryAcknowledgedEventInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAcknowledgedEventInfoResponse(): QueryAcknowledgedEventInfoResponse { + return { + info: BridgeEventInfo.fromPartial({}) + }; +} +export const QueryAcknowledgedEventInfoResponse = { + typeUrl: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoResponse", + encode(message: QueryAcknowledgedEventInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + BridgeEventInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAcknowledgedEventInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAcknowledgedEventInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = BridgeEventInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAcknowledgedEventInfoResponse { + const message = createBaseQueryAcknowledgedEventInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? BridgeEventInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryAcknowledgedEventInfoResponseAmino): QueryAcknowledgedEventInfoResponse { + const message = createBaseQueryAcknowledgedEventInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = BridgeEventInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryAcknowledgedEventInfoResponse): QueryAcknowledgedEventInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? BridgeEventInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAcknowledgedEventInfoResponseAminoMsg): QueryAcknowledgedEventInfoResponse { + return QueryAcknowledgedEventInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAcknowledgedEventInfoResponseProtoMsg): QueryAcknowledgedEventInfoResponse { + return QueryAcknowledgedEventInfoResponse.decode(message.value); + }, + toProto(message: QueryAcknowledgedEventInfoResponse): Uint8Array { + return QueryAcknowledgedEventInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAcknowledgedEventInfoResponse): QueryAcknowledgedEventInfoResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryAcknowledgedEventInfoResponse", + value: QueryAcknowledgedEventInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRecognizedEventInfoRequest(): QueryRecognizedEventInfoRequest { + return {}; +} +export const QueryRecognizedEventInfoRequest = { + typeUrl: "/dydxprotocol.bridge.QueryRecognizedEventInfoRequest", + encode(_: QueryRecognizedEventInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRecognizedEventInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRecognizedEventInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryRecognizedEventInfoRequest { + const message = createBaseQueryRecognizedEventInfoRequest(); + return message; + }, + fromAmino(_: QueryRecognizedEventInfoRequestAmino): QueryRecognizedEventInfoRequest { + const message = createBaseQueryRecognizedEventInfoRequest(); + return message; + }, + toAmino(_: QueryRecognizedEventInfoRequest): QueryRecognizedEventInfoRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryRecognizedEventInfoRequestAminoMsg): QueryRecognizedEventInfoRequest { + return QueryRecognizedEventInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRecognizedEventInfoRequestProtoMsg): QueryRecognizedEventInfoRequest { + return QueryRecognizedEventInfoRequest.decode(message.value); + }, + toProto(message: QueryRecognizedEventInfoRequest): Uint8Array { + return QueryRecognizedEventInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRecognizedEventInfoRequest): QueryRecognizedEventInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryRecognizedEventInfoRequest", + value: QueryRecognizedEventInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRecognizedEventInfoResponse(): QueryRecognizedEventInfoResponse { + return { + info: BridgeEventInfo.fromPartial({}) + }; +} +export const QueryRecognizedEventInfoResponse = { + typeUrl: "/dydxprotocol.bridge.QueryRecognizedEventInfoResponse", + encode(message: QueryRecognizedEventInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + BridgeEventInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRecognizedEventInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRecognizedEventInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = BridgeEventInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRecognizedEventInfoResponse { + const message = createBaseQueryRecognizedEventInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? BridgeEventInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryRecognizedEventInfoResponseAmino): QueryRecognizedEventInfoResponse { + const message = createBaseQueryRecognizedEventInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = BridgeEventInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryRecognizedEventInfoResponse): QueryRecognizedEventInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? BridgeEventInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRecognizedEventInfoResponseAminoMsg): QueryRecognizedEventInfoResponse { + return QueryRecognizedEventInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRecognizedEventInfoResponseProtoMsg): QueryRecognizedEventInfoResponse { + return QueryRecognizedEventInfoResponse.decode(message.value); + }, + toProto(message: QueryRecognizedEventInfoResponse): Uint8Array { + return QueryRecognizedEventInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRecognizedEventInfoResponse): QueryRecognizedEventInfoResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryRecognizedEventInfoResponse", + value: QueryRecognizedEventInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelayedCompleteBridgeMessagesRequest(): QueryDelayedCompleteBridgeMessagesRequest { + return { + address: "" + }; +} +export const QueryDelayedCompleteBridgeMessagesRequest = { + typeUrl: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesRequest", + encode(message: QueryDelayedCompleteBridgeMessagesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelayedCompleteBridgeMessagesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelayedCompleteBridgeMessagesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelayedCompleteBridgeMessagesRequest { + const message = createBaseQueryDelayedCompleteBridgeMessagesRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryDelayedCompleteBridgeMessagesRequestAmino): QueryDelayedCompleteBridgeMessagesRequest { + const message = createBaseQueryDelayedCompleteBridgeMessagesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryDelayedCompleteBridgeMessagesRequest): QueryDelayedCompleteBridgeMessagesRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryDelayedCompleteBridgeMessagesRequestAminoMsg): QueryDelayedCompleteBridgeMessagesRequest { + return QueryDelayedCompleteBridgeMessagesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelayedCompleteBridgeMessagesRequestProtoMsg): QueryDelayedCompleteBridgeMessagesRequest { + return QueryDelayedCompleteBridgeMessagesRequest.decode(message.value); + }, + toProto(message: QueryDelayedCompleteBridgeMessagesRequest): Uint8Array { + return QueryDelayedCompleteBridgeMessagesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelayedCompleteBridgeMessagesRequest): QueryDelayedCompleteBridgeMessagesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesRequest", + value: QueryDelayedCompleteBridgeMessagesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelayedCompleteBridgeMessagesResponse(): QueryDelayedCompleteBridgeMessagesResponse { + return { + messages: [] + }; +} +export const QueryDelayedCompleteBridgeMessagesResponse = { + typeUrl: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesResponse", + encode(message: QueryDelayedCompleteBridgeMessagesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + DelayedCompleteBridgeMessage.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelayedCompleteBridgeMessagesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelayedCompleteBridgeMessagesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(DelayedCompleteBridgeMessage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelayedCompleteBridgeMessagesResponse { + const message = createBaseQueryDelayedCompleteBridgeMessagesResponse(); + message.messages = object.messages?.map(e => DelayedCompleteBridgeMessage.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDelayedCompleteBridgeMessagesResponseAmino): QueryDelayedCompleteBridgeMessagesResponse { + const message = createBaseQueryDelayedCompleteBridgeMessagesResponse(); + message.messages = object.messages?.map(e => DelayedCompleteBridgeMessage.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDelayedCompleteBridgeMessagesResponse): QueryDelayedCompleteBridgeMessagesResponseAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? DelayedCompleteBridgeMessage.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + return obj; + }, + fromAminoMsg(object: QueryDelayedCompleteBridgeMessagesResponseAminoMsg): QueryDelayedCompleteBridgeMessagesResponse { + return QueryDelayedCompleteBridgeMessagesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelayedCompleteBridgeMessagesResponseProtoMsg): QueryDelayedCompleteBridgeMessagesResponse { + return QueryDelayedCompleteBridgeMessagesResponse.decode(message.value); + }, + toProto(message: QueryDelayedCompleteBridgeMessagesResponse): Uint8Array { + return QueryDelayedCompleteBridgeMessagesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelayedCompleteBridgeMessagesResponse): QueryDelayedCompleteBridgeMessagesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.QueryDelayedCompleteBridgeMessagesResponse", + value: QueryDelayedCompleteBridgeMessagesResponse.encode(message).finish() + }; + } +}; +function createBaseDelayedCompleteBridgeMessage(): DelayedCompleteBridgeMessage { + return { + message: MsgCompleteBridge.fromPartial({}), + blockHeight: 0 + }; +} +export const DelayedCompleteBridgeMessage = { + typeUrl: "/dydxprotocol.bridge.DelayedCompleteBridgeMessage", + encode(message: DelayedCompleteBridgeMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== undefined) { + MsgCompleteBridge.encode(message.message, writer.uint32(10).fork()).ldelim(); + } + if (message.blockHeight !== 0) { + writer.uint32(16).uint32(message.blockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelayedCompleteBridgeMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelayedCompleteBridgeMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = MsgCompleteBridge.decode(reader, reader.uint32()); + break; + case 2: + message.blockHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelayedCompleteBridgeMessage { + const message = createBaseDelayedCompleteBridgeMessage(); + message.message = object.message !== undefined && object.message !== null ? MsgCompleteBridge.fromPartial(object.message) : undefined; + message.blockHeight = object.blockHeight ?? 0; + return message; + }, + fromAmino(object: DelayedCompleteBridgeMessageAmino): DelayedCompleteBridgeMessage { + const message = createBaseDelayedCompleteBridgeMessage(); + if (object.message !== undefined && object.message !== null) { + message.message = MsgCompleteBridge.fromAmino(object.message); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + return message; + }, + toAmino(message: DelayedCompleteBridgeMessage): DelayedCompleteBridgeMessageAmino { + const obj: any = {}; + obj.message = message.message ? MsgCompleteBridge.toAmino(message.message) : undefined; + obj.block_height = message.blockHeight === 0 ? undefined : message.blockHeight; + return obj; + }, + fromAminoMsg(object: DelayedCompleteBridgeMessageAminoMsg): DelayedCompleteBridgeMessage { + return DelayedCompleteBridgeMessage.fromAmino(object.value); + }, + fromProtoMsg(message: DelayedCompleteBridgeMessageProtoMsg): DelayedCompleteBridgeMessage { + return DelayedCompleteBridgeMessage.decode(message.value); + }, + toProto(message: DelayedCompleteBridgeMessage): Uint8Array { + return DelayedCompleteBridgeMessage.encode(message).finish(); + }, + toProtoMsg(message: DelayedCompleteBridgeMessage): DelayedCompleteBridgeMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.DelayedCompleteBridgeMessage", + value: DelayedCompleteBridgeMessage.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.amino.ts new file mode 100644 index 00000000..28ed7a42 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.amino.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { MsgAcknowledgeBridges, MsgCompleteBridge, MsgUpdateEventParams, MsgUpdateProposeParams, MsgUpdateSafetyParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.bridge.MsgAcknowledgeBridges": { + aminoType: "/dydxprotocol.bridge.MsgAcknowledgeBridges", + toAmino: MsgAcknowledgeBridges.toAmino, + fromAmino: MsgAcknowledgeBridges.fromAmino + }, + "/dydxprotocol.bridge.MsgCompleteBridge": { + aminoType: "/dydxprotocol.bridge.MsgCompleteBridge", + toAmino: MsgCompleteBridge.toAmino, + fromAmino: MsgCompleteBridge.fromAmino + }, + "/dydxprotocol.bridge.MsgUpdateEventParams": { + aminoType: "/dydxprotocol.bridge.MsgUpdateEventParams", + toAmino: MsgUpdateEventParams.toAmino, + fromAmino: MsgUpdateEventParams.fromAmino + }, + "/dydxprotocol.bridge.MsgUpdateProposeParams": { + aminoType: "/dydxprotocol.bridge.MsgUpdateProposeParams", + toAmino: MsgUpdateProposeParams.toAmino, + fromAmino: MsgUpdateProposeParams.fromAmino + }, + "/dydxprotocol.bridge.MsgUpdateSafetyParams": { + aminoType: "/dydxprotocol.bridge.MsgUpdateSafetyParams", + toAmino: MsgUpdateSafetyParams.toAmino, + fromAmino: MsgUpdateSafetyParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.registry.ts new file mode 100644 index 00000000..255e498e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.registry.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAcknowledgeBridges, MsgCompleteBridge, MsgUpdateEventParams, MsgUpdateProposeParams, MsgUpdateSafetyParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.bridge.MsgAcknowledgeBridges", MsgAcknowledgeBridges], ["/dydxprotocol.bridge.MsgCompleteBridge", MsgCompleteBridge], ["/dydxprotocol.bridge.MsgUpdateEventParams", MsgUpdateEventParams], ["/dydxprotocol.bridge.MsgUpdateProposeParams", MsgUpdateProposeParams], ["/dydxprotocol.bridge.MsgUpdateSafetyParams", MsgUpdateSafetyParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + acknowledgeBridges(value: MsgAcknowledgeBridges) { + return { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridges", + value: MsgAcknowledgeBridges.encode(value).finish() + }; + }, + completeBridge(value: MsgCompleteBridge) { + return { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridge", + value: MsgCompleteBridge.encode(value).finish() + }; + }, + updateEventParams(value: MsgUpdateEventParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParams", + value: MsgUpdateEventParams.encode(value).finish() + }; + }, + updateProposeParams(value: MsgUpdateProposeParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParams", + value: MsgUpdateProposeParams.encode(value).finish() + }; + }, + updateSafetyParams(value: MsgUpdateSafetyParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParams", + value: MsgUpdateSafetyParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + acknowledgeBridges(value: MsgAcknowledgeBridges) { + return { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridges", + value + }; + }, + completeBridge(value: MsgCompleteBridge) { + return { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridge", + value + }; + }, + updateEventParams(value: MsgUpdateEventParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParams", + value + }; + }, + updateProposeParams(value: MsgUpdateProposeParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParams", + value + }; + }, + updateSafetyParams(value: MsgUpdateSafetyParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParams", + value + }; + } + }, + fromPartial: { + acknowledgeBridges(value: MsgAcknowledgeBridges) { + return { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridges", + value: MsgAcknowledgeBridges.fromPartial(value) + }; + }, + completeBridge(value: MsgCompleteBridge) { + return { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridge", + value: MsgCompleteBridge.fromPartial(value) + }; + }, + updateEventParams(value: MsgUpdateEventParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParams", + value: MsgUpdateEventParams.fromPartial(value) + }; + }, + updateProposeParams(value: MsgUpdateProposeParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParams", + value: MsgUpdateProposeParams.fromPartial(value) + }; + }, + updateSafetyParams(value: MsgUpdateSafetyParams) { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParams", + value: MsgUpdateSafetyParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.rpc.msg.ts new file mode 100644 index 00000000..52fa1818 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.rpc.msg.ts @@ -0,0 +1,56 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgAcknowledgeBridges, MsgAcknowledgeBridgesResponse, MsgCompleteBridge, MsgCompleteBridgeResponse, MsgUpdateEventParams, MsgUpdateEventParamsResponse, MsgUpdateProposeParams, MsgUpdateProposeParamsResponse, MsgUpdateSafetyParams, MsgUpdateSafetyParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * AcknowledgeBridges acknowledges bridges and sets them to complete at a + * later block. + */ + acknowledgeBridges(request: MsgAcknowledgeBridges): Promise; + /** CompleteBridge finalizes a bridge by minting coins to an address. */ + completeBridge(request: MsgCompleteBridge): Promise; + /** UpdateEventParams updates the EventParams in state. */ + updateEventParams(request: MsgUpdateEventParams): Promise; + /** UpdateProposeParams updates the ProposeParams in state. */ + updateProposeParams(request: MsgUpdateProposeParams): Promise; + /** UpdateSafetyParams updates the SafetyParams in state. */ + updateSafetyParams(request: MsgUpdateSafetyParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.acknowledgeBridges = this.acknowledgeBridges.bind(this); + this.completeBridge = this.completeBridge.bind(this); + this.updateEventParams = this.updateEventParams.bind(this); + this.updateProposeParams = this.updateProposeParams.bind(this); + this.updateSafetyParams = this.updateSafetyParams.bind(this); + } + acknowledgeBridges(request: MsgAcknowledgeBridges): Promise { + const data = MsgAcknowledgeBridges.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Msg", "AcknowledgeBridges", data); + return promise.then(data => MsgAcknowledgeBridgesResponse.decode(new BinaryReader(data))); + } + completeBridge(request: MsgCompleteBridge): Promise { + const data = MsgCompleteBridge.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Msg", "CompleteBridge", data); + return promise.then(data => MsgCompleteBridgeResponse.decode(new BinaryReader(data))); + } + updateEventParams(request: MsgUpdateEventParams): Promise { + const data = MsgUpdateEventParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Msg", "UpdateEventParams", data); + return promise.then(data => MsgUpdateEventParamsResponse.decode(new BinaryReader(data))); + } + updateProposeParams(request: MsgUpdateProposeParams): Promise { + const data = MsgUpdateProposeParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Msg", "UpdateProposeParams", data); + return promise.then(data => MsgUpdateProposeParamsResponse.decode(new BinaryReader(data))); + } + updateSafetyParams(request: MsgUpdateSafetyParams): Promise { + const data = MsgUpdateSafetyParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.bridge.Msg", "UpdateSafetyParams", data); + return promise.then(data => MsgUpdateSafetyParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.ts new file mode 100644 index 00000000..ed558e33 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bridge/tx.ts @@ -0,0 +1,820 @@ +//@ts-nocheck +import { BridgeEvent, BridgeEventAmino, BridgeEventSDKType } from "./bridge_event"; +import { EventParams, EventParamsAmino, EventParamsSDKType, ProposeParams, ProposeParamsAmino, ProposeParamsSDKType, SafetyParams, SafetyParamsAmino, SafetyParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgAcknowledgeBridges is the Msg/AcknowledgeBridges request type. */ +export interface MsgAcknowledgeBridges { + /** The events to acknowledge. */ + events: BridgeEvent[]; +} +export interface MsgAcknowledgeBridgesProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridges"; + value: Uint8Array; +} +/** MsgAcknowledgeBridges is the Msg/AcknowledgeBridges request type. */ +export interface MsgAcknowledgeBridgesAmino { + /** The events to acknowledge. */ + events?: BridgeEventAmino[]; +} +export interface MsgAcknowledgeBridgesAminoMsg { + type: "/dydxprotocol.bridge.MsgAcknowledgeBridges"; + value: MsgAcknowledgeBridgesAmino; +} +/** MsgAcknowledgeBridges is the Msg/AcknowledgeBridges request type. */ +export interface MsgAcknowledgeBridgesSDKType { + events: BridgeEventSDKType[]; +} +/** + * MsgAcknowledgeBridgesResponse is the Msg/AcknowledgeBridgesResponse response + * type. + */ +export interface MsgAcknowledgeBridgesResponse {} +export interface MsgAcknowledgeBridgesResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridgesResponse"; + value: Uint8Array; +} +/** + * MsgAcknowledgeBridgesResponse is the Msg/AcknowledgeBridgesResponse response + * type. + */ +export interface MsgAcknowledgeBridgesResponseAmino {} +export interface MsgAcknowledgeBridgesResponseAminoMsg { + type: "/dydxprotocol.bridge.MsgAcknowledgeBridgesResponse"; + value: MsgAcknowledgeBridgesResponseAmino; +} +/** + * MsgAcknowledgeBridgesResponse is the Msg/AcknowledgeBridgesResponse response + * type. + */ +export interface MsgAcknowledgeBridgesResponseSDKType {} +/** MsgCompleteBridge is the Msg/CompleteBridgeResponse request type. */ +export interface MsgCompleteBridge { + authority: string; + /** The event to complete. */ + event: BridgeEvent; +} +export interface MsgCompleteBridgeProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridge"; + value: Uint8Array; +} +/** MsgCompleteBridge is the Msg/CompleteBridgeResponse request type. */ +export interface MsgCompleteBridgeAmino { + authority?: string; + /** The event to complete. */ + event?: BridgeEventAmino; +} +export interface MsgCompleteBridgeAminoMsg { + type: "/dydxprotocol.bridge.MsgCompleteBridge"; + value: MsgCompleteBridgeAmino; +} +/** MsgCompleteBridge is the Msg/CompleteBridgeResponse request type. */ +export interface MsgCompleteBridgeSDKType { + authority: string; + event: BridgeEventSDKType; +} +/** MsgCompleteBridgeResponse is the Msg/CompleteBridgeResponse response type. */ +export interface MsgCompleteBridgeResponse {} +export interface MsgCompleteBridgeResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridgeResponse"; + value: Uint8Array; +} +/** MsgCompleteBridgeResponse is the Msg/CompleteBridgeResponse response type. */ +export interface MsgCompleteBridgeResponseAmino {} +export interface MsgCompleteBridgeResponseAminoMsg { + type: "/dydxprotocol.bridge.MsgCompleteBridgeResponse"; + value: MsgCompleteBridgeResponseAmino; +} +/** MsgCompleteBridgeResponse is the Msg/CompleteBridgeResponse response type. */ +export interface MsgCompleteBridgeResponseSDKType {} +/** MsgUpdateEventParams is the Msg/UpdateEventParams request type. */ +export interface MsgUpdateEventParams { + authority: string; + /** The parameters to update. Each field must be set. */ + params: EventParams; +} +export interface MsgUpdateEventParamsProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParams"; + value: Uint8Array; +} +/** MsgUpdateEventParams is the Msg/UpdateEventParams request type. */ +export interface MsgUpdateEventParamsAmino { + authority?: string; + /** The parameters to update. Each field must be set. */ + params?: EventParamsAmino; +} +export interface MsgUpdateEventParamsAminoMsg { + type: "/dydxprotocol.bridge.MsgUpdateEventParams"; + value: MsgUpdateEventParamsAmino; +} +/** MsgUpdateEventParams is the Msg/UpdateEventParams request type. */ +export interface MsgUpdateEventParamsSDKType { + authority: string; + params: EventParamsSDKType; +} +/** MsgUpdateEventParamsResponse is the Msg/UpdateEventParams response type. */ +export interface MsgUpdateEventParamsResponse {} +export interface MsgUpdateEventParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateEventParamsResponse is the Msg/UpdateEventParams response type. */ +export interface MsgUpdateEventParamsResponseAmino {} +export interface MsgUpdateEventParamsResponseAminoMsg { + type: "/dydxprotocol.bridge.MsgUpdateEventParamsResponse"; + value: MsgUpdateEventParamsResponseAmino; +} +/** MsgUpdateEventParamsResponse is the Msg/UpdateEventParams response type. */ +export interface MsgUpdateEventParamsResponseSDKType {} +/** MsgUpdateProposeParams is the Msg/UpdateProposeParams request type. */ +export interface MsgUpdateProposeParams { + authority: string; + /** The parameters to update. Each field must be set. */ + params: ProposeParams; +} +export interface MsgUpdateProposeParamsProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParams"; + value: Uint8Array; +} +/** MsgUpdateProposeParams is the Msg/UpdateProposeParams request type. */ +export interface MsgUpdateProposeParamsAmino { + authority?: string; + /** The parameters to update. Each field must be set. */ + params?: ProposeParamsAmino; +} +export interface MsgUpdateProposeParamsAminoMsg { + type: "/dydxprotocol.bridge.MsgUpdateProposeParams"; + value: MsgUpdateProposeParamsAmino; +} +/** MsgUpdateProposeParams is the Msg/UpdateProposeParams request type. */ +export interface MsgUpdateProposeParamsSDKType { + authority: string; + params: ProposeParamsSDKType; +} +/** MsgUpdateProposeParamsResponse is the Msg/UpdateProposeParams response type. */ +export interface MsgUpdateProposeParamsResponse {} +export interface MsgUpdateProposeParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateProposeParamsResponse is the Msg/UpdateProposeParams response type. */ +export interface MsgUpdateProposeParamsResponseAmino {} +export interface MsgUpdateProposeParamsResponseAminoMsg { + type: "/dydxprotocol.bridge.MsgUpdateProposeParamsResponse"; + value: MsgUpdateProposeParamsResponseAmino; +} +/** MsgUpdateProposeParamsResponse is the Msg/UpdateProposeParams response type. */ +export interface MsgUpdateProposeParamsResponseSDKType {} +/** MsgUpdateSafetyParams is the Msg/UpdateSafetyParams request type. */ +export interface MsgUpdateSafetyParams { + authority: string; + /** The parameters to update. Each field must be set. */ + params: SafetyParams; +} +export interface MsgUpdateSafetyParamsProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParams"; + value: Uint8Array; +} +/** MsgUpdateSafetyParams is the Msg/UpdateSafetyParams request type. */ +export interface MsgUpdateSafetyParamsAmino { + authority?: string; + /** The parameters to update. Each field must be set. */ + params?: SafetyParamsAmino; +} +export interface MsgUpdateSafetyParamsAminoMsg { + type: "/dydxprotocol.bridge.MsgUpdateSafetyParams"; + value: MsgUpdateSafetyParamsAmino; +} +/** MsgUpdateSafetyParams is the Msg/UpdateSafetyParams request type. */ +export interface MsgUpdateSafetyParamsSDKType { + authority: string; + params: SafetyParamsSDKType; +} +/** MsgUpdateSafetyParamsResponse is the Msg/UpdateSafetyParams response type. */ +export interface MsgUpdateSafetyParamsResponse {} +export interface MsgUpdateSafetyParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateSafetyParamsResponse is the Msg/UpdateSafetyParams response type. */ +export interface MsgUpdateSafetyParamsResponseAmino {} +export interface MsgUpdateSafetyParamsResponseAminoMsg { + type: "/dydxprotocol.bridge.MsgUpdateSafetyParamsResponse"; + value: MsgUpdateSafetyParamsResponseAmino; +} +/** MsgUpdateSafetyParamsResponse is the Msg/UpdateSafetyParams response type. */ +export interface MsgUpdateSafetyParamsResponseSDKType {} +function createBaseMsgAcknowledgeBridges(): MsgAcknowledgeBridges { + return { + events: [] + }; +} +export const MsgAcknowledgeBridges = { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridges", + encode(message: MsgAcknowledgeBridges, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.events) { + BridgeEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgeBridges { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgeBridges(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(BridgeEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAcknowledgeBridges { + const message = createBaseMsgAcknowledgeBridges(); + message.events = object.events?.map(e => BridgeEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgAcknowledgeBridgesAmino): MsgAcknowledgeBridges { + const message = createBaseMsgAcknowledgeBridges(); + message.events = object.events?.map(e => BridgeEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgAcknowledgeBridges): MsgAcknowledgeBridgesAmino { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e ? BridgeEvent.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: MsgAcknowledgeBridgesAminoMsg): MsgAcknowledgeBridges { + return MsgAcknowledgeBridges.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAcknowledgeBridgesProtoMsg): MsgAcknowledgeBridges { + return MsgAcknowledgeBridges.decode(message.value); + }, + toProto(message: MsgAcknowledgeBridges): Uint8Array { + return MsgAcknowledgeBridges.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgeBridges): MsgAcknowledgeBridgesProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridges", + value: MsgAcknowledgeBridges.encode(message).finish() + }; + } +}; +function createBaseMsgAcknowledgeBridgesResponse(): MsgAcknowledgeBridgesResponse { + return {}; +} +export const MsgAcknowledgeBridgesResponse = { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridgesResponse", + encode(_: MsgAcknowledgeBridgesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgeBridgesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgeBridgesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAcknowledgeBridgesResponse { + const message = createBaseMsgAcknowledgeBridgesResponse(); + return message; + }, + fromAmino(_: MsgAcknowledgeBridgesResponseAmino): MsgAcknowledgeBridgesResponse { + const message = createBaseMsgAcknowledgeBridgesResponse(); + return message; + }, + toAmino(_: MsgAcknowledgeBridgesResponse): MsgAcknowledgeBridgesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAcknowledgeBridgesResponseAminoMsg): MsgAcknowledgeBridgesResponse { + return MsgAcknowledgeBridgesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAcknowledgeBridgesResponseProtoMsg): MsgAcknowledgeBridgesResponse { + return MsgAcknowledgeBridgesResponse.decode(message.value); + }, + toProto(message: MsgAcknowledgeBridgesResponse): Uint8Array { + return MsgAcknowledgeBridgesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgeBridgesResponse): MsgAcknowledgeBridgesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgAcknowledgeBridgesResponse", + value: MsgAcknowledgeBridgesResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCompleteBridge(): MsgCompleteBridge { + return { + authority: "", + event: BridgeEvent.fromPartial({}) + }; +} +export const MsgCompleteBridge = { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridge", + encode(message: MsgCompleteBridge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.event !== undefined) { + BridgeEvent.encode(message.event, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCompleteBridge { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCompleteBridge(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.event = BridgeEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCompleteBridge { + const message = createBaseMsgCompleteBridge(); + message.authority = object.authority ?? ""; + message.event = object.event !== undefined && object.event !== null ? BridgeEvent.fromPartial(object.event) : undefined; + return message; + }, + fromAmino(object: MsgCompleteBridgeAmino): MsgCompleteBridge { + const message = createBaseMsgCompleteBridge(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.event !== undefined && object.event !== null) { + message.event = BridgeEvent.fromAmino(object.event); + } + return message; + }, + toAmino(message: MsgCompleteBridge): MsgCompleteBridgeAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.event = message.event ? BridgeEvent.toAmino(message.event) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCompleteBridgeAminoMsg): MsgCompleteBridge { + return MsgCompleteBridge.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCompleteBridgeProtoMsg): MsgCompleteBridge { + return MsgCompleteBridge.decode(message.value); + }, + toProto(message: MsgCompleteBridge): Uint8Array { + return MsgCompleteBridge.encode(message).finish(); + }, + toProtoMsg(message: MsgCompleteBridge): MsgCompleteBridgeProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridge", + value: MsgCompleteBridge.encode(message).finish() + }; + } +}; +function createBaseMsgCompleteBridgeResponse(): MsgCompleteBridgeResponse { + return {}; +} +export const MsgCompleteBridgeResponse = { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridgeResponse", + encode(_: MsgCompleteBridgeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCompleteBridgeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCompleteBridgeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCompleteBridgeResponse { + const message = createBaseMsgCompleteBridgeResponse(); + return message; + }, + fromAmino(_: MsgCompleteBridgeResponseAmino): MsgCompleteBridgeResponse { + const message = createBaseMsgCompleteBridgeResponse(); + return message; + }, + toAmino(_: MsgCompleteBridgeResponse): MsgCompleteBridgeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCompleteBridgeResponseAminoMsg): MsgCompleteBridgeResponse { + return MsgCompleteBridgeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCompleteBridgeResponseProtoMsg): MsgCompleteBridgeResponse { + return MsgCompleteBridgeResponse.decode(message.value); + }, + toProto(message: MsgCompleteBridgeResponse): Uint8Array { + return MsgCompleteBridgeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCompleteBridgeResponse): MsgCompleteBridgeResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgCompleteBridgeResponse", + value: MsgCompleteBridgeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateEventParams(): MsgUpdateEventParams { + return { + authority: "", + params: EventParams.fromPartial({}) + }; +} +export const MsgUpdateEventParams = { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParams", + encode(message: MsgUpdateEventParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + EventParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateEventParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateEventParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = EventParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateEventParams { + const message = createBaseMsgUpdateEventParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? EventParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateEventParamsAmino): MsgUpdateEventParams { + const message = createBaseMsgUpdateEventParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = EventParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateEventParams): MsgUpdateEventParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? EventParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateEventParamsAminoMsg): MsgUpdateEventParams { + return MsgUpdateEventParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateEventParamsProtoMsg): MsgUpdateEventParams { + return MsgUpdateEventParams.decode(message.value); + }, + toProto(message: MsgUpdateEventParams): Uint8Array { + return MsgUpdateEventParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateEventParams): MsgUpdateEventParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParams", + value: MsgUpdateEventParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateEventParamsResponse(): MsgUpdateEventParamsResponse { + return {}; +} +export const MsgUpdateEventParamsResponse = { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParamsResponse", + encode(_: MsgUpdateEventParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateEventParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateEventParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateEventParamsResponse { + const message = createBaseMsgUpdateEventParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateEventParamsResponseAmino): MsgUpdateEventParamsResponse { + const message = createBaseMsgUpdateEventParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateEventParamsResponse): MsgUpdateEventParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateEventParamsResponseAminoMsg): MsgUpdateEventParamsResponse { + return MsgUpdateEventParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateEventParamsResponseProtoMsg): MsgUpdateEventParamsResponse { + return MsgUpdateEventParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateEventParamsResponse): Uint8Array { + return MsgUpdateEventParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateEventParamsResponse): MsgUpdateEventParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateEventParamsResponse", + value: MsgUpdateEventParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateProposeParams(): MsgUpdateProposeParams { + return { + authority: "", + params: ProposeParams.fromPartial({}) + }; +} +export const MsgUpdateProposeParams = { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParams", + encode(message: MsgUpdateProposeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + ProposeParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateProposeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProposeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = ProposeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateProposeParams { + const message = createBaseMsgUpdateProposeParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? ProposeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateProposeParamsAmino): MsgUpdateProposeParams { + const message = createBaseMsgUpdateProposeParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = ProposeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateProposeParams): MsgUpdateProposeParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? ProposeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateProposeParamsAminoMsg): MsgUpdateProposeParams { + return MsgUpdateProposeParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateProposeParamsProtoMsg): MsgUpdateProposeParams { + return MsgUpdateProposeParams.decode(message.value); + }, + toProto(message: MsgUpdateProposeParams): Uint8Array { + return MsgUpdateProposeParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateProposeParams): MsgUpdateProposeParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParams", + value: MsgUpdateProposeParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateProposeParamsResponse(): MsgUpdateProposeParamsResponse { + return {}; +} +export const MsgUpdateProposeParamsResponse = { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParamsResponse", + encode(_: MsgUpdateProposeParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateProposeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateProposeParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateProposeParamsResponse { + const message = createBaseMsgUpdateProposeParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateProposeParamsResponseAmino): MsgUpdateProposeParamsResponse { + const message = createBaseMsgUpdateProposeParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateProposeParamsResponse): MsgUpdateProposeParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateProposeParamsResponseAminoMsg): MsgUpdateProposeParamsResponse { + return MsgUpdateProposeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateProposeParamsResponseProtoMsg): MsgUpdateProposeParamsResponse { + return MsgUpdateProposeParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateProposeParamsResponse): Uint8Array { + return MsgUpdateProposeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateProposeParamsResponse): MsgUpdateProposeParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateProposeParamsResponse", + value: MsgUpdateProposeParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateSafetyParams(): MsgUpdateSafetyParams { + return { + authority: "", + params: SafetyParams.fromPartial({}) + }; +} +export const MsgUpdateSafetyParams = { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParams", + encode(message: MsgUpdateSafetyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + SafetyParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSafetyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSafetyParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = SafetyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateSafetyParams { + const message = createBaseMsgUpdateSafetyParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? SafetyParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateSafetyParamsAmino): MsgUpdateSafetyParams { + const message = createBaseMsgUpdateSafetyParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = SafetyParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateSafetyParams): MsgUpdateSafetyParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? SafetyParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateSafetyParamsAminoMsg): MsgUpdateSafetyParams { + return MsgUpdateSafetyParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateSafetyParamsProtoMsg): MsgUpdateSafetyParams { + return MsgUpdateSafetyParams.decode(message.value); + }, + toProto(message: MsgUpdateSafetyParams): Uint8Array { + return MsgUpdateSafetyParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateSafetyParams): MsgUpdateSafetyParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParams", + value: MsgUpdateSafetyParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateSafetyParamsResponse(): MsgUpdateSafetyParamsResponse { + return {}; +} +export const MsgUpdateSafetyParamsResponse = { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParamsResponse", + encode(_: MsgUpdateSafetyParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSafetyParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateSafetyParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateSafetyParamsResponse { + const message = createBaseMsgUpdateSafetyParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateSafetyParamsResponseAmino): MsgUpdateSafetyParamsResponse { + const message = createBaseMsgUpdateSafetyParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateSafetyParamsResponse): MsgUpdateSafetyParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateSafetyParamsResponseAminoMsg): MsgUpdateSafetyParamsResponse { + return MsgUpdateSafetyParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateSafetyParamsResponseProtoMsg): MsgUpdateSafetyParamsResponse { + return MsgUpdateSafetyParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateSafetyParamsResponse): Uint8Array { + return MsgUpdateSafetyParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateSafetyParamsResponse): MsgUpdateSafetyParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.bridge.MsgUpdateSafetyParamsResponse", + value: MsgUpdateSafetyParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/bundle.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/bundle.ts new file mode 100644 index 00000000..650884eb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/bundle.ts @@ -0,0 +1,453 @@ +//@ts-nocheck +import * as _72 from "./accountplus/accountplus"; +import * as _73 from "./accountplus/genesis"; +import * as _74 from "./affiliates/affiliates"; +import * as _75 from "./affiliates/genesis"; +import * as _76 from "./affiliates/query"; +import * as _77 from "./affiliates/tx"; +import * as _78 from "./assets/asset"; +import * as _79 from "./assets/genesis"; +import * as _80 from "./assets/query"; +import * as _81 from "./assets/tx"; +import * as _82 from "./blocktime/blocktime"; +import * as _83 from "./blocktime/genesis"; +import * as _84 from "./blocktime/params"; +import * as _85 from "./blocktime/query"; +import * as _86 from "./blocktime/tx"; +import * as _87 from "./bridge/bridge_event_info"; +import * as _88 from "./bridge/bridge_event"; +import * as _89 from "./bridge/genesis"; +import * as _90 from "./bridge/params"; +import * as _91 from "./bridge/query"; +import * as _92 from "./bridge/tx"; +import * as _93 from "./clob/block_rate_limit_config"; +import * as _94 from "./clob/clob_pair"; +import * as _95 from "./clob/equity_tier_limit_config"; +import * as _96 from "./clob/genesis"; +import * as _97 from "./clob/liquidations_config"; +import * as _98 from "./clob/liquidations"; +import * as _99 from "./clob/matches"; +import * as _100 from "./clob/mev"; +import * as _101 from "./clob/operation"; +import * as _102 from "./clob/order_removals"; +import * as _103 from "./clob/order"; +import * as _104 from "./clob/process_proposer_matches_events"; +import * as _105 from "./clob/query"; +import * as _106 from "./clob/tx"; +import * as _107 from "./daemons/bridge/bridge"; +import * as _108 from "./daemons/liquidation/liquidation"; +import * as _109 from "./daemons/pricefeed/price_feed"; +import * as _110 from "./delaymsg/block_message_ids"; +import * as _111 from "./delaymsg/delayed_message"; +import * as _112 from "./delaymsg/genesis"; +import * as _113 from "./delaymsg/query"; +import * as _114 from "./delaymsg/tx"; +import * as _115 from "./epochs/epoch_info"; +import * as _116 from "./epochs/genesis"; +import * as _117 from "./epochs/query"; +import * as _118 from "./feetiers/genesis"; +import * as _119 from "./feetiers/params"; +import * as _120 from "./feetiers/query"; +import * as _121 from "./feetiers/tx"; +import * as _122 from "./govplus/genesis"; +import * as _123 from "./govplus/query"; +import * as _124 from "./govplus/tx"; +import * as _125 from "./indexer/events/events"; +import * as _126 from "./indexer/indexer_manager/event"; +import * as _127 from "./indexer/off_chain_updates/off_chain_updates"; +import * as _128 from "./indexer/protocol/v1/clob"; +import * as _129 from "./indexer/protocol/v1/perpetual"; +import * as _130 from "./indexer/protocol/v1/subaccount"; +import * as _131 from "./indexer/redis/redis_order"; +import * as _132 from "./indexer/shared/removal_reason"; +import * as _133 from "./indexer/socks/messages"; +import * as _134 from "./listing/genesis"; +import * as _135 from "./listing/params"; +import * as _136 from "./listing/query"; +import * as _137 from "./listing/tx"; +import * as _138 from "./perpetuals/genesis"; +import * as _139 from "./perpetuals/params"; +import * as _140 from "./perpetuals/perpetual"; +import * as _141 from "./perpetuals/query"; +import * as _142 from "./perpetuals/tx"; +import * as _143 from "./prices/genesis"; +import * as _144 from "./prices/market_param"; +import * as _145 from "./prices/market_price"; +import * as _146 from "./prices/query"; +import * as _147 from "./prices/tx"; +import * as _148 from "./ratelimit/capacity"; +import * as _149 from "./ratelimit/genesis"; +import * as _150 from "./ratelimit/limit_params"; +import * as _151 from "./ratelimit/pending_send_packet"; +import * as _152 from "./ratelimit/query"; +import * as _153 from "./ratelimit/tx"; +import * as _154 from "./revshare/genesis"; +import * as _155 from "./revshare/params"; +import * as _156 from "./revshare/query"; +import * as _157 from "./revshare/revshare"; +import * as _158 from "./revshare/tx"; +import * as _159 from "./rewards/genesis"; +import * as _160 from "./rewards/params"; +import * as _161 from "./rewards/query"; +import * as _162 from "./rewards/reward_share"; +import * as _163 from "./rewards/tx"; +import * as _164 from "./sending/genesis"; +import * as _165 from "./sending/query"; +import * as _166 from "./sending/transfer"; +import * as _167 from "./sending/tx"; +import * as _168 from "./stats/genesis"; +import * as _169 from "./stats/params"; +import * as _170 from "./stats/query"; +import * as _171 from "./stats/stats"; +import * as _172 from "./stats/tx"; +import * as _173 from "./subaccounts/asset_position"; +import * as _174 from "./subaccounts/genesis"; +import * as _175 from "./subaccounts/perpetual_position"; +import * as _176 from "./subaccounts/query"; +import * as _177 from "./subaccounts/streaming"; +import * as _178 from "./subaccounts/subaccount"; +import * as _179 from "./vault/genesis"; +import * as _180 from "./vault/params"; +import * as _181 from "./vault/query"; +import * as _182 from "./vault/share"; +import * as _183 from "./vault/tx"; +import * as _184 from "./vault/vault"; +import * as _185 from "./vest/genesis"; +import * as _186 from "./vest/query"; +import * as _187 from "./vest/tx"; +import * as _188 from "./vest/vest_entry"; +import * as _303 from "./affiliates/tx.amino"; +import * as _304 from "./blocktime/tx.amino"; +import * as _305 from "./bridge/tx.amino"; +import * as _306 from "./clob/tx.amino"; +import * as _307 from "./delaymsg/tx.amino"; +import * as _308 from "./feetiers/tx.amino"; +import * as _309 from "./govplus/tx.amino"; +import * as _310 from "./listing/tx.amino"; +import * as _311 from "./perpetuals/tx.amino"; +import * as _312 from "./prices/tx.amino"; +import * as _313 from "./ratelimit/tx.amino"; +import * as _314 from "./revshare/tx.amino"; +import * as _315 from "./rewards/tx.amino"; +import * as _316 from "./sending/tx.amino"; +import * as _317 from "./stats/tx.amino"; +import * as _318 from "./vault/tx.amino"; +import * as _319 from "./vest/tx.amino"; +import * as _320 from "./affiliates/tx.registry"; +import * as _321 from "./blocktime/tx.registry"; +import * as _322 from "./bridge/tx.registry"; +import * as _323 from "./clob/tx.registry"; +import * as _324 from "./delaymsg/tx.registry"; +import * as _325 from "./feetiers/tx.registry"; +import * as _326 from "./govplus/tx.registry"; +import * as _327 from "./listing/tx.registry"; +import * as _328 from "./perpetuals/tx.registry"; +import * as _329 from "./prices/tx.registry"; +import * as _330 from "./ratelimit/tx.registry"; +import * as _331 from "./revshare/tx.registry"; +import * as _332 from "./rewards/tx.registry"; +import * as _333 from "./sending/tx.registry"; +import * as _334 from "./stats/tx.registry"; +import * as _335 from "./vault/tx.registry"; +import * as _336 from "./vest/tx.registry"; +import * as _337 from "./affiliates/query.rpc.Query"; +import * as _338 from "./assets/query.rpc.Query"; +import * as _339 from "./blocktime/query.rpc.Query"; +import * as _340 from "./bridge/query.rpc.Query"; +import * as _341 from "./clob/query.rpc.Query"; +import * as _342 from "./delaymsg/query.rpc.Query"; +import * as _343 from "./epochs/query.rpc.Query"; +import * as _344 from "./feetiers/query.rpc.Query"; +import * as _345 from "./govplus/query.rpc.Query"; +import * as _346 from "./listing/query.rpc.Query"; +import * as _347 from "./perpetuals/query.rpc.Query"; +import * as _348 from "./prices/query.rpc.Query"; +import * as _349 from "./ratelimit/query.rpc.Query"; +import * as _350 from "./revshare/query.rpc.Query"; +import * as _351 from "./rewards/query.rpc.Query"; +import * as _352 from "./sending/query.rpc.Query"; +import * as _353 from "./stats/query.rpc.Query"; +import * as _354 from "./subaccounts/query.rpc.Query"; +import * as _355 from "./vault/query.rpc.Query"; +import * as _356 from "./vest/query.rpc.Query"; +import * as _357 from "./affiliates/tx.rpc.msg"; +import * as _358 from "./blocktime/tx.rpc.msg"; +import * as _359 from "./bridge/tx.rpc.msg"; +import * as _360 from "./clob/tx.rpc.msg"; +import * as _361 from "./delaymsg/tx.rpc.msg"; +import * as _362 from "./feetiers/tx.rpc.msg"; +import * as _363 from "./govplus/tx.rpc.msg"; +import * as _364 from "./listing/tx.rpc.msg"; +import * as _365 from "./perpetuals/tx.rpc.msg"; +import * as _366 from "./prices/tx.rpc.msg"; +import * as _367 from "./ratelimit/tx.rpc.msg"; +import * as _368 from "./revshare/tx.rpc.msg"; +import * as _369 from "./rewards/tx.rpc.msg"; +import * as _370 from "./sending/tx.rpc.msg"; +import * as _371 from "./stats/tx.rpc.msg"; +import * as _372 from "./vault/tx.rpc.msg"; +import * as _373 from "./vest/tx.rpc.msg"; +import * as _411 from "./rpc.query"; +import * as _412 from "./rpc.tx"; +export namespace dydxprotocol { + export const accountplus = { + ..._72, + ..._73 + }; + export const affiliates = { + ..._74, + ..._75, + ..._76, + ..._77, + ..._303, + ..._320, + ..._337, + ..._357 + }; + export const assets = { + ..._78, + ..._79, + ..._80, + ..._81, + ..._338 + }; + export const blocktime = { + ..._82, + ..._83, + ..._84, + ..._85, + ..._86, + ..._304, + ..._321, + ..._339, + ..._358 + }; + export const bridge = { + ..._87, + ..._88, + ..._89, + ..._90, + ..._91, + ..._92, + ..._305, + ..._322, + ..._340, + ..._359 + }; + export const clob = { + ..._93, + ..._94, + ..._95, + ..._96, + ..._97, + ..._98, + ..._99, + ..._100, + ..._101, + ..._102, + ..._103, + ..._104, + ..._105, + ..._106, + ..._306, + ..._323, + ..._341, + ..._360 + }; + export namespace daemons { + export const bridge = { + ..._107 + }; + export const liquidation = { + ..._108 + }; + export const pricefeed = { + ..._109 + }; + } + export const delaymsg = { + ..._110, + ..._111, + ..._112, + ..._113, + ..._114, + ..._307, + ..._324, + ..._342, + ..._361 + }; + export const epochs = { + ..._115, + ..._116, + ..._117, + ..._343 + }; + export const feetiers = { + ..._118, + ..._119, + ..._120, + ..._121, + ..._308, + ..._325, + ..._344, + ..._362 + }; + export const govplus = { + ..._122, + ..._123, + ..._124, + ..._309, + ..._326, + ..._345, + ..._363 + }; + export namespace indexer { + export const events = { + ..._125 + }; + export const indexer_manager = { + ..._126 + }; + export const off_chain_updates = { + ..._127 + }; + export namespace protocol { + export const v1 = { + ..._128, + ..._129, + ..._130 + }; + } + export const redis = { + ..._131 + }; + export const shared = { + ..._132 + }; + export const socks = { + ..._133 + }; + } + export const listing = { + ..._134, + ..._135, + ..._136, + ..._137, + ..._310, + ..._327, + ..._346, + ..._364 + }; + export const perpetuals = { + ..._138, + ..._139, + ..._140, + ..._141, + ..._142, + ..._311, + ..._328, + ..._347, + ..._365 + }; + export const prices = { + ..._143, + ..._144, + ..._145, + ..._146, + ..._147, + ..._312, + ..._329, + ..._348, + ..._366 + }; + export const ratelimit = { + ..._148, + ..._149, + ..._150, + ..._151, + ..._152, + ..._153, + ..._313, + ..._330, + ..._349, + ..._367 + }; + export const revshare = { + ..._154, + ..._155, + ..._156, + ..._157, + ..._158, + ..._314, + ..._331, + ..._350, + ..._368 + }; + export const rewards = { + ..._159, + ..._160, + ..._161, + ..._162, + ..._163, + ..._315, + ..._332, + ..._351, + ..._369 + }; + export const sending = { + ..._164, + ..._165, + ..._166, + ..._167, + ..._316, + ..._333, + ..._352, + ..._370 + }; + export const stats = { + ..._168, + ..._169, + ..._170, + ..._171, + ..._172, + ..._317, + ..._334, + ..._353, + ..._371 + }; + export const subaccounts = { + ..._173, + ..._174, + ..._175, + ..._176, + ..._177, + ..._178, + ..._354 + }; + export const vault = { + ..._179, + ..._180, + ..._181, + ..._182, + ..._183, + ..._184, + ..._318, + ..._335, + ..._355, + ..._372 + }; + export const vest = { + ..._185, + ..._186, + ..._187, + ..._188, + ..._319, + ..._336, + ..._356, + ..._373 + }; + export const ClientFactory = { + ..._411, + ..._412 + }; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/client.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/client.ts new file mode 100644 index 00000000..32b6ff4b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/client.ts @@ -0,0 +1,94 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as dydxprotocolAffiliatesTxRegistry from "./affiliates/tx.registry"; +import * as dydxprotocolBlocktimeTxRegistry from "./blocktime/tx.registry"; +import * as dydxprotocolBridgeTxRegistry from "./bridge/tx.registry"; +import * as dydxprotocolClobTxRegistry from "./clob/tx.registry"; +import * as dydxprotocolDelaymsgTxRegistry from "./delaymsg/tx.registry"; +import * as dydxprotocolFeetiersTxRegistry from "./feetiers/tx.registry"; +import * as dydxprotocolGovplusTxRegistry from "./govplus/tx.registry"; +import * as dydxprotocolListingTxRegistry from "./listing/tx.registry"; +import * as dydxprotocolPerpetualsTxRegistry from "./perpetuals/tx.registry"; +import * as dydxprotocolPricesTxRegistry from "./prices/tx.registry"; +import * as dydxprotocolRatelimitTxRegistry from "./ratelimit/tx.registry"; +import * as dydxprotocolRevshareTxRegistry from "./revshare/tx.registry"; +import * as dydxprotocolRewardsTxRegistry from "./rewards/tx.registry"; +import * as dydxprotocolSendingTxRegistry from "./sending/tx.registry"; +import * as dydxprotocolStatsTxRegistry from "./stats/tx.registry"; +import * as dydxprotocolVaultTxRegistry from "./vault/tx.registry"; +import * as dydxprotocolVestTxRegistry from "./vest/tx.registry"; +import * as dydxprotocolAffiliatesTxAmino from "./affiliates/tx.amino"; +import * as dydxprotocolBlocktimeTxAmino from "./blocktime/tx.amino"; +import * as dydxprotocolBridgeTxAmino from "./bridge/tx.amino"; +import * as dydxprotocolClobTxAmino from "./clob/tx.amino"; +import * as dydxprotocolDelaymsgTxAmino from "./delaymsg/tx.amino"; +import * as dydxprotocolFeetiersTxAmino from "./feetiers/tx.amino"; +import * as dydxprotocolGovplusTxAmino from "./govplus/tx.amino"; +import * as dydxprotocolListingTxAmino from "./listing/tx.amino"; +import * as dydxprotocolPerpetualsTxAmino from "./perpetuals/tx.amino"; +import * as dydxprotocolPricesTxAmino from "./prices/tx.amino"; +import * as dydxprotocolRatelimitTxAmino from "./ratelimit/tx.amino"; +import * as dydxprotocolRevshareTxAmino from "./revshare/tx.amino"; +import * as dydxprotocolRewardsTxAmino from "./rewards/tx.amino"; +import * as dydxprotocolSendingTxAmino from "./sending/tx.amino"; +import * as dydxprotocolStatsTxAmino from "./stats/tx.amino"; +import * as dydxprotocolVaultTxAmino from "./vault/tx.amino"; +import * as dydxprotocolVestTxAmino from "./vest/tx.amino"; +export const dydxprotocolAminoConverters = { + ...dydxprotocolAffiliatesTxAmino.AminoConverter, + ...dydxprotocolBlocktimeTxAmino.AminoConverter, + ...dydxprotocolBridgeTxAmino.AminoConverter, + ...dydxprotocolClobTxAmino.AminoConverter, + ...dydxprotocolDelaymsgTxAmino.AminoConverter, + ...dydxprotocolFeetiersTxAmino.AminoConverter, + ...dydxprotocolGovplusTxAmino.AminoConverter, + ...dydxprotocolListingTxAmino.AminoConverter, + ...dydxprotocolPerpetualsTxAmino.AminoConverter, + ...dydxprotocolPricesTxAmino.AminoConverter, + ...dydxprotocolRatelimitTxAmino.AminoConverter, + ...dydxprotocolRevshareTxAmino.AminoConverter, + ...dydxprotocolRewardsTxAmino.AminoConverter, + ...dydxprotocolSendingTxAmino.AminoConverter, + ...dydxprotocolStatsTxAmino.AminoConverter, + ...dydxprotocolVaultTxAmino.AminoConverter, + ...dydxprotocolVestTxAmino.AminoConverter +}; +export const dydxprotocolProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...dydxprotocolAffiliatesTxRegistry.registry, ...dydxprotocolBlocktimeTxRegistry.registry, ...dydxprotocolBridgeTxRegistry.registry, ...dydxprotocolClobTxRegistry.registry, ...dydxprotocolDelaymsgTxRegistry.registry, ...dydxprotocolFeetiersTxRegistry.registry, ...dydxprotocolGovplusTxRegistry.registry, ...dydxprotocolListingTxRegistry.registry, ...dydxprotocolPerpetualsTxRegistry.registry, ...dydxprotocolPricesTxRegistry.registry, ...dydxprotocolRatelimitTxRegistry.registry, ...dydxprotocolRevshareTxRegistry.registry, ...dydxprotocolRewardsTxRegistry.registry, ...dydxprotocolSendingTxRegistry.registry, ...dydxprotocolStatsTxRegistry.registry, ...dydxprotocolVaultTxRegistry.registry, ...dydxprotocolVestTxRegistry.registry]; +export const getSigningDydxprotocolClientOptions = ({ + defaultTypes = defaultRegistryTypes +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...dydxprotocolProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...dydxprotocolAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningDydxprotocolClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningDydxprotocolClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/block_rate_limit_config.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/block_rate_limit_config.ts new file mode 100644 index 00000000..671e4177 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/block_rate_limit_config.ts @@ -0,0 +1,294 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Defines the block rate limits for CLOB specific operations. */ +export interface BlockRateLimitConfiguration { + /** + * How many short term order attempts (successful and failed) are allowed for + * an account per N blocks. Note that the rate limits are applied + * in an AND fashion such that an order placement must pass all rate limit + * configurations. + * + * Specifying 0 values disables this rate limit. + * Deprecated in favor of `max_short_term_orders_and_cancels_per_n_blocks` + * for v5.x onwards. + */ + /** @deprecated */ + maxShortTermOrdersPerNBlocks: MaxPerNBlocksRateLimit[]; + /** + * How many stateful order attempts (successful and failed) are allowed for + * an account per N blocks. Note that the rate limits are applied + * in an AND fashion such that an order placement must pass all rate limit + * configurations. + * + * Specifying 0 values disables this rate limit. + */ + maxStatefulOrdersPerNBlocks: MaxPerNBlocksRateLimit[]; + /** @deprecated */ + maxShortTermOrderCancellationsPerNBlocks: MaxPerNBlocksRateLimit[]; + maxShortTermOrdersAndCancelsPerNBlocks: MaxPerNBlocksRateLimit[]; +} +export interface BlockRateLimitConfigurationProtoMsg { + typeUrl: "/dydxprotocol.clob.BlockRateLimitConfiguration"; + value: Uint8Array; +} +/** Defines the block rate limits for CLOB specific operations. */ +export interface BlockRateLimitConfigurationAmino { + /** + * How many short term order attempts (successful and failed) are allowed for + * an account per N blocks. Note that the rate limits are applied + * in an AND fashion such that an order placement must pass all rate limit + * configurations. + * + * Specifying 0 values disables this rate limit. + * Deprecated in favor of `max_short_term_orders_and_cancels_per_n_blocks` + * for v5.x onwards. + */ + /** @deprecated */ + max_short_term_orders_per_n_blocks?: MaxPerNBlocksRateLimitAmino[]; + /** + * How many stateful order attempts (successful and failed) are allowed for + * an account per N blocks. Note that the rate limits are applied + * in an AND fashion such that an order placement must pass all rate limit + * configurations. + * + * Specifying 0 values disables this rate limit. + */ + max_stateful_orders_per_n_blocks?: MaxPerNBlocksRateLimitAmino[]; + /** @deprecated */ + max_short_term_order_cancellations_per_n_blocks?: MaxPerNBlocksRateLimitAmino[]; + max_short_term_orders_and_cancels_per_n_blocks?: MaxPerNBlocksRateLimitAmino[]; +} +export interface BlockRateLimitConfigurationAminoMsg { + type: "/dydxprotocol.clob.BlockRateLimitConfiguration"; + value: BlockRateLimitConfigurationAmino; +} +/** Defines the block rate limits for CLOB specific operations. */ +export interface BlockRateLimitConfigurationSDKType { + /** @deprecated */ + max_short_term_orders_per_n_blocks: MaxPerNBlocksRateLimitSDKType[]; + max_stateful_orders_per_n_blocks: MaxPerNBlocksRateLimitSDKType[]; + /** @deprecated */ + max_short_term_order_cancellations_per_n_blocks: MaxPerNBlocksRateLimitSDKType[]; + max_short_term_orders_and_cancels_per_n_blocks: MaxPerNBlocksRateLimitSDKType[]; +} +/** Defines a rate limit over a specific number of blocks. */ +export interface MaxPerNBlocksRateLimit { + /** + * How many blocks the rate limit is over. + * Specifying 0 is invalid. + */ + numBlocks: number; + /** + * What the limit is for `num_blocks`. + * Specifying 0 is invalid. + */ + limit: number; +} +export interface MaxPerNBlocksRateLimitProtoMsg { + typeUrl: "/dydxprotocol.clob.MaxPerNBlocksRateLimit"; + value: Uint8Array; +} +/** Defines a rate limit over a specific number of blocks. */ +export interface MaxPerNBlocksRateLimitAmino { + /** + * How many blocks the rate limit is over. + * Specifying 0 is invalid. + */ + num_blocks?: number; + /** + * What the limit is for `num_blocks`. + * Specifying 0 is invalid. + */ + limit?: number; +} +export interface MaxPerNBlocksRateLimitAminoMsg { + type: "/dydxprotocol.clob.MaxPerNBlocksRateLimit"; + value: MaxPerNBlocksRateLimitAmino; +} +/** Defines a rate limit over a specific number of blocks. */ +export interface MaxPerNBlocksRateLimitSDKType { + num_blocks: number; + limit: number; +} +function createBaseBlockRateLimitConfiguration(): BlockRateLimitConfiguration { + return { + maxShortTermOrdersPerNBlocks: [], + maxStatefulOrdersPerNBlocks: [], + maxShortTermOrderCancellationsPerNBlocks: [], + maxShortTermOrdersAndCancelsPerNBlocks: [] + }; +} +export const BlockRateLimitConfiguration = { + typeUrl: "/dydxprotocol.clob.BlockRateLimitConfiguration", + encode(message: BlockRateLimitConfiguration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.maxShortTermOrdersPerNBlocks) { + MaxPerNBlocksRateLimit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.maxStatefulOrdersPerNBlocks) { + MaxPerNBlocksRateLimit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.maxShortTermOrderCancellationsPerNBlocks) { + MaxPerNBlocksRateLimit.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.maxShortTermOrdersAndCancelsPerNBlocks) { + MaxPerNBlocksRateLimit.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockRateLimitConfiguration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockRateLimitConfiguration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxShortTermOrdersPerNBlocks.push(MaxPerNBlocksRateLimit.decode(reader, reader.uint32())); + break; + case 2: + message.maxStatefulOrdersPerNBlocks.push(MaxPerNBlocksRateLimit.decode(reader, reader.uint32())); + break; + case 3: + message.maxShortTermOrderCancellationsPerNBlocks.push(MaxPerNBlocksRateLimit.decode(reader, reader.uint32())); + break; + case 4: + message.maxShortTermOrdersAndCancelsPerNBlocks.push(MaxPerNBlocksRateLimit.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockRateLimitConfiguration { + const message = createBaseBlockRateLimitConfiguration(); + message.maxShortTermOrdersPerNBlocks = object.maxShortTermOrdersPerNBlocks?.map(e => MaxPerNBlocksRateLimit.fromPartial(e)) || []; + message.maxStatefulOrdersPerNBlocks = object.maxStatefulOrdersPerNBlocks?.map(e => MaxPerNBlocksRateLimit.fromPartial(e)) || []; + message.maxShortTermOrderCancellationsPerNBlocks = object.maxShortTermOrderCancellationsPerNBlocks?.map(e => MaxPerNBlocksRateLimit.fromPartial(e)) || []; + message.maxShortTermOrdersAndCancelsPerNBlocks = object.maxShortTermOrdersAndCancelsPerNBlocks?.map(e => MaxPerNBlocksRateLimit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BlockRateLimitConfigurationAmino): BlockRateLimitConfiguration { + const message = createBaseBlockRateLimitConfiguration(); + message.maxShortTermOrdersPerNBlocks = object.max_short_term_orders_per_n_blocks?.map(e => MaxPerNBlocksRateLimit.fromAmino(e)) || []; + message.maxStatefulOrdersPerNBlocks = object.max_stateful_orders_per_n_blocks?.map(e => MaxPerNBlocksRateLimit.fromAmino(e)) || []; + message.maxShortTermOrderCancellationsPerNBlocks = object.max_short_term_order_cancellations_per_n_blocks?.map(e => MaxPerNBlocksRateLimit.fromAmino(e)) || []; + message.maxShortTermOrdersAndCancelsPerNBlocks = object.max_short_term_orders_and_cancels_per_n_blocks?.map(e => MaxPerNBlocksRateLimit.fromAmino(e)) || []; + return message; + }, + toAmino(message: BlockRateLimitConfiguration): BlockRateLimitConfigurationAmino { + const obj: any = {}; + if (message.maxShortTermOrdersPerNBlocks) { + obj.max_short_term_orders_per_n_blocks = message.maxShortTermOrdersPerNBlocks.map(e => e ? MaxPerNBlocksRateLimit.toAmino(e) : undefined); + } else { + obj.max_short_term_orders_per_n_blocks = message.maxShortTermOrdersPerNBlocks; + } + if (message.maxStatefulOrdersPerNBlocks) { + obj.max_stateful_orders_per_n_blocks = message.maxStatefulOrdersPerNBlocks.map(e => e ? MaxPerNBlocksRateLimit.toAmino(e) : undefined); + } else { + obj.max_stateful_orders_per_n_blocks = message.maxStatefulOrdersPerNBlocks; + } + if (message.maxShortTermOrderCancellationsPerNBlocks) { + obj.max_short_term_order_cancellations_per_n_blocks = message.maxShortTermOrderCancellationsPerNBlocks.map(e => e ? MaxPerNBlocksRateLimit.toAmino(e) : undefined); + } else { + obj.max_short_term_order_cancellations_per_n_blocks = message.maxShortTermOrderCancellationsPerNBlocks; + } + if (message.maxShortTermOrdersAndCancelsPerNBlocks) { + obj.max_short_term_orders_and_cancels_per_n_blocks = message.maxShortTermOrdersAndCancelsPerNBlocks.map(e => e ? MaxPerNBlocksRateLimit.toAmino(e) : undefined); + } else { + obj.max_short_term_orders_and_cancels_per_n_blocks = message.maxShortTermOrdersAndCancelsPerNBlocks; + } + return obj; + }, + fromAminoMsg(object: BlockRateLimitConfigurationAminoMsg): BlockRateLimitConfiguration { + return BlockRateLimitConfiguration.fromAmino(object.value); + }, + fromProtoMsg(message: BlockRateLimitConfigurationProtoMsg): BlockRateLimitConfiguration { + return BlockRateLimitConfiguration.decode(message.value); + }, + toProto(message: BlockRateLimitConfiguration): Uint8Array { + return BlockRateLimitConfiguration.encode(message).finish(); + }, + toProtoMsg(message: BlockRateLimitConfiguration): BlockRateLimitConfigurationProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.BlockRateLimitConfiguration", + value: BlockRateLimitConfiguration.encode(message).finish() + }; + } +}; +function createBaseMaxPerNBlocksRateLimit(): MaxPerNBlocksRateLimit { + return { + numBlocks: 0, + limit: 0 + }; +} +export const MaxPerNBlocksRateLimit = { + typeUrl: "/dydxprotocol.clob.MaxPerNBlocksRateLimit", + encode(message: MaxPerNBlocksRateLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.numBlocks !== 0) { + writer.uint32(8).uint32(message.numBlocks); + } + if (message.limit !== 0) { + writer.uint32(16).uint32(message.limit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MaxPerNBlocksRateLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMaxPerNBlocksRateLimit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numBlocks = reader.uint32(); + break; + case 2: + message.limit = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MaxPerNBlocksRateLimit { + const message = createBaseMaxPerNBlocksRateLimit(); + message.numBlocks = object.numBlocks ?? 0; + message.limit = object.limit ?? 0; + return message; + }, + fromAmino(object: MaxPerNBlocksRateLimitAmino): MaxPerNBlocksRateLimit { + const message = createBaseMaxPerNBlocksRateLimit(); + if (object.num_blocks !== undefined && object.num_blocks !== null) { + message.numBlocks = object.num_blocks; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit; + } + return message; + }, + toAmino(message: MaxPerNBlocksRateLimit): MaxPerNBlocksRateLimitAmino { + const obj: any = {}; + obj.num_blocks = message.numBlocks === 0 ? undefined : message.numBlocks; + obj.limit = message.limit === 0 ? undefined : message.limit; + return obj; + }, + fromAminoMsg(object: MaxPerNBlocksRateLimitAminoMsg): MaxPerNBlocksRateLimit { + return MaxPerNBlocksRateLimit.fromAmino(object.value); + }, + fromProtoMsg(message: MaxPerNBlocksRateLimitProtoMsg): MaxPerNBlocksRateLimit { + return MaxPerNBlocksRateLimit.decode(message.value); + }, + toProto(message: MaxPerNBlocksRateLimit): Uint8Array { + return MaxPerNBlocksRateLimit.encode(message).finish(); + }, + toProtoMsg(message: MaxPerNBlocksRateLimit): MaxPerNBlocksRateLimitProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MaxPerNBlocksRateLimit", + value: MaxPerNBlocksRateLimit.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/clob_pair.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/clob_pair.ts new file mode 100644 index 00000000..73b92c77 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/clob_pair.ts @@ -0,0 +1,513 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Status of the CLOB. */ +export enum ClobPair_Status { + /** STATUS_UNSPECIFIED - Default value. This value is invalid and unused. */ + STATUS_UNSPECIFIED = 0, + /** STATUS_ACTIVE - STATUS_ACTIVE represents an active clob pair. */ + STATUS_ACTIVE = 1, + /** + * STATUS_PAUSED - STATUS_PAUSED behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + STATUS_PAUSED = 2, + /** + * STATUS_CANCEL_ONLY - STATUS_CANCEL_ONLY behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + STATUS_CANCEL_ONLY = 3, + /** + * STATUS_POST_ONLY - STATUS_POST_ONLY behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + STATUS_POST_ONLY = 4, + /** + * STATUS_INITIALIZING - STATUS_INITIALIZING represents a newly-added clob pair. + * Clob pairs in this state only accept orders which are + * both short-term and post-only. + */ + STATUS_INITIALIZING = 5, + /** + * STATUS_FINAL_SETTLEMENT - STATUS_FINAL_SETTLEMENT represents a clob pair which is deactivated + * and trading has ceased. All open positions will be closed by the + * protocol. Open stateful orders will be cancelled. Open short-term + * orders will be left to expire. + */ + STATUS_FINAL_SETTLEMENT = 6, + UNRECOGNIZED = -1, +} +export const ClobPair_StatusSDKType = ClobPair_Status; +export const ClobPair_StatusAmino = ClobPair_Status; +export function clobPair_StatusFromJSON(object: any): ClobPair_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return ClobPair_Status.STATUS_UNSPECIFIED; + case 1: + case "STATUS_ACTIVE": + return ClobPair_Status.STATUS_ACTIVE; + case 2: + case "STATUS_PAUSED": + return ClobPair_Status.STATUS_PAUSED; + case 3: + case "STATUS_CANCEL_ONLY": + return ClobPair_Status.STATUS_CANCEL_ONLY; + case 4: + case "STATUS_POST_ONLY": + return ClobPair_Status.STATUS_POST_ONLY; + case 5: + case "STATUS_INITIALIZING": + return ClobPair_Status.STATUS_INITIALIZING; + case 6: + case "STATUS_FINAL_SETTLEMENT": + return ClobPair_Status.STATUS_FINAL_SETTLEMENT; + case -1: + case "UNRECOGNIZED": + default: + return ClobPair_Status.UNRECOGNIZED; + } +} +export function clobPair_StatusToJSON(object: ClobPair_Status): string { + switch (object) { + case ClobPair_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case ClobPair_Status.STATUS_ACTIVE: + return "STATUS_ACTIVE"; + case ClobPair_Status.STATUS_PAUSED: + return "STATUS_PAUSED"; + case ClobPair_Status.STATUS_CANCEL_ONLY: + return "STATUS_CANCEL_ONLY"; + case ClobPair_Status.STATUS_POST_ONLY: + return "STATUS_POST_ONLY"; + case ClobPair_Status.STATUS_INITIALIZING: + return "STATUS_INITIALIZING"; + case ClobPair_Status.STATUS_FINAL_SETTLEMENT: + return "STATUS_FINAL_SETTLEMENT"; + case ClobPair_Status.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * PerpetualClobMetadata contains metadata for a `ClobPair` + * representing a Perpetual product. + */ +export interface PerpetualClobMetadata { + /** Id of the Perpetual the CLOB allows trading of. */ + perpetualId: number; +} +export interface PerpetualClobMetadataProtoMsg { + typeUrl: "/dydxprotocol.clob.PerpetualClobMetadata"; + value: Uint8Array; +} +/** + * PerpetualClobMetadata contains metadata for a `ClobPair` + * representing a Perpetual product. + */ +export interface PerpetualClobMetadataAmino { + /** Id of the Perpetual the CLOB allows trading of. */ + perpetual_id?: number; +} +export interface PerpetualClobMetadataAminoMsg { + type: "dydxprotocol/clob/PerpetualClobMetadata"; + value: PerpetualClobMetadataAmino; +} +/** + * PerpetualClobMetadata contains metadata for a `ClobPair` + * representing a Perpetual product. + */ +export interface PerpetualClobMetadataSDKType { + perpetual_id: number; +} +/** + * PerpetualClobMetadata contains metadata for a `ClobPair` + * representing a Spot product. + */ +export interface SpotClobMetadata { + /** Id of the base Asset in the trading pair. */ + baseAssetId: number; + /** Id of the quote Asset in the trading pair. */ + quoteAssetId: number; +} +export interface SpotClobMetadataProtoMsg { + typeUrl: "/dydxprotocol.clob.SpotClobMetadata"; + value: Uint8Array; +} +/** + * PerpetualClobMetadata contains metadata for a `ClobPair` + * representing a Spot product. + */ +export interface SpotClobMetadataAmino { + /** Id of the base Asset in the trading pair. */ + base_asset_id?: number; + /** Id of the quote Asset in the trading pair. */ + quote_asset_id?: number; +} +export interface SpotClobMetadataAminoMsg { + type: "dydxprotocol/clob/SpotClobMetadata"; + value: SpotClobMetadataAmino; +} +/** + * PerpetualClobMetadata contains metadata for a `ClobPair` + * representing a Spot product. + */ +export interface SpotClobMetadataSDKType { + base_asset_id: number; + quote_asset_id: number; +} +/** + * ClobPair represents a single CLOB pair for a given product + * in state. + */ +export interface ClobPair { + /** ID of the orderbook that stores all resting liquidity for this CLOB. */ + id: number; + perpetualClobMetadata?: PerpetualClobMetadata; + spotClobMetadata?: SpotClobMetadata; + /** Minimum increment in the size of orders on the CLOB, in base quantums. */ + stepBaseQuantums: bigint; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + */ + subticksPerTick: number; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + */ + quantumConversionExponent: number; + status: ClobPair_Status; +} +export interface ClobPairProtoMsg { + typeUrl: "/dydxprotocol.clob.ClobPair"; + value: Uint8Array; +} +/** + * ClobPair represents a single CLOB pair for a given product + * in state. + */ +export interface ClobPairAmino { + /** ID of the orderbook that stores all resting liquidity for this CLOB. */ + id?: number; + perpetual_clob_metadata?: PerpetualClobMetadataAmino; + spot_clob_metadata?: SpotClobMetadataAmino; + /** Minimum increment in the size of orders on the CLOB, in base quantums. */ + step_base_quantums?: string; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + */ + subticks_per_tick?: number; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + */ + quantum_conversion_exponent?: number; + status?: ClobPair_Status; +} +export interface ClobPairAminoMsg { + type: "/dydxprotocol.clob.ClobPair"; + value: ClobPairAmino; +} +/** + * ClobPair represents a single CLOB pair for a given product + * in state. + */ +export interface ClobPairSDKType { + id: number; + perpetual_clob_metadata?: PerpetualClobMetadataSDKType; + spot_clob_metadata?: SpotClobMetadataSDKType; + step_base_quantums: bigint; + subticks_per_tick: number; + quantum_conversion_exponent: number; + status: ClobPair_Status; +} +function createBasePerpetualClobMetadata(): PerpetualClobMetadata { + return { + perpetualId: 0 + }; +} +export const PerpetualClobMetadata = { + typeUrl: "/dydxprotocol.clob.PerpetualClobMetadata", + encode(message: PerpetualClobMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualClobMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualClobMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualClobMetadata { + const message = createBasePerpetualClobMetadata(); + message.perpetualId = object.perpetualId ?? 0; + return message; + }, + fromAmino(object: PerpetualClobMetadataAmino): PerpetualClobMetadata { + const message = createBasePerpetualClobMetadata(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + return message; + }, + toAmino(message: PerpetualClobMetadata): PerpetualClobMetadataAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + return obj; + }, + fromAminoMsg(object: PerpetualClobMetadataAminoMsg): PerpetualClobMetadata { + return PerpetualClobMetadata.fromAmino(object.value); + }, + toAminoMsg(message: PerpetualClobMetadata): PerpetualClobMetadataAminoMsg { + return { + type: "dydxprotocol/clob/PerpetualClobMetadata", + value: PerpetualClobMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: PerpetualClobMetadataProtoMsg): PerpetualClobMetadata { + return PerpetualClobMetadata.decode(message.value); + }, + toProto(message: PerpetualClobMetadata): Uint8Array { + return PerpetualClobMetadata.encode(message).finish(); + }, + toProtoMsg(message: PerpetualClobMetadata): PerpetualClobMetadataProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.PerpetualClobMetadata", + value: PerpetualClobMetadata.encode(message).finish() + }; + } +}; +function createBaseSpotClobMetadata(): SpotClobMetadata { + return { + baseAssetId: 0, + quoteAssetId: 0 + }; +} +export const SpotClobMetadata = { + typeUrl: "/dydxprotocol.clob.SpotClobMetadata", + encode(message: SpotClobMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseAssetId !== 0) { + writer.uint32(8).uint32(message.baseAssetId); + } + if (message.quoteAssetId !== 0) { + writer.uint32(16).uint32(message.quoteAssetId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotClobMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotClobMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAssetId = reader.uint32(); + break; + case 2: + message.quoteAssetId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SpotClobMetadata { + const message = createBaseSpotClobMetadata(); + message.baseAssetId = object.baseAssetId ?? 0; + message.quoteAssetId = object.quoteAssetId ?? 0; + return message; + }, + fromAmino(object: SpotClobMetadataAmino): SpotClobMetadata { + const message = createBaseSpotClobMetadata(); + if (object.base_asset_id !== undefined && object.base_asset_id !== null) { + message.baseAssetId = object.base_asset_id; + } + if (object.quote_asset_id !== undefined && object.quote_asset_id !== null) { + message.quoteAssetId = object.quote_asset_id; + } + return message; + }, + toAmino(message: SpotClobMetadata): SpotClobMetadataAmino { + const obj: any = {}; + obj.base_asset_id = message.baseAssetId === 0 ? undefined : message.baseAssetId; + obj.quote_asset_id = message.quoteAssetId === 0 ? undefined : message.quoteAssetId; + return obj; + }, + fromAminoMsg(object: SpotClobMetadataAminoMsg): SpotClobMetadata { + return SpotClobMetadata.fromAmino(object.value); + }, + toAminoMsg(message: SpotClobMetadata): SpotClobMetadataAminoMsg { + return { + type: "dydxprotocol/clob/SpotClobMetadata", + value: SpotClobMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: SpotClobMetadataProtoMsg): SpotClobMetadata { + return SpotClobMetadata.decode(message.value); + }, + toProto(message: SpotClobMetadata): Uint8Array { + return SpotClobMetadata.encode(message).finish(); + }, + toProtoMsg(message: SpotClobMetadata): SpotClobMetadataProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.SpotClobMetadata", + value: SpotClobMetadata.encode(message).finish() + }; + } +}; +function createBaseClobPair(): ClobPair { + return { + id: 0, + perpetualClobMetadata: undefined, + spotClobMetadata: undefined, + stepBaseQuantums: BigInt(0), + subticksPerTick: 0, + quantumConversionExponent: 0, + status: 0 + }; +} +export const ClobPair = { + typeUrl: "/dydxprotocol.clob.ClobPair", + encode(message: ClobPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.perpetualClobMetadata !== undefined) { + PerpetualClobMetadata.encode(message.perpetualClobMetadata, writer.uint32(18).fork()).ldelim(); + } + if (message.spotClobMetadata !== undefined) { + SpotClobMetadata.encode(message.spotClobMetadata, writer.uint32(26).fork()).ldelim(); + } + if (message.stepBaseQuantums !== BigInt(0)) { + writer.uint32(32).uint64(message.stepBaseQuantums); + } + if (message.subticksPerTick !== 0) { + writer.uint32(40).uint32(message.subticksPerTick); + } + if (message.quantumConversionExponent !== 0) { + writer.uint32(48).sint32(message.quantumConversionExponent); + } + if (message.status !== 0) { + writer.uint32(56).int32(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClobPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClobPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.perpetualClobMetadata = PerpetualClobMetadata.decode(reader, reader.uint32()); + break; + case 3: + message.spotClobMetadata = SpotClobMetadata.decode(reader, reader.uint32()); + break; + case 4: + message.stepBaseQuantums = reader.uint64(); + break; + case 5: + message.subticksPerTick = reader.uint32(); + break; + case 6: + message.quantumConversionExponent = reader.sint32(); + break; + case 7: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClobPair { + const message = createBaseClobPair(); + message.id = object.id ?? 0; + message.perpetualClobMetadata = object.perpetualClobMetadata !== undefined && object.perpetualClobMetadata !== null ? PerpetualClobMetadata.fromPartial(object.perpetualClobMetadata) : undefined; + message.spotClobMetadata = object.spotClobMetadata !== undefined && object.spotClobMetadata !== null ? SpotClobMetadata.fromPartial(object.spotClobMetadata) : undefined; + message.stepBaseQuantums = object.stepBaseQuantums !== undefined && object.stepBaseQuantums !== null ? BigInt(object.stepBaseQuantums.toString()) : BigInt(0); + message.subticksPerTick = object.subticksPerTick ?? 0; + message.quantumConversionExponent = object.quantumConversionExponent ?? 0; + message.status = object.status ?? 0; + return message; + }, + fromAmino(object: ClobPairAmino): ClobPair { + const message = createBaseClobPair(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.perpetual_clob_metadata !== undefined && object.perpetual_clob_metadata !== null) { + message.perpetualClobMetadata = PerpetualClobMetadata.fromAmino(object.perpetual_clob_metadata); + } + if (object.spot_clob_metadata !== undefined && object.spot_clob_metadata !== null) { + message.spotClobMetadata = SpotClobMetadata.fromAmino(object.spot_clob_metadata); + } + if (object.step_base_quantums !== undefined && object.step_base_quantums !== null) { + message.stepBaseQuantums = BigInt(object.step_base_quantums); + } + if (object.subticks_per_tick !== undefined && object.subticks_per_tick !== null) { + message.subticksPerTick = object.subticks_per_tick; + } + if (object.quantum_conversion_exponent !== undefined && object.quantum_conversion_exponent !== null) { + message.quantumConversionExponent = object.quantum_conversion_exponent; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: ClobPair): ClobPairAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.perpetual_clob_metadata = message.perpetualClobMetadata ? PerpetualClobMetadata.toAmino(message.perpetualClobMetadata) : undefined; + obj.spot_clob_metadata = message.spotClobMetadata ? SpotClobMetadata.toAmino(message.spotClobMetadata) : undefined; + obj.step_base_quantums = message.stepBaseQuantums !== BigInt(0) ? message.stepBaseQuantums.toString() : undefined; + obj.subticks_per_tick = message.subticksPerTick === 0 ? undefined : message.subticksPerTick; + obj.quantum_conversion_exponent = message.quantumConversionExponent === 0 ? undefined : message.quantumConversionExponent; + obj.status = message.status === 0 ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: ClobPairAminoMsg): ClobPair { + return ClobPair.fromAmino(object.value); + }, + fromProtoMsg(message: ClobPairProtoMsg): ClobPair { + return ClobPair.decode(message.value); + }, + toProto(message: ClobPair): Uint8Array { + return ClobPair.encode(message).finish(); + }, + toProtoMsg(message: ClobPair): ClobPairProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.ClobPair", + value: ClobPair.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/equity_tier_limit_config.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/equity_tier_limit_config.ts new file mode 100644 index 00000000..918eb857 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/equity_tier_limit_config.ts @@ -0,0 +1,232 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * Defines the set of equity tiers to limit how many open orders + * a subaccount is allowed to have. + */ +export interface EquityTierLimitConfiguration { + /** + * How many short term stateful orders are allowed per equity tier. + * Specifying 0 values disables this limit. + */ + shortTermOrderEquityTiers: EquityTierLimit[]; + /** + * How many open stateful orders are allowed per equity tier. + * Specifying 0 values disables this limit. + */ + statefulOrderEquityTiers: EquityTierLimit[]; +} +export interface EquityTierLimitConfigurationProtoMsg { + typeUrl: "/dydxprotocol.clob.EquityTierLimitConfiguration"; + value: Uint8Array; +} +/** + * Defines the set of equity tiers to limit how many open orders + * a subaccount is allowed to have. + */ +export interface EquityTierLimitConfigurationAmino { + /** + * How many short term stateful orders are allowed per equity tier. + * Specifying 0 values disables this limit. + */ + short_term_order_equity_tiers?: EquityTierLimitAmino[]; + /** + * How many open stateful orders are allowed per equity tier. + * Specifying 0 values disables this limit. + */ + stateful_order_equity_tiers?: EquityTierLimitAmino[]; +} +export interface EquityTierLimitConfigurationAminoMsg { + type: "/dydxprotocol.clob.EquityTierLimitConfiguration"; + value: EquityTierLimitConfigurationAmino; +} +/** + * Defines the set of equity tiers to limit how many open orders + * a subaccount is allowed to have. + */ +export interface EquityTierLimitConfigurationSDKType { + short_term_order_equity_tiers: EquityTierLimitSDKType[]; + stateful_order_equity_tiers: EquityTierLimitSDKType[]; +} +/** Defines an equity tier limit. */ +export interface EquityTierLimit { + /** The total net collateral in USDC quote quantums of equity required. */ + usdTncRequired: Uint8Array; + /** What the limit is for `usd_tnc_required`. */ + limit: number; +} +export interface EquityTierLimitProtoMsg { + typeUrl: "/dydxprotocol.clob.EquityTierLimit"; + value: Uint8Array; +} +/** Defines an equity tier limit. */ +export interface EquityTierLimitAmino { + /** The total net collateral in USDC quote quantums of equity required. */ + usd_tnc_required?: string; + /** What the limit is for `usd_tnc_required`. */ + limit?: number; +} +export interface EquityTierLimitAminoMsg { + type: "/dydxprotocol.clob.EquityTierLimit"; + value: EquityTierLimitAmino; +} +/** Defines an equity tier limit. */ +export interface EquityTierLimitSDKType { + usd_tnc_required: Uint8Array; + limit: number; +} +function createBaseEquityTierLimitConfiguration(): EquityTierLimitConfiguration { + return { + shortTermOrderEquityTiers: [], + statefulOrderEquityTiers: [] + }; +} +export const EquityTierLimitConfiguration = { + typeUrl: "/dydxprotocol.clob.EquityTierLimitConfiguration", + encode(message: EquityTierLimitConfiguration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.shortTermOrderEquityTiers) { + EquityTierLimit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.statefulOrderEquityTiers) { + EquityTierLimit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EquityTierLimitConfiguration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEquityTierLimitConfiguration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shortTermOrderEquityTiers.push(EquityTierLimit.decode(reader, reader.uint32())); + break; + case 2: + message.statefulOrderEquityTiers.push(EquityTierLimit.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EquityTierLimitConfiguration { + const message = createBaseEquityTierLimitConfiguration(); + message.shortTermOrderEquityTiers = object.shortTermOrderEquityTiers?.map(e => EquityTierLimit.fromPartial(e)) || []; + message.statefulOrderEquityTiers = object.statefulOrderEquityTiers?.map(e => EquityTierLimit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EquityTierLimitConfigurationAmino): EquityTierLimitConfiguration { + const message = createBaseEquityTierLimitConfiguration(); + message.shortTermOrderEquityTiers = object.short_term_order_equity_tiers?.map(e => EquityTierLimit.fromAmino(e)) || []; + message.statefulOrderEquityTiers = object.stateful_order_equity_tiers?.map(e => EquityTierLimit.fromAmino(e)) || []; + return message; + }, + toAmino(message: EquityTierLimitConfiguration): EquityTierLimitConfigurationAmino { + const obj: any = {}; + if (message.shortTermOrderEquityTiers) { + obj.short_term_order_equity_tiers = message.shortTermOrderEquityTiers.map(e => e ? EquityTierLimit.toAmino(e) : undefined); + } else { + obj.short_term_order_equity_tiers = message.shortTermOrderEquityTiers; + } + if (message.statefulOrderEquityTiers) { + obj.stateful_order_equity_tiers = message.statefulOrderEquityTiers.map(e => e ? EquityTierLimit.toAmino(e) : undefined); + } else { + obj.stateful_order_equity_tiers = message.statefulOrderEquityTiers; + } + return obj; + }, + fromAminoMsg(object: EquityTierLimitConfigurationAminoMsg): EquityTierLimitConfiguration { + return EquityTierLimitConfiguration.fromAmino(object.value); + }, + fromProtoMsg(message: EquityTierLimitConfigurationProtoMsg): EquityTierLimitConfiguration { + return EquityTierLimitConfiguration.decode(message.value); + }, + toProto(message: EquityTierLimitConfiguration): Uint8Array { + return EquityTierLimitConfiguration.encode(message).finish(); + }, + toProtoMsg(message: EquityTierLimitConfiguration): EquityTierLimitConfigurationProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.EquityTierLimitConfiguration", + value: EquityTierLimitConfiguration.encode(message).finish() + }; + } +}; +function createBaseEquityTierLimit(): EquityTierLimit { + return { + usdTncRequired: new Uint8Array(), + limit: 0 + }; +} +export const EquityTierLimit = { + typeUrl: "/dydxprotocol.clob.EquityTierLimit", + encode(message: EquityTierLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.usdTncRequired.length !== 0) { + writer.uint32(10).bytes(message.usdTncRequired); + } + if (message.limit !== 0) { + writer.uint32(16).uint32(message.limit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EquityTierLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEquityTierLimit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.usdTncRequired = reader.bytes(); + break; + case 2: + message.limit = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EquityTierLimit { + const message = createBaseEquityTierLimit(); + message.usdTncRequired = object.usdTncRequired ?? new Uint8Array(); + message.limit = object.limit ?? 0; + return message; + }, + fromAmino(object: EquityTierLimitAmino): EquityTierLimit { + const message = createBaseEquityTierLimit(); + if (object.usd_tnc_required !== undefined && object.usd_tnc_required !== null) { + message.usdTncRequired = bytesFromBase64(object.usd_tnc_required); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit; + } + return message; + }, + toAmino(message: EquityTierLimit): EquityTierLimitAmino { + const obj: any = {}; + obj.usd_tnc_required = message.usdTncRequired ? base64FromBytes(message.usdTncRequired) : undefined; + obj.limit = message.limit === 0 ? undefined : message.limit; + return obj; + }, + fromAminoMsg(object: EquityTierLimitAminoMsg): EquityTierLimit { + return EquityTierLimit.fromAmino(object.value); + }, + fromProtoMsg(message: EquityTierLimitProtoMsg): EquityTierLimit { + return EquityTierLimit.decode(message.value); + }, + toProto(message: EquityTierLimit): Uint8Array { + return EquityTierLimit.encode(message).finish(); + }, + toProtoMsg(message: EquityTierLimit): EquityTierLimitProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.EquityTierLimit", + value: EquityTierLimit.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/genesis.ts new file mode 100644 index 00000000..c346866b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/genesis.ts @@ -0,0 +1,136 @@ +//@ts-nocheck +import { ClobPair, ClobPairAmino, ClobPairSDKType } from "./clob_pair"; +import { LiquidationsConfig, LiquidationsConfigAmino, LiquidationsConfigSDKType } from "./liquidations_config"; +import { BlockRateLimitConfiguration, BlockRateLimitConfigurationAmino, BlockRateLimitConfigurationSDKType } from "./block_rate_limit_config"; +import { EquityTierLimitConfiguration, EquityTierLimitConfigurationAmino, EquityTierLimitConfigurationSDKType } from "./equity_tier_limit_config"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the clob module's genesis state. */ +export interface GenesisState { + clobPairs: ClobPair[]; + liquidationsConfig: LiquidationsConfig; + blockRateLimitConfig: BlockRateLimitConfiguration; + equityTierLimitConfig: EquityTierLimitConfiguration; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.clob.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the clob module's genesis state. */ +export interface GenesisStateAmino { + clob_pairs?: ClobPairAmino[]; + liquidations_config?: LiquidationsConfigAmino; + block_rate_limit_config?: BlockRateLimitConfigurationAmino; + equity_tier_limit_config?: EquityTierLimitConfigurationAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.clob.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the clob module's genesis state. */ +export interface GenesisStateSDKType { + clob_pairs: ClobPairSDKType[]; + liquidations_config: LiquidationsConfigSDKType; + block_rate_limit_config: BlockRateLimitConfigurationSDKType; + equity_tier_limit_config: EquityTierLimitConfigurationSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + clobPairs: [], + liquidationsConfig: LiquidationsConfig.fromPartial({}), + blockRateLimitConfig: BlockRateLimitConfiguration.fromPartial({}), + equityTierLimitConfig: EquityTierLimitConfiguration.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.clob.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.clobPairs) { + ClobPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.liquidationsConfig !== undefined) { + LiquidationsConfig.encode(message.liquidationsConfig, writer.uint32(18).fork()).ldelim(); + } + if (message.blockRateLimitConfig !== undefined) { + BlockRateLimitConfiguration.encode(message.blockRateLimitConfig, writer.uint32(26).fork()).ldelim(); + } + if (message.equityTierLimitConfig !== undefined) { + EquityTierLimitConfiguration.encode(message.equityTierLimitConfig, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobPairs.push(ClobPair.decode(reader, reader.uint32())); + break; + case 2: + message.liquidationsConfig = LiquidationsConfig.decode(reader, reader.uint32()); + break; + case 3: + message.blockRateLimitConfig = BlockRateLimitConfiguration.decode(reader, reader.uint32()); + break; + case 4: + message.equityTierLimitConfig = EquityTierLimitConfiguration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.clobPairs = object.clobPairs?.map(e => ClobPair.fromPartial(e)) || []; + message.liquidationsConfig = object.liquidationsConfig !== undefined && object.liquidationsConfig !== null ? LiquidationsConfig.fromPartial(object.liquidationsConfig) : undefined; + message.blockRateLimitConfig = object.blockRateLimitConfig !== undefined && object.blockRateLimitConfig !== null ? BlockRateLimitConfiguration.fromPartial(object.blockRateLimitConfig) : undefined; + message.equityTierLimitConfig = object.equityTierLimitConfig !== undefined && object.equityTierLimitConfig !== null ? EquityTierLimitConfiguration.fromPartial(object.equityTierLimitConfig) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.clobPairs = object.clob_pairs?.map(e => ClobPair.fromAmino(e)) || []; + if (object.liquidations_config !== undefined && object.liquidations_config !== null) { + message.liquidationsConfig = LiquidationsConfig.fromAmino(object.liquidations_config); + } + if (object.block_rate_limit_config !== undefined && object.block_rate_limit_config !== null) { + message.blockRateLimitConfig = BlockRateLimitConfiguration.fromAmino(object.block_rate_limit_config); + } + if (object.equity_tier_limit_config !== undefined && object.equity_tier_limit_config !== null) { + message.equityTierLimitConfig = EquityTierLimitConfiguration.fromAmino(object.equity_tier_limit_config); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.clobPairs) { + obj.clob_pairs = message.clobPairs.map(e => e ? ClobPair.toAmino(e) : undefined); + } else { + obj.clob_pairs = message.clobPairs; + } + obj.liquidations_config = message.liquidationsConfig ? LiquidationsConfig.toAmino(message.liquidationsConfig) : undefined; + obj.block_rate_limit_config = message.blockRateLimitConfig ? BlockRateLimitConfiguration.toAmino(message.blockRateLimitConfig) : undefined; + obj.equity_tier_limit_config = message.equityTierLimitConfig ? EquityTierLimitConfiguration.toAmino(message.equityTierLimitConfig) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/liquidations.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/liquidations.ts new file mode 100644 index 00000000..db87bb50 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/liquidations.ts @@ -0,0 +1,411 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * PerpetualLiquidationInfo holds information about a liquidation that occurred + * for a position held by a subaccount. + * Note this proto is defined to make it easier to hash + * the metadata of a liquidation, and is never written to state. + */ +export interface PerpetualLiquidationInfo { + /** + * The id of the subaccount that got liquidated/deleveraged or was deleveraged + * onto. + */ + subaccountId: SubaccountId; + /** The id of the perpetual involved. */ + perpetualId: number; +} +export interface PerpetualLiquidationInfoProtoMsg { + typeUrl: "/dydxprotocol.clob.PerpetualLiquidationInfo"; + value: Uint8Array; +} +/** + * PerpetualLiquidationInfo holds information about a liquidation that occurred + * for a position held by a subaccount. + * Note this proto is defined to make it easier to hash + * the metadata of a liquidation, and is never written to state. + */ +export interface PerpetualLiquidationInfoAmino { + /** + * The id of the subaccount that got liquidated/deleveraged or was deleveraged + * onto. + */ + subaccount_id?: SubaccountIdAmino; + /** The id of the perpetual involved. */ + perpetual_id?: number; +} +export interface PerpetualLiquidationInfoAminoMsg { + type: "/dydxprotocol.clob.PerpetualLiquidationInfo"; + value: PerpetualLiquidationInfoAmino; +} +/** + * PerpetualLiquidationInfo holds information about a liquidation that occurred + * for a position held by a subaccount. + * Note this proto is defined to make it easier to hash + * the metadata of a liquidation, and is never written to state. + */ +export interface PerpetualLiquidationInfoSDKType { + subaccount_id: SubaccountIdSDKType; + perpetual_id: number; +} +/** + * SubaccountLiquidationInfo holds liquidation information per-subaccount in the + * current block. + */ +export interface SubaccountLiquidationInfo { + /** + * An unsorted list of unique perpetual IDs that the subaccount has previously + * liquidated. + */ + perpetualsLiquidated: number[]; + /** + * The notional value (in quote quantums, determined by the oracle price) of + * all positions liquidated for this subaccount. + */ + notionalLiquidated: bigint; + /** + * The amount of funds that the insurance fund has lost + * covering this subaccount. + */ + quantumsInsuranceLost: bigint; +} +export interface SubaccountLiquidationInfoProtoMsg { + typeUrl: "/dydxprotocol.clob.SubaccountLiquidationInfo"; + value: Uint8Array; +} +/** + * SubaccountLiquidationInfo holds liquidation information per-subaccount in the + * current block. + */ +export interface SubaccountLiquidationInfoAmino { + /** + * An unsorted list of unique perpetual IDs that the subaccount has previously + * liquidated. + */ + perpetuals_liquidated?: number[]; + /** + * The notional value (in quote quantums, determined by the oracle price) of + * all positions liquidated for this subaccount. + */ + notional_liquidated?: string; + /** + * The amount of funds that the insurance fund has lost + * covering this subaccount. + */ + quantums_insurance_lost?: string; +} +export interface SubaccountLiquidationInfoAminoMsg { + type: "/dydxprotocol.clob.SubaccountLiquidationInfo"; + value: SubaccountLiquidationInfoAmino; +} +/** + * SubaccountLiquidationInfo holds liquidation information per-subaccount in the + * current block. + */ +export interface SubaccountLiquidationInfoSDKType { + perpetuals_liquidated: number[]; + notional_liquidated: bigint; + quantums_insurance_lost: bigint; +} +/** + * SubaccountOpenPositionInfo holds information about open positions for a + * perpetual. + */ +export interface SubaccountOpenPositionInfo { + /** The id of the perpetual. */ + perpetualId: number; + subaccountsWithLongPosition: SubaccountId[]; + subaccountsWithShortPosition: SubaccountId[]; +} +export interface SubaccountOpenPositionInfoProtoMsg { + typeUrl: "/dydxprotocol.clob.SubaccountOpenPositionInfo"; + value: Uint8Array; +} +/** + * SubaccountOpenPositionInfo holds information about open positions for a + * perpetual. + */ +export interface SubaccountOpenPositionInfoAmino { + /** The id of the perpetual. */ + perpetual_id?: number; + subaccounts_with_long_position?: SubaccountIdAmino[]; + subaccounts_with_short_position?: SubaccountIdAmino[]; +} +export interface SubaccountOpenPositionInfoAminoMsg { + type: "/dydxprotocol.clob.SubaccountOpenPositionInfo"; + value: SubaccountOpenPositionInfoAmino; +} +/** + * SubaccountOpenPositionInfo holds information about open positions for a + * perpetual. + */ +export interface SubaccountOpenPositionInfoSDKType { + perpetual_id: number; + subaccounts_with_long_position: SubaccountIdSDKType[]; + subaccounts_with_short_position: SubaccountIdSDKType[]; +} +function createBasePerpetualLiquidationInfo(): PerpetualLiquidationInfo { + return { + subaccountId: SubaccountId.fromPartial({}), + perpetualId: 0 + }; +} +export const PerpetualLiquidationInfo = { + typeUrl: "/dydxprotocol.clob.PerpetualLiquidationInfo", + encode(message: PerpetualLiquidationInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.perpetualId !== 0) { + writer.uint32(16).uint32(message.perpetualId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualLiquidationInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualLiquidationInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.perpetualId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualLiquidationInfo { + const message = createBasePerpetualLiquidationInfo(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; + message.perpetualId = object.perpetualId ?? 0; + return message; + }, + fromAmino(object: PerpetualLiquidationInfoAmino): PerpetualLiquidationInfo { + const message = createBasePerpetualLiquidationInfo(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = SubaccountId.fromAmino(object.subaccount_id); + } + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + return message; + }, + toAmino(message: PerpetualLiquidationInfo): PerpetualLiquidationInfoAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? SubaccountId.toAmino(message.subaccountId) : undefined; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + return obj; + }, + fromAminoMsg(object: PerpetualLiquidationInfoAminoMsg): PerpetualLiquidationInfo { + return PerpetualLiquidationInfo.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualLiquidationInfoProtoMsg): PerpetualLiquidationInfo { + return PerpetualLiquidationInfo.decode(message.value); + }, + toProto(message: PerpetualLiquidationInfo): Uint8Array { + return PerpetualLiquidationInfo.encode(message).finish(); + }, + toProtoMsg(message: PerpetualLiquidationInfo): PerpetualLiquidationInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.PerpetualLiquidationInfo", + value: PerpetualLiquidationInfo.encode(message).finish() + }; + } +}; +function createBaseSubaccountLiquidationInfo(): SubaccountLiquidationInfo { + return { + perpetualsLiquidated: [], + notionalLiquidated: BigInt(0), + quantumsInsuranceLost: BigInt(0) + }; +} +export const SubaccountLiquidationInfo = { + typeUrl: "/dydxprotocol.clob.SubaccountLiquidationInfo", + encode(message: SubaccountLiquidationInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.perpetualsLiquidated) { + writer.uint32(v); + } + writer.ldelim(); + if (message.notionalLiquidated !== BigInt(0)) { + writer.uint32(16).uint64(message.notionalLiquidated); + } + if (message.quantumsInsuranceLost !== BigInt(0)) { + writer.uint32(24).uint64(message.quantumsInsuranceLost); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountLiquidationInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountLiquidationInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.perpetualsLiquidated.push(reader.uint32()); + } + } else { + message.perpetualsLiquidated.push(reader.uint32()); + } + break; + case 2: + message.notionalLiquidated = reader.uint64(); + break; + case 3: + message.quantumsInsuranceLost = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountLiquidationInfo { + const message = createBaseSubaccountLiquidationInfo(); + message.perpetualsLiquidated = object.perpetualsLiquidated?.map(e => e) || []; + message.notionalLiquidated = object.notionalLiquidated !== undefined && object.notionalLiquidated !== null ? BigInt(object.notionalLiquidated.toString()) : BigInt(0); + message.quantumsInsuranceLost = object.quantumsInsuranceLost !== undefined && object.quantumsInsuranceLost !== null ? BigInt(object.quantumsInsuranceLost.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SubaccountLiquidationInfoAmino): SubaccountLiquidationInfo { + const message = createBaseSubaccountLiquidationInfo(); + message.perpetualsLiquidated = object.perpetuals_liquidated?.map(e => e) || []; + if (object.notional_liquidated !== undefined && object.notional_liquidated !== null) { + message.notionalLiquidated = BigInt(object.notional_liquidated); + } + if (object.quantums_insurance_lost !== undefined && object.quantums_insurance_lost !== null) { + message.quantumsInsuranceLost = BigInt(object.quantums_insurance_lost); + } + return message; + }, + toAmino(message: SubaccountLiquidationInfo): SubaccountLiquidationInfoAmino { + const obj: any = {}; + if (message.perpetualsLiquidated) { + obj.perpetuals_liquidated = message.perpetualsLiquidated.map(e => e); + } else { + obj.perpetuals_liquidated = message.perpetualsLiquidated; + } + obj.notional_liquidated = message.notionalLiquidated !== BigInt(0) ? message.notionalLiquidated.toString() : undefined; + obj.quantums_insurance_lost = message.quantumsInsuranceLost !== BigInt(0) ? message.quantumsInsuranceLost.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountLiquidationInfoAminoMsg): SubaccountLiquidationInfo { + return SubaccountLiquidationInfo.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountLiquidationInfoProtoMsg): SubaccountLiquidationInfo { + return SubaccountLiquidationInfo.decode(message.value); + }, + toProto(message: SubaccountLiquidationInfo): Uint8Array { + return SubaccountLiquidationInfo.encode(message).finish(); + }, + toProtoMsg(message: SubaccountLiquidationInfo): SubaccountLiquidationInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.SubaccountLiquidationInfo", + value: SubaccountLiquidationInfo.encode(message).finish() + }; + } +}; +function createBaseSubaccountOpenPositionInfo(): SubaccountOpenPositionInfo { + return { + perpetualId: 0, + subaccountsWithLongPosition: [], + subaccountsWithShortPosition: [] + }; +} +export const SubaccountOpenPositionInfo = { + typeUrl: "/dydxprotocol.clob.SubaccountOpenPositionInfo", + encode(message: SubaccountOpenPositionInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + for (const v of message.subaccountsWithLongPosition) { + SubaccountId.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.subaccountsWithShortPosition) { + SubaccountId.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountOpenPositionInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOpenPositionInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.subaccountsWithLongPosition.push(SubaccountId.decode(reader, reader.uint32())); + break; + case 3: + message.subaccountsWithShortPosition.push(SubaccountId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountOpenPositionInfo { + const message = createBaseSubaccountOpenPositionInfo(); + message.perpetualId = object.perpetualId ?? 0; + message.subaccountsWithLongPosition = object.subaccountsWithLongPosition?.map(e => SubaccountId.fromPartial(e)) || []; + message.subaccountsWithShortPosition = object.subaccountsWithShortPosition?.map(e => SubaccountId.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SubaccountOpenPositionInfoAmino): SubaccountOpenPositionInfo { + const message = createBaseSubaccountOpenPositionInfo(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + message.subaccountsWithLongPosition = object.subaccounts_with_long_position?.map(e => SubaccountId.fromAmino(e)) || []; + message.subaccountsWithShortPosition = object.subaccounts_with_short_position?.map(e => SubaccountId.fromAmino(e)) || []; + return message; + }, + toAmino(message: SubaccountOpenPositionInfo): SubaccountOpenPositionInfoAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + if (message.subaccountsWithLongPosition) { + obj.subaccounts_with_long_position = message.subaccountsWithLongPosition.map(e => e ? SubaccountId.toAmino(e) : undefined); + } else { + obj.subaccounts_with_long_position = message.subaccountsWithLongPosition; + } + if (message.subaccountsWithShortPosition) { + obj.subaccounts_with_short_position = message.subaccountsWithShortPosition.map(e => e ? SubaccountId.toAmino(e) : undefined); + } else { + obj.subaccounts_with_short_position = message.subaccountsWithShortPosition; + } + return obj; + }, + fromAminoMsg(object: SubaccountOpenPositionInfoAminoMsg): SubaccountOpenPositionInfo { + return SubaccountOpenPositionInfo.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountOpenPositionInfoProtoMsg): SubaccountOpenPositionInfo { + return SubaccountOpenPositionInfo.decode(message.value); + }, + toProto(message: SubaccountOpenPositionInfo): Uint8Array { + return SubaccountOpenPositionInfo.encode(message).finish(); + }, + toProtoMsg(message: SubaccountOpenPositionInfo): SubaccountOpenPositionInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.SubaccountOpenPositionInfo", + value: SubaccountOpenPositionInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/liquidations_config.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/liquidations_config.ts new file mode 100644 index 00000000..61c0f590 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/liquidations_config.ts @@ -0,0 +1,530 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** LiquidationsConfig stores all configurable fields related to liquidations. */ +export interface LiquidationsConfig { + /** + * The maximum liquidation fee (in parts-per-million). This fee goes + * 100% to the insurance fund. + */ + maxLiquidationFeePpm: number; + /** + * Limits around how much of a single position can be liquidated + * within a single block. + */ + positionBlockLimits: PositionBlockLimits; + /** + * Limits around how many quote quantums from a single subaccount can + * be liquidated within a single block. + */ + subaccountBlockLimits: SubaccountBlockLimits; + /** + * Config about how the fillable-price spread from the oracle price + * increases based on the adjusted bankruptcy rating of the subaccount. + */ + fillablePriceConfig: FillablePriceConfig; +} +export interface LiquidationsConfigProtoMsg { + typeUrl: "/dydxprotocol.clob.LiquidationsConfig"; + value: Uint8Array; +} +/** LiquidationsConfig stores all configurable fields related to liquidations. */ +export interface LiquidationsConfigAmino { + /** + * The maximum liquidation fee (in parts-per-million). This fee goes + * 100% to the insurance fund. + */ + max_liquidation_fee_ppm?: number; + /** + * Limits around how much of a single position can be liquidated + * within a single block. + */ + position_block_limits?: PositionBlockLimitsAmino; + /** + * Limits around how many quote quantums from a single subaccount can + * be liquidated within a single block. + */ + subaccount_block_limits?: SubaccountBlockLimitsAmino; + /** + * Config about how the fillable-price spread from the oracle price + * increases based on the adjusted bankruptcy rating of the subaccount. + */ + fillable_price_config?: FillablePriceConfigAmino; +} +export interface LiquidationsConfigAminoMsg { + type: "/dydxprotocol.clob.LiquidationsConfig"; + value: LiquidationsConfigAmino; +} +/** LiquidationsConfig stores all configurable fields related to liquidations. */ +export interface LiquidationsConfigSDKType { + max_liquidation_fee_ppm: number; + position_block_limits: PositionBlockLimitsSDKType; + subaccount_block_limits: SubaccountBlockLimitsSDKType; + fillable_price_config: FillablePriceConfigSDKType; +} +/** + * PositionBlockLimits stores all configurable fields related to limits + * around how much of a single position can be liquidated within a single block. + */ +export interface PositionBlockLimits { + /** + * The minimum amount of quantums to liquidate for each message (in + * quote quantums). + * Overridden by the maximum size of the position. + */ + minPositionNotionalLiquidated: bigint; + /** + * The maximum portion of the position liquidated (in parts-per- + * million). Overridden by min_position_notional_liquidated. + */ + maxPositionPortionLiquidatedPpm: number; +} +export interface PositionBlockLimitsProtoMsg { + typeUrl: "/dydxprotocol.clob.PositionBlockLimits"; + value: Uint8Array; +} +/** + * PositionBlockLimits stores all configurable fields related to limits + * around how much of a single position can be liquidated within a single block. + */ +export interface PositionBlockLimitsAmino { + /** + * The minimum amount of quantums to liquidate for each message (in + * quote quantums). + * Overridden by the maximum size of the position. + */ + min_position_notional_liquidated?: string; + /** + * The maximum portion of the position liquidated (in parts-per- + * million). Overridden by min_position_notional_liquidated. + */ + max_position_portion_liquidated_ppm?: number; +} +export interface PositionBlockLimitsAminoMsg { + type: "/dydxprotocol.clob.PositionBlockLimits"; + value: PositionBlockLimitsAmino; +} +/** + * PositionBlockLimits stores all configurable fields related to limits + * around how much of a single position can be liquidated within a single block. + */ +export interface PositionBlockLimitsSDKType { + min_position_notional_liquidated: bigint; + max_position_portion_liquidated_ppm: number; +} +/** + * SubaccountBlockLimits stores all configurable fields related to limits + * around how many quote quantums from a single subaccount can + * be liquidated within a single block. + */ +export interface SubaccountBlockLimits { + /** + * The maximum notional amount that a single subaccount can have + * liquidated (in quote quantums) per block. + */ + maxNotionalLiquidated: bigint; + /** + * The maximum insurance-fund payout amount for a given subaccount + * per block. I.e. how much it can cover for that subaccount. + */ + maxQuantumsInsuranceLost: bigint; +} +export interface SubaccountBlockLimitsProtoMsg { + typeUrl: "/dydxprotocol.clob.SubaccountBlockLimits"; + value: Uint8Array; +} +/** + * SubaccountBlockLimits stores all configurable fields related to limits + * around how many quote quantums from a single subaccount can + * be liquidated within a single block. + */ +export interface SubaccountBlockLimitsAmino { + /** + * The maximum notional amount that a single subaccount can have + * liquidated (in quote quantums) per block. + */ + max_notional_liquidated?: string; + /** + * The maximum insurance-fund payout amount for a given subaccount + * per block. I.e. how much it can cover for that subaccount. + */ + max_quantums_insurance_lost?: string; +} +export interface SubaccountBlockLimitsAminoMsg { + type: "/dydxprotocol.clob.SubaccountBlockLimits"; + value: SubaccountBlockLimitsAmino; +} +/** + * SubaccountBlockLimits stores all configurable fields related to limits + * around how many quote quantums from a single subaccount can + * be liquidated within a single block. + */ +export interface SubaccountBlockLimitsSDKType { + max_notional_liquidated: bigint; + max_quantums_insurance_lost: bigint; +} +/** + * FillablePriceConfig stores all configurable fields related to calculating + * the fillable price for liquidating a position. + */ +export interface FillablePriceConfig { + /** The rate at which the Adjusted Bankruptcy Rating increases. */ + bankruptcyAdjustmentPpm: number; + /** + * The maximum value that the liquidation spread can take, as + * a ratio against the position's maintenance margin. + */ + spreadToMaintenanceMarginRatioPpm: number; +} +export interface FillablePriceConfigProtoMsg { + typeUrl: "/dydxprotocol.clob.FillablePriceConfig"; + value: Uint8Array; +} +/** + * FillablePriceConfig stores all configurable fields related to calculating + * the fillable price for liquidating a position. + */ +export interface FillablePriceConfigAmino { + /** The rate at which the Adjusted Bankruptcy Rating increases. */ + bankruptcy_adjustment_ppm?: number; + /** + * The maximum value that the liquidation spread can take, as + * a ratio against the position's maintenance margin. + */ + spread_to_maintenance_margin_ratio_ppm?: number; +} +export interface FillablePriceConfigAminoMsg { + type: "/dydxprotocol.clob.FillablePriceConfig"; + value: FillablePriceConfigAmino; +} +/** + * FillablePriceConfig stores all configurable fields related to calculating + * the fillable price for liquidating a position. + */ +export interface FillablePriceConfigSDKType { + bankruptcy_adjustment_ppm: number; + spread_to_maintenance_margin_ratio_ppm: number; +} +function createBaseLiquidationsConfig(): LiquidationsConfig { + return { + maxLiquidationFeePpm: 0, + positionBlockLimits: PositionBlockLimits.fromPartial({}), + subaccountBlockLimits: SubaccountBlockLimits.fromPartial({}), + fillablePriceConfig: FillablePriceConfig.fromPartial({}) + }; +} +export const LiquidationsConfig = { + typeUrl: "/dydxprotocol.clob.LiquidationsConfig", + encode(message: LiquidationsConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxLiquidationFeePpm !== 0) { + writer.uint32(8).uint32(message.maxLiquidationFeePpm); + } + if (message.positionBlockLimits !== undefined) { + PositionBlockLimits.encode(message.positionBlockLimits, writer.uint32(18).fork()).ldelim(); + } + if (message.subaccountBlockLimits !== undefined) { + SubaccountBlockLimits.encode(message.subaccountBlockLimits, writer.uint32(26).fork()).ldelim(); + } + if (message.fillablePriceConfig !== undefined) { + FillablePriceConfig.encode(message.fillablePriceConfig, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidationsConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidationsConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxLiquidationFeePpm = reader.uint32(); + break; + case 2: + message.positionBlockLimits = PositionBlockLimits.decode(reader, reader.uint32()); + break; + case 3: + message.subaccountBlockLimits = SubaccountBlockLimits.decode(reader, reader.uint32()); + break; + case 4: + message.fillablePriceConfig = FillablePriceConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidationsConfig { + const message = createBaseLiquidationsConfig(); + message.maxLiquidationFeePpm = object.maxLiquidationFeePpm ?? 0; + message.positionBlockLimits = object.positionBlockLimits !== undefined && object.positionBlockLimits !== null ? PositionBlockLimits.fromPartial(object.positionBlockLimits) : undefined; + message.subaccountBlockLimits = object.subaccountBlockLimits !== undefined && object.subaccountBlockLimits !== null ? SubaccountBlockLimits.fromPartial(object.subaccountBlockLimits) : undefined; + message.fillablePriceConfig = object.fillablePriceConfig !== undefined && object.fillablePriceConfig !== null ? FillablePriceConfig.fromPartial(object.fillablePriceConfig) : undefined; + return message; + }, + fromAmino(object: LiquidationsConfigAmino): LiquidationsConfig { + const message = createBaseLiquidationsConfig(); + if (object.max_liquidation_fee_ppm !== undefined && object.max_liquidation_fee_ppm !== null) { + message.maxLiquidationFeePpm = object.max_liquidation_fee_ppm; + } + if (object.position_block_limits !== undefined && object.position_block_limits !== null) { + message.positionBlockLimits = PositionBlockLimits.fromAmino(object.position_block_limits); + } + if (object.subaccount_block_limits !== undefined && object.subaccount_block_limits !== null) { + message.subaccountBlockLimits = SubaccountBlockLimits.fromAmino(object.subaccount_block_limits); + } + if (object.fillable_price_config !== undefined && object.fillable_price_config !== null) { + message.fillablePriceConfig = FillablePriceConfig.fromAmino(object.fillable_price_config); + } + return message; + }, + toAmino(message: LiquidationsConfig): LiquidationsConfigAmino { + const obj: any = {}; + obj.max_liquidation_fee_ppm = message.maxLiquidationFeePpm === 0 ? undefined : message.maxLiquidationFeePpm; + obj.position_block_limits = message.positionBlockLimits ? PositionBlockLimits.toAmino(message.positionBlockLimits) : undefined; + obj.subaccount_block_limits = message.subaccountBlockLimits ? SubaccountBlockLimits.toAmino(message.subaccountBlockLimits) : undefined; + obj.fillable_price_config = message.fillablePriceConfig ? FillablePriceConfig.toAmino(message.fillablePriceConfig) : undefined; + return obj; + }, + fromAminoMsg(object: LiquidationsConfigAminoMsg): LiquidationsConfig { + return LiquidationsConfig.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidationsConfigProtoMsg): LiquidationsConfig { + return LiquidationsConfig.decode(message.value); + }, + toProto(message: LiquidationsConfig): Uint8Array { + return LiquidationsConfig.encode(message).finish(); + }, + toProtoMsg(message: LiquidationsConfig): LiquidationsConfigProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.LiquidationsConfig", + value: LiquidationsConfig.encode(message).finish() + }; + } +}; +function createBasePositionBlockLimits(): PositionBlockLimits { + return { + minPositionNotionalLiquidated: BigInt(0), + maxPositionPortionLiquidatedPpm: 0 + }; +} +export const PositionBlockLimits = { + typeUrl: "/dydxprotocol.clob.PositionBlockLimits", + encode(message: PositionBlockLimits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.minPositionNotionalLiquidated !== BigInt(0)) { + writer.uint32(8).uint64(message.minPositionNotionalLiquidated); + } + if (message.maxPositionPortionLiquidatedPpm !== 0) { + writer.uint32(16).uint32(message.maxPositionPortionLiquidatedPpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PositionBlockLimits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionBlockLimits(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minPositionNotionalLiquidated = reader.uint64(); + break; + case 2: + message.maxPositionPortionLiquidatedPpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PositionBlockLimits { + const message = createBasePositionBlockLimits(); + message.minPositionNotionalLiquidated = object.minPositionNotionalLiquidated !== undefined && object.minPositionNotionalLiquidated !== null ? BigInt(object.minPositionNotionalLiquidated.toString()) : BigInt(0); + message.maxPositionPortionLiquidatedPpm = object.maxPositionPortionLiquidatedPpm ?? 0; + return message; + }, + fromAmino(object: PositionBlockLimitsAmino): PositionBlockLimits { + const message = createBasePositionBlockLimits(); + if (object.min_position_notional_liquidated !== undefined && object.min_position_notional_liquidated !== null) { + message.minPositionNotionalLiquidated = BigInt(object.min_position_notional_liquidated); + } + if (object.max_position_portion_liquidated_ppm !== undefined && object.max_position_portion_liquidated_ppm !== null) { + message.maxPositionPortionLiquidatedPpm = object.max_position_portion_liquidated_ppm; + } + return message; + }, + toAmino(message: PositionBlockLimits): PositionBlockLimitsAmino { + const obj: any = {}; + obj.min_position_notional_liquidated = message.minPositionNotionalLiquidated !== BigInt(0) ? message.minPositionNotionalLiquidated.toString() : undefined; + obj.max_position_portion_liquidated_ppm = message.maxPositionPortionLiquidatedPpm === 0 ? undefined : message.maxPositionPortionLiquidatedPpm; + return obj; + }, + fromAminoMsg(object: PositionBlockLimitsAminoMsg): PositionBlockLimits { + return PositionBlockLimits.fromAmino(object.value); + }, + fromProtoMsg(message: PositionBlockLimitsProtoMsg): PositionBlockLimits { + return PositionBlockLimits.decode(message.value); + }, + toProto(message: PositionBlockLimits): Uint8Array { + return PositionBlockLimits.encode(message).finish(); + }, + toProtoMsg(message: PositionBlockLimits): PositionBlockLimitsProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.PositionBlockLimits", + value: PositionBlockLimits.encode(message).finish() + }; + } +}; +function createBaseSubaccountBlockLimits(): SubaccountBlockLimits { + return { + maxNotionalLiquidated: BigInt(0), + maxQuantumsInsuranceLost: BigInt(0) + }; +} +export const SubaccountBlockLimits = { + typeUrl: "/dydxprotocol.clob.SubaccountBlockLimits", + encode(message: SubaccountBlockLimits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxNotionalLiquidated !== BigInt(0)) { + writer.uint32(8).uint64(message.maxNotionalLiquidated); + } + if (message.maxQuantumsInsuranceLost !== BigInt(0)) { + writer.uint32(16).uint64(message.maxQuantumsInsuranceLost); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountBlockLimits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountBlockLimits(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxNotionalLiquidated = reader.uint64(); + break; + case 2: + message.maxQuantumsInsuranceLost = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountBlockLimits { + const message = createBaseSubaccountBlockLimits(); + message.maxNotionalLiquidated = object.maxNotionalLiquidated !== undefined && object.maxNotionalLiquidated !== null ? BigInt(object.maxNotionalLiquidated.toString()) : BigInt(0); + message.maxQuantumsInsuranceLost = object.maxQuantumsInsuranceLost !== undefined && object.maxQuantumsInsuranceLost !== null ? BigInt(object.maxQuantumsInsuranceLost.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SubaccountBlockLimitsAmino): SubaccountBlockLimits { + const message = createBaseSubaccountBlockLimits(); + if (object.max_notional_liquidated !== undefined && object.max_notional_liquidated !== null) { + message.maxNotionalLiquidated = BigInt(object.max_notional_liquidated); + } + if (object.max_quantums_insurance_lost !== undefined && object.max_quantums_insurance_lost !== null) { + message.maxQuantumsInsuranceLost = BigInt(object.max_quantums_insurance_lost); + } + return message; + }, + toAmino(message: SubaccountBlockLimits): SubaccountBlockLimitsAmino { + const obj: any = {}; + obj.max_notional_liquidated = message.maxNotionalLiquidated !== BigInt(0) ? message.maxNotionalLiquidated.toString() : undefined; + obj.max_quantums_insurance_lost = message.maxQuantumsInsuranceLost !== BigInt(0) ? message.maxQuantumsInsuranceLost.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountBlockLimitsAminoMsg): SubaccountBlockLimits { + return SubaccountBlockLimits.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountBlockLimitsProtoMsg): SubaccountBlockLimits { + return SubaccountBlockLimits.decode(message.value); + }, + toProto(message: SubaccountBlockLimits): Uint8Array { + return SubaccountBlockLimits.encode(message).finish(); + }, + toProtoMsg(message: SubaccountBlockLimits): SubaccountBlockLimitsProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.SubaccountBlockLimits", + value: SubaccountBlockLimits.encode(message).finish() + }; + } +}; +function createBaseFillablePriceConfig(): FillablePriceConfig { + return { + bankruptcyAdjustmentPpm: 0, + spreadToMaintenanceMarginRatioPpm: 0 + }; +} +export const FillablePriceConfig = { + typeUrl: "/dydxprotocol.clob.FillablePriceConfig", + encode(message: FillablePriceConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bankruptcyAdjustmentPpm !== 0) { + writer.uint32(8).uint32(message.bankruptcyAdjustmentPpm); + } + if (message.spreadToMaintenanceMarginRatioPpm !== 0) { + writer.uint32(16).uint32(message.spreadToMaintenanceMarginRatioPpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FillablePriceConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFillablePriceConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bankruptcyAdjustmentPpm = reader.uint32(); + break; + case 2: + message.spreadToMaintenanceMarginRatioPpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FillablePriceConfig { + const message = createBaseFillablePriceConfig(); + message.bankruptcyAdjustmentPpm = object.bankruptcyAdjustmentPpm ?? 0; + message.spreadToMaintenanceMarginRatioPpm = object.spreadToMaintenanceMarginRatioPpm ?? 0; + return message; + }, + fromAmino(object: FillablePriceConfigAmino): FillablePriceConfig { + const message = createBaseFillablePriceConfig(); + if (object.bankruptcy_adjustment_ppm !== undefined && object.bankruptcy_adjustment_ppm !== null) { + message.bankruptcyAdjustmentPpm = object.bankruptcy_adjustment_ppm; + } + if (object.spread_to_maintenance_margin_ratio_ppm !== undefined && object.spread_to_maintenance_margin_ratio_ppm !== null) { + message.spreadToMaintenanceMarginRatioPpm = object.spread_to_maintenance_margin_ratio_ppm; + } + return message; + }, + toAmino(message: FillablePriceConfig): FillablePriceConfigAmino { + const obj: any = {}; + obj.bankruptcy_adjustment_ppm = message.bankruptcyAdjustmentPpm === 0 ? undefined : message.bankruptcyAdjustmentPpm; + obj.spread_to_maintenance_margin_ratio_ppm = message.spreadToMaintenanceMarginRatioPpm === 0 ? undefined : message.spreadToMaintenanceMarginRatioPpm; + return obj; + }, + fromAminoMsg(object: FillablePriceConfigAminoMsg): FillablePriceConfig { + return FillablePriceConfig.fromAmino(object.value); + }, + fromProtoMsg(message: FillablePriceConfigProtoMsg): FillablePriceConfig { + return FillablePriceConfig.decode(message.value); + }, + toProto(message: FillablePriceConfig): Uint8Array { + return FillablePriceConfig.encode(message).finish(); + }, + toProtoMsg(message: FillablePriceConfig): FillablePriceConfigProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.FillablePriceConfig", + value: FillablePriceConfig.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/matches.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/matches.ts new file mode 100644 index 00000000..3d0bcabc --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/matches.ts @@ -0,0 +1,795 @@ +//@ts-nocheck +import { OrderId, OrderIdAmino, OrderIdSDKType } from "./order"; +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * ClobMatch represents an operations queue entry around all different types + * of matches, specifically regular matches, liquidation matches, and + * deleveraging matches. + */ +export interface ClobMatch { + matchOrders?: MatchOrders; + matchPerpetualLiquidation?: MatchPerpetualLiquidation; + matchPerpetualDeleveraging?: MatchPerpetualDeleveraging; +} +export interface ClobMatchProtoMsg { + typeUrl: "/dydxprotocol.clob.ClobMatch"; + value: Uint8Array; +} +/** + * ClobMatch represents an operations queue entry around all different types + * of matches, specifically regular matches, liquidation matches, and + * deleveraging matches. + */ +export interface ClobMatchAmino { + match_orders?: MatchOrdersAmino; + match_perpetual_liquidation?: MatchPerpetualLiquidationAmino; + match_perpetual_deleveraging?: MatchPerpetualDeleveragingAmino; +} +export interface ClobMatchAminoMsg { + type: "/dydxprotocol.clob.ClobMatch"; + value: ClobMatchAmino; +} +/** + * ClobMatch represents an operations queue entry around all different types + * of matches, specifically regular matches, liquidation matches, and + * deleveraging matches. + */ +export interface ClobMatchSDKType { + match_orders?: MatchOrdersSDKType; + match_perpetual_liquidation?: MatchPerpetualLiquidationSDKType; + match_perpetual_deleveraging?: MatchPerpetualDeleveragingSDKType; +} +/** MakerFill represents the filled amount of a matched maker order. */ +export interface MakerFill { + /** + * The filled amount of the matched maker order, in base quantums. + * TODO(CLOB-571): update to use SerializableInt. + */ + fillAmount: bigint; + /** The `OrderId` of the matched maker order. */ + makerOrderId: OrderId; +} +export interface MakerFillProtoMsg { + typeUrl: "/dydxprotocol.clob.MakerFill"; + value: Uint8Array; +} +/** MakerFill represents the filled amount of a matched maker order. */ +export interface MakerFillAmino { + /** + * The filled amount of the matched maker order, in base quantums. + * TODO(CLOB-571): update to use SerializableInt. + */ + fill_amount?: string; + /** The `OrderId` of the matched maker order. */ + maker_order_id?: OrderIdAmino; +} +export interface MakerFillAminoMsg { + type: "/dydxprotocol.clob.MakerFill"; + value: MakerFillAmino; +} +/** MakerFill represents the filled amount of a matched maker order. */ +export interface MakerFillSDKType { + fill_amount: bigint; + maker_order_id: OrderIdSDKType; +} +/** MatchOrders is an injected message used for matching orders. */ +export interface MatchOrders { + /** The `OrderId` of the taker order. */ + takerOrderId: OrderId; + /** An ordered list of fills created by this taker order. */ + fills: MakerFill[]; +} +export interface MatchOrdersProtoMsg { + typeUrl: "/dydxprotocol.clob.MatchOrders"; + value: Uint8Array; +} +/** MatchOrders is an injected message used for matching orders. */ +export interface MatchOrdersAmino { + /** The `OrderId` of the taker order. */ + taker_order_id?: OrderIdAmino; + /** An ordered list of fills created by this taker order. */ + fills?: MakerFillAmino[]; +} +export interface MatchOrdersAminoMsg { + type: "/dydxprotocol.clob.MatchOrders"; + value: MatchOrdersAmino; +} +/** MatchOrders is an injected message used for matching orders. */ +export interface MatchOrdersSDKType { + taker_order_id: OrderIdSDKType; + fills: MakerFillSDKType[]; +} +/** + * MatchPerpetualLiquidation is an injected message used for liquidating a + * subaccount. + */ +export interface MatchPerpetualLiquidation { + /** ID of the subaccount that was liquidated. */ + liquidated: SubaccountId; + /** The ID of the clob pair involved in the liquidation. */ + clobPairId: number; + /** The ID of the perpetual involved in the liquidation. */ + perpetualId: number; + /** The total size of the liquidation order including any unfilled size. */ + totalSize: bigint; + /** `true` if liquidating a short position, `false` otherwise. */ + isBuy: boolean; + /** An ordered list of fills created by this liquidation. */ + fills: MakerFill[]; +} +export interface MatchPerpetualLiquidationProtoMsg { + typeUrl: "/dydxprotocol.clob.MatchPerpetualLiquidation"; + value: Uint8Array; +} +/** + * MatchPerpetualLiquidation is an injected message used for liquidating a + * subaccount. + */ +export interface MatchPerpetualLiquidationAmino { + /** ID of the subaccount that was liquidated. */ + liquidated?: SubaccountIdAmino; + /** The ID of the clob pair involved in the liquidation. */ + clob_pair_id?: number; + /** The ID of the perpetual involved in the liquidation. */ + perpetual_id?: number; + /** The total size of the liquidation order including any unfilled size. */ + total_size?: string; + /** `true` if liquidating a short position, `false` otherwise. */ + is_buy?: boolean; + /** An ordered list of fills created by this liquidation. */ + fills?: MakerFillAmino[]; +} +export interface MatchPerpetualLiquidationAminoMsg { + type: "/dydxprotocol.clob.MatchPerpetualLiquidation"; + value: MatchPerpetualLiquidationAmino; +} +/** + * MatchPerpetualLiquidation is an injected message used for liquidating a + * subaccount. + */ +export interface MatchPerpetualLiquidationSDKType { + liquidated: SubaccountIdSDKType; + clob_pair_id: number; + perpetual_id: number; + total_size: bigint; + is_buy: boolean; + fills: MakerFillSDKType[]; +} +/** + * MatchPerpetualDeleveraging is an injected message used for deleveraging a + * subaccount. + */ +export interface MatchPerpetualDeleveraging { + /** ID of the subaccount that was liquidated. */ + liquidated: SubaccountId; + /** The ID of the perpetual that was liquidated. */ + perpetualId: number; + /** An ordered list of fills created by this liquidation. */ + fills: MatchPerpetualDeleveraging_Fill[]; + /** + * Flag denoting whether the deleveraging operation was for the purpose + * of final settlement. Final settlement matches are at the oracle price, + * whereas deleveraging happens at the bankruptcy price of the deleveraged + * subaccount. + */ + isFinalSettlement: boolean; +} +export interface MatchPerpetualDeleveragingProtoMsg { + typeUrl: "/dydxprotocol.clob.MatchPerpetualDeleveraging"; + value: Uint8Array; +} +/** + * MatchPerpetualDeleveraging is an injected message used for deleveraging a + * subaccount. + */ +export interface MatchPerpetualDeleveragingAmino { + /** ID of the subaccount that was liquidated. */ + liquidated?: SubaccountIdAmino; + /** The ID of the perpetual that was liquidated. */ + perpetual_id?: number; + /** An ordered list of fills created by this liquidation. */ + fills?: MatchPerpetualDeleveraging_FillAmino[]; + /** + * Flag denoting whether the deleveraging operation was for the purpose + * of final settlement. Final settlement matches are at the oracle price, + * whereas deleveraging happens at the bankruptcy price of the deleveraged + * subaccount. + */ + is_final_settlement?: boolean; +} +export interface MatchPerpetualDeleveragingAminoMsg { + type: "/dydxprotocol.clob.MatchPerpetualDeleveraging"; + value: MatchPerpetualDeleveragingAmino; +} +/** + * MatchPerpetualDeleveraging is an injected message used for deleveraging a + * subaccount. + */ +export interface MatchPerpetualDeleveragingSDKType { + liquidated: SubaccountIdSDKType; + perpetual_id: number; + fills: MatchPerpetualDeleveraging_FillSDKType[]; + is_final_settlement: boolean; +} +/** Fill represents a fill between the liquidated and offsetting subaccount. */ +export interface MatchPerpetualDeleveraging_Fill { + /** + * ID of the subaccount that was used to offset the liquidated subaccount's + * position. + */ + offsettingSubaccountId: SubaccountId; + /** + * The amount filled between the liquidated and offsetting position, in + * base quantums. + * TODO(CLOB-571): update to use SerializableInt. + */ + fillAmount: bigint; +} +export interface MatchPerpetualDeleveraging_FillProtoMsg { + typeUrl: "/dydxprotocol.clob.Fill"; + value: Uint8Array; +} +/** Fill represents a fill between the liquidated and offsetting subaccount. */ +export interface MatchPerpetualDeleveraging_FillAmino { + /** + * ID of the subaccount that was used to offset the liquidated subaccount's + * position. + */ + offsetting_subaccount_id?: SubaccountIdAmino; + /** + * The amount filled between the liquidated and offsetting position, in + * base quantums. + * TODO(CLOB-571): update to use SerializableInt. + */ + fill_amount?: string; +} +export interface MatchPerpetualDeleveraging_FillAminoMsg { + type: "/dydxprotocol.clob.Fill"; + value: MatchPerpetualDeleveraging_FillAmino; +} +/** Fill represents a fill between the liquidated and offsetting subaccount. */ +export interface MatchPerpetualDeleveraging_FillSDKType { + offsetting_subaccount_id: SubaccountIdSDKType; + fill_amount: bigint; +} +function createBaseClobMatch(): ClobMatch { + return { + matchOrders: undefined, + matchPerpetualLiquidation: undefined, + matchPerpetualDeleveraging: undefined + }; +} +export const ClobMatch = { + typeUrl: "/dydxprotocol.clob.ClobMatch", + encode(message: ClobMatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.matchOrders !== undefined) { + MatchOrders.encode(message.matchOrders, writer.uint32(10).fork()).ldelim(); + } + if (message.matchPerpetualLiquidation !== undefined) { + MatchPerpetualLiquidation.encode(message.matchPerpetualLiquidation, writer.uint32(18).fork()).ldelim(); + } + if (message.matchPerpetualDeleveraging !== undefined) { + MatchPerpetualDeleveraging.encode(message.matchPerpetualDeleveraging, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClobMatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClobMatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.matchOrders = MatchOrders.decode(reader, reader.uint32()); + break; + case 2: + message.matchPerpetualLiquidation = MatchPerpetualLiquidation.decode(reader, reader.uint32()); + break; + case 3: + message.matchPerpetualDeleveraging = MatchPerpetualDeleveraging.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClobMatch { + const message = createBaseClobMatch(); + message.matchOrders = object.matchOrders !== undefined && object.matchOrders !== null ? MatchOrders.fromPartial(object.matchOrders) : undefined; + message.matchPerpetualLiquidation = object.matchPerpetualLiquidation !== undefined && object.matchPerpetualLiquidation !== null ? MatchPerpetualLiquidation.fromPartial(object.matchPerpetualLiquidation) : undefined; + message.matchPerpetualDeleveraging = object.matchPerpetualDeleveraging !== undefined && object.matchPerpetualDeleveraging !== null ? MatchPerpetualDeleveraging.fromPartial(object.matchPerpetualDeleveraging) : undefined; + return message; + }, + fromAmino(object: ClobMatchAmino): ClobMatch { + const message = createBaseClobMatch(); + if (object.match_orders !== undefined && object.match_orders !== null) { + message.matchOrders = MatchOrders.fromAmino(object.match_orders); + } + if (object.match_perpetual_liquidation !== undefined && object.match_perpetual_liquidation !== null) { + message.matchPerpetualLiquidation = MatchPerpetualLiquidation.fromAmino(object.match_perpetual_liquidation); + } + if (object.match_perpetual_deleveraging !== undefined && object.match_perpetual_deleveraging !== null) { + message.matchPerpetualDeleveraging = MatchPerpetualDeleveraging.fromAmino(object.match_perpetual_deleveraging); + } + return message; + }, + toAmino(message: ClobMatch): ClobMatchAmino { + const obj: any = {}; + obj.match_orders = message.matchOrders ? MatchOrders.toAmino(message.matchOrders) : undefined; + obj.match_perpetual_liquidation = message.matchPerpetualLiquidation ? MatchPerpetualLiquidation.toAmino(message.matchPerpetualLiquidation) : undefined; + obj.match_perpetual_deleveraging = message.matchPerpetualDeleveraging ? MatchPerpetualDeleveraging.toAmino(message.matchPerpetualDeleveraging) : undefined; + return obj; + }, + fromAminoMsg(object: ClobMatchAminoMsg): ClobMatch { + return ClobMatch.fromAmino(object.value); + }, + fromProtoMsg(message: ClobMatchProtoMsg): ClobMatch { + return ClobMatch.decode(message.value); + }, + toProto(message: ClobMatch): Uint8Array { + return ClobMatch.encode(message).finish(); + }, + toProtoMsg(message: ClobMatch): ClobMatchProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.ClobMatch", + value: ClobMatch.encode(message).finish() + }; + } +}; +function createBaseMakerFill(): MakerFill { + return { + fillAmount: BigInt(0), + makerOrderId: OrderId.fromPartial({}) + }; +} +export const MakerFill = { + typeUrl: "/dydxprotocol.clob.MakerFill", + encode(message: MakerFill, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fillAmount !== BigInt(0)) { + writer.uint32(8).uint64(message.fillAmount); + } + if (message.makerOrderId !== undefined) { + OrderId.encode(message.makerOrderId, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MakerFill { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMakerFill(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fillAmount = reader.uint64(); + break; + case 2: + message.makerOrderId = OrderId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MakerFill { + const message = createBaseMakerFill(); + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + message.makerOrderId = object.makerOrderId !== undefined && object.makerOrderId !== null ? OrderId.fromPartial(object.makerOrderId) : undefined; + return message; + }, + fromAmino(object: MakerFillAmino): MakerFill { + const message = createBaseMakerFill(); + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + if (object.maker_order_id !== undefined && object.maker_order_id !== null) { + message.makerOrderId = OrderId.fromAmino(object.maker_order_id); + } + return message; + }, + toAmino(message: MakerFill): MakerFillAmino { + const obj: any = {}; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + obj.maker_order_id = message.makerOrderId ? OrderId.toAmino(message.makerOrderId) : undefined; + return obj; + }, + fromAminoMsg(object: MakerFillAminoMsg): MakerFill { + return MakerFill.fromAmino(object.value); + }, + fromProtoMsg(message: MakerFillProtoMsg): MakerFill { + return MakerFill.decode(message.value); + }, + toProto(message: MakerFill): Uint8Array { + return MakerFill.encode(message).finish(); + }, + toProtoMsg(message: MakerFill): MakerFillProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MakerFill", + value: MakerFill.encode(message).finish() + }; + } +}; +function createBaseMatchOrders(): MatchOrders { + return { + takerOrderId: OrderId.fromPartial({}), + fills: [] + }; +} +export const MatchOrders = { + typeUrl: "/dydxprotocol.clob.MatchOrders", + encode(message: MatchOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.takerOrderId !== undefined) { + OrderId.encode(message.takerOrderId, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.fills) { + MakerFill.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MatchOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMatchOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerOrderId = OrderId.decode(reader, reader.uint32()); + break; + case 2: + message.fills.push(MakerFill.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MatchOrders { + const message = createBaseMatchOrders(); + message.takerOrderId = object.takerOrderId !== undefined && object.takerOrderId !== null ? OrderId.fromPartial(object.takerOrderId) : undefined; + message.fills = object.fills?.map(e => MakerFill.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MatchOrdersAmino): MatchOrders { + const message = createBaseMatchOrders(); + if (object.taker_order_id !== undefined && object.taker_order_id !== null) { + message.takerOrderId = OrderId.fromAmino(object.taker_order_id); + } + message.fills = object.fills?.map(e => MakerFill.fromAmino(e)) || []; + return message; + }, + toAmino(message: MatchOrders): MatchOrdersAmino { + const obj: any = {}; + obj.taker_order_id = message.takerOrderId ? OrderId.toAmino(message.takerOrderId) : undefined; + if (message.fills) { + obj.fills = message.fills.map(e => e ? MakerFill.toAmino(e) : undefined); + } else { + obj.fills = message.fills; + } + return obj; + }, + fromAminoMsg(object: MatchOrdersAminoMsg): MatchOrders { + return MatchOrders.fromAmino(object.value); + }, + fromProtoMsg(message: MatchOrdersProtoMsg): MatchOrders { + return MatchOrders.decode(message.value); + }, + toProto(message: MatchOrders): Uint8Array { + return MatchOrders.encode(message).finish(); + }, + toProtoMsg(message: MatchOrders): MatchOrdersProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MatchOrders", + value: MatchOrders.encode(message).finish() + }; + } +}; +function createBaseMatchPerpetualLiquidation(): MatchPerpetualLiquidation { + return { + liquidated: SubaccountId.fromPartial({}), + clobPairId: 0, + perpetualId: 0, + totalSize: BigInt(0), + isBuy: false, + fills: [] + }; +} +export const MatchPerpetualLiquidation = { + typeUrl: "/dydxprotocol.clob.MatchPerpetualLiquidation", + encode(message: MatchPerpetualLiquidation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidated !== undefined) { + SubaccountId.encode(message.liquidated, writer.uint32(10).fork()).ldelim(); + } + if (message.clobPairId !== 0) { + writer.uint32(16).uint32(message.clobPairId); + } + if (message.perpetualId !== 0) { + writer.uint32(24).uint32(message.perpetualId); + } + if (message.totalSize !== BigInt(0)) { + writer.uint32(32).uint64(message.totalSize); + } + if (message.isBuy === true) { + writer.uint32(40).bool(message.isBuy); + } + for (const v of message.fills) { + MakerFill.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MatchPerpetualLiquidation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMatchPerpetualLiquidation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidated = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.clobPairId = reader.uint32(); + break; + case 3: + message.perpetualId = reader.uint32(); + break; + case 4: + message.totalSize = reader.uint64(); + break; + case 5: + message.isBuy = reader.bool(); + break; + case 6: + message.fills.push(MakerFill.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MatchPerpetualLiquidation { + const message = createBaseMatchPerpetualLiquidation(); + message.liquidated = object.liquidated !== undefined && object.liquidated !== null ? SubaccountId.fromPartial(object.liquidated) : undefined; + message.clobPairId = object.clobPairId ?? 0; + message.perpetualId = object.perpetualId ?? 0; + message.totalSize = object.totalSize !== undefined && object.totalSize !== null ? BigInt(object.totalSize.toString()) : BigInt(0); + message.isBuy = object.isBuy ?? false; + message.fills = object.fills?.map(e => MakerFill.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MatchPerpetualLiquidationAmino): MatchPerpetualLiquidation { + const message = createBaseMatchPerpetualLiquidation(); + if (object.liquidated !== undefined && object.liquidated !== null) { + message.liquidated = SubaccountId.fromAmino(object.liquidated); + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.total_size !== undefined && object.total_size !== null) { + message.totalSize = BigInt(object.total_size); + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + message.fills = object.fills?.map(e => MakerFill.fromAmino(e)) || []; + return message; + }, + toAmino(message: MatchPerpetualLiquidation): MatchPerpetualLiquidationAmino { + const obj: any = {}; + obj.liquidated = message.liquidated ? SubaccountId.toAmino(message.liquidated) : undefined; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.total_size = message.totalSize !== BigInt(0) ? message.totalSize.toString() : undefined; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + if (message.fills) { + obj.fills = message.fills.map(e => e ? MakerFill.toAmino(e) : undefined); + } else { + obj.fills = message.fills; + } + return obj; + }, + fromAminoMsg(object: MatchPerpetualLiquidationAminoMsg): MatchPerpetualLiquidation { + return MatchPerpetualLiquidation.fromAmino(object.value); + }, + fromProtoMsg(message: MatchPerpetualLiquidationProtoMsg): MatchPerpetualLiquidation { + return MatchPerpetualLiquidation.decode(message.value); + }, + toProto(message: MatchPerpetualLiquidation): Uint8Array { + return MatchPerpetualLiquidation.encode(message).finish(); + }, + toProtoMsg(message: MatchPerpetualLiquidation): MatchPerpetualLiquidationProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MatchPerpetualLiquidation", + value: MatchPerpetualLiquidation.encode(message).finish() + }; + } +}; +function createBaseMatchPerpetualDeleveraging(): MatchPerpetualDeleveraging { + return { + liquidated: SubaccountId.fromPartial({}), + perpetualId: 0, + fills: [], + isFinalSettlement: false + }; +} +export const MatchPerpetualDeleveraging = { + typeUrl: "/dydxprotocol.clob.MatchPerpetualDeleveraging", + encode(message: MatchPerpetualDeleveraging, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidated !== undefined) { + SubaccountId.encode(message.liquidated, writer.uint32(10).fork()).ldelim(); + } + if (message.perpetualId !== 0) { + writer.uint32(16).uint32(message.perpetualId); + } + for (const v of message.fills) { + MatchPerpetualDeleveraging_Fill.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.isFinalSettlement === true) { + writer.uint32(32).bool(message.isFinalSettlement); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MatchPerpetualDeleveraging { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMatchPerpetualDeleveraging(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidated = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.perpetualId = reader.uint32(); + break; + case 3: + message.fills.push(MatchPerpetualDeleveraging_Fill.decode(reader, reader.uint32())); + break; + case 4: + message.isFinalSettlement = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MatchPerpetualDeleveraging { + const message = createBaseMatchPerpetualDeleveraging(); + message.liquidated = object.liquidated !== undefined && object.liquidated !== null ? SubaccountId.fromPartial(object.liquidated) : undefined; + message.perpetualId = object.perpetualId ?? 0; + message.fills = object.fills?.map(e => MatchPerpetualDeleveraging_Fill.fromPartial(e)) || []; + message.isFinalSettlement = object.isFinalSettlement ?? false; + return message; + }, + fromAmino(object: MatchPerpetualDeleveragingAmino): MatchPerpetualDeleveraging { + const message = createBaseMatchPerpetualDeleveraging(); + if (object.liquidated !== undefined && object.liquidated !== null) { + message.liquidated = SubaccountId.fromAmino(object.liquidated); + } + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + message.fills = object.fills?.map(e => MatchPerpetualDeleveraging_Fill.fromAmino(e)) || []; + if (object.is_final_settlement !== undefined && object.is_final_settlement !== null) { + message.isFinalSettlement = object.is_final_settlement; + } + return message; + }, + toAmino(message: MatchPerpetualDeleveraging): MatchPerpetualDeleveragingAmino { + const obj: any = {}; + obj.liquidated = message.liquidated ? SubaccountId.toAmino(message.liquidated) : undefined; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + if (message.fills) { + obj.fills = message.fills.map(e => e ? MatchPerpetualDeleveraging_Fill.toAmino(e) : undefined); + } else { + obj.fills = message.fills; + } + obj.is_final_settlement = message.isFinalSettlement === false ? undefined : message.isFinalSettlement; + return obj; + }, + fromAminoMsg(object: MatchPerpetualDeleveragingAminoMsg): MatchPerpetualDeleveraging { + return MatchPerpetualDeleveraging.fromAmino(object.value); + }, + fromProtoMsg(message: MatchPerpetualDeleveragingProtoMsg): MatchPerpetualDeleveraging { + return MatchPerpetualDeleveraging.decode(message.value); + }, + toProto(message: MatchPerpetualDeleveraging): Uint8Array { + return MatchPerpetualDeleveraging.encode(message).finish(); + }, + toProtoMsg(message: MatchPerpetualDeleveraging): MatchPerpetualDeleveragingProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MatchPerpetualDeleveraging", + value: MatchPerpetualDeleveraging.encode(message).finish() + }; + } +}; +function createBaseMatchPerpetualDeleveraging_Fill(): MatchPerpetualDeleveraging_Fill { + return { + offsettingSubaccountId: SubaccountId.fromPartial({}), + fillAmount: BigInt(0) + }; +} +export const MatchPerpetualDeleveraging_Fill = { + typeUrl: "/dydxprotocol.clob.Fill", + encode(message: MatchPerpetualDeleveraging_Fill, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.offsettingSubaccountId !== undefined) { + SubaccountId.encode(message.offsettingSubaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.fillAmount !== BigInt(0)) { + writer.uint32(16).uint64(message.fillAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MatchPerpetualDeleveraging_Fill { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMatchPerpetualDeleveraging_Fill(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.offsettingSubaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.fillAmount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MatchPerpetualDeleveraging_Fill { + const message = createBaseMatchPerpetualDeleveraging_Fill(); + message.offsettingSubaccountId = object.offsettingSubaccountId !== undefined && object.offsettingSubaccountId !== null ? SubaccountId.fromPartial(object.offsettingSubaccountId) : undefined; + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MatchPerpetualDeleveraging_FillAmino): MatchPerpetualDeleveraging_Fill { + const message = createBaseMatchPerpetualDeleveraging_Fill(); + if (object.offsetting_subaccount_id !== undefined && object.offsetting_subaccount_id !== null) { + message.offsettingSubaccountId = SubaccountId.fromAmino(object.offsetting_subaccount_id); + } + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + return message; + }, + toAmino(message: MatchPerpetualDeleveraging_Fill): MatchPerpetualDeleveraging_FillAmino { + const obj: any = {}; + obj.offsetting_subaccount_id = message.offsettingSubaccountId ? SubaccountId.toAmino(message.offsettingSubaccountId) : undefined; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MatchPerpetualDeleveraging_FillAminoMsg): MatchPerpetualDeleveraging_Fill { + return MatchPerpetualDeleveraging_Fill.fromAmino(object.value); + }, + fromProtoMsg(message: MatchPerpetualDeleveraging_FillProtoMsg): MatchPerpetualDeleveraging_Fill { + return MatchPerpetualDeleveraging_Fill.decode(message.value); + }, + toProto(message: MatchPerpetualDeleveraging_Fill): Uint8Array { + return MatchPerpetualDeleveraging_Fill.encode(message).finish(); + }, + toProtoMsg(message: MatchPerpetualDeleveraging_Fill): MatchPerpetualDeleveraging_FillProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.Fill", + value: MatchPerpetualDeleveraging_Fill.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/mev.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/mev.ts new file mode 100644 index 00000000..45015d57 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/mev.ts @@ -0,0 +1,737 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { ClobPair, ClobPairAmino, ClobPairSDKType } from "./clob_pair"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MEVMatch represents all necessary data to calculate MEV for a regular match. */ +export interface MEVMatch { + takerOrderSubaccountId?: SubaccountId; + takerFeePpm: number; + makerOrderSubaccountId?: SubaccountId; + makerOrderSubticks: bigint; + makerOrderIsBuy: boolean; + makerFeePpm: number; + clobPairId: number; + fillAmount: bigint; +} +export interface MEVMatchProtoMsg { + typeUrl: "/dydxprotocol.clob.MEVMatch"; + value: Uint8Array; +} +/** MEVMatch represents all necessary data to calculate MEV for a regular match. */ +export interface MEVMatchAmino { + taker_order_subaccount_id?: SubaccountIdAmino; + taker_fee_ppm?: number; + maker_order_subaccount_id?: SubaccountIdAmino; + maker_order_subticks?: string; + maker_order_is_buy?: boolean; + maker_fee_ppm?: number; + clob_pair_id?: number; + fill_amount?: string; +} +export interface MEVMatchAminoMsg { + type: "/dydxprotocol.clob.MEVMatch"; + value: MEVMatchAmino; +} +/** MEVMatch represents all necessary data to calculate MEV for a regular match. */ +export interface MEVMatchSDKType { + taker_order_subaccount_id?: SubaccountIdSDKType; + taker_fee_ppm: number; + maker_order_subaccount_id?: SubaccountIdSDKType; + maker_order_subticks: bigint; + maker_order_is_buy: boolean; + maker_fee_ppm: number; + clob_pair_id: number; + fill_amount: bigint; +} +/** + * MEVLiquidationMatch represents all necessary data to calculate MEV for a + * liquidation. + */ +export interface MEVLiquidationMatch { + liquidatedSubaccountId: SubaccountId; + insuranceFundDeltaQuoteQuantums: bigint; + makerOrderSubaccountId: SubaccountId; + makerOrderSubticks: bigint; + makerOrderIsBuy: boolean; + makerFeePpm: number; + clobPairId: number; + fillAmount: bigint; +} +export interface MEVLiquidationMatchProtoMsg { + typeUrl: "/dydxprotocol.clob.MEVLiquidationMatch"; + value: Uint8Array; +} +/** + * MEVLiquidationMatch represents all necessary data to calculate MEV for a + * liquidation. + */ +export interface MEVLiquidationMatchAmino { + liquidated_subaccount_id?: SubaccountIdAmino; + insurance_fund_delta_quote_quantums?: string; + maker_order_subaccount_id?: SubaccountIdAmino; + maker_order_subticks?: string; + maker_order_is_buy?: boolean; + maker_fee_ppm?: number; + clob_pair_id?: number; + fill_amount?: string; +} +export interface MEVLiquidationMatchAminoMsg { + type: "/dydxprotocol.clob.MEVLiquidationMatch"; + value: MEVLiquidationMatchAmino; +} +/** + * MEVLiquidationMatch represents all necessary data to calculate MEV for a + * liquidation. + */ +export interface MEVLiquidationMatchSDKType { + liquidated_subaccount_id: SubaccountIdSDKType; + insurance_fund_delta_quote_quantums: bigint; + maker_order_subaccount_id: SubaccountIdSDKType; + maker_order_subticks: bigint; + maker_order_is_buy: boolean; + maker_fee_ppm: number; + clob_pair_id: number; + fill_amount: bigint; +} +/** ClobMidPrice contains the mid price of a CLOB pair, represented by it's ID. */ +export interface ClobMidPrice { + clobPair: ClobPair; + subticks: bigint; +} +export interface ClobMidPriceProtoMsg { + typeUrl: "/dydxprotocol.clob.ClobMidPrice"; + value: Uint8Array; +} +/** ClobMidPrice contains the mid price of a CLOB pair, represented by it's ID. */ +export interface ClobMidPriceAmino { + clob_pair?: ClobPairAmino; + subticks?: string; +} +export interface ClobMidPriceAminoMsg { + type: "/dydxprotocol.clob.ClobMidPrice"; + value: ClobMidPriceAmino; +} +/** ClobMidPrice contains the mid price of a CLOB pair, represented by it's ID. */ +export interface ClobMidPriceSDKType { + clob_pair: ClobPairSDKType; + subticks: bigint; +} +/** + * ValidatorMevMatches contains all matches from the validator's local + * operations queue. + */ +export interface ValidatorMevMatches { + matches: MEVMatch[]; + liquidationMatches: MEVLiquidationMatch[]; +} +export interface ValidatorMevMatchesProtoMsg { + typeUrl: "/dydxprotocol.clob.ValidatorMevMatches"; + value: Uint8Array; +} +/** + * ValidatorMevMatches contains all matches from the validator's local + * operations queue. + */ +export interface ValidatorMevMatchesAmino { + matches?: MEVMatchAmino[]; + liquidation_matches?: MEVLiquidationMatchAmino[]; +} +export interface ValidatorMevMatchesAminoMsg { + type: "/dydxprotocol.clob.ValidatorMevMatches"; + value: ValidatorMevMatchesAmino; +} +/** + * ValidatorMevMatches contains all matches from the validator's local + * operations queue. + */ +export interface ValidatorMevMatchesSDKType { + matches: MEVMatchSDKType[]; + liquidation_matches: MEVLiquidationMatchSDKType[]; +} +/** + * MevNodeToNodeMetrics is a data structure for encapsulating all MEV node <> + * node metrics. + */ +export interface MevNodeToNodeMetrics { + validatorMevMatches?: ValidatorMevMatches; + clobMidPrices: ClobMidPrice[]; + bpMevMatches?: ValidatorMevMatches; + proposalReceiveTime: bigint; +} +export interface MevNodeToNodeMetricsProtoMsg { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeMetrics"; + value: Uint8Array; +} +/** + * MevNodeToNodeMetrics is a data structure for encapsulating all MEV node <> + * node metrics. + */ +export interface MevNodeToNodeMetricsAmino { + validator_mev_matches?: ValidatorMevMatchesAmino; + clob_mid_prices?: ClobMidPriceAmino[]; + bp_mev_matches?: ValidatorMevMatchesAmino; + proposal_receive_time?: string; +} +export interface MevNodeToNodeMetricsAminoMsg { + type: "/dydxprotocol.clob.MevNodeToNodeMetrics"; + value: MevNodeToNodeMetricsAmino; +} +/** + * MevNodeToNodeMetrics is a data structure for encapsulating all MEV node <> + * node metrics. + */ +export interface MevNodeToNodeMetricsSDKType { + validator_mev_matches?: ValidatorMevMatchesSDKType; + clob_mid_prices: ClobMidPriceSDKType[]; + bp_mev_matches?: ValidatorMevMatchesSDKType; + proposal_receive_time: bigint; +} +function createBaseMEVMatch(): MEVMatch { + return { + takerOrderSubaccountId: undefined, + takerFeePpm: 0, + makerOrderSubaccountId: undefined, + makerOrderSubticks: BigInt(0), + makerOrderIsBuy: false, + makerFeePpm: 0, + clobPairId: 0, + fillAmount: BigInt(0) + }; +} +export const MEVMatch = { + typeUrl: "/dydxprotocol.clob.MEVMatch", + encode(message: MEVMatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.takerOrderSubaccountId !== undefined) { + SubaccountId.encode(message.takerOrderSubaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.takerFeePpm !== 0) { + writer.uint32(16).int32(message.takerFeePpm); + } + if (message.makerOrderSubaccountId !== undefined) { + SubaccountId.encode(message.makerOrderSubaccountId, writer.uint32(26).fork()).ldelim(); + } + if (message.makerOrderSubticks !== BigInt(0)) { + writer.uint32(32).uint64(message.makerOrderSubticks); + } + if (message.makerOrderIsBuy === true) { + writer.uint32(40).bool(message.makerOrderIsBuy); + } + if (message.makerFeePpm !== 0) { + writer.uint32(48).int32(message.makerFeePpm); + } + if (message.clobPairId !== 0) { + writer.uint32(56).uint32(message.clobPairId); + } + if (message.fillAmount !== BigInt(0)) { + writer.uint32(64).uint64(message.fillAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MEVMatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMEVMatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerOrderSubaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.takerFeePpm = reader.int32(); + break; + case 3: + message.makerOrderSubaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 4: + message.makerOrderSubticks = reader.uint64(); + break; + case 5: + message.makerOrderIsBuy = reader.bool(); + break; + case 6: + message.makerFeePpm = reader.int32(); + break; + case 7: + message.clobPairId = reader.uint32(); + break; + case 8: + message.fillAmount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MEVMatch { + const message = createBaseMEVMatch(); + message.takerOrderSubaccountId = object.takerOrderSubaccountId !== undefined && object.takerOrderSubaccountId !== null ? SubaccountId.fromPartial(object.takerOrderSubaccountId) : undefined; + message.takerFeePpm = object.takerFeePpm ?? 0; + message.makerOrderSubaccountId = object.makerOrderSubaccountId !== undefined && object.makerOrderSubaccountId !== null ? SubaccountId.fromPartial(object.makerOrderSubaccountId) : undefined; + message.makerOrderSubticks = object.makerOrderSubticks !== undefined && object.makerOrderSubticks !== null ? BigInt(object.makerOrderSubticks.toString()) : BigInt(0); + message.makerOrderIsBuy = object.makerOrderIsBuy ?? false; + message.makerFeePpm = object.makerFeePpm ?? 0; + message.clobPairId = object.clobPairId ?? 0; + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MEVMatchAmino): MEVMatch { + const message = createBaseMEVMatch(); + if (object.taker_order_subaccount_id !== undefined && object.taker_order_subaccount_id !== null) { + message.takerOrderSubaccountId = SubaccountId.fromAmino(object.taker_order_subaccount_id); + } + if (object.taker_fee_ppm !== undefined && object.taker_fee_ppm !== null) { + message.takerFeePpm = object.taker_fee_ppm; + } + if (object.maker_order_subaccount_id !== undefined && object.maker_order_subaccount_id !== null) { + message.makerOrderSubaccountId = SubaccountId.fromAmino(object.maker_order_subaccount_id); + } + if (object.maker_order_subticks !== undefined && object.maker_order_subticks !== null) { + message.makerOrderSubticks = BigInt(object.maker_order_subticks); + } + if (object.maker_order_is_buy !== undefined && object.maker_order_is_buy !== null) { + message.makerOrderIsBuy = object.maker_order_is_buy; + } + if (object.maker_fee_ppm !== undefined && object.maker_fee_ppm !== null) { + message.makerFeePpm = object.maker_fee_ppm; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + return message; + }, + toAmino(message: MEVMatch): MEVMatchAmino { + const obj: any = {}; + obj.taker_order_subaccount_id = message.takerOrderSubaccountId ? SubaccountId.toAmino(message.takerOrderSubaccountId) : undefined; + obj.taker_fee_ppm = message.takerFeePpm === 0 ? undefined : message.takerFeePpm; + obj.maker_order_subaccount_id = message.makerOrderSubaccountId ? SubaccountId.toAmino(message.makerOrderSubaccountId) : undefined; + obj.maker_order_subticks = message.makerOrderSubticks !== BigInt(0) ? message.makerOrderSubticks.toString() : undefined; + obj.maker_order_is_buy = message.makerOrderIsBuy === false ? undefined : message.makerOrderIsBuy; + obj.maker_fee_ppm = message.makerFeePpm === 0 ? undefined : message.makerFeePpm; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MEVMatchAminoMsg): MEVMatch { + return MEVMatch.fromAmino(object.value); + }, + fromProtoMsg(message: MEVMatchProtoMsg): MEVMatch { + return MEVMatch.decode(message.value); + }, + toProto(message: MEVMatch): Uint8Array { + return MEVMatch.encode(message).finish(); + }, + toProtoMsg(message: MEVMatch): MEVMatchProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MEVMatch", + value: MEVMatch.encode(message).finish() + }; + } +}; +function createBaseMEVLiquidationMatch(): MEVLiquidationMatch { + return { + liquidatedSubaccountId: SubaccountId.fromPartial({}), + insuranceFundDeltaQuoteQuantums: BigInt(0), + makerOrderSubaccountId: SubaccountId.fromPartial({}), + makerOrderSubticks: BigInt(0), + makerOrderIsBuy: false, + makerFeePpm: 0, + clobPairId: 0, + fillAmount: BigInt(0) + }; +} +export const MEVLiquidationMatch = { + typeUrl: "/dydxprotocol.clob.MEVLiquidationMatch", + encode(message: MEVLiquidationMatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidatedSubaccountId !== undefined) { + SubaccountId.encode(message.liquidatedSubaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.insuranceFundDeltaQuoteQuantums !== BigInt(0)) { + writer.uint32(16).int64(message.insuranceFundDeltaQuoteQuantums); + } + if (message.makerOrderSubaccountId !== undefined) { + SubaccountId.encode(message.makerOrderSubaccountId, writer.uint32(26).fork()).ldelim(); + } + if (message.makerOrderSubticks !== BigInt(0)) { + writer.uint32(32).uint64(message.makerOrderSubticks); + } + if (message.makerOrderIsBuy === true) { + writer.uint32(40).bool(message.makerOrderIsBuy); + } + if (message.makerFeePpm !== 0) { + writer.uint32(48).int32(message.makerFeePpm); + } + if (message.clobPairId !== 0) { + writer.uint32(56).uint32(message.clobPairId); + } + if (message.fillAmount !== BigInt(0)) { + writer.uint32(64).uint64(message.fillAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MEVLiquidationMatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMEVLiquidationMatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidatedSubaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.insuranceFundDeltaQuoteQuantums = reader.int64(); + break; + case 3: + message.makerOrderSubaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 4: + message.makerOrderSubticks = reader.uint64(); + break; + case 5: + message.makerOrderIsBuy = reader.bool(); + break; + case 6: + message.makerFeePpm = reader.int32(); + break; + case 7: + message.clobPairId = reader.uint32(); + break; + case 8: + message.fillAmount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MEVLiquidationMatch { + const message = createBaseMEVLiquidationMatch(); + message.liquidatedSubaccountId = object.liquidatedSubaccountId !== undefined && object.liquidatedSubaccountId !== null ? SubaccountId.fromPartial(object.liquidatedSubaccountId) : undefined; + message.insuranceFundDeltaQuoteQuantums = object.insuranceFundDeltaQuoteQuantums !== undefined && object.insuranceFundDeltaQuoteQuantums !== null ? BigInt(object.insuranceFundDeltaQuoteQuantums.toString()) : BigInt(0); + message.makerOrderSubaccountId = object.makerOrderSubaccountId !== undefined && object.makerOrderSubaccountId !== null ? SubaccountId.fromPartial(object.makerOrderSubaccountId) : undefined; + message.makerOrderSubticks = object.makerOrderSubticks !== undefined && object.makerOrderSubticks !== null ? BigInt(object.makerOrderSubticks.toString()) : BigInt(0); + message.makerOrderIsBuy = object.makerOrderIsBuy ?? false; + message.makerFeePpm = object.makerFeePpm ?? 0; + message.clobPairId = object.clobPairId ?? 0; + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MEVLiquidationMatchAmino): MEVLiquidationMatch { + const message = createBaseMEVLiquidationMatch(); + if (object.liquidated_subaccount_id !== undefined && object.liquidated_subaccount_id !== null) { + message.liquidatedSubaccountId = SubaccountId.fromAmino(object.liquidated_subaccount_id); + } + if (object.insurance_fund_delta_quote_quantums !== undefined && object.insurance_fund_delta_quote_quantums !== null) { + message.insuranceFundDeltaQuoteQuantums = BigInt(object.insurance_fund_delta_quote_quantums); + } + if (object.maker_order_subaccount_id !== undefined && object.maker_order_subaccount_id !== null) { + message.makerOrderSubaccountId = SubaccountId.fromAmino(object.maker_order_subaccount_id); + } + if (object.maker_order_subticks !== undefined && object.maker_order_subticks !== null) { + message.makerOrderSubticks = BigInt(object.maker_order_subticks); + } + if (object.maker_order_is_buy !== undefined && object.maker_order_is_buy !== null) { + message.makerOrderIsBuy = object.maker_order_is_buy; + } + if (object.maker_fee_ppm !== undefined && object.maker_fee_ppm !== null) { + message.makerFeePpm = object.maker_fee_ppm; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + return message; + }, + toAmino(message: MEVLiquidationMatch): MEVLiquidationMatchAmino { + const obj: any = {}; + obj.liquidated_subaccount_id = message.liquidatedSubaccountId ? SubaccountId.toAmino(message.liquidatedSubaccountId) : undefined; + obj.insurance_fund_delta_quote_quantums = message.insuranceFundDeltaQuoteQuantums !== BigInt(0) ? message.insuranceFundDeltaQuoteQuantums.toString() : undefined; + obj.maker_order_subaccount_id = message.makerOrderSubaccountId ? SubaccountId.toAmino(message.makerOrderSubaccountId) : undefined; + obj.maker_order_subticks = message.makerOrderSubticks !== BigInt(0) ? message.makerOrderSubticks.toString() : undefined; + obj.maker_order_is_buy = message.makerOrderIsBuy === false ? undefined : message.makerOrderIsBuy; + obj.maker_fee_ppm = message.makerFeePpm === 0 ? undefined : message.makerFeePpm; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MEVLiquidationMatchAminoMsg): MEVLiquidationMatch { + return MEVLiquidationMatch.fromAmino(object.value); + }, + fromProtoMsg(message: MEVLiquidationMatchProtoMsg): MEVLiquidationMatch { + return MEVLiquidationMatch.decode(message.value); + }, + toProto(message: MEVLiquidationMatch): Uint8Array { + return MEVLiquidationMatch.encode(message).finish(); + }, + toProtoMsg(message: MEVLiquidationMatch): MEVLiquidationMatchProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MEVLiquidationMatch", + value: MEVLiquidationMatch.encode(message).finish() + }; + } +}; +function createBaseClobMidPrice(): ClobMidPrice { + return { + clobPair: ClobPair.fromPartial({}), + subticks: BigInt(0) + }; +} +export const ClobMidPrice = { + typeUrl: "/dydxprotocol.clob.ClobMidPrice", + encode(message: ClobMidPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clobPair !== undefined) { + ClobPair.encode(message.clobPair, writer.uint32(10).fork()).ldelim(); + } + if (message.subticks !== BigInt(0)) { + writer.uint32(16).uint64(message.subticks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClobMidPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClobMidPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobPair = ClobPair.decode(reader, reader.uint32()); + break; + case 2: + message.subticks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClobMidPrice { + const message = createBaseClobMidPrice(); + message.clobPair = object.clobPair !== undefined && object.clobPair !== null ? ClobPair.fromPartial(object.clobPair) : undefined; + message.subticks = object.subticks !== undefined && object.subticks !== null ? BigInt(object.subticks.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ClobMidPriceAmino): ClobMidPrice { + const message = createBaseClobMidPrice(); + if (object.clob_pair !== undefined && object.clob_pair !== null) { + message.clobPair = ClobPair.fromAmino(object.clob_pair); + } + if (object.subticks !== undefined && object.subticks !== null) { + message.subticks = BigInt(object.subticks); + } + return message; + }, + toAmino(message: ClobMidPrice): ClobMidPriceAmino { + const obj: any = {}; + obj.clob_pair = message.clobPair ? ClobPair.toAmino(message.clobPair) : undefined; + obj.subticks = message.subticks !== BigInt(0) ? message.subticks.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ClobMidPriceAminoMsg): ClobMidPrice { + return ClobMidPrice.fromAmino(object.value); + }, + fromProtoMsg(message: ClobMidPriceProtoMsg): ClobMidPrice { + return ClobMidPrice.decode(message.value); + }, + toProto(message: ClobMidPrice): Uint8Array { + return ClobMidPrice.encode(message).finish(); + }, + toProtoMsg(message: ClobMidPrice): ClobMidPriceProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.ClobMidPrice", + value: ClobMidPrice.encode(message).finish() + }; + } +}; +function createBaseValidatorMevMatches(): ValidatorMevMatches { + return { + matches: [], + liquidationMatches: [] + }; +} +export const ValidatorMevMatches = { + typeUrl: "/dydxprotocol.clob.ValidatorMevMatches", + encode(message: ValidatorMevMatches, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.matches) { + MEVMatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.liquidationMatches) { + MEVLiquidationMatch.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorMevMatches { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorMevMatches(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.matches.push(MEVMatch.decode(reader, reader.uint32())); + break; + case 2: + message.liquidationMatches.push(MEVLiquidationMatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorMevMatches { + const message = createBaseValidatorMevMatches(); + message.matches = object.matches?.map(e => MEVMatch.fromPartial(e)) || []; + message.liquidationMatches = object.liquidationMatches?.map(e => MEVLiquidationMatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorMevMatchesAmino): ValidatorMevMatches { + const message = createBaseValidatorMevMatches(); + message.matches = object.matches?.map(e => MEVMatch.fromAmino(e)) || []; + message.liquidationMatches = object.liquidation_matches?.map(e => MEVLiquidationMatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorMevMatches): ValidatorMevMatchesAmino { + const obj: any = {}; + if (message.matches) { + obj.matches = message.matches.map(e => e ? MEVMatch.toAmino(e) : undefined); + } else { + obj.matches = message.matches; + } + if (message.liquidationMatches) { + obj.liquidation_matches = message.liquidationMatches.map(e => e ? MEVLiquidationMatch.toAmino(e) : undefined); + } else { + obj.liquidation_matches = message.liquidationMatches; + } + return obj; + }, + fromAminoMsg(object: ValidatorMevMatchesAminoMsg): ValidatorMevMatches { + return ValidatorMevMatches.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorMevMatchesProtoMsg): ValidatorMevMatches { + return ValidatorMevMatches.decode(message.value); + }, + toProto(message: ValidatorMevMatches): Uint8Array { + return ValidatorMevMatches.encode(message).finish(); + }, + toProtoMsg(message: ValidatorMevMatches): ValidatorMevMatchesProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.ValidatorMevMatches", + value: ValidatorMevMatches.encode(message).finish() + }; + } +}; +function createBaseMevNodeToNodeMetrics(): MevNodeToNodeMetrics { + return { + validatorMevMatches: undefined, + clobMidPrices: [], + bpMevMatches: undefined, + proposalReceiveTime: BigInt(0) + }; +} +export const MevNodeToNodeMetrics = { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeMetrics", + encode(message: MevNodeToNodeMetrics, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorMevMatches !== undefined) { + ValidatorMevMatches.encode(message.validatorMevMatches, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clobMidPrices) { + ClobMidPrice.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.bpMevMatches !== undefined) { + ValidatorMevMatches.encode(message.bpMevMatches, writer.uint32(26).fork()).ldelim(); + } + if (message.proposalReceiveTime !== BigInt(0)) { + writer.uint32(32).uint64(message.proposalReceiveTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MevNodeToNodeMetrics { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMevNodeToNodeMetrics(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorMevMatches = ValidatorMevMatches.decode(reader, reader.uint32()); + break; + case 2: + message.clobMidPrices.push(ClobMidPrice.decode(reader, reader.uint32())); + break; + case 3: + message.bpMevMatches = ValidatorMevMatches.decode(reader, reader.uint32()); + break; + case 4: + message.proposalReceiveTime = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MevNodeToNodeMetrics { + const message = createBaseMevNodeToNodeMetrics(); + message.validatorMevMatches = object.validatorMevMatches !== undefined && object.validatorMevMatches !== null ? ValidatorMevMatches.fromPartial(object.validatorMevMatches) : undefined; + message.clobMidPrices = object.clobMidPrices?.map(e => ClobMidPrice.fromPartial(e)) || []; + message.bpMevMatches = object.bpMevMatches !== undefined && object.bpMevMatches !== null ? ValidatorMevMatches.fromPartial(object.bpMevMatches) : undefined; + message.proposalReceiveTime = object.proposalReceiveTime !== undefined && object.proposalReceiveTime !== null ? BigInt(object.proposalReceiveTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MevNodeToNodeMetricsAmino): MevNodeToNodeMetrics { + const message = createBaseMevNodeToNodeMetrics(); + if (object.validator_mev_matches !== undefined && object.validator_mev_matches !== null) { + message.validatorMevMatches = ValidatorMevMatches.fromAmino(object.validator_mev_matches); + } + message.clobMidPrices = object.clob_mid_prices?.map(e => ClobMidPrice.fromAmino(e)) || []; + if (object.bp_mev_matches !== undefined && object.bp_mev_matches !== null) { + message.bpMevMatches = ValidatorMevMatches.fromAmino(object.bp_mev_matches); + } + if (object.proposal_receive_time !== undefined && object.proposal_receive_time !== null) { + message.proposalReceiveTime = BigInt(object.proposal_receive_time); + } + return message; + }, + toAmino(message: MevNodeToNodeMetrics): MevNodeToNodeMetricsAmino { + const obj: any = {}; + obj.validator_mev_matches = message.validatorMevMatches ? ValidatorMevMatches.toAmino(message.validatorMevMatches) : undefined; + if (message.clobMidPrices) { + obj.clob_mid_prices = message.clobMidPrices.map(e => e ? ClobMidPrice.toAmino(e) : undefined); + } else { + obj.clob_mid_prices = message.clobMidPrices; + } + obj.bp_mev_matches = message.bpMevMatches ? ValidatorMevMatches.toAmino(message.bpMevMatches) : undefined; + obj.proposal_receive_time = message.proposalReceiveTime !== BigInt(0) ? message.proposalReceiveTime.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MevNodeToNodeMetricsAminoMsg): MevNodeToNodeMetrics { + return MevNodeToNodeMetrics.fromAmino(object.value); + }, + fromProtoMsg(message: MevNodeToNodeMetricsProtoMsg): MevNodeToNodeMetrics { + return MevNodeToNodeMetrics.decode(message.value); + }, + toProto(message: MevNodeToNodeMetrics): Uint8Array { + return MevNodeToNodeMetrics.encode(message).finish(); + }, + toProtoMsg(message: MevNodeToNodeMetrics): MevNodeToNodeMetricsProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeMetrics", + value: MevNodeToNodeMetrics.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/operation.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/operation.ts new file mode 100644 index 00000000..0205b015 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/operation.ts @@ -0,0 +1,280 @@ +//@ts-nocheck +import { ClobMatch, ClobMatchAmino, ClobMatchSDKType } from "./matches"; +import { MsgPlaceOrder, MsgPlaceOrderAmino, MsgPlaceOrderSDKType, MsgCancelOrder, MsgCancelOrderAmino, MsgCancelOrderSDKType } from "./tx"; +import { OrderId, OrderIdAmino, OrderIdSDKType } from "./order"; +import { OrderRemoval, OrderRemovalAmino, OrderRemovalSDKType } from "./order_removals"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * Operation represents an operation in the proposed operations. Operation is + * used internally within the memclob only. + */ +export interface Operation { + match?: ClobMatch; + shortTermOrderPlacement?: MsgPlaceOrder; + shortTermOrderCancellation?: MsgCancelOrder; + preexistingStatefulOrder?: OrderId; +} +export interface OperationProtoMsg { + typeUrl: "/dydxprotocol.clob.Operation"; + value: Uint8Array; +} +/** + * Operation represents an operation in the proposed operations. Operation is + * used internally within the memclob only. + */ +export interface OperationAmino { + match?: ClobMatchAmino; + short_term_order_placement?: MsgPlaceOrderAmino; + short_term_order_cancellation?: MsgCancelOrderAmino; + preexisting_stateful_order?: OrderIdAmino; +} +export interface OperationAminoMsg { + type: "/dydxprotocol.clob.Operation"; + value: OperationAmino; +} +/** + * Operation represents an operation in the proposed operations. Operation is + * used internally within the memclob only. + */ +export interface OperationSDKType { + match?: ClobMatchSDKType; + short_term_order_placement?: MsgPlaceOrderSDKType; + short_term_order_cancellation?: MsgCancelOrderSDKType; + preexisting_stateful_order?: OrderIdSDKType; +} +/** + * InternalOperation represents an internal operation in the operations to + * propose. InternalOperation is used internally within the memclob only. + */ +export interface InternalOperation { + match?: ClobMatch; + shortTermOrderPlacement?: MsgPlaceOrder; + preexistingStatefulOrder?: OrderId; + orderRemoval?: OrderRemoval; +} +export interface InternalOperationProtoMsg { + typeUrl: "/dydxprotocol.clob.InternalOperation"; + value: Uint8Array; +} +/** + * InternalOperation represents an internal operation in the operations to + * propose. InternalOperation is used internally within the memclob only. + */ +export interface InternalOperationAmino { + match?: ClobMatchAmino; + short_term_order_placement?: MsgPlaceOrderAmino; + preexisting_stateful_order?: OrderIdAmino; + order_removal?: OrderRemovalAmino; +} +export interface InternalOperationAminoMsg { + type: "/dydxprotocol.clob.InternalOperation"; + value: InternalOperationAmino; +} +/** + * InternalOperation represents an internal operation in the operations to + * propose. InternalOperation is used internally within the memclob only. + */ +export interface InternalOperationSDKType { + match?: ClobMatchSDKType; + short_term_order_placement?: MsgPlaceOrderSDKType; + preexisting_stateful_order?: OrderIdSDKType; + order_removal?: OrderRemovalSDKType; +} +function createBaseOperation(): Operation { + return { + match: undefined, + shortTermOrderPlacement: undefined, + shortTermOrderCancellation: undefined, + preexistingStatefulOrder: undefined + }; +} +export const Operation = { + typeUrl: "/dydxprotocol.clob.Operation", + encode(message: Operation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.match !== undefined) { + ClobMatch.encode(message.match, writer.uint32(10).fork()).ldelim(); + } + if (message.shortTermOrderPlacement !== undefined) { + MsgPlaceOrder.encode(message.shortTermOrderPlacement, writer.uint32(18).fork()).ldelim(); + } + if (message.shortTermOrderCancellation !== undefined) { + MsgCancelOrder.encode(message.shortTermOrderCancellation, writer.uint32(26).fork()).ldelim(); + } + if (message.preexistingStatefulOrder !== undefined) { + OrderId.encode(message.preexistingStatefulOrder, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Operation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOperation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.match = ClobMatch.decode(reader, reader.uint32()); + break; + case 2: + message.shortTermOrderPlacement = MsgPlaceOrder.decode(reader, reader.uint32()); + break; + case 3: + message.shortTermOrderCancellation = MsgCancelOrder.decode(reader, reader.uint32()); + break; + case 4: + message.preexistingStatefulOrder = OrderId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Operation { + const message = createBaseOperation(); + message.match = object.match !== undefined && object.match !== null ? ClobMatch.fromPartial(object.match) : undefined; + message.shortTermOrderPlacement = object.shortTermOrderPlacement !== undefined && object.shortTermOrderPlacement !== null ? MsgPlaceOrder.fromPartial(object.shortTermOrderPlacement) : undefined; + message.shortTermOrderCancellation = object.shortTermOrderCancellation !== undefined && object.shortTermOrderCancellation !== null ? MsgCancelOrder.fromPartial(object.shortTermOrderCancellation) : undefined; + message.preexistingStatefulOrder = object.preexistingStatefulOrder !== undefined && object.preexistingStatefulOrder !== null ? OrderId.fromPartial(object.preexistingStatefulOrder) : undefined; + return message; + }, + fromAmino(object: OperationAmino): Operation { + const message = createBaseOperation(); + if (object.match !== undefined && object.match !== null) { + message.match = ClobMatch.fromAmino(object.match); + } + if (object.short_term_order_placement !== undefined && object.short_term_order_placement !== null) { + message.shortTermOrderPlacement = MsgPlaceOrder.fromAmino(object.short_term_order_placement); + } + if (object.short_term_order_cancellation !== undefined && object.short_term_order_cancellation !== null) { + message.shortTermOrderCancellation = MsgCancelOrder.fromAmino(object.short_term_order_cancellation); + } + if (object.preexisting_stateful_order !== undefined && object.preexisting_stateful_order !== null) { + message.preexistingStatefulOrder = OrderId.fromAmino(object.preexisting_stateful_order); + } + return message; + }, + toAmino(message: Operation): OperationAmino { + const obj: any = {}; + obj.match = message.match ? ClobMatch.toAmino(message.match) : undefined; + obj.short_term_order_placement = message.shortTermOrderPlacement ? MsgPlaceOrder.toAmino(message.shortTermOrderPlacement) : undefined; + obj.short_term_order_cancellation = message.shortTermOrderCancellation ? MsgCancelOrder.toAmino(message.shortTermOrderCancellation) : undefined; + obj.preexisting_stateful_order = message.preexistingStatefulOrder ? OrderId.toAmino(message.preexistingStatefulOrder) : undefined; + return obj; + }, + fromAminoMsg(object: OperationAminoMsg): Operation { + return Operation.fromAmino(object.value); + }, + fromProtoMsg(message: OperationProtoMsg): Operation { + return Operation.decode(message.value); + }, + toProto(message: Operation): Uint8Array { + return Operation.encode(message).finish(); + }, + toProtoMsg(message: Operation): OperationProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.Operation", + value: Operation.encode(message).finish() + }; + } +}; +function createBaseInternalOperation(): InternalOperation { + return { + match: undefined, + shortTermOrderPlacement: undefined, + preexistingStatefulOrder: undefined, + orderRemoval: undefined + }; +} +export const InternalOperation = { + typeUrl: "/dydxprotocol.clob.InternalOperation", + encode(message: InternalOperation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.match !== undefined) { + ClobMatch.encode(message.match, writer.uint32(10).fork()).ldelim(); + } + if (message.shortTermOrderPlacement !== undefined) { + MsgPlaceOrder.encode(message.shortTermOrderPlacement, writer.uint32(18).fork()).ldelim(); + } + if (message.preexistingStatefulOrder !== undefined) { + OrderId.encode(message.preexistingStatefulOrder, writer.uint32(26).fork()).ldelim(); + } + if (message.orderRemoval !== undefined) { + OrderRemoval.encode(message.orderRemoval, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InternalOperation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInternalOperation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.match = ClobMatch.decode(reader, reader.uint32()); + break; + case 2: + message.shortTermOrderPlacement = MsgPlaceOrder.decode(reader, reader.uint32()); + break; + case 3: + message.preexistingStatefulOrder = OrderId.decode(reader, reader.uint32()); + break; + case 4: + message.orderRemoval = OrderRemoval.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InternalOperation { + const message = createBaseInternalOperation(); + message.match = object.match !== undefined && object.match !== null ? ClobMatch.fromPartial(object.match) : undefined; + message.shortTermOrderPlacement = object.shortTermOrderPlacement !== undefined && object.shortTermOrderPlacement !== null ? MsgPlaceOrder.fromPartial(object.shortTermOrderPlacement) : undefined; + message.preexistingStatefulOrder = object.preexistingStatefulOrder !== undefined && object.preexistingStatefulOrder !== null ? OrderId.fromPartial(object.preexistingStatefulOrder) : undefined; + message.orderRemoval = object.orderRemoval !== undefined && object.orderRemoval !== null ? OrderRemoval.fromPartial(object.orderRemoval) : undefined; + return message; + }, + fromAmino(object: InternalOperationAmino): InternalOperation { + const message = createBaseInternalOperation(); + if (object.match !== undefined && object.match !== null) { + message.match = ClobMatch.fromAmino(object.match); + } + if (object.short_term_order_placement !== undefined && object.short_term_order_placement !== null) { + message.shortTermOrderPlacement = MsgPlaceOrder.fromAmino(object.short_term_order_placement); + } + if (object.preexisting_stateful_order !== undefined && object.preexisting_stateful_order !== null) { + message.preexistingStatefulOrder = OrderId.fromAmino(object.preexisting_stateful_order); + } + if (object.order_removal !== undefined && object.order_removal !== null) { + message.orderRemoval = OrderRemoval.fromAmino(object.order_removal); + } + return message; + }, + toAmino(message: InternalOperation): InternalOperationAmino { + const obj: any = {}; + obj.match = message.match ? ClobMatch.toAmino(message.match) : undefined; + obj.short_term_order_placement = message.shortTermOrderPlacement ? MsgPlaceOrder.toAmino(message.shortTermOrderPlacement) : undefined; + obj.preexisting_stateful_order = message.preexistingStatefulOrder ? OrderId.toAmino(message.preexistingStatefulOrder) : undefined; + obj.order_removal = message.orderRemoval ? OrderRemoval.toAmino(message.orderRemoval) : undefined; + return obj; + }, + fromAminoMsg(object: InternalOperationAminoMsg): InternalOperation { + return InternalOperation.fromAmino(object.value); + }, + fromProtoMsg(message: InternalOperationProtoMsg): InternalOperation { + return InternalOperation.decode(message.value); + }, + toProto(message: InternalOperation): Uint8Array { + return InternalOperation.encode(message).finish(); + }, + toProtoMsg(message: InternalOperation): InternalOperationProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.InternalOperation", + value: InternalOperation.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/order.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/order.ts new file mode 100644 index 00000000..48479281 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/order.ts @@ -0,0 +1,1680 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { PerpetualLiquidationInfo, PerpetualLiquidationInfoAmino, PerpetualLiquidationInfoSDKType } from "./liquidations"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * Represents the side of the orderbook the order will be placed on. + * Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be + * placed on the orderbook. + */ +export enum Order_Side { + /** SIDE_UNSPECIFIED - Default value. This value is invalid and unused. */ + SIDE_UNSPECIFIED = 0, + /** SIDE_BUY - SIDE_BUY is used to represent a BUY order. */ + SIDE_BUY = 1, + /** SIDE_SELL - SIDE_SELL is used to represent a SELL order. */ + SIDE_SELL = 2, + UNRECOGNIZED = -1, +} +export const Order_SideSDKType = Order_Side; +export const Order_SideAmino = Order_Side; +export function order_SideFromJSON(object: any): Order_Side { + switch (object) { + case 0: + case "SIDE_UNSPECIFIED": + return Order_Side.SIDE_UNSPECIFIED; + case 1: + case "SIDE_BUY": + return Order_Side.SIDE_BUY; + case 2: + case "SIDE_SELL": + return Order_Side.SIDE_SELL; + case -1: + case "UNRECOGNIZED": + default: + return Order_Side.UNRECOGNIZED; + } +} +export function order_SideToJSON(object: Order_Side): string { + switch (object) { + case Order_Side.SIDE_UNSPECIFIED: + return "SIDE_UNSPECIFIED"; + case Order_Side.SIDE_BUY: + return "SIDE_BUY"; + case Order_Side.SIDE_SELL: + return "SIDE_SELL"; + case Order_Side.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * TimeInForce indicates how long an order will remain active before it + * is executed or expires. + */ +export enum Order_TimeInForce { + /** + * TIME_IN_FORCE_UNSPECIFIED - TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an + * order will first match with existing orders on the book, and any + * remaining size will be added to the book as a maker order. + */ + TIME_IN_FORCE_UNSPECIFIED = 0, + /** + * TIME_IN_FORCE_IOC - TIME_IN_FORCE_IOC enforces that an order only be matched with + * maker orders on the book. If the order has remaining size after + * matching with existing orders on the book, the remaining size + * is not placed on the book. + */ + TIME_IN_FORCE_IOC = 1, + /** + * TIME_IN_FORCE_POST_ONLY - TIME_IN_FORCE_POST_ONLY enforces that an order only be placed + * on the book as a maker order. Note this means that validators will cancel + * any newly-placed post only orders that would cross with other maker + * orders. + */ + TIME_IN_FORCE_POST_ONLY = 2, + /** + * TIME_IN_FORCE_FILL_OR_KILL - TIME_IN_FORCE_FILL_OR_KILL has been deprecated and will be removed in + * future versions. + */ + TIME_IN_FORCE_FILL_OR_KILL = 3, + UNRECOGNIZED = -1, +} +export const Order_TimeInForceSDKType = Order_TimeInForce; +export const Order_TimeInForceAmino = Order_TimeInForce; +export function order_TimeInForceFromJSON(object: any): Order_TimeInForce { + switch (object) { + case 0: + case "TIME_IN_FORCE_UNSPECIFIED": + return Order_TimeInForce.TIME_IN_FORCE_UNSPECIFIED; + case 1: + case "TIME_IN_FORCE_IOC": + return Order_TimeInForce.TIME_IN_FORCE_IOC; + case 2: + case "TIME_IN_FORCE_POST_ONLY": + return Order_TimeInForce.TIME_IN_FORCE_POST_ONLY; + case 3: + case "TIME_IN_FORCE_FILL_OR_KILL": + return Order_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL; + case -1: + case "UNRECOGNIZED": + default: + return Order_TimeInForce.UNRECOGNIZED; + } +} +export function order_TimeInForceToJSON(object: Order_TimeInForce): string { + switch (object) { + case Order_TimeInForce.TIME_IN_FORCE_UNSPECIFIED: + return "TIME_IN_FORCE_UNSPECIFIED"; + case Order_TimeInForce.TIME_IN_FORCE_IOC: + return "TIME_IN_FORCE_IOC"; + case Order_TimeInForce.TIME_IN_FORCE_POST_ONLY: + return "TIME_IN_FORCE_POST_ONLY"; + case Order_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL: + return "TIME_IN_FORCE_FILL_OR_KILL"; + case Order_TimeInForce.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum Order_ConditionType { + /** + * CONDITION_TYPE_UNSPECIFIED - CONDITION_TYPE_UNSPECIFIED represents the default behavior where an + * order will be placed immediately on the orderbook. + */ + CONDITION_TYPE_UNSPECIFIED = 0, + /** + * CONDITION_TYPE_STOP_LOSS - CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will + * trigger when the oracle price moves at or above the trigger price for + * buys, and at or below the trigger price for sells. + */ + CONDITION_TYPE_STOP_LOSS = 1, + /** + * CONDITION_TYPE_TAKE_PROFIT - CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit + * order will trigger when the oracle price moves at or below the trigger + * price for buys and at or above the trigger price for sells. + */ + CONDITION_TYPE_TAKE_PROFIT = 2, + UNRECOGNIZED = -1, +} +export const Order_ConditionTypeSDKType = Order_ConditionType; +export const Order_ConditionTypeAmino = Order_ConditionType; +export function order_ConditionTypeFromJSON(object: any): Order_ConditionType { + switch (object) { + case 0: + case "CONDITION_TYPE_UNSPECIFIED": + return Order_ConditionType.CONDITION_TYPE_UNSPECIFIED; + case 1: + case "CONDITION_TYPE_STOP_LOSS": + return Order_ConditionType.CONDITION_TYPE_STOP_LOSS; + case 2: + case "CONDITION_TYPE_TAKE_PROFIT": + return Order_ConditionType.CONDITION_TYPE_TAKE_PROFIT; + case -1: + case "UNRECOGNIZED": + default: + return Order_ConditionType.UNRECOGNIZED; + } +} +export function order_ConditionTypeToJSON(object: Order_ConditionType): string { + switch (object) { + case Order_ConditionType.CONDITION_TYPE_UNSPECIFIED: + return "CONDITION_TYPE_UNSPECIFIED"; + case Order_ConditionType.CONDITION_TYPE_STOP_LOSS: + return "CONDITION_TYPE_STOP_LOSS"; + case Order_ConditionType.CONDITION_TYPE_TAKE_PROFIT: + return "CONDITION_TYPE_TAKE_PROFIT"; + case Order_ConditionType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** OrderId refers to a single order belonging to a Subaccount. */ +export interface OrderId { + /** + * The subaccount ID that opened this order. + * Note that this field has `gogoproto.nullable = false` so that it is + * generated as a value instead of a pointer. This is because the `OrderId` + * proto is used as a key within maps, and map comparisons will compare + * pointers for equality (when the desired behavior is to compare the values). + */ + subaccountId: SubaccountId; + /** + * The client ID of this order, unique with respect to the specific + * sub account (I.E., the same subaccount can't have two orders with + * the same ClientId). + */ + clientId: number; + /** + * order_flags represent order flags for the order. This field is invalid if + * it's greater than 127 (larger than one byte). Each bit in the first byte + * represents a different flag. Currently only two flags are supported. + * + * Starting from the bit after the most MSB (note that the MSB is used in + * proto varint encoding, and therefore cannot be used): Bit 1 is set if this + * order is a Long-Term order (0x40, or 64 as a uint8). Bit 2 is set if this + * order is a Conditional order (0x20, or 32 as a uint8). + * + * If neither bit is set, the order is assumed to be a Short-Term order. + * + * If both bits are set or bits other than the 2nd and 3rd are set, the order + * ID is invalid. + */ + orderFlags: number; + /** ID of the CLOB the order is created for. */ + clobPairId: number; +} +export interface OrderIdProtoMsg { + typeUrl: "/dydxprotocol.clob.OrderId"; + value: Uint8Array; +} +/** OrderId refers to a single order belonging to a Subaccount. */ +export interface OrderIdAmino { + /** + * The subaccount ID that opened this order. + * Note that this field has `gogoproto.nullable = false` so that it is + * generated as a value instead of a pointer. This is because the `OrderId` + * proto is used as a key within maps, and map comparisons will compare + * pointers for equality (when the desired behavior is to compare the values). + */ + subaccount_id?: SubaccountIdAmino; + /** + * The client ID of this order, unique with respect to the specific + * sub account (I.E., the same subaccount can't have two orders with + * the same ClientId). + */ + client_id?: number; + /** + * order_flags represent order flags for the order. This field is invalid if + * it's greater than 127 (larger than one byte). Each bit in the first byte + * represents a different flag. Currently only two flags are supported. + * + * Starting from the bit after the most MSB (note that the MSB is used in + * proto varint encoding, and therefore cannot be used): Bit 1 is set if this + * order is a Long-Term order (0x40, or 64 as a uint8). Bit 2 is set if this + * order is a Conditional order (0x20, or 32 as a uint8). + * + * If neither bit is set, the order is assumed to be a Short-Term order. + * + * If both bits are set or bits other than the 2nd and 3rd are set, the order + * ID is invalid. + */ + order_flags?: number; + /** ID of the CLOB the order is created for. */ + clob_pair_id?: number; +} +export interface OrderIdAminoMsg { + type: "/dydxprotocol.clob.OrderId"; + value: OrderIdAmino; +} +/** OrderId refers to a single order belonging to a Subaccount. */ +export interface OrderIdSDKType { + subaccount_id: SubaccountIdSDKType; + client_id: number; + order_flags: number; + clob_pair_id: number; +} +/** + * OrdersFilledDuringLatestBlock represents a list of `OrderIds` that were + * filled by any non-zero amount in the latest block. + */ +export interface OrdersFilledDuringLatestBlock { + /** + * A list of unique order_ids that were filled by any non-zero amount in the + * latest block. + */ + orderIds: OrderId[]; +} +export interface OrdersFilledDuringLatestBlockProtoMsg { + typeUrl: "/dydxprotocol.clob.OrdersFilledDuringLatestBlock"; + value: Uint8Array; +} +/** + * OrdersFilledDuringLatestBlock represents a list of `OrderIds` that were + * filled by any non-zero amount in the latest block. + */ +export interface OrdersFilledDuringLatestBlockAmino { + /** + * A list of unique order_ids that were filled by any non-zero amount in the + * latest block. + */ + order_ids?: OrderIdAmino[]; +} +export interface OrdersFilledDuringLatestBlockAminoMsg { + type: "/dydxprotocol.clob.OrdersFilledDuringLatestBlock"; + value: OrdersFilledDuringLatestBlockAmino; +} +/** + * OrdersFilledDuringLatestBlock represents a list of `OrderIds` that were + * filled by any non-zero amount in the latest block. + */ +export interface OrdersFilledDuringLatestBlockSDKType { + order_ids: OrderIdSDKType[]; +} +/** + * PotentiallyPrunableOrders represents a list of orders that may be prunable + * from state at a future block height. + */ +export interface PotentiallyPrunableOrders { + /** + * A list of unique order_ids that may potentially be pruned from state at a + * future block height. + */ + orderIds: OrderId[]; +} +export interface PotentiallyPrunableOrdersProtoMsg { + typeUrl: "/dydxprotocol.clob.PotentiallyPrunableOrders"; + value: Uint8Array; +} +/** + * PotentiallyPrunableOrders represents a list of orders that may be prunable + * from state at a future block height. + */ +export interface PotentiallyPrunableOrdersAmino { + /** + * A list of unique order_ids that may potentially be pruned from state at a + * future block height. + */ + order_ids?: OrderIdAmino[]; +} +export interface PotentiallyPrunableOrdersAminoMsg { + type: "/dydxprotocol.clob.PotentiallyPrunableOrders"; + value: PotentiallyPrunableOrdersAmino; +} +/** + * PotentiallyPrunableOrders represents a list of orders that may be prunable + * from state at a future block height. + */ +export interface PotentiallyPrunableOrdersSDKType { + order_ids: OrderIdSDKType[]; +} +/** + * OrderFillState represents the fill amount of an order according to on-chain + * state. This proto includes both the current on-chain fill amount of the + * order, as well as the block at which this information can be pruned from + * state. + */ +export interface OrderFillState { + /** The current fillAmount of the order according to on-chain state. */ + fillAmount: bigint; + /** + * The block height at which the fillAmount state for this order can be + * pruned. + */ + prunableBlockHeight: number; +} +export interface OrderFillStateProtoMsg { + typeUrl: "/dydxprotocol.clob.OrderFillState"; + value: Uint8Array; +} +/** + * OrderFillState represents the fill amount of an order according to on-chain + * state. This proto includes both the current on-chain fill amount of the + * order, as well as the block at which this information can be pruned from + * state. + */ +export interface OrderFillStateAmino { + /** The current fillAmount of the order according to on-chain state. */ + fill_amount?: string; + /** + * The block height at which the fillAmount state for this order can be + * pruned. + */ + prunable_block_height?: number; +} +export interface OrderFillStateAminoMsg { + type: "/dydxprotocol.clob.OrderFillState"; + value: OrderFillStateAmino; +} +/** + * OrderFillState represents the fill amount of an order according to on-chain + * state. This proto includes both the current on-chain fill amount of the + * order, as well as the block at which this information can be pruned from + * state. + */ +export interface OrderFillStateSDKType { + fill_amount: bigint; + prunable_block_height: number; +} +/** + * StatefulOrderTimeSliceValue represents the type of the value of the + * `StatefulOrdersTimeSlice` in state. The `StatefulOrdersTimeSlice` + * in state consists of key/value pairs where the keys are UTF-8-encoded + * `RFC3339NANO` timestamp strings with right-padded zeroes and no + * time zone info, and the values are of type `StatefulOrderTimeSliceValue`. + * This `StatefulOrderTimeSliceValue` in state is used for managing stateful + * order expiration. Stateful order expirations can be for either long term + * or conditional orders. + */ +export interface StatefulOrderTimeSliceValue { + /** + * A unique list of order_ids that expire at this timestamp, sorted in + * ascending order by block height and transaction index of each stateful + * order. + */ + orderIds: OrderId[]; +} +export interface StatefulOrderTimeSliceValueProtoMsg { + typeUrl: "/dydxprotocol.clob.StatefulOrderTimeSliceValue"; + value: Uint8Array; +} +/** + * StatefulOrderTimeSliceValue represents the type of the value of the + * `StatefulOrdersTimeSlice` in state. The `StatefulOrdersTimeSlice` + * in state consists of key/value pairs where the keys are UTF-8-encoded + * `RFC3339NANO` timestamp strings with right-padded zeroes and no + * time zone info, and the values are of type `StatefulOrderTimeSliceValue`. + * This `StatefulOrderTimeSliceValue` in state is used for managing stateful + * order expiration. Stateful order expirations can be for either long term + * or conditional orders. + */ +export interface StatefulOrderTimeSliceValueAmino { + /** + * A unique list of order_ids that expire at this timestamp, sorted in + * ascending order by block height and transaction index of each stateful + * order. + */ + order_ids?: OrderIdAmino[]; +} +export interface StatefulOrderTimeSliceValueAminoMsg { + type: "/dydxprotocol.clob.StatefulOrderTimeSliceValue"; + value: StatefulOrderTimeSliceValueAmino; +} +/** + * StatefulOrderTimeSliceValue represents the type of the value of the + * `StatefulOrdersTimeSlice` in state. The `StatefulOrdersTimeSlice` + * in state consists of key/value pairs where the keys are UTF-8-encoded + * `RFC3339NANO` timestamp strings with right-padded zeroes and no + * time zone info, and the values are of type `StatefulOrderTimeSliceValue`. + * This `StatefulOrderTimeSliceValue` in state is used for managing stateful + * order expiration. Stateful order expirations can be for either long term + * or conditional orders. + */ +export interface StatefulOrderTimeSliceValueSDKType { + order_ids: OrderIdSDKType[]; +} +/** + * LongTermOrderPlacement represents the placement of a stateful order in + * state. It stores the stateful order itself and the `BlockHeight` and + * `TransactionIndex` at which the order was placed. + */ +export interface LongTermOrderPlacement { + order: Order; + /** + * The block height and transaction index at which the order was placed. + * Used for ordering by time priority when the chain is restarted. + */ + placementIndex: TransactionOrdering; +} +export interface LongTermOrderPlacementProtoMsg { + typeUrl: "/dydxprotocol.clob.LongTermOrderPlacement"; + value: Uint8Array; +} +/** + * LongTermOrderPlacement represents the placement of a stateful order in + * state. It stores the stateful order itself and the `BlockHeight` and + * `TransactionIndex` at which the order was placed. + */ +export interface LongTermOrderPlacementAmino { + order?: OrderAmino; + /** + * The block height and transaction index at which the order was placed. + * Used for ordering by time priority when the chain is restarted. + */ + placement_index?: TransactionOrderingAmino; +} +export interface LongTermOrderPlacementAminoMsg { + type: "/dydxprotocol.clob.LongTermOrderPlacement"; + value: LongTermOrderPlacementAmino; +} +/** + * LongTermOrderPlacement represents the placement of a stateful order in + * state. It stores the stateful order itself and the `BlockHeight` and + * `TransactionIndex` at which the order was placed. + */ +export interface LongTermOrderPlacementSDKType { + order: OrderSDKType; + placement_index: TransactionOrderingSDKType; +} +/** + * ConditionalOrderPlacement represents the placement of a conditional order in + * state. It stores the stateful order itself, the `BlockHeight` and + * `TransactionIndex` at which the order was placed and triggered. + */ +export interface ConditionalOrderPlacement { + order: Order; + /** The block height and transaction index at which the order was placed. */ + placementIndex: TransactionOrdering; + /** + * The block height and transaction index at which the order was triggered. + * Set to be nil if the transaction has not been triggered. + * Used for ordering by time priority when the chain is restarted. + */ + triggerIndex?: TransactionOrdering; +} +export interface ConditionalOrderPlacementProtoMsg { + typeUrl: "/dydxprotocol.clob.ConditionalOrderPlacement"; + value: Uint8Array; +} +/** + * ConditionalOrderPlacement represents the placement of a conditional order in + * state. It stores the stateful order itself, the `BlockHeight` and + * `TransactionIndex` at which the order was placed and triggered. + */ +export interface ConditionalOrderPlacementAmino { + order?: OrderAmino; + /** The block height and transaction index at which the order was placed. */ + placement_index?: TransactionOrderingAmino; + /** + * The block height and transaction index at which the order was triggered. + * Set to be nil if the transaction has not been triggered. + * Used for ordering by time priority when the chain is restarted. + */ + trigger_index?: TransactionOrderingAmino; +} +export interface ConditionalOrderPlacementAminoMsg { + type: "/dydxprotocol.clob.ConditionalOrderPlacement"; + value: ConditionalOrderPlacementAmino; +} +/** + * ConditionalOrderPlacement represents the placement of a conditional order in + * state. It stores the stateful order itself, the `BlockHeight` and + * `TransactionIndex` at which the order was placed and triggered. + */ +export interface ConditionalOrderPlacementSDKType { + order: OrderSDKType; + placement_index: TransactionOrderingSDKType; + trigger_index?: TransactionOrderingSDKType; +} +/** + * Order represents a single order belonging to a `Subaccount` + * for a particular `ClobPair`. + */ +export interface Order { + /** The unique ID of this order. Meant to be unique across all orders. */ + orderId: OrderId; + side: Order_Side; + /** + * The size of this order in base quantums. Must be a multiple of + * `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`). + */ + quantums: bigint; + /** + * The price level that this order will be placed at on the orderbook, + * in subticks. Must be a multiple of ClobPair.SubticksPerTick + * (where `ClobPair.Id = orderId.ClobPairId`). + */ + subticks: bigint; + /** + * The last block this order can be executed at (after which it will be + * unfillable). Used only for Short-Term orders. If this value is non-zero + * then the order is assumed to be a Short-Term order. + */ + goodTilBlock?: number; + /** + * good_til_block_time represents the unix timestamp (in seconds) at which a + * stateful order will be considered expired. The + * good_til_block_time is always evaluated against the previous block's + * `BlockTime` instead of the block in which the order is committed. If this + * value is non-zero then the order is assumed to be a stateful or + * conditional order. + */ + goodTilBlockTime?: number; + /** The time in force of this order. */ + timeInForce: Order_TimeInForce; + /** + * Enforces that the order can only reduce the size of an existing position. + * If a ReduceOnly order would change the side of the existing position, + * its size is reduced to that of the remaining size of the position. + * If existing orders on the book with ReduceOnly + * would already close the position, the least aggressive (out-of-the-money) + * ReduceOnly orders are resized and canceled first. + */ + reduceOnly: boolean; + /** + * Set of bit flags set arbitrarily by clients and ignored by the protocol. + * Used by indexer to infer information about a placed order. + */ + clientMetadata: number; + conditionType: Order_ConditionType; + /** + * conditional_order_trigger_subticks represents the price at which this order + * will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED, + * this value is enforced to be 0. If this value is nonzero, condition_type + * cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks. + * Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id = + * orderId.ClobPairId`). + */ + conditionalOrderTriggerSubticks: bigint; +} +export interface OrderProtoMsg { + typeUrl: "/dydxprotocol.clob.Order"; + value: Uint8Array; +} +/** + * Order represents a single order belonging to a `Subaccount` + * for a particular `ClobPair`. + */ +export interface OrderAmino { + /** The unique ID of this order. Meant to be unique across all orders. */ + order_id?: OrderIdAmino; + side?: Order_Side; + /** + * The size of this order in base quantums. Must be a multiple of + * `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`). + */ + quantums?: string; + /** + * The price level that this order will be placed at on the orderbook, + * in subticks. Must be a multiple of ClobPair.SubticksPerTick + * (where `ClobPair.Id = orderId.ClobPairId`). + */ + subticks?: string; + /** + * The last block this order can be executed at (after which it will be + * unfillable). Used only for Short-Term orders. If this value is non-zero + * then the order is assumed to be a Short-Term order. + */ + good_til_block?: number; + /** + * good_til_block_time represents the unix timestamp (in seconds) at which a + * stateful order will be considered expired. The + * good_til_block_time is always evaluated against the previous block's + * `BlockTime` instead of the block in which the order is committed. If this + * value is non-zero then the order is assumed to be a stateful or + * conditional order. + */ + good_til_block_time?: number; + /** The time in force of this order. */ + time_in_force?: Order_TimeInForce; + /** + * Enforces that the order can only reduce the size of an existing position. + * If a ReduceOnly order would change the side of the existing position, + * its size is reduced to that of the remaining size of the position. + * If existing orders on the book with ReduceOnly + * would already close the position, the least aggressive (out-of-the-money) + * ReduceOnly orders are resized and canceled first. + */ + reduce_only?: boolean; + /** + * Set of bit flags set arbitrarily by clients and ignored by the protocol. + * Used by indexer to infer information about a placed order. + */ + client_metadata?: number; + condition_type?: Order_ConditionType; + /** + * conditional_order_trigger_subticks represents the price at which this order + * will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED, + * this value is enforced to be 0. If this value is nonzero, condition_type + * cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks. + * Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id = + * orderId.ClobPairId`). + */ + conditional_order_trigger_subticks?: string; +} +export interface OrderAminoMsg { + type: "/dydxprotocol.clob.Order"; + value: OrderAmino; +} +/** + * Order represents a single order belonging to a `Subaccount` + * for a particular `ClobPair`. + */ +export interface OrderSDKType { + order_id: OrderIdSDKType; + side: Order_Side; + quantums: bigint; + subticks: bigint; + good_til_block?: number; + good_til_block_time?: number; + time_in_force: Order_TimeInForce; + reduce_only: boolean; + client_metadata: number; + condition_type: Order_ConditionType; + conditional_order_trigger_subticks: bigint; +} +/** + * TransactionOrdering represents a unique location in the block where a + * transaction was placed. This proto includes both block height and the + * transaction index that the specific transaction was placed. This information + * is used for ordering by time priority when the chain is restarted. + */ +export interface TransactionOrdering { + /** Block height in which the transaction was placed. */ + blockHeight: number; + /** Within the block, the unique transaction index. */ + transactionIndex: number; +} +export interface TransactionOrderingProtoMsg { + typeUrl: "/dydxprotocol.clob.TransactionOrdering"; + value: Uint8Array; +} +/** + * TransactionOrdering represents a unique location in the block where a + * transaction was placed. This proto includes both block height and the + * transaction index that the specific transaction was placed. This information + * is used for ordering by time priority when the chain is restarted. + */ +export interface TransactionOrderingAmino { + /** Block height in which the transaction was placed. */ + block_height?: number; + /** Within the block, the unique transaction index. */ + transaction_index?: number; +} +export interface TransactionOrderingAminoMsg { + type: "/dydxprotocol.clob.TransactionOrdering"; + value: TransactionOrderingAmino; +} +/** + * TransactionOrdering represents a unique location in the block where a + * transaction was placed. This proto includes both block height and the + * transaction index that the specific transaction was placed. This information + * is used for ordering by time priority when the chain is restarted. + */ +export interface TransactionOrderingSDKType { + block_height: number; + transaction_index: number; +} +/** + * StreamLiquidationOrder represents an protocol-generated IOC liquidation + * order. Used in full node streaming. + */ +export interface StreamLiquidationOrder { + /** Information about this liquidation order. */ + liquidationInfo?: PerpetualLiquidationInfo; + /** + * CLOB pair ID of the CLOB pair the liquidation order will be matched + * against. + */ + clobPairId: number; + /** + * True if this is a buy order liquidating a short position, false if vice + * versa. + */ + isBuy: boolean; + /** The number of base quantums for this liquidation order. */ + quantums: bigint; + /** The subticks this liquidation order will be submitted at. */ + subticks: bigint; +} +export interface StreamLiquidationOrderProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamLiquidationOrder"; + value: Uint8Array; +} +/** + * StreamLiquidationOrder represents an protocol-generated IOC liquidation + * order. Used in full node streaming. + */ +export interface StreamLiquidationOrderAmino { + /** Information about this liquidation order. */ + liquidation_info?: PerpetualLiquidationInfoAmino; + /** + * CLOB pair ID of the CLOB pair the liquidation order will be matched + * against. + */ + clob_pair_id?: number; + /** + * True if this is a buy order liquidating a short position, false if vice + * versa. + */ + is_buy?: boolean; + /** The number of base quantums for this liquidation order. */ + quantums?: string; + /** The subticks this liquidation order will be submitted at. */ + subticks?: string; +} +export interface StreamLiquidationOrderAminoMsg { + type: "/dydxprotocol.clob.StreamLiquidationOrder"; + value: StreamLiquidationOrderAmino; +} +/** + * StreamLiquidationOrder represents an protocol-generated IOC liquidation + * order. Used in full node streaming. + */ +export interface StreamLiquidationOrderSDKType { + liquidation_info?: PerpetualLiquidationInfoSDKType; + clob_pair_id: number; + is_buy: boolean; + quantums: bigint; + subticks: bigint; +} +function createBaseOrderId(): OrderId { + return { + subaccountId: SubaccountId.fromPartial({}), + clientId: 0, + orderFlags: 0, + clobPairId: 0 + }; +} +export const OrderId = { + typeUrl: "/dydxprotocol.clob.OrderId", + encode(message: OrderId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== 0) { + writer.uint32(21).fixed32(message.clientId); + } + if (message.orderFlags !== 0) { + writer.uint32(24).uint32(message.orderFlags); + } + if (message.clobPairId !== 0) { + writer.uint32(32).uint32(message.clobPairId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.fixed32(); + break; + case 3: + message.orderFlags = reader.uint32(); + break; + case 4: + message.clobPairId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderId { + const message = createBaseOrderId(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; + message.clientId = object.clientId ?? 0; + message.orderFlags = object.orderFlags ?? 0; + message.clobPairId = object.clobPairId ?? 0; + return message; + }, + fromAmino(object: OrderIdAmino): OrderId { + const message = createBaseOrderId(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = SubaccountId.fromAmino(object.subaccount_id); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.order_flags !== undefined && object.order_flags !== null) { + message.orderFlags = object.order_flags; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + return message; + }, + toAmino(message: OrderId): OrderIdAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? SubaccountId.toAmino(message.subaccountId) : undefined; + obj.client_id = message.clientId === 0 ? undefined : message.clientId; + obj.order_flags = message.orderFlags === 0 ? undefined : message.orderFlags; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + return obj; + }, + fromAminoMsg(object: OrderIdAminoMsg): OrderId { + return OrderId.fromAmino(object.value); + }, + fromProtoMsg(message: OrderIdProtoMsg): OrderId { + return OrderId.decode(message.value); + }, + toProto(message: OrderId): Uint8Array { + return OrderId.encode(message).finish(); + }, + toProtoMsg(message: OrderId): OrderIdProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.OrderId", + value: OrderId.encode(message).finish() + }; + } +}; +function createBaseOrdersFilledDuringLatestBlock(): OrdersFilledDuringLatestBlock { + return { + orderIds: [] + }; +} +export const OrdersFilledDuringLatestBlock = { + typeUrl: "/dydxprotocol.clob.OrdersFilledDuringLatestBlock", + encode(message: OrdersFilledDuringLatestBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orderIds) { + OrderId.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrdersFilledDuringLatestBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrdersFilledDuringLatestBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderIds.push(OrderId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrdersFilledDuringLatestBlock { + const message = createBaseOrdersFilledDuringLatestBlock(); + message.orderIds = object.orderIds?.map(e => OrderId.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OrdersFilledDuringLatestBlockAmino): OrdersFilledDuringLatestBlock { + const message = createBaseOrdersFilledDuringLatestBlock(); + message.orderIds = object.order_ids?.map(e => OrderId.fromAmino(e)) || []; + return message; + }, + toAmino(message: OrdersFilledDuringLatestBlock): OrdersFilledDuringLatestBlockAmino { + const obj: any = {}; + if (message.orderIds) { + obj.order_ids = message.orderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.order_ids = message.orderIds; + } + return obj; + }, + fromAminoMsg(object: OrdersFilledDuringLatestBlockAminoMsg): OrdersFilledDuringLatestBlock { + return OrdersFilledDuringLatestBlock.fromAmino(object.value); + }, + fromProtoMsg(message: OrdersFilledDuringLatestBlockProtoMsg): OrdersFilledDuringLatestBlock { + return OrdersFilledDuringLatestBlock.decode(message.value); + }, + toProto(message: OrdersFilledDuringLatestBlock): Uint8Array { + return OrdersFilledDuringLatestBlock.encode(message).finish(); + }, + toProtoMsg(message: OrdersFilledDuringLatestBlock): OrdersFilledDuringLatestBlockProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.OrdersFilledDuringLatestBlock", + value: OrdersFilledDuringLatestBlock.encode(message).finish() + }; + } +}; +function createBasePotentiallyPrunableOrders(): PotentiallyPrunableOrders { + return { + orderIds: [] + }; +} +export const PotentiallyPrunableOrders = { + typeUrl: "/dydxprotocol.clob.PotentiallyPrunableOrders", + encode(message: PotentiallyPrunableOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orderIds) { + OrderId.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PotentiallyPrunableOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePotentiallyPrunableOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderIds.push(OrderId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PotentiallyPrunableOrders { + const message = createBasePotentiallyPrunableOrders(); + message.orderIds = object.orderIds?.map(e => OrderId.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PotentiallyPrunableOrdersAmino): PotentiallyPrunableOrders { + const message = createBasePotentiallyPrunableOrders(); + message.orderIds = object.order_ids?.map(e => OrderId.fromAmino(e)) || []; + return message; + }, + toAmino(message: PotentiallyPrunableOrders): PotentiallyPrunableOrdersAmino { + const obj: any = {}; + if (message.orderIds) { + obj.order_ids = message.orderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.order_ids = message.orderIds; + } + return obj; + }, + fromAminoMsg(object: PotentiallyPrunableOrdersAminoMsg): PotentiallyPrunableOrders { + return PotentiallyPrunableOrders.fromAmino(object.value); + }, + fromProtoMsg(message: PotentiallyPrunableOrdersProtoMsg): PotentiallyPrunableOrders { + return PotentiallyPrunableOrders.decode(message.value); + }, + toProto(message: PotentiallyPrunableOrders): Uint8Array { + return PotentiallyPrunableOrders.encode(message).finish(); + }, + toProtoMsg(message: PotentiallyPrunableOrders): PotentiallyPrunableOrdersProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.PotentiallyPrunableOrders", + value: PotentiallyPrunableOrders.encode(message).finish() + }; + } +}; +function createBaseOrderFillState(): OrderFillState { + return { + fillAmount: BigInt(0), + prunableBlockHeight: 0 + }; +} +export const OrderFillState = { + typeUrl: "/dydxprotocol.clob.OrderFillState", + encode(message: OrderFillState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fillAmount !== BigInt(0)) { + writer.uint32(8).uint64(message.fillAmount); + } + if (message.prunableBlockHeight !== 0) { + writer.uint32(16).uint32(message.prunableBlockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderFillState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderFillState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fillAmount = reader.uint64(); + break; + case 2: + message.prunableBlockHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderFillState { + const message = createBaseOrderFillState(); + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + message.prunableBlockHeight = object.prunableBlockHeight ?? 0; + return message; + }, + fromAmino(object: OrderFillStateAmino): OrderFillState { + const message = createBaseOrderFillState(); + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + if (object.prunable_block_height !== undefined && object.prunable_block_height !== null) { + message.prunableBlockHeight = object.prunable_block_height; + } + return message; + }, + toAmino(message: OrderFillState): OrderFillStateAmino { + const obj: any = {}; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + obj.prunable_block_height = message.prunableBlockHeight === 0 ? undefined : message.prunableBlockHeight; + return obj; + }, + fromAminoMsg(object: OrderFillStateAminoMsg): OrderFillState { + return OrderFillState.fromAmino(object.value); + }, + fromProtoMsg(message: OrderFillStateProtoMsg): OrderFillState { + return OrderFillState.decode(message.value); + }, + toProto(message: OrderFillState): Uint8Array { + return OrderFillState.encode(message).finish(); + }, + toProtoMsg(message: OrderFillState): OrderFillStateProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.OrderFillState", + value: OrderFillState.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderTimeSliceValue(): StatefulOrderTimeSliceValue { + return { + orderIds: [] + }; +} +export const StatefulOrderTimeSliceValue = { + typeUrl: "/dydxprotocol.clob.StatefulOrderTimeSliceValue", + encode(message: StatefulOrderTimeSliceValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.orderIds) { + OrderId.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderTimeSliceValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderTimeSliceValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderIds.push(OrderId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderTimeSliceValue { + const message = createBaseStatefulOrderTimeSliceValue(); + message.orderIds = object.orderIds?.map(e => OrderId.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StatefulOrderTimeSliceValueAmino): StatefulOrderTimeSliceValue { + const message = createBaseStatefulOrderTimeSliceValue(); + message.orderIds = object.order_ids?.map(e => OrderId.fromAmino(e)) || []; + return message; + }, + toAmino(message: StatefulOrderTimeSliceValue): StatefulOrderTimeSliceValueAmino { + const obj: any = {}; + if (message.orderIds) { + obj.order_ids = message.orderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.order_ids = message.orderIds; + } + return obj; + }, + fromAminoMsg(object: StatefulOrderTimeSliceValueAminoMsg): StatefulOrderTimeSliceValue { + return StatefulOrderTimeSliceValue.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderTimeSliceValueProtoMsg): StatefulOrderTimeSliceValue { + return StatefulOrderTimeSliceValue.decode(message.value); + }, + toProto(message: StatefulOrderTimeSliceValue): Uint8Array { + return StatefulOrderTimeSliceValue.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderTimeSliceValue): StatefulOrderTimeSliceValueProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StatefulOrderTimeSliceValue", + value: StatefulOrderTimeSliceValue.encode(message).finish() + }; + } +}; +function createBaseLongTermOrderPlacement(): LongTermOrderPlacement { + return { + order: Order.fromPartial({}), + placementIndex: TransactionOrdering.fromPartial({}) + }; +} +export const LongTermOrderPlacement = { + typeUrl: "/dydxprotocol.clob.LongTermOrderPlacement", + encode(message: LongTermOrderPlacement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.placementIndex !== undefined) { + TransactionOrdering.encode(message.placementIndex, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LongTermOrderPlacement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLongTermOrderPlacement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = Order.decode(reader, reader.uint32()); + break; + case 2: + message.placementIndex = TransactionOrdering.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LongTermOrderPlacement { + const message = createBaseLongTermOrderPlacement(); + message.order = object.order !== undefined && object.order !== null ? Order.fromPartial(object.order) : undefined; + message.placementIndex = object.placementIndex !== undefined && object.placementIndex !== null ? TransactionOrdering.fromPartial(object.placementIndex) : undefined; + return message; + }, + fromAmino(object: LongTermOrderPlacementAmino): LongTermOrderPlacement { + const message = createBaseLongTermOrderPlacement(); + if (object.order !== undefined && object.order !== null) { + message.order = Order.fromAmino(object.order); + } + if (object.placement_index !== undefined && object.placement_index !== null) { + message.placementIndex = TransactionOrdering.fromAmino(object.placement_index); + } + return message; + }, + toAmino(message: LongTermOrderPlacement): LongTermOrderPlacementAmino { + const obj: any = {}; + obj.order = message.order ? Order.toAmino(message.order) : undefined; + obj.placement_index = message.placementIndex ? TransactionOrdering.toAmino(message.placementIndex) : undefined; + return obj; + }, + fromAminoMsg(object: LongTermOrderPlacementAminoMsg): LongTermOrderPlacement { + return LongTermOrderPlacement.fromAmino(object.value); + }, + fromProtoMsg(message: LongTermOrderPlacementProtoMsg): LongTermOrderPlacement { + return LongTermOrderPlacement.decode(message.value); + }, + toProto(message: LongTermOrderPlacement): Uint8Array { + return LongTermOrderPlacement.encode(message).finish(); + }, + toProtoMsg(message: LongTermOrderPlacement): LongTermOrderPlacementProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.LongTermOrderPlacement", + value: LongTermOrderPlacement.encode(message).finish() + }; + } +}; +function createBaseConditionalOrderPlacement(): ConditionalOrderPlacement { + return { + order: Order.fromPartial({}), + placementIndex: TransactionOrdering.fromPartial({}), + triggerIndex: undefined + }; +} +export const ConditionalOrderPlacement = { + typeUrl: "/dydxprotocol.clob.ConditionalOrderPlacement", + encode(message: ConditionalOrderPlacement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.placementIndex !== undefined) { + TransactionOrdering.encode(message.placementIndex, writer.uint32(18).fork()).ldelim(); + } + if (message.triggerIndex !== undefined) { + TransactionOrdering.encode(message.triggerIndex, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConditionalOrderPlacement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConditionalOrderPlacement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = Order.decode(reader, reader.uint32()); + break; + case 2: + message.placementIndex = TransactionOrdering.decode(reader, reader.uint32()); + break; + case 3: + message.triggerIndex = TransactionOrdering.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConditionalOrderPlacement { + const message = createBaseConditionalOrderPlacement(); + message.order = object.order !== undefined && object.order !== null ? Order.fromPartial(object.order) : undefined; + message.placementIndex = object.placementIndex !== undefined && object.placementIndex !== null ? TransactionOrdering.fromPartial(object.placementIndex) : undefined; + message.triggerIndex = object.triggerIndex !== undefined && object.triggerIndex !== null ? TransactionOrdering.fromPartial(object.triggerIndex) : undefined; + return message; + }, + fromAmino(object: ConditionalOrderPlacementAmino): ConditionalOrderPlacement { + const message = createBaseConditionalOrderPlacement(); + if (object.order !== undefined && object.order !== null) { + message.order = Order.fromAmino(object.order); + } + if (object.placement_index !== undefined && object.placement_index !== null) { + message.placementIndex = TransactionOrdering.fromAmino(object.placement_index); + } + if (object.trigger_index !== undefined && object.trigger_index !== null) { + message.triggerIndex = TransactionOrdering.fromAmino(object.trigger_index); + } + return message; + }, + toAmino(message: ConditionalOrderPlacement): ConditionalOrderPlacementAmino { + const obj: any = {}; + obj.order = message.order ? Order.toAmino(message.order) : undefined; + obj.placement_index = message.placementIndex ? TransactionOrdering.toAmino(message.placementIndex) : undefined; + obj.trigger_index = message.triggerIndex ? TransactionOrdering.toAmino(message.triggerIndex) : undefined; + return obj; + }, + fromAminoMsg(object: ConditionalOrderPlacementAminoMsg): ConditionalOrderPlacement { + return ConditionalOrderPlacement.fromAmino(object.value); + }, + fromProtoMsg(message: ConditionalOrderPlacementProtoMsg): ConditionalOrderPlacement { + return ConditionalOrderPlacement.decode(message.value); + }, + toProto(message: ConditionalOrderPlacement): Uint8Array { + return ConditionalOrderPlacement.encode(message).finish(); + }, + toProtoMsg(message: ConditionalOrderPlacement): ConditionalOrderPlacementProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.ConditionalOrderPlacement", + value: ConditionalOrderPlacement.encode(message).finish() + }; + } +}; +function createBaseOrder(): Order { + return { + orderId: OrderId.fromPartial({}), + side: 0, + quantums: BigInt(0), + subticks: BigInt(0), + goodTilBlock: undefined, + goodTilBlockTime: undefined, + timeInForce: 0, + reduceOnly: false, + clientMetadata: 0, + conditionType: 0, + conditionalOrderTriggerSubticks: BigInt(0) + }; +} +export const Order = { + typeUrl: "/dydxprotocol.clob.Order", + encode(message: Order, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderId !== undefined) { + OrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.side !== 0) { + writer.uint32(16).int32(message.side); + } + if (message.quantums !== BigInt(0)) { + writer.uint32(24).uint64(message.quantums); + } + if (message.subticks !== BigInt(0)) { + writer.uint32(32).uint64(message.subticks); + } + if (message.goodTilBlock !== undefined) { + writer.uint32(40).uint32(message.goodTilBlock); + } + if (message.goodTilBlockTime !== undefined) { + writer.uint32(53).fixed32(message.goodTilBlockTime); + } + if (message.timeInForce !== 0) { + writer.uint32(56).int32(message.timeInForce); + } + if (message.reduceOnly === true) { + writer.uint32(64).bool(message.reduceOnly); + } + if (message.clientMetadata !== 0) { + writer.uint32(72).uint32(message.clientMetadata); + } + if (message.conditionType !== 0) { + writer.uint32(80).int32(message.conditionType); + } + if (message.conditionalOrderTriggerSubticks !== BigInt(0)) { + writer.uint32(88).uint64(message.conditionalOrderTriggerSubticks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Order { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = OrderId.decode(reader, reader.uint32()); + break; + case 2: + message.side = reader.int32() as any; + break; + case 3: + message.quantums = reader.uint64(); + break; + case 4: + message.subticks = reader.uint64(); + break; + case 5: + message.goodTilBlock = reader.uint32(); + break; + case 6: + message.goodTilBlockTime = reader.fixed32(); + break; + case 7: + message.timeInForce = reader.int32() as any; + break; + case 8: + message.reduceOnly = reader.bool(); + break; + case 9: + message.clientMetadata = reader.uint32(); + break; + case 10: + message.conditionType = reader.int32() as any; + break; + case 11: + message.conditionalOrderTriggerSubticks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Order { + const message = createBaseOrder(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? OrderId.fromPartial(object.orderId) : undefined; + message.side = object.side ?? 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? BigInt(object.quantums.toString()) : BigInt(0); + message.subticks = object.subticks !== undefined && object.subticks !== null ? BigInt(object.subticks.toString()) : BigInt(0); + message.goodTilBlock = object.goodTilBlock ?? undefined; + message.goodTilBlockTime = object.goodTilBlockTime ?? undefined; + message.timeInForce = object.timeInForce ?? 0; + message.reduceOnly = object.reduceOnly ?? false; + message.clientMetadata = object.clientMetadata ?? 0; + message.conditionType = object.conditionType ?? 0; + message.conditionalOrderTriggerSubticks = object.conditionalOrderTriggerSubticks !== undefined && object.conditionalOrderTriggerSubticks !== null ? BigInt(object.conditionalOrderTriggerSubticks.toString()) : BigInt(0); + return message; + }, + fromAmino(object: OrderAmino): Order { + const message = createBaseOrder(); + if (object.order_id !== undefined && object.order_id !== null) { + message.orderId = OrderId.fromAmino(object.order_id); + } + if (object.side !== undefined && object.side !== null) { + message.side = object.side; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = BigInt(object.quantums); + } + if (object.subticks !== undefined && object.subticks !== null) { + message.subticks = BigInt(object.subticks); + } + if (object.good_til_block !== undefined && object.good_til_block !== null) { + message.goodTilBlock = object.good_til_block; + } + if (object.good_til_block_time !== undefined && object.good_til_block_time !== null) { + message.goodTilBlockTime = object.good_til_block_time; + } + if (object.time_in_force !== undefined && object.time_in_force !== null) { + message.timeInForce = object.time_in_force; + } + if (object.reduce_only !== undefined && object.reduce_only !== null) { + message.reduceOnly = object.reduce_only; + } + if (object.client_metadata !== undefined && object.client_metadata !== null) { + message.clientMetadata = object.client_metadata; + } + if (object.condition_type !== undefined && object.condition_type !== null) { + message.conditionType = object.condition_type; + } + if (object.conditional_order_trigger_subticks !== undefined && object.conditional_order_trigger_subticks !== null) { + message.conditionalOrderTriggerSubticks = BigInt(object.conditional_order_trigger_subticks); + } + return message; + }, + toAmino(message: Order): OrderAmino { + const obj: any = {}; + obj.order_id = message.orderId ? OrderId.toAmino(message.orderId) : undefined; + obj.side = message.side === 0 ? undefined : message.side; + obj.quantums = message.quantums !== BigInt(0) ? message.quantums.toString() : undefined; + obj.subticks = message.subticks !== BigInt(0) ? message.subticks.toString() : undefined; + obj.good_til_block = message.goodTilBlock === null ? undefined : message.goodTilBlock; + obj.good_til_block_time = message.goodTilBlockTime === null ? undefined : message.goodTilBlockTime; + obj.time_in_force = message.timeInForce === 0 ? undefined : message.timeInForce; + obj.reduce_only = message.reduceOnly === false ? undefined : message.reduceOnly; + obj.client_metadata = message.clientMetadata === 0 ? undefined : message.clientMetadata; + obj.condition_type = message.conditionType === 0 ? undefined : message.conditionType; + obj.conditional_order_trigger_subticks = message.conditionalOrderTriggerSubticks !== BigInt(0) ? message.conditionalOrderTriggerSubticks.toString() : undefined; + return obj; + }, + fromAminoMsg(object: OrderAminoMsg): Order { + return Order.fromAmino(object.value); + }, + fromProtoMsg(message: OrderProtoMsg): Order { + return Order.decode(message.value); + }, + toProto(message: Order): Uint8Array { + return Order.encode(message).finish(); + }, + toProtoMsg(message: Order): OrderProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.Order", + value: Order.encode(message).finish() + }; + } +}; +function createBaseTransactionOrdering(): TransactionOrdering { + return { + blockHeight: 0, + transactionIndex: 0 + }; +} +export const TransactionOrdering = { + typeUrl: "/dydxprotocol.clob.TransactionOrdering", + encode(message: TransactionOrdering, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== 0) { + writer.uint32(8).uint32(message.blockHeight); + } + if (message.transactionIndex !== 0) { + writer.uint32(16).uint32(message.transactionIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TransactionOrdering { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransactionOrdering(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint32(); + break; + case 2: + message.transactionIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TransactionOrdering { + const message = createBaseTransactionOrdering(); + message.blockHeight = object.blockHeight ?? 0; + message.transactionIndex = object.transactionIndex ?? 0; + return message; + }, + fromAmino(object: TransactionOrderingAmino): TransactionOrdering { + const message = createBaseTransactionOrdering(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + if (object.transaction_index !== undefined && object.transaction_index !== null) { + message.transactionIndex = object.transaction_index; + } + return message; + }, + toAmino(message: TransactionOrdering): TransactionOrderingAmino { + const obj: any = {}; + obj.block_height = message.blockHeight === 0 ? undefined : message.blockHeight; + obj.transaction_index = message.transactionIndex === 0 ? undefined : message.transactionIndex; + return obj; + }, + fromAminoMsg(object: TransactionOrderingAminoMsg): TransactionOrdering { + return TransactionOrdering.fromAmino(object.value); + }, + fromProtoMsg(message: TransactionOrderingProtoMsg): TransactionOrdering { + return TransactionOrdering.decode(message.value); + }, + toProto(message: TransactionOrdering): Uint8Array { + return TransactionOrdering.encode(message).finish(); + }, + toProtoMsg(message: TransactionOrdering): TransactionOrderingProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.TransactionOrdering", + value: TransactionOrdering.encode(message).finish() + }; + } +}; +function createBaseStreamLiquidationOrder(): StreamLiquidationOrder { + return { + liquidationInfo: undefined, + clobPairId: 0, + isBuy: false, + quantums: BigInt(0), + subticks: BigInt(0) + }; +} +export const StreamLiquidationOrder = { + typeUrl: "/dydxprotocol.clob.StreamLiquidationOrder", + encode(message: StreamLiquidationOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidationInfo !== undefined) { + PerpetualLiquidationInfo.encode(message.liquidationInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.clobPairId !== 0) { + writer.uint32(16).uint32(message.clobPairId); + } + if (message.isBuy === true) { + writer.uint32(24).bool(message.isBuy); + } + if (message.quantums !== BigInt(0)) { + writer.uint32(32).uint64(message.quantums); + } + if (message.subticks !== BigInt(0)) { + writer.uint32(40).uint64(message.subticks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamLiquidationOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamLiquidationOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidationInfo = PerpetualLiquidationInfo.decode(reader, reader.uint32()); + break; + case 2: + message.clobPairId = reader.uint32(); + break; + case 3: + message.isBuy = reader.bool(); + break; + case 4: + message.quantums = reader.uint64(); + break; + case 5: + message.subticks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamLiquidationOrder { + const message = createBaseStreamLiquidationOrder(); + message.liquidationInfo = object.liquidationInfo !== undefined && object.liquidationInfo !== null ? PerpetualLiquidationInfo.fromPartial(object.liquidationInfo) : undefined; + message.clobPairId = object.clobPairId ?? 0; + message.isBuy = object.isBuy ?? false; + message.quantums = object.quantums !== undefined && object.quantums !== null ? BigInt(object.quantums.toString()) : BigInt(0); + message.subticks = object.subticks !== undefined && object.subticks !== null ? BigInt(object.subticks.toString()) : BigInt(0); + return message; + }, + fromAmino(object: StreamLiquidationOrderAmino): StreamLiquidationOrder { + const message = createBaseStreamLiquidationOrder(); + if (object.liquidation_info !== undefined && object.liquidation_info !== null) { + message.liquidationInfo = PerpetualLiquidationInfo.fromAmino(object.liquidation_info); + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = BigInt(object.quantums); + } + if (object.subticks !== undefined && object.subticks !== null) { + message.subticks = BigInt(object.subticks); + } + return message; + }, + toAmino(message: StreamLiquidationOrder): StreamLiquidationOrderAmino { + const obj: any = {}; + obj.liquidation_info = message.liquidationInfo ? PerpetualLiquidationInfo.toAmino(message.liquidationInfo) : undefined; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.quantums = message.quantums !== BigInt(0) ? message.quantums.toString() : undefined; + obj.subticks = message.subticks !== BigInt(0) ? message.subticks.toString() : undefined; + return obj; + }, + fromAminoMsg(object: StreamLiquidationOrderAminoMsg): StreamLiquidationOrder { + return StreamLiquidationOrder.fromAmino(object.value); + }, + fromProtoMsg(message: StreamLiquidationOrderProtoMsg): StreamLiquidationOrder { + return StreamLiquidationOrder.decode(message.value); + }, + toProto(message: StreamLiquidationOrder): Uint8Array { + return StreamLiquidationOrder.encode(message).finish(); + }, + toProtoMsg(message: StreamLiquidationOrder): StreamLiquidationOrderProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamLiquidationOrder", + value: StreamLiquidationOrder.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/order_removals.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/order_removals.ts new file mode 100644 index 00000000..269bea69 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/order_removals.ts @@ -0,0 +1,221 @@ +//@ts-nocheck +import { OrderId, OrderIdAmino, OrderIdSDKType } from "./order"; +import { BinaryReader, BinaryWriter } from "../../binary"; +export enum OrderRemoval_RemovalReason { + /** + * REMOVAL_REASON_UNSPECIFIED - REMOVAL_REASON_UNSPECIFIED represents an unspecified removal reason. This + * removal reason is used as a catchall and should never appear on an + * OrderRemoval in the operations queue. + */ + REMOVAL_REASON_UNSPECIFIED = 0, + /** + * REMOVAL_REASON_UNDERCOLLATERALIZED - REMOVAL_REASON_UNDERCOLLATERALIZED represents a removal of an order which + * if filled in isolation with respect to the current state of the + * subaccount would leave the subaccount undercollateralized. + */ + REMOVAL_REASON_UNDERCOLLATERALIZED = 1, + /** + * REMOVAL_REASON_INVALID_REDUCE_ONLY - REMOVAL_REASON_INVALID_REDUCE_ONLY represents a removal of a reduce-only + * order which if filled in isolation with respect to the current state of + * the subaccount would cause the subaccount's existing position to increase + * or change sides. + */ + REMOVAL_REASON_INVALID_REDUCE_ONLY = 2, + /** + * REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER - REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER represents a removal of + * a stateful post-only order that was deemed invalid because it crossed + * maker orders on the book of the proposer. + */ + REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER = 3, + /** + * REMOVAL_REASON_INVALID_SELF_TRADE - REMOVAL_REASON_INVALID_SELF_TRADE represents a removal of a stateful + * order that was deemed invalid because it constituted a self trade on the + * proposers orderbook. + */ + REMOVAL_REASON_INVALID_SELF_TRADE = 4, + /** + * REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED - REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED represents a + * removal of a conditional FOK order that was deemed invalid because it + * could not be completely filled. Conditional FOK orders should always be + * fully-filled or removed in the block after they are triggered. + */ + REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED = 5, + /** + * REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK - REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK represents a removal + * of a conditional IOC order. + * Conditional IOC orders should always have their remaining size removed + * in the block after they are triggered. + */ + REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK = 6, + /** + * REMOVAL_REASON_FULLY_FILLED - REMOVAL_REASON_FULLY_FILLED represents a removal of an order that + * was fully filled and should therefore be removed from state. + */ + REMOVAL_REASON_FULLY_FILLED = 7, + /** + * REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS - REMOVAL_REASON_FULLY_FILLED represents a removal of an order that + * would lead to the subaccount violating isolated subaccount constraints. + */ + REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS = 8, + UNRECOGNIZED = -1, +} +export const OrderRemoval_RemovalReasonSDKType = OrderRemoval_RemovalReason; +export const OrderRemoval_RemovalReasonAmino = OrderRemoval_RemovalReason; +export function orderRemoval_RemovalReasonFromJSON(object: any): OrderRemoval_RemovalReason { + switch (object) { + case 0: + case "REMOVAL_REASON_UNSPECIFIED": + return OrderRemoval_RemovalReason.REMOVAL_REASON_UNSPECIFIED; + case 1: + case "REMOVAL_REASON_UNDERCOLLATERALIZED": + return OrderRemoval_RemovalReason.REMOVAL_REASON_UNDERCOLLATERALIZED; + case 2: + case "REMOVAL_REASON_INVALID_REDUCE_ONLY": + return OrderRemoval_RemovalReason.REMOVAL_REASON_INVALID_REDUCE_ONLY; + case 3: + case "REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER": + return OrderRemoval_RemovalReason.REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER; + case 4: + case "REMOVAL_REASON_INVALID_SELF_TRADE": + return OrderRemoval_RemovalReason.REMOVAL_REASON_INVALID_SELF_TRADE; + case 5: + case "REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED": + return OrderRemoval_RemovalReason.REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED; + case 6: + case "REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK": + return OrderRemoval_RemovalReason.REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK; + case 7: + case "REMOVAL_REASON_FULLY_FILLED": + return OrderRemoval_RemovalReason.REMOVAL_REASON_FULLY_FILLED; + case 8: + case "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS": + return OrderRemoval_RemovalReason.REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS; + case -1: + case "UNRECOGNIZED": + default: + return OrderRemoval_RemovalReason.UNRECOGNIZED; + } +} +export function orderRemoval_RemovalReasonToJSON(object: OrderRemoval_RemovalReason): string { + switch (object) { + case OrderRemoval_RemovalReason.REMOVAL_REASON_UNSPECIFIED: + return "REMOVAL_REASON_UNSPECIFIED"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_UNDERCOLLATERALIZED: + return "REMOVAL_REASON_UNDERCOLLATERALIZED"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_INVALID_REDUCE_ONLY: + return "REMOVAL_REASON_INVALID_REDUCE_ONLY"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER: + return "REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_INVALID_SELF_TRADE: + return "REMOVAL_REASON_INVALID_SELF_TRADE"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED: + return "REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK: + return "REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_FULLY_FILLED: + return "REMOVAL_REASON_FULLY_FILLED"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS: + return "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS"; + case OrderRemoval_RemovalReason.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** OrderRemoval is a request type used for forced removal of stateful orders. */ +export interface OrderRemoval { + orderId: OrderId; + removalReason: OrderRemoval_RemovalReason; +} +export interface OrderRemovalProtoMsg { + typeUrl: "/dydxprotocol.clob.OrderRemoval"; + value: Uint8Array; +} +/** OrderRemoval is a request type used for forced removal of stateful orders. */ +export interface OrderRemovalAmino { + order_id?: OrderIdAmino; + removal_reason?: OrderRemoval_RemovalReason; +} +export interface OrderRemovalAminoMsg { + type: "/dydxprotocol.clob.OrderRemoval"; + value: OrderRemovalAmino; +} +/** OrderRemoval is a request type used for forced removal of stateful orders. */ +export interface OrderRemovalSDKType { + order_id: OrderIdSDKType; + removal_reason: OrderRemoval_RemovalReason; +} +function createBaseOrderRemoval(): OrderRemoval { + return { + orderId: OrderId.fromPartial({}), + removalReason: 0 + }; +} +export const OrderRemoval = { + typeUrl: "/dydxprotocol.clob.OrderRemoval", + encode(message: OrderRemoval, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderId !== undefined) { + OrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.removalReason !== 0) { + writer.uint32(16).int32(message.removalReason); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderRemoval { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderRemoval(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = OrderId.decode(reader, reader.uint32()); + break; + case 2: + message.removalReason = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderRemoval { + const message = createBaseOrderRemoval(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? OrderId.fromPartial(object.orderId) : undefined; + message.removalReason = object.removalReason ?? 0; + return message; + }, + fromAmino(object: OrderRemovalAmino): OrderRemoval { + const message = createBaseOrderRemoval(); + if (object.order_id !== undefined && object.order_id !== null) { + message.orderId = OrderId.fromAmino(object.order_id); + } + if (object.removal_reason !== undefined && object.removal_reason !== null) { + message.removalReason = object.removal_reason; + } + return message; + }, + toAmino(message: OrderRemoval): OrderRemovalAmino { + const obj: any = {}; + obj.order_id = message.orderId ? OrderId.toAmino(message.orderId) : undefined; + obj.removal_reason = message.removalReason === 0 ? undefined : message.removalReason; + return obj; + }, + fromAminoMsg(object: OrderRemovalAminoMsg): OrderRemoval { + return OrderRemoval.fromAmino(object.value); + }, + fromProtoMsg(message: OrderRemovalProtoMsg): OrderRemoval { + return OrderRemoval.decode(message.value); + }, + toProto(message: OrderRemoval): Uint8Array { + return OrderRemoval.encode(message).finish(); + }, + toProtoMsg(message: OrderRemoval): OrderRemovalProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.OrderRemoval", + value: OrderRemoval.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/process_proposer_matches_events.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/process_proposer_matches_events.ts new file mode 100644 index 00000000..970241bb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/process_proposer_matches_events.ts @@ -0,0 +1,250 @@ +//@ts-nocheck +import { OrderId, OrderIdAmino, OrderIdSDKType } from "./order"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * ProcessProposerMatchesEvents is used for communicating which events occurred + * in the last block that require updating the state of the memclob in the + * Commit blocker. It contains information about the following state updates: + * - Long term order IDs that were placed in the last block. + * - Stateful order IDs that were expired in the last block. + * - Order IDs that were filled in the last block. + * - Stateful cancellations order IDs that were placed in the last block. + * - Stateful order IDs forcefully removed in the last block. + * - Conditional order IDs triggered in the last block. + * - Conditional order IDs placed, but not triggered in the last block. + * - The height of the block in which the events occurred. + */ +export interface ProcessProposerMatchesEvents { + /** @deprecated */ + placedLongTermOrderIds: OrderId[]; + expiredStatefulOrderIds: OrderId[]; + orderIdsFilledInLastBlock: OrderId[]; + /** @deprecated */ + placedStatefulCancellationOrderIds: OrderId[]; + removedStatefulOrderIds: OrderId[]; + conditionalOrderIdsTriggeredInLastBlock: OrderId[]; + /** @deprecated */ + placedConditionalOrderIds: OrderId[]; + blockHeight: number; +} +export interface ProcessProposerMatchesEventsProtoMsg { + typeUrl: "/dydxprotocol.clob.ProcessProposerMatchesEvents"; + value: Uint8Array; +} +/** + * ProcessProposerMatchesEvents is used for communicating which events occurred + * in the last block that require updating the state of the memclob in the + * Commit blocker. It contains information about the following state updates: + * - Long term order IDs that were placed in the last block. + * - Stateful order IDs that were expired in the last block. + * - Order IDs that were filled in the last block. + * - Stateful cancellations order IDs that were placed in the last block. + * - Stateful order IDs forcefully removed in the last block. + * - Conditional order IDs triggered in the last block. + * - Conditional order IDs placed, but not triggered in the last block. + * - The height of the block in which the events occurred. + */ +export interface ProcessProposerMatchesEventsAmino { + /** @deprecated */ + placed_long_term_order_ids?: OrderIdAmino[]; + expired_stateful_order_ids?: OrderIdAmino[]; + order_ids_filled_in_last_block?: OrderIdAmino[]; + /** @deprecated */ + placed_stateful_cancellation_order_ids?: OrderIdAmino[]; + removed_stateful_order_ids?: OrderIdAmino[]; + conditional_order_ids_triggered_in_last_block?: OrderIdAmino[]; + /** @deprecated */ + placed_conditional_order_ids?: OrderIdAmino[]; + block_height?: number; +} +export interface ProcessProposerMatchesEventsAminoMsg { + type: "/dydxprotocol.clob.ProcessProposerMatchesEvents"; + value: ProcessProposerMatchesEventsAmino; +} +/** + * ProcessProposerMatchesEvents is used for communicating which events occurred + * in the last block that require updating the state of the memclob in the + * Commit blocker. It contains information about the following state updates: + * - Long term order IDs that were placed in the last block. + * - Stateful order IDs that were expired in the last block. + * - Order IDs that were filled in the last block. + * - Stateful cancellations order IDs that were placed in the last block. + * - Stateful order IDs forcefully removed in the last block. + * - Conditional order IDs triggered in the last block. + * - Conditional order IDs placed, but not triggered in the last block. + * - The height of the block in which the events occurred. + */ +export interface ProcessProposerMatchesEventsSDKType { + /** @deprecated */ + placed_long_term_order_ids: OrderIdSDKType[]; + expired_stateful_order_ids: OrderIdSDKType[]; + order_ids_filled_in_last_block: OrderIdSDKType[]; + /** @deprecated */ + placed_stateful_cancellation_order_ids: OrderIdSDKType[]; + removed_stateful_order_ids: OrderIdSDKType[]; + conditional_order_ids_triggered_in_last_block: OrderIdSDKType[]; + /** @deprecated */ + placed_conditional_order_ids: OrderIdSDKType[]; + block_height: number; +} +function createBaseProcessProposerMatchesEvents(): ProcessProposerMatchesEvents { + return { + placedLongTermOrderIds: [], + expiredStatefulOrderIds: [], + orderIdsFilledInLastBlock: [], + placedStatefulCancellationOrderIds: [], + removedStatefulOrderIds: [], + conditionalOrderIdsTriggeredInLastBlock: [], + placedConditionalOrderIds: [], + blockHeight: 0 + }; +} +export const ProcessProposerMatchesEvents = { + typeUrl: "/dydxprotocol.clob.ProcessProposerMatchesEvents", + encode(message: ProcessProposerMatchesEvents, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.placedLongTermOrderIds) { + OrderId.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.expiredStatefulOrderIds) { + OrderId.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.orderIdsFilledInLastBlock) { + OrderId.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.placedStatefulCancellationOrderIds) { + OrderId.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.removedStatefulOrderIds) { + OrderId.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.conditionalOrderIdsTriggeredInLastBlock) { + OrderId.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.placedConditionalOrderIds) { + OrderId.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.blockHeight !== 0) { + writer.uint32(64).uint32(message.blockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProcessProposerMatchesEvents { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProcessProposerMatchesEvents(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.placedLongTermOrderIds.push(OrderId.decode(reader, reader.uint32())); + break; + case 2: + message.expiredStatefulOrderIds.push(OrderId.decode(reader, reader.uint32())); + break; + case 3: + message.orderIdsFilledInLastBlock.push(OrderId.decode(reader, reader.uint32())); + break; + case 4: + message.placedStatefulCancellationOrderIds.push(OrderId.decode(reader, reader.uint32())); + break; + case 5: + message.removedStatefulOrderIds.push(OrderId.decode(reader, reader.uint32())); + break; + case 6: + message.conditionalOrderIdsTriggeredInLastBlock.push(OrderId.decode(reader, reader.uint32())); + break; + case 7: + message.placedConditionalOrderIds.push(OrderId.decode(reader, reader.uint32())); + break; + case 8: + message.blockHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProcessProposerMatchesEvents { + const message = createBaseProcessProposerMatchesEvents(); + message.placedLongTermOrderIds = object.placedLongTermOrderIds?.map(e => OrderId.fromPartial(e)) || []; + message.expiredStatefulOrderIds = object.expiredStatefulOrderIds?.map(e => OrderId.fromPartial(e)) || []; + message.orderIdsFilledInLastBlock = object.orderIdsFilledInLastBlock?.map(e => OrderId.fromPartial(e)) || []; + message.placedStatefulCancellationOrderIds = object.placedStatefulCancellationOrderIds?.map(e => OrderId.fromPartial(e)) || []; + message.removedStatefulOrderIds = object.removedStatefulOrderIds?.map(e => OrderId.fromPartial(e)) || []; + message.conditionalOrderIdsTriggeredInLastBlock = object.conditionalOrderIdsTriggeredInLastBlock?.map(e => OrderId.fromPartial(e)) || []; + message.placedConditionalOrderIds = object.placedConditionalOrderIds?.map(e => OrderId.fromPartial(e)) || []; + message.blockHeight = object.blockHeight ?? 0; + return message; + }, + fromAmino(object: ProcessProposerMatchesEventsAmino): ProcessProposerMatchesEvents { + const message = createBaseProcessProposerMatchesEvents(); + message.placedLongTermOrderIds = object.placed_long_term_order_ids?.map(e => OrderId.fromAmino(e)) || []; + message.expiredStatefulOrderIds = object.expired_stateful_order_ids?.map(e => OrderId.fromAmino(e)) || []; + message.orderIdsFilledInLastBlock = object.order_ids_filled_in_last_block?.map(e => OrderId.fromAmino(e)) || []; + message.placedStatefulCancellationOrderIds = object.placed_stateful_cancellation_order_ids?.map(e => OrderId.fromAmino(e)) || []; + message.removedStatefulOrderIds = object.removed_stateful_order_ids?.map(e => OrderId.fromAmino(e)) || []; + message.conditionalOrderIdsTriggeredInLastBlock = object.conditional_order_ids_triggered_in_last_block?.map(e => OrderId.fromAmino(e)) || []; + message.placedConditionalOrderIds = object.placed_conditional_order_ids?.map(e => OrderId.fromAmino(e)) || []; + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + return message; + }, + toAmino(message: ProcessProposerMatchesEvents): ProcessProposerMatchesEventsAmino { + const obj: any = {}; + if (message.placedLongTermOrderIds) { + obj.placed_long_term_order_ids = message.placedLongTermOrderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.placed_long_term_order_ids = message.placedLongTermOrderIds; + } + if (message.expiredStatefulOrderIds) { + obj.expired_stateful_order_ids = message.expiredStatefulOrderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.expired_stateful_order_ids = message.expiredStatefulOrderIds; + } + if (message.orderIdsFilledInLastBlock) { + obj.order_ids_filled_in_last_block = message.orderIdsFilledInLastBlock.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.order_ids_filled_in_last_block = message.orderIdsFilledInLastBlock; + } + if (message.placedStatefulCancellationOrderIds) { + obj.placed_stateful_cancellation_order_ids = message.placedStatefulCancellationOrderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.placed_stateful_cancellation_order_ids = message.placedStatefulCancellationOrderIds; + } + if (message.removedStatefulOrderIds) { + obj.removed_stateful_order_ids = message.removedStatefulOrderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.removed_stateful_order_ids = message.removedStatefulOrderIds; + } + if (message.conditionalOrderIdsTriggeredInLastBlock) { + obj.conditional_order_ids_triggered_in_last_block = message.conditionalOrderIdsTriggeredInLastBlock.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.conditional_order_ids_triggered_in_last_block = message.conditionalOrderIdsTriggeredInLastBlock; + } + if (message.placedConditionalOrderIds) { + obj.placed_conditional_order_ids = message.placedConditionalOrderIds.map(e => e ? OrderId.toAmino(e) : undefined); + } else { + obj.placed_conditional_order_ids = message.placedConditionalOrderIds; + } + obj.block_height = message.blockHeight === 0 ? undefined : message.blockHeight; + return obj; + }, + fromAminoMsg(object: ProcessProposerMatchesEventsAminoMsg): ProcessProposerMatchesEvents { + return ProcessProposerMatchesEvents.fromAmino(object.value); + }, + fromProtoMsg(message: ProcessProposerMatchesEventsProtoMsg): ProcessProposerMatchesEvents { + return ProcessProposerMatchesEvents.decode(message.value); + }, + toProto(message: ProcessProposerMatchesEvents): Uint8Array { + return ProcessProposerMatchesEvents.encode(message).finish(); + }, + toProtoMsg(message: ProcessProposerMatchesEvents): ProcessProposerMatchesEventsProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.ProcessProposerMatchesEvents", + value: ProcessProposerMatchesEvents.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/query.rpc.Query.ts new file mode 100644 index 00000000..83119d7d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/query.rpc.Query.ts @@ -0,0 +1,113 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryGetClobPairRequest, QueryClobPairResponse, QueryAllClobPairRequest, QueryClobPairAllResponse, MevNodeToNodeCalculationRequest, MevNodeToNodeCalculationResponse, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponse, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponse, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponse, QueryStatefulOrderRequest, QueryStatefulOrderResponse, StreamOrderbookUpdatesRequest, StreamOrderbookUpdatesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a ClobPair by id. */ + clobPair(request: QueryGetClobPairRequest): Promise; + /** Queries a list of ClobPair items. */ + clobPairAll(request?: QueryAllClobPairRequest): Promise; + /** Runs the MEV node <> node calculation with the provided parameters. */ + mevNodeToNodeCalculation(request: MevNodeToNodeCalculationRequest): Promise; + /** Queries EquityTierLimitConfiguration. */ + equityTierLimitConfiguration(request?: QueryEquityTierLimitConfigurationRequest): Promise; + /** Queries BlockRateLimitConfiguration. */ + blockRateLimitConfiguration(request?: QueryBlockRateLimitConfigurationRequest): Promise; + /** Queries LiquidationsConfiguration. */ + liquidationsConfiguration(request?: QueryLiquidationsConfigurationRequest): Promise; + /** Queries the stateful order for a given order id. */ + statefulOrder(request: QueryStatefulOrderRequest): Promise; + /** + * Streams orderbook updates. Updates contain orderbook data + * such as order placements, updates, and fills. + */ + streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.clobPair = this.clobPair.bind(this); + this.clobPairAll = this.clobPairAll.bind(this); + this.mevNodeToNodeCalculation = this.mevNodeToNodeCalculation.bind(this); + this.equityTierLimitConfiguration = this.equityTierLimitConfiguration.bind(this); + this.blockRateLimitConfiguration = this.blockRateLimitConfiguration.bind(this); + this.liquidationsConfiguration = this.liquidationsConfiguration.bind(this); + this.statefulOrder = this.statefulOrder.bind(this); + this.streamOrderbookUpdates = this.streamOrderbookUpdates.bind(this); + } + clobPair(request: QueryGetClobPairRequest): Promise { + const data = QueryGetClobPairRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "ClobPair", data); + return promise.then(data => QueryClobPairResponse.decode(new BinaryReader(data))); + } + clobPairAll(request: QueryAllClobPairRequest = { + pagination: undefined + }): Promise { + const data = QueryAllClobPairRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "ClobPairAll", data); + return promise.then(data => QueryClobPairAllResponse.decode(new BinaryReader(data))); + } + mevNodeToNodeCalculation(request: MevNodeToNodeCalculationRequest): Promise { + const data = MevNodeToNodeCalculationRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "MevNodeToNodeCalculation", data); + return promise.then(data => MevNodeToNodeCalculationResponse.decode(new BinaryReader(data))); + } + equityTierLimitConfiguration(request: QueryEquityTierLimitConfigurationRequest = {}): Promise { + const data = QueryEquityTierLimitConfigurationRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "EquityTierLimitConfiguration", data); + return promise.then(data => QueryEquityTierLimitConfigurationResponse.decode(new BinaryReader(data))); + } + blockRateLimitConfiguration(request: QueryBlockRateLimitConfigurationRequest = {}): Promise { + const data = QueryBlockRateLimitConfigurationRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "BlockRateLimitConfiguration", data); + return promise.then(data => QueryBlockRateLimitConfigurationResponse.decode(new BinaryReader(data))); + } + liquidationsConfiguration(request: QueryLiquidationsConfigurationRequest = {}): Promise { + const data = QueryLiquidationsConfigurationRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "LiquidationsConfiguration", data); + return promise.then(data => QueryLiquidationsConfigurationResponse.decode(new BinaryReader(data))); + } + statefulOrder(request: QueryStatefulOrderRequest): Promise { + const data = QueryStatefulOrderRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "StatefulOrder", data); + return promise.then(data => QueryStatefulOrderResponse.decode(new BinaryReader(data))); + } + streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise { + const data = StreamOrderbookUpdatesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "StreamOrderbookUpdates", data); + return promise.then(data => StreamOrderbookUpdatesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + clobPair(request: QueryGetClobPairRequest): Promise { + return queryService.clobPair(request); + }, + clobPairAll(request?: QueryAllClobPairRequest): Promise { + return queryService.clobPairAll(request); + }, + mevNodeToNodeCalculation(request: MevNodeToNodeCalculationRequest): Promise { + return queryService.mevNodeToNodeCalculation(request); + }, + equityTierLimitConfiguration(request?: QueryEquityTierLimitConfigurationRequest): Promise { + return queryService.equityTierLimitConfiguration(request); + }, + blockRateLimitConfiguration(request?: QueryBlockRateLimitConfigurationRequest): Promise { + return queryService.blockRateLimitConfiguration(request); + }, + liquidationsConfiguration(request?: QueryLiquidationsConfigurationRequest): Promise { + return queryService.liquidationsConfiguration(request); + }, + statefulOrder(request: QueryStatefulOrderRequest): Promise { + return queryService.statefulOrder(request); + }, + streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise { + return queryService.streamOrderbookUpdates(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/query.ts new file mode 100644 index 00000000..325fff27 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/query.ts @@ -0,0 +1,2355 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { ValidatorMevMatches, ValidatorMevMatchesAmino, ValidatorMevMatchesSDKType, MevNodeToNodeMetrics, MevNodeToNodeMetricsAmino, MevNodeToNodeMetricsSDKType } from "./mev"; +import { OrderId, OrderIdAmino, OrderIdSDKType, LongTermOrderPlacement, LongTermOrderPlacementAmino, LongTermOrderPlacementSDKType, Order, OrderAmino, OrderSDKType, StreamLiquidationOrder, StreamLiquidationOrderAmino, StreamLiquidationOrderSDKType } from "./order"; +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { ClobPair, ClobPairAmino, ClobPairSDKType } from "./clob_pair"; +import { EquityTierLimitConfiguration, EquityTierLimitConfigurationAmino, EquityTierLimitConfigurationSDKType } from "./equity_tier_limit_config"; +import { BlockRateLimitConfiguration, BlockRateLimitConfigurationAmino, BlockRateLimitConfigurationSDKType } from "./block_rate_limit_config"; +import { LiquidationsConfig, LiquidationsConfigAmino, LiquidationsConfigSDKType } from "./liquidations_config"; +import { StreamSubaccountUpdate, StreamSubaccountUpdateAmino, StreamSubaccountUpdateSDKType } from "../subaccounts/streaming"; +import { OffChainUpdateV1, OffChainUpdateV1Amino, OffChainUpdateV1SDKType } from "../indexer/off_chain_updates/off_chain_updates"; +import { ClobMatch, ClobMatchAmino, ClobMatchSDKType } from "./matches"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryGetClobPairRequest is request type for the ClobPair method. */ +export interface QueryGetClobPairRequest { + id: number; +} +export interface QueryGetClobPairRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryGetClobPairRequest"; + value: Uint8Array; +} +/** QueryGetClobPairRequest is request type for the ClobPair method. */ +export interface QueryGetClobPairRequestAmino { + id?: number; +} +export interface QueryGetClobPairRequestAminoMsg { + type: "/dydxprotocol.clob.QueryGetClobPairRequest"; + value: QueryGetClobPairRequestAmino; +} +/** QueryGetClobPairRequest is request type for the ClobPair method. */ +export interface QueryGetClobPairRequestSDKType { + id: number; +} +/** QueryClobPairResponse is response type for the ClobPair method. */ +export interface QueryClobPairResponse { + clobPair: ClobPair; +} +export interface QueryClobPairResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryClobPairResponse"; + value: Uint8Array; +} +/** QueryClobPairResponse is response type for the ClobPair method. */ +export interface QueryClobPairResponseAmino { + clob_pair?: ClobPairAmino; +} +export interface QueryClobPairResponseAminoMsg { + type: "/dydxprotocol.clob.QueryClobPairResponse"; + value: QueryClobPairResponseAmino; +} +/** QueryClobPairResponse is response type for the ClobPair method. */ +export interface QueryClobPairResponseSDKType { + clob_pair: ClobPairSDKType; +} +/** QueryAllClobPairRequest is request type for the ClobPairAll method. */ +export interface QueryAllClobPairRequest { + pagination?: PageRequest; +} +export interface QueryAllClobPairRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryAllClobPairRequest"; + value: Uint8Array; +} +/** QueryAllClobPairRequest is request type for the ClobPairAll method. */ +export interface QueryAllClobPairRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllClobPairRequestAminoMsg { + type: "/dydxprotocol.clob.QueryAllClobPairRequest"; + value: QueryAllClobPairRequestAmino; +} +/** QueryAllClobPairRequest is request type for the ClobPairAll method. */ +export interface QueryAllClobPairRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryClobPairAllResponse is response type for the ClobPairAll method. */ +export interface QueryClobPairAllResponse { + clobPair: ClobPair[]; + pagination?: PageResponse; +} +export interface QueryClobPairAllResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryClobPairAllResponse"; + value: Uint8Array; +} +/** QueryClobPairAllResponse is response type for the ClobPairAll method. */ +export interface QueryClobPairAllResponseAmino { + clob_pair?: ClobPairAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryClobPairAllResponseAminoMsg { + type: "/dydxprotocol.clob.QueryClobPairAllResponse"; + value: QueryClobPairAllResponseAmino; +} +/** QueryClobPairAllResponse is response type for the ClobPairAll method. */ +export interface QueryClobPairAllResponseSDKType { + clob_pair: ClobPairSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * MevNodeToNodeCalculationRequest is a request message used to run the + * MEV node <> node calculation. + */ +export interface MevNodeToNodeCalculationRequest { + /** + * Represents the matches on the "block proposer". Note that this field + * does not need to be the actual block proposer's matches for a block, since + * the MEV calculation logic is run with this nodes matches as the "block + * proposer" matches. + */ + blockProposerMatches?: ValidatorMevMatches; + /** Represents the matches and mid-prices on the validator. */ + validatorMevMetrics?: MevNodeToNodeMetrics; +} +export interface MevNodeToNodeCalculationRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeCalculationRequest"; + value: Uint8Array; +} +/** + * MevNodeToNodeCalculationRequest is a request message used to run the + * MEV node <> node calculation. + */ +export interface MevNodeToNodeCalculationRequestAmino { + /** + * Represents the matches on the "block proposer". Note that this field + * does not need to be the actual block proposer's matches for a block, since + * the MEV calculation logic is run with this nodes matches as the "block + * proposer" matches. + */ + block_proposer_matches?: ValidatorMevMatchesAmino; + /** Represents the matches and mid-prices on the validator. */ + validator_mev_metrics?: MevNodeToNodeMetricsAmino; +} +export interface MevNodeToNodeCalculationRequestAminoMsg { + type: "/dydxprotocol.clob.MevNodeToNodeCalculationRequest"; + value: MevNodeToNodeCalculationRequestAmino; +} +/** + * MevNodeToNodeCalculationRequest is a request message used to run the + * MEV node <> node calculation. + */ +export interface MevNodeToNodeCalculationRequestSDKType { + block_proposer_matches?: ValidatorMevMatchesSDKType; + validator_mev_metrics?: MevNodeToNodeMetricsSDKType; +} +/** + * MevNodeToNodeCalculationResponse is a response message that contains the + * MEV node <> node calculation result. + */ +export interface MevNodeToNodeCalculationResponse { + results: MevNodeToNodeCalculationResponse_MevAndVolumePerClob[]; +} +export interface MevNodeToNodeCalculationResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeCalculationResponse"; + value: Uint8Array; +} +/** + * MevNodeToNodeCalculationResponse is a response message that contains the + * MEV node <> node calculation result. + */ +export interface MevNodeToNodeCalculationResponseAmino { + results?: MevNodeToNodeCalculationResponse_MevAndVolumePerClobAmino[]; +} +export interface MevNodeToNodeCalculationResponseAminoMsg { + type: "/dydxprotocol.clob.MevNodeToNodeCalculationResponse"; + value: MevNodeToNodeCalculationResponseAmino; +} +/** + * MevNodeToNodeCalculationResponse is a response message that contains the + * MEV node <> node calculation result. + */ +export interface MevNodeToNodeCalculationResponseSDKType { + results: MevNodeToNodeCalculationResponse_MevAndVolumePerClobSDKType[]; +} +/** MevAndVolumePerClob contains information about the MEV and volume per CLOB. */ +export interface MevNodeToNodeCalculationResponse_MevAndVolumePerClob { + clobPairId: number; + mev: number; + volume: bigint; +} +export interface MevNodeToNodeCalculationResponse_MevAndVolumePerClobProtoMsg { + typeUrl: "/dydxprotocol.clob.MevAndVolumePerClob"; + value: Uint8Array; +} +/** MevAndVolumePerClob contains information about the MEV and volume per CLOB. */ +export interface MevNodeToNodeCalculationResponse_MevAndVolumePerClobAmino { + clob_pair_id?: number; + mev?: number; + volume?: string; +} +export interface MevNodeToNodeCalculationResponse_MevAndVolumePerClobAminoMsg { + type: "/dydxprotocol.clob.MevAndVolumePerClob"; + value: MevNodeToNodeCalculationResponse_MevAndVolumePerClobAmino; +} +/** MevAndVolumePerClob contains information about the MEV and volume per CLOB. */ +export interface MevNodeToNodeCalculationResponse_MevAndVolumePerClobSDKType { + clob_pair_id: number; + mev: number; + volume: bigint; +} +/** + * QueryEquityTierLimitConfigurationRequest is a request message for + * EquityTierLimitConfiguration. + */ +export interface QueryEquityTierLimitConfigurationRequest {} +export interface QueryEquityTierLimitConfigurationRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationRequest"; + value: Uint8Array; +} +/** + * QueryEquityTierLimitConfigurationRequest is a request message for + * EquityTierLimitConfiguration. + */ +export interface QueryEquityTierLimitConfigurationRequestAmino {} +export interface QueryEquityTierLimitConfigurationRequestAminoMsg { + type: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationRequest"; + value: QueryEquityTierLimitConfigurationRequestAmino; +} +/** + * QueryEquityTierLimitConfigurationRequest is a request message for + * EquityTierLimitConfiguration. + */ +export interface QueryEquityTierLimitConfigurationRequestSDKType {} +/** + * QueryEquityTierLimitConfigurationResponse is a response message that contains + * the EquityTierLimitConfiguration. + */ +export interface QueryEquityTierLimitConfigurationResponse { + equityTierLimitConfig: EquityTierLimitConfiguration; +} +export interface QueryEquityTierLimitConfigurationResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationResponse"; + value: Uint8Array; +} +/** + * QueryEquityTierLimitConfigurationResponse is a response message that contains + * the EquityTierLimitConfiguration. + */ +export interface QueryEquityTierLimitConfigurationResponseAmino { + equity_tier_limit_config?: EquityTierLimitConfigurationAmino; +} +export interface QueryEquityTierLimitConfigurationResponseAminoMsg { + type: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationResponse"; + value: QueryEquityTierLimitConfigurationResponseAmino; +} +/** + * QueryEquityTierLimitConfigurationResponse is a response message that contains + * the EquityTierLimitConfiguration. + */ +export interface QueryEquityTierLimitConfigurationResponseSDKType { + equity_tier_limit_config: EquityTierLimitConfigurationSDKType; +} +/** + * QueryBlockRateLimitConfigurationRequest is a request message for + * BlockRateLimitConfiguration. + */ +export interface QueryBlockRateLimitConfigurationRequest {} +export interface QueryBlockRateLimitConfigurationRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationRequest"; + value: Uint8Array; +} +/** + * QueryBlockRateLimitConfigurationRequest is a request message for + * BlockRateLimitConfiguration. + */ +export interface QueryBlockRateLimitConfigurationRequestAmino {} +export interface QueryBlockRateLimitConfigurationRequestAminoMsg { + type: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationRequest"; + value: QueryBlockRateLimitConfigurationRequestAmino; +} +/** + * QueryBlockRateLimitConfigurationRequest is a request message for + * BlockRateLimitConfiguration. + */ +export interface QueryBlockRateLimitConfigurationRequestSDKType {} +/** + * QueryBlockRateLimitConfigurationResponse is a response message that contains + * the BlockRateLimitConfiguration. + */ +export interface QueryBlockRateLimitConfigurationResponse { + blockRateLimitConfig: BlockRateLimitConfiguration; +} +export interface QueryBlockRateLimitConfigurationResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationResponse"; + value: Uint8Array; +} +/** + * QueryBlockRateLimitConfigurationResponse is a response message that contains + * the BlockRateLimitConfiguration. + */ +export interface QueryBlockRateLimitConfigurationResponseAmino { + block_rate_limit_config?: BlockRateLimitConfigurationAmino; +} +export interface QueryBlockRateLimitConfigurationResponseAminoMsg { + type: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationResponse"; + value: QueryBlockRateLimitConfigurationResponseAmino; +} +/** + * QueryBlockRateLimitConfigurationResponse is a response message that contains + * the BlockRateLimitConfiguration. + */ +export interface QueryBlockRateLimitConfigurationResponseSDKType { + block_rate_limit_config: BlockRateLimitConfigurationSDKType; +} +/** QueryStatefulOrderRequest is a request message for StatefulOrder. */ +export interface QueryStatefulOrderRequest { + /** Order id to query. */ + orderId: OrderId; +} +export interface QueryStatefulOrderRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryStatefulOrderRequest"; + value: Uint8Array; +} +/** QueryStatefulOrderRequest is a request message for StatefulOrder. */ +export interface QueryStatefulOrderRequestAmino { + /** Order id to query. */ + order_id?: OrderIdAmino; +} +export interface QueryStatefulOrderRequestAminoMsg { + type: "/dydxprotocol.clob.QueryStatefulOrderRequest"; + value: QueryStatefulOrderRequestAmino; +} +/** QueryStatefulOrderRequest is a request message for StatefulOrder. */ +export interface QueryStatefulOrderRequestSDKType { + order_id: OrderIdSDKType; +} +/** + * QueryStatefulOrderResponse is a response message that contains the stateful + * order. + */ +export interface QueryStatefulOrderResponse { + /** Stateful order placement. */ + orderPlacement: LongTermOrderPlacement; + /** Fill amounts. */ + fillAmount: bigint; + /** Triggered status. */ + triggered: boolean; +} +export interface QueryStatefulOrderResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryStatefulOrderResponse"; + value: Uint8Array; +} +/** + * QueryStatefulOrderResponse is a response message that contains the stateful + * order. + */ +export interface QueryStatefulOrderResponseAmino { + /** Stateful order placement. */ + order_placement?: LongTermOrderPlacementAmino; + /** Fill amounts. */ + fill_amount?: string; + /** Triggered status. */ + triggered?: boolean; +} +export interface QueryStatefulOrderResponseAminoMsg { + type: "/dydxprotocol.clob.QueryStatefulOrderResponse"; + value: QueryStatefulOrderResponseAmino; +} +/** + * QueryStatefulOrderResponse is a response message that contains the stateful + * order. + */ +export interface QueryStatefulOrderResponseSDKType { + order_placement: LongTermOrderPlacementSDKType; + fill_amount: bigint; + triggered: boolean; +} +/** + * QueryLiquidationsConfigurationRequest is a request message for + * LiquidationsConfiguration. + */ +export interface QueryLiquidationsConfigurationRequest {} +export interface QueryLiquidationsConfigurationRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryLiquidationsConfigurationRequest"; + value: Uint8Array; +} +/** + * QueryLiquidationsConfigurationRequest is a request message for + * LiquidationsConfiguration. + */ +export interface QueryLiquidationsConfigurationRequestAmino {} +export interface QueryLiquidationsConfigurationRequestAminoMsg { + type: "/dydxprotocol.clob.QueryLiquidationsConfigurationRequest"; + value: QueryLiquidationsConfigurationRequestAmino; +} +/** + * QueryLiquidationsConfigurationRequest is a request message for + * LiquidationsConfiguration. + */ +export interface QueryLiquidationsConfigurationRequestSDKType {} +/** + * QueryLiquidationsConfigurationResponse is a response message that contains + * the LiquidationsConfiguration. + */ +export interface QueryLiquidationsConfigurationResponse { + liquidationsConfig: LiquidationsConfig; +} +export interface QueryLiquidationsConfigurationResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.QueryLiquidationsConfigurationResponse"; + value: Uint8Array; +} +/** + * QueryLiquidationsConfigurationResponse is a response message that contains + * the LiquidationsConfiguration. + */ +export interface QueryLiquidationsConfigurationResponseAmino { + liquidations_config?: LiquidationsConfigAmino; +} +export interface QueryLiquidationsConfigurationResponseAminoMsg { + type: "/dydxprotocol.clob.QueryLiquidationsConfigurationResponse"; + value: QueryLiquidationsConfigurationResponseAmino; +} +/** + * QueryLiquidationsConfigurationResponse is a response message that contains + * the LiquidationsConfiguration. + */ +export interface QueryLiquidationsConfigurationResponseSDKType { + liquidations_config: LiquidationsConfigSDKType; +} +/** + * StreamOrderbookUpdatesRequest is a request message for the + * StreamOrderbookUpdates method. + */ +export interface StreamOrderbookUpdatesRequest { + /** Clob pair ids to stream orderbook updates for. */ + clobPairId: number[]; + /** Subaccount ids to stream subaccount updates for. */ + subaccountIds: SubaccountId[]; +} +export interface StreamOrderbookUpdatesRequestProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdatesRequest"; + value: Uint8Array; +} +/** + * StreamOrderbookUpdatesRequest is a request message for the + * StreamOrderbookUpdates method. + */ +export interface StreamOrderbookUpdatesRequestAmino { + /** Clob pair ids to stream orderbook updates for. */ + clob_pair_id?: number[]; + /** Subaccount ids to stream subaccount updates for. */ + subaccount_ids?: SubaccountIdAmino[]; +} +export interface StreamOrderbookUpdatesRequestAminoMsg { + type: "/dydxprotocol.clob.StreamOrderbookUpdatesRequest"; + value: StreamOrderbookUpdatesRequestAmino; +} +/** + * StreamOrderbookUpdatesRequest is a request message for the + * StreamOrderbookUpdates method. + */ +export interface StreamOrderbookUpdatesRequestSDKType { + clob_pair_id: number[]; + subaccount_ids: SubaccountIdSDKType[]; +} +/** + * StreamOrderbookUpdatesResponse is a response message for the + * StreamOrderbookUpdates method. + */ +export interface StreamOrderbookUpdatesResponse { + /** Batch of updates for the clob pair. */ + updates: StreamUpdate[]; +} +export interface StreamOrderbookUpdatesResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdatesResponse"; + value: Uint8Array; +} +/** + * StreamOrderbookUpdatesResponse is a response message for the + * StreamOrderbookUpdates method. + */ +export interface StreamOrderbookUpdatesResponseAmino { + /** Batch of updates for the clob pair. */ + updates?: StreamUpdateAmino[]; +} +export interface StreamOrderbookUpdatesResponseAminoMsg { + type: "/dydxprotocol.clob.StreamOrderbookUpdatesResponse"; + value: StreamOrderbookUpdatesResponseAmino; +} +/** + * StreamOrderbookUpdatesResponse is a response message for the + * StreamOrderbookUpdates method. + */ +export interface StreamOrderbookUpdatesResponseSDKType { + updates: StreamUpdateSDKType[]; +} +/** + * StreamUpdate is an update that will be pushed through the + * GRPC stream. + */ +export interface StreamUpdate { + orderbookUpdate?: StreamOrderbookUpdate; + orderFill?: StreamOrderbookFill; + takerOrder?: StreamTakerOrder; + subaccountUpdate?: StreamSubaccountUpdate; + /** Block height of the update. */ + blockHeight: number; + /** Exec mode of the update. */ + execMode: number; +} +export interface StreamUpdateProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamUpdate"; + value: Uint8Array; +} +/** + * StreamUpdate is an update that will be pushed through the + * GRPC stream. + */ +export interface StreamUpdateAmino { + orderbook_update?: StreamOrderbookUpdateAmino; + order_fill?: StreamOrderbookFillAmino; + taker_order?: StreamTakerOrderAmino; + subaccount_update?: StreamSubaccountUpdateAmino; + /** Block height of the update. */ + block_height?: number; + /** Exec mode of the update. */ + exec_mode?: number; +} +export interface StreamUpdateAminoMsg { + type: "/dydxprotocol.clob.StreamUpdate"; + value: StreamUpdateAmino; +} +/** + * StreamUpdate is an update that will be pushed through the + * GRPC stream. + */ +export interface StreamUpdateSDKType { + orderbook_update?: StreamOrderbookUpdateSDKType; + order_fill?: StreamOrderbookFillSDKType; + taker_order?: StreamTakerOrderSDKType; + subaccount_update?: StreamSubaccountUpdateSDKType; + block_height: number; + exec_mode: number; +} +/** + * StreamOrderbookUpdate provides information on an orderbook update. Used in + * the full node GRPC stream. + */ +export interface StreamOrderbookUpdate { + /** + * Orderbook updates for the clob pair. Can contain order place, removals, + * or updates. + */ + updates: OffChainUpdateV1[]; + /** + * Snapshot indicates if the response is from a snapshot of the orderbook. + * All updates should be ignored until snapshot is recieved. + * If the snapshot is true, then all previous entries should be + * discarded and the orderbook should be resynced. + */ + snapshot: boolean; +} +export interface StreamOrderbookUpdateProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdate"; + value: Uint8Array; +} +/** + * StreamOrderbookUpdate provides information on an orderbook update. Used in + * the full node GRPC stream. + */ +export interface StreamOrderbookUpdateAmino { + /** + * Orderbook updates for the clob pair. Can contain order place, removals, + * or updates. + */ + updates?: OffChainUpdateV1Amino[]; + /** + * Snapshot indicates if the response is from a snapshot of the orderbook. + * All updates should be ignored until snapshot is recieved. + * If the snapshot is true, then all previous entries should be + * discarded and the orderbook should be resynced. + */ + snapshot?: boolean; +} +export interface StreamOrderbookUpdateAminoMsg { + type: "/dydxprotocol.clob.StreamOrderbookUpdate"; + value: StreamOrderbookUpdateAmino; +} +/** + * StreamOrderbookUpdate provides information on an orderbook update. Used in + * the full node GRPC stream. + */ +export interface StreamOrderbookUpdateSDKType { + updates: OffChainUpdateV1SDKType[]; + snapshot: boolean; +} +/** + * StreamOrderbookFill provides information on an orderbook fill. Used in + * the full node GRPC stream. + */ +export interface StreamOrderbookFill { + /** + * Clob match. Provides information on which orders were matched + * and the type of order. + */ + clobMatch?: ClobMatch; + /** + * All orders involved in the specified clob match. Used to look up + * price of a match through a given maker order id. + */ + orders: Order[]; + /** Resulting fill amounts for each order in the orders array. */ + fillAmounts: bigint[]; +} +export interface StreamOrderbookFillProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamOrderbookFill"; + value: Uint8Array; +} +/** + * StreamOrderbookFill provides information on an orderbook fill. Used in + * the full node GRPC stream. + */ +export interface StreamOrderbookFillAmino { + /** + * Clob match. Provides information on which orders were matched + * and the type of order. + */ + clob_match?: ClobMatchAmino; + /** + * All orders involved in the specified clob match. Used to look up + * price of a match through a given maker order id. + */ + orders?: OrderAmino[]; + /** Resulting fill amounts for each order in the orders array. */ + fill_amounts?: string[]; +} +export interface StreamOrderbookFillAminoMsg { + type: "/dydxprotocol.clob.StreamOrderbookFill"; + value: StreamOrderbookFillAmino; +} +/** + * StreamOrderbookFill provides information on an orderbook fill. Used in + * the full node GRPC stream. + */ +export interface StreamOrderbookFillSDKType { + clob_match?: ClobMatchSDKType; + orders: OrderSDKType[]; + fill_amounts: bigint[]; +} +/** + * StreamTakerOrder provides information on a taker order that was attempted + * to be matched on the orderbook. + * It is intended to be used only in full node streaming. + */ +export interface StreamTakerOrder { + order?: Order; + liquidationOrder?: StreamLiquidationOrder; + /** + * Information on the taker order after it is matched on the book, + * either successfully or unsuccessfully. + */ + takerOrderStatus?: StreamTakerOrderStatus; +} +export interface StreamTakerOrderProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamTakerOrder"; + value: Uint8Array; +} +/** + * StreamTakerOrder provides information on a taker order that was attempted + * to be matched on the orderbook. + * It is intended to be used only in full node streaming. + */ +export interface StreamTakerOrderAmino { + order?: OrderAmino; + liquidation_order?: StreamLiquidationOrderAmino; + /** + * Information on the taker order after it is matched on the book, + * either successfully or unsuccessfully. + */ + taker_order_status?: StreamTakerOrderStatusAmino; +} +export interface StreamTakerOrderAminoMsg { + type: "/dydxprotocol.clob.StreamTakerOrder"; + value: StreamTakerOrderAmino; +} +/** + * StreamTakerOrder provides information on a taker order that was attempted + * to be matched on the orderbook. + * It is intended to be used only in full node streaming. + */ +export interface StreamTakerOrderSDKType { + order?: OrderSDKType; + liquidation_order?: StreamLiquidationOrderSDKType; + taker_order_status?: StreamTakerOrderStatusSDKType; +} +/** + * StreamTakerOrderStatus is a representation of a taker order + * after it is attempted to be matched on the orderbook. + * It is intended to be used only in full node streaming. + */ +export interface StreamTakerOrderStatus { + /** + * The state of the taker order after attempting to match it against the + * orderbook. Possible enum values can be found here: + * https://github.com/dydxprotocol/v4-chain/blob/main/protocol/x/clob/types/orderbook.go#L105 + */ + orderStatus: number; + /** The amount of remaining (non-matched) base quantums of this taker order. */ + remainingQuantums: bigint; + /** + * The amount of base quantums that were *optimistically* filled for this + * taker order when the order is matched against the orderbook. Note that if + * any quantums of this order were optimistically filled or filled in state + * before this invocation of the matching loop, this value will not include + * them. + */ + optimisticallyFilledQuantums: bigint; +} +export interface StreamTakerOrderStatusProtoMsg { + typeUrl: "/dydxprotocol.clob.StreamTakerOrderStatus"; + value: Uint8Array; +} +/** + * StreamTakerOrderStatus is a representation of a taker order + * after it is attempted to be matched on the orderbook. + * It is intended to be used only in full node streaming. + */ +export interface StreamTakerOrderStatusAmino { + /** + * The state of the taker order after attempting to match it against the + * orderbook. Possible enum values can be found here: + * https://github.com/dydxprotocol/v4-chain/blob/main/protocol/x/clob/types/orderbook.go#L105 + */ + order_status?: number; + /** The amount of remaining (non-matched) base quantums of this taker order. */ + remaining_quantums?: string; + /** + * The amount of base quantums that were *optimistically* filled for this + * taker order when the order is matched against the orderbook. Note that if + * any quantums of this order were optimistically filled or filled in state + * before this invocation of the matching loop, this value will not include + * them. + */ + optimistically_filled_quantums?: string; +} +export interface StreamTakerOrderStatusAminoMsg { + type: "/dydxprotocol.clob.StreamTakerOrderStatus"; + value: StreamTakerOrderStatusAmino; +} +/** + * StreamTakerOrderStatus is a representation of a taker order + * after it is attempted to be matched on the orderbook. + * It is intended to be used only in full node streaming. + */ +export interface StreamTakerOrderStatusSDKType { + order_status: number; + remaining_quantums: bigint; + optimistically_filled_quantums: bigint; +} +function createBaseQueryGetClobPairRequest(): QueryGetClobPairRequest { + return { + id: 0 + }; +} +export const QueryGetClobPairRequest = { + typeUrl: "/dydxprotocol.clob.QueryGetClobPairRequest", + encode(message: QueryGetClobPairRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetClobPairRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetClobPairRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetClobPairRequest { + const message = createBaseQueryGetClobPairRequest(); + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: QueryGetClobPairRequestAmino): QueryGetClobPairRequest { + const message = createBaseQueryGetClobPairRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryGetClobPairRequest): QueryGetClobPairRequestAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryGetClobPairRequestAminoMsg): QueryGetClobPairRequest { + return QueryGetClobPairRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetClobPairRequestProtoMsg): QueryGetClobPairRequest { + return QueryGetClobPairRequest.decode(message.value); + }, + toProto(message: QueryGetClobPairRequest): Uint8Array { + return QueryGetClobPairRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetClobPairRequest): QueryGetClobPairRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryGetClobPairRequest", + value: QueryGetClobPairRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClobPairResponse(): QueryClobPairResponse { + return { + clobPair: ClobPair.fromPartial({}) + }; +} +export const QueryClobPairResponse = { + typeUrl: "/dydxprotocol.clob.QueryClobPairResponse", + encode(message: QueryClobPairResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clobPair !== undefined) { + ClobPair.encode(message.clobPair, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClobPairResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClobPairResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobPair = ClobPair.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClobPairResponse { + const message = createBaseQueryClobPairResponse(); + message.clobPair = object.clobPair !== undefined && object.clobPair !== null ? ClobPair.fromPartial(object.clobPair) : undefined; + return message; + }, + fromAmino(object: QueryClobPairResponseAmino): QueryClobPairResponse { + const message = createBaseQueryClobPairResponse(); + if (object.clob_pair !== undefined && object.clob_pair !== null) { + message.clobPair = ClobPair.fromAmino(object.clob_pair); + } + return message; + }, + toAmino(message: QueryClobPairResponse): QueryClobPairResponseAmino { + const obj: any = {}; + obj.clob_pair = message.clobPair ? ClobPair.toAmino(message.clobPair) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClobPairResponseAminoMsg): QueryClobPairResponse { + return QueryClobPairResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryClobPairResponseProtoMsg): QueryClobPairResponse { + return QueryClobPairResponse.decode(message.value); + }, + toProto(message: QueryClobPairResponse): Uint8Array { + return QueryClobPairResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClobPairResponse): QueryClobPairResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryClobPairResponse", + value: QueryClobPairResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllClobPairRequest(): QueryAllClobPairRequest { + return { + pagination: undefined + }; +} +export const QueryAllClobPairRequest = { + typeUrl: "/dydxprotocol.clob.QueryAllClobPairRequest", + encode(message: QueryAllClobPairRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllClobPairRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllClobPairRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllClobPairRequest { + const message = createBaseQueryAllClobPairRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllClobPairRequestAmino): QueryAllClobPairRequest { + const message = createBaseQueryAllClobPairRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllClobPairRequest): QueryAllClobPairRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllClobPairRequestAminoMsg): QueryAllClobPairRequest { + return QueryAllClobPairRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllClobPairRequestProtoMsg): QueryAllClobPairRequest { + return QueryAllClobPairRequest.decode(message.value); + }, + toProto(message: QueryAllClobPairRequest): Uint8Array { + return QueryAllClobPairRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllClobPairRequest): QueryAllClobPairRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryAllClobPairRequest", + value: QueryAllClobPairRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClobPairAllResponse(): QueryClobPairAllResponse { + return { + clobPair: [], + pagination: undefined + }; +} +export const QueryClobPairAllResponse = { + typeUrl: "/dydxprotocol.clob.QueryClobPairAllResponse", + encode(message: QueryClobPairAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.clobPair) { + ClobPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClobPairAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClobPairAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobPair.push(ClobPair.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClobPairAllResponse { + const message = createBaseQueryClobPairAllResponse(); + message.clobPair = object.clobPair?.map(e => ClobPair.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryClobPairAllResponseAmino): QueryClobPairAllResponse { + const message = createBaseQueryClobPairAllResponse(); + message.clobPair = object.clob_pair?.map(e => ClobPair.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryClobPairAllResponse): QueryClobPairAllResponseAmino { + const obj: any = {}; + if (message.clobPair) { + obj.clob_pair = message.clobPair.map(e => e ? ClobPair.toAmino(e) : undefined); + } else { + obj.clob_pair = message.clobPair; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClobPairAllResponseAminoMsg): QueryClobPairAllResponse { + return QueryClobPairAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryClobPairAllResponseProtoMsg): QueryClobPairAllResponse { + return QueryClobPairAllResponse.decode(message.value); + }, + toProto(message: QueryClobPairAllResponse): Uint8Array { + return QueryClobPairAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClobPairAllResponse): QueryClobPairAllResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryClobPairAllResponse", + value: QueryClobPairAllResponse.encode(message).finish() + }; + } +}; +function createBaseMevNodeToNodeCalculationRequest(): MevNodeToNodeCalculationRequest { + return { + blockProposerMatches: undefined, + validatorMevMetrics: undefined + }; +} +export const MevNodeToNodeCalculationRequest = { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeCalculationRequest", + encode(message: MevNodeToNodeCalculationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockProposerMatches !== undefined) { + ValidatorMevMatches.encode(message.blockProposerMatches, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorMevMetrics !== undefined) { + MevNodeToNodeMetrics.encode(message.validatorMevMetrics, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MevNodeToNodeCalculationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMevNodeToNodeCalculationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockProposerMatches = ValidatorMevMatches.decode(reader, reader.uint32()); + break; + case 2: + message.validatorMevMetrics = MevNodeToNodeMetrics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MevNodeToNodeCalculationRequest { + const message = createBaseMevNodeToNodeCalculationRequest(); + message.blockProposerMatches = object.blockProposerMatches !== undefined && object.blockProposerMatches !== null ? ValidatorMevMatches.fromPartial(object.blockProposerMatches) : undefined; + message.validatorMevMetrics = object.validatorMevMetrics !== undefined && object.validatorMevMetrics !== null ? MevNodeToNodeMetrics.fromPartial(object.validatorMevMetrics) : undefined; + return message; + }, + fromAmino(object: MevNodeToNodeCalculationRequestAmino): MevNodeToNodeCalculationRequest { + const message = createBaseMevNodeToNodeCalculationRequest(); + if (object.block_proposer_matches !== undefined && object.block_proposer_matches !== null) { + message.blockProposerMatches = ValidatorMevMatches.fromAmino(object.block_proposer_matches); + } + if (object.validator_mev_metrics !== undefined && object.validator_mev_metrics !== null) { + message.validatorMevMetrics = MevNodeToNodeMetrics.fromAmino(object.validator_mev_metrics); + } + return message; + }, + toAmino(message: MevNodeToNodeCalculationRequest): MevNodeToNodeCalculationRequestAmino { + const obj: any = {}; + obj.block_proposer_matches = message.blockProposerMatches ? ValidatorMevMatches.toAmino(message.blockProposerMatches) : undefined; + obj.validator_mev_metrics = message.validatorMevMetrics ? MevNodeToNodeMetrics.toAmino(message.validatorMevMetrics) : undefined; + return obj; + }, + fromAminoMsg(object: MevNodeToNodeCalculationRequestAminoMsg): MevNodeToNodeCalculationRequest { + return MevNodeToNodeCalculationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: MevNodeToNodeCalculationRequestProtoMsg): MevNodeToNodeCalculationRequest { + return MevNodeToNodeCalculationRequest.decode(message.value); + }, + toProto(message: MevNodeToNodeCalculationRequest): Uint8Array { + return MevNodeToNodeCalculationRequest.encode(message).finish(); + }, + toProtoMsg(message: MevNodeToNodeCalculationRequest): MevNodeToNodeCalculationRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeCalculationRequest", + value: MevNodeToNodeCalculationRequest.encode(message).finish() + }; + } +}; +function createBaseMevNodeToNodeCalculationResponse(): MevNodeToNodeCalculationResponse { + return { + results: [] + }; +} +export const MevNodeToNodeCalculationResponse = { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeCalculationResponse", + encode(message: MevNodeToNodeCalculationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.results) { + MevNodeToNodeCalculationResponse_MevAndVolumePerClob.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MevNodeToNodeCalculationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMevNodeToNodeCalculationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.results.push(MevNodeToNodeCalculationResponse_MevAndVolumePerClob.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MevNodeToNodeCalculationResponse { + const message = createBaseMevNodeToNodeCalculationResponse(); + message.results = object.results?.map(e => MevNodeToNodeCalculationResponse_MevAndVolumePerClob.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MevNodeToNodeCalculationResponseAmino): MevNodeToNodeCalculationResponse { + const message = createBaseMevNodeToNodeCalculationResponse(); + message.results = object.results?.map(e => MevNodeToNodeCalculationResponse_MevAndVolumePerClob.fromAmino(e)) || []; + return message; + }, + toAmino(message: MevNodeToNodeCalculationResponse): MevNodeToNodeCalculationResponseAmino { + const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => e ? MevNodeToNodeCalculationResponse_MevAndVolumePerClob.toAmino(e) : undefined); + } else { + obj.results = message.results; + } + return obj; + }, + fromAminoMsg(object: MevNodeToNodeCalculationResponseAminoMsg): MevNodeToNodeCalculationResponse { + return MevNodeToNodeCalculationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MevNodeToNodeCalculationResponseProtoMsg): MevNodeToNodeCalculationResponse { + return MevNodeToNodeCalculationResponse.decode(message.value); + }, + toProto(message: MevNodeToNodeCalculationResponse): Uint8Array { + return MevNodeToNodeCalculationResponse.encode(message).finish(); + }, + toProtoMsg(message: MevNodeToNodeCalculationResponse): MevNodeToNodeCalculationResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MevNodeToNodeCalculationResponse", + value: MevNodeToNodeCalculationResponse.encode(message).finish() + }; + } +}; +function createBaseMevNodeToNodeCalculationResponse_MevAndVolumePerClob(): MevNodeToNodeCalculationResponse_MevAndVolumePerClob { + return { + clobPairId: 0, + mev: 0, + volume: BigInt(0) + }; +} +export const MevNodeToNodeCalculationResponse_MevAndVolumePerClob = { + typeUrl: "/dydxprotocol.clob.MevAndVolumePerClob", + encode(message: MevNodeToNodeCalculationResponse_MevAndVolumePerClob, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clobPairId !== 0) { + writer.uint32(8).uint32(message.clobPairId); + } + if (message.mev !== 0) { + writer.uint32(21).float(message.mev); + } + if (message.volume !== BigInt(0)) { + writer.uint32(24).uint64(message.volume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MevNodeToNodeCalculationResponse_MevAndVolumePerClob { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMevNodeToNodeCalculationResponse_MevAndVolumePerClob(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobPairId = reader.uint32(); + break; + case 2: + message.mev = reader.float(); + break; + case 3: + message.volume = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MevNodeToNodeCalculationResponse_MevAndVolumePerClob { + const message = createBaseMevNodeToNodeCalculationResponse_MevAndVolumePerClob(); + message.clobPairId = object.clobPairId ?? 0; + message.mev = object.mev ?? 0; + message.volume = object.volume !== undefined && object.volume !== null ? BigInt(object.volume.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MevNodeToNodeCalculationResponse_MevAndVolumePerClobAmino): MevNodeToNodeCalculationResponse_MevAndVolumePerClob { + const message = createBaseMevNodeToNodeCalculationResponse_MevAndVolumePerClob(); + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.mev !== undefined && object.mev !== null) { + message.mev = object.mev; + } + if (object.volume !== undefined && object.volume !== null) { + message.volume = BigInt(object.volume); + } + return message; + }, + toAmino(message: MevNodeToNodeCalculationResponse_MevAndVolumePerClob): MevNodeToNodeCalculationResponse_MevAndVolumePerClobAmino { + const obj: any = {}; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.mev = message.mev === 0 ? undefined : message.mev; + obj.volume = message.volume !== BigInt(0) ? message.volume.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MevNodeToNodeCalculationResponse_MevAndVolumePerClobAminoMsg): MevNodeToNodeCalculationResponse_MevAndVolumePerClob { + return MevNodeToNodeCalculationResponse_MevAndVolumePerClob.fromAmino(object.value); + }, + fromProtoMsg(message: MevNodeToNodeCalculationResponse_MevAndVolumePerClobProtoMsg): MevNodeToNodeCalculationResponse_MevAndVolumePerClob { + return MevNodeToNodeCalculationResponse_MevAndVolumePerClob.decode(message.value); + }, + toProto(message: MevNodeToNodeCalculationResponse_MevAndVolumePerClob): Uint8Array { + return MevNodeToNodeCalculationResponse_MevAndVolumePerClob.encode(message).finish(); + }, + toProtoMsg(message: MevNodeToNodeCalculationResponse_MevAndVolumePerClob): MevNodeToNodeCalculationResponse_MevAndVolumePerClobProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MevAndVolumePerClob", + value: MevNodeToNodeCalculationResponse_MevAndVolumePerClob.encode(message).finish() + }; + } +}; +function createBaseQueryEquityTierLimitConfigurationRequest(): QueryEquityTierLimitConfigurationRequest { + return {}; +} +export const QueryEquityTierLimitConfigurationRequest = { + typeUrl: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationRequest", + encode(_: QueryEquityTierLimitConfigurationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEquityTierLimitConfigurationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEquityTierLimitConfigurationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryEquityTierLimitConfigurationRequest { + const message = createBaseQueryEquityTierLimitConfigurationRequest(); + return message; + }, + fromAmino(_: QueryEquityTierLimitConfigurationRequestAmino): QueryEquityTierLimitConfigurationRequest { + const message = createBaseQueryEquityTierLimitConfigurationRequest(); + return message; + }, + toAmino(_: QueryEquityTierLimitConfigurationRequest): QueryEquityTierLimitConfigurationRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryEquityTierLimitConfigurationRequestAminoMsg): QueryEquityTierLimitConfigurationRequest { + return QueryEquityTierLimitConfigurationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEquityTierLimitConfigurationRequestProtoMsg): QueryEquityTierLimitConfigurationRequest { + return QueryEquityTierLimitConfigurationRequest.decode(message.value); + }, + toProto(message: QueryEquityTierLimitConfigurationRequest): Uint8Array { + return QueryEquityTierLimitConfigurationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEquityTierLimitConfigurationRequest): QueryEquityTierLimitConfigurationRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationRequest", + value: QueryEquityTierLimitConfigurationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEquityTierLimitConfigurationResponse(): QueryEquityTierLimitConfigurationResponse { + return { + equityTierLimitConfig: EquityTierLimitConfiguration.fromPartial({}) + }; +} +export const QueryEquityTierLimitConfigurationResponse = { + typeUrl: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationResponse", + encode(message: QueryEquityTierLimitConfigurationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.equityTierLimitConfig !== undefined) { + EquityTierLimitConfiguration.encode(message.equityTierLimitConfig, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEquityTierLimitConfigurationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEquityTierLimitConfigurationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.equityTierLimitConfig = EquityTierLimitConfiguration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEquityTierLimitConfigurationResponse { + const message = createBaseQueryEquityTierLimitConfigurationResponse(); + message.equityTierLimitConfig = object.equityTierLimitConfig !== undefined && object.equityTierLimitConfig !== null ? EquityTierLimitConfiguration.fromPartial(object.equityTierLimitConfig) : undefined; + return message; + }, + fromAmino(object: QueryEquityTierLimitConfigurationResponseAmino): QueryEquityTierLimitConfigurationResponse { + const message = createBaseQueryEquityTierLimitConfigurationResponse(); + if (object.equity_tier_limit_config !== undefined && object.equity_tier_limit_config !== null) { + message.equityTierLimitConfig = EquityTierLimitConfiguration.fromAmino(object.equity_tier_limit_config); + } + return message; + }, + toAmino(message: QueryEquityTierLimitConfigurationResponse): QueryEquityTierLimitConfigurationResponseAmino { + const obj: any = {}; + obj.equity_tier_limit_config = message.equityTierLimitConfig ? EquityTierLimitConfiguration.toAmino(message.equityTierLimitConfig) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEquityTierLimitConfigurationResponseAminoMsg): QueryEquityTierLimitConfigurationResponse { + return QueryEquityTierLimitConfigurationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEquityTierLimitConfigurationResponseProtoMsg): QueryEquityTierLimitConfigurationResponse { + return QueryEquityTierLimitConfigurationResponse.decode(message.value); + }, + toProto(message: QueryEquityTierLimitConfigurationResponse): Uint8Array { + return QueryEquityTierLimitConfigurationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEquityTierLimitConfigurationResponse): QueryEquityTierLimitConfigurationResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryEquityTierLimitConfigurationResponse", + value: QueryEquityTierLimitConfigurationResponse.encode(message).finish() + }; + } +}; +function createBaseQueryBlockRateLimitConfigurationRequest(): QueryBlockRateLimitConfigurationRequest { + return {}; +} +export const QueryBlockRateLimitConfigurationRequest = { + typeUrl: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationRequest", + encode(_: QueryBlockRateLimitConfigurationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBlockRateLimitConfigurationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBlockRateLimitConfigurationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryBlockRateLimitConfigurationRequest { + const message = createBaseQueryBlockRateLimitConfigurationRequest(); + return message; + }, + fromAmino(_: QueryBlockRateLimitConfigurationRequestAmino): QueryBlockRateLimitConfigurationRequest { + const message = createBaseQueryBlockRateLimitConfigurationRequest(); + return message; + }, + toAmino(_: QueryBlockRateLimitConfigurationRequest): QueryBlockRateLimitConfigurationRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryBlockRateLimitConfigurationRequestAminoMsg): QueryBlockRateLimitConfigurationRequest { + return QueryBlockRateLimitConfigurationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBlockRateLimitConfigurationRequestProtoMsg): QueryBlockRateLimitConfigurationRequest { + return QueryBlockRateLimitConfigurationRequest.decode(message.value); + }, + toProto(message: QueryBlockRateLimitConfigurationRequest): Uint8Array { + return QueryBlockRateLimitConfigurationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBlockRateLimitConfigurationRequest): QueryBlockRateLimitConfigurationRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationRequest", + value: QueryBlockRateLimitConfigurationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryBlockRateLimitConfigurationResponse(): QueryBlockRateLimitConfigurationResponse { + return { + blockRateLimitConfig: BlockRateLimitConfiguration.fromPartial({}) + }; +} +export const QueryBlockRateLimitConfigurationResponse = { + typeUrl: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationResponse", + encode(message: QueryBlockRateLimitConfigurationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockRateLimitConfig !== undefined) { + BlockRateLimitConfiguration.encode(message.blockRateLimitConfig, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBlockRateLimitConfigurationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBlockRateLimitConfigurationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockRateLimitConfig = BlockRateLimitConfiguration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBlockRateLimitConfigurationResponse { + const message = createBaseQueryBlockRateLimitConfigurationResponse(); + message.blockRateLimitConfig = object.blockRateLimitConfig !== undefined && object.blockRateLimitConfig !== null ? BlockRateLimitConfiguration.fromPartial(object.blockRateLimitConfig) : undefined; + return message; + }, + fromAmino(object: QueryBlockRateLimitConfigurationResponseAmino): QueryBlockRateLimitConfigurationResponse { + const message = createBaseQueryBlockRateLimitConfigurationResponse(); + if (object.block_rate_limit_config !== undefined && object.block_rate_limit_config !== null) { + message.blockRateLimitConfig = BlockRateLimitConfiguration.fromAmino(object.block_rate_limit_config); + } + return message; + }, + toAmino(message: QueryBlockRateLimitConfigurationResponse): QueryBlockRateLimitConfigurationResponseAmino { + const obj: any = {}; + obj.block_rate_limit_config = message.blockRateLimitConfig ? BlockRateLimitConfiguration.toAmino(message.blockRateLimitConfig) : undefined; + return obj; + }, + fromAminoMsg(object: QueryBlockRateLimitConfigurationResponseAminoMsg): QueryBlockRateLimitConfigurationResponse { + return QueryBlockRateLimitConfigurationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBlockRateLimitConfigurationResponseProtoMsg): QueryBlockRateLimitConfigurationResponse { + return QueryBlockRateLimitConfigurationResponse.decode(message.value); + }, + toProto(message: QueryBlockRateLimitConfigurationResponse): Uint8Array { + return QueryBlockRateLimitConfigurationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBlockRateLimitConfigurationResponse): QueryBlockRateLimitConfigurationResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryBlockRateLimitConfigurationResponse", + value: QueryBlockRateLimitConfigurationResponse.encode(message).finish() + }; + } +}; +function createBaseQueryStatefulOrderRequest(): QueryStatefulOrderRequest { + return { + orderId: OrderId.fromPartial({}) + }; +} +export const QueryStatefulOrderRequest = { + typeUrl: "/dydxprotocol.clob.QueryStatefulOrderRequest", + encode(message: QueryStatefulOrderRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderId !== undefined) { + OrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStatefulOrderRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatefulOrderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = OrderId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryStatefulOrderRequest { + const message = createBaseQueryStatefulOrderRequest(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? OrderId.fromPartial(object.orderId) : undefined; + return message; + }, + fromAmino(object: QueryStatefulOrderRequestAmino): QueryStatefulOrderRequest { + const message = createBaseQueryStatefulOrderRequest(); + if (object.order_id !== undefined && object.order_id !== null) { + message.orderId = OrderId.fromAmino(object.order_id); + } + return message; + }, + toAmino(message: QueryStatefulOrderRequest): QueryStatefulOrderRequestAmino { + const obj: any = {}; + obj.order_id = message.orderId ? OrderId.toAmino(message.orderId) : undefined; + return obj; + }, + fromAminoMsg(object: QueryStatefulOrderRequestAminoMsg): QueryStatefulOrderRequest { + return QueryStatefulOrderRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStatefulOrderRequestProtoMsg): QueryStatefulOrderRequest { + return QueryStatefulOrderRequest.decode(message.value); + }, + toProto(message: QueryStatefulOrderRequest): Uint8Array { + return QueryStatefulOrderRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStatefulOrderRequest): QueryStatefulOrderRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryStatefulOrderRequest", + value: QueryStatefulOrderRequest.encode(message).finish() + }; + } +}; +function createBaseQueryStatefulOrderResponse(): QueryStatefulOrderResponse { + return { + orderPlacement: LongTermOrderPlacement.fromPartial({}), + fillAmount: BigInt(0), + triggered: false + }; +} +export const QueryStatefulOrderResponse = { + typeUrl: "/dydxprotocol.clob.QueryStatefulOrderResponse", + encode(message: QueryStatefulOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderPlacement !== undefined) { + LongTermOrderPlacement.encode(message.orderPlacement, writer.uint32(10).fork()).ldelim(); + } + if (message.fillAmount !== BigInt(0)) { + writer.uint32(16).uint64(message.fillAmount); + } + if (message.triggered === true) { + writer.uint32(24).bool(message.triggered); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStatefulOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatefulOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderPlacement = LongTermOrderPlacement.decode(reader, reader.uint32()); + break; + case 2: + message.fillAmount = reader.uint64(); + break; + case 3: + message.triggered = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryStatefulOrderResponse { + const message = createBaseQueryStatefulOrderResponse(); + message.orderPlacement = object.orderPlacement !== undefined && object.orderPlacement !== null ? LongTermOrderPlacement.fromPartial(object.orderPlacement) : undefined; + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + message.triggered = object.triggered ?? false; + return message; + }, + fromAmino(object: QueryStatefulOrderResponseAmino): QueryStatefulOrderResponse { + const message = createBaseQueryStatefulOrderResponse(); + if (object.order_placement !== undefined && object.order_placement !== null) { + message.orderPlacement = LongTermOrderPlacement.fromAmino(object.order_placement); + } + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + if (object.triggered !== undefined && object.triggered !== null) { + message.triggered = object.triggered; + } + return message; + }, + toAmino(message: QueryStatefulOrderResponse): QueryStatefulOrderResponseAmino { + const obj: any = {}; + obj.order_placement = message.orderPlacement ? LongTermOrderPlacement.toAmino(message.orderPlacement) : undefined; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + obj.triggered = message.triggered === false ? undefined : message.triggered; + return obj; + }, + fromAminoMsg(object: QueryStatefulOrderResponseAminoMsg): QueryStatefulOrderResponse { + return QueryStatefulOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStatefulOrderResponseProtoMsg): QueryStatefulOrderResponse { + return QueryStatefulOrderResponse.decode(message.value); + }, + toProto(message: QueryStatefulOrderResponse): Uint8Array { + return QueryStatefulOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStatefulOrderResponse): QueryStatefulOrderResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryStatefulOrderResponse", + value: QueryStatefulOrderResponse.encode(message).finish() + }; + } +}; +function createBaseQueryLiquidationsConfigurationRequest(): QueryLiquidationsConfigurationRequest { + return {}; +} +export const QueryLiquidationsConfigurationRequest = { + typeUrl: "/dydxprotocol.clob.QueryLiquidationsConfigurationRequest", + encode(_: QueryLiquidationsConfigurationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLiquidationsConfigurationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLiquidationsConfigurationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryLiquidationsConfigurationRequest { + const message = createBaseQueryLiquidationsConfigurationRequest(); + return message; + }, + fromAmino(_: QueryLiquidationsConfigurationRequestAmino): QueryLiquidationsConfigurationRequest { + const message = createBaseQueryLiquidationsConfigurationRequest(); + return message; + }, + toAmino(_: QueryLiquidationsConfigurationRequest): QueryLiquidationsConfigurationRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryLiquidationsConfigurationRequestAminoMsg): QueryLiquidationsConfigurationRequest { + return QueryLiquidationsConfigurationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLiquidationsConfigurationRequestProtoMsg): QueryLiquidationsConfigurationRequest { + return QueryLiquidationsConfigurationRequest.decode(message.value); + }, + toProto(message: QueryLiquidationsConfigurationRequest): Uint8Array { + return QueryLiquidationsConfigurationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLiquidationsConfigurationRequest): QueryLiquidationsConfigurationRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryLiquidationsConfigurationRequest", + value: QueryLiquidationsConfigurationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryLiquidationsConfigurationResponse(): QueryLiquidationsConfigurationResponse { + return { + liquidationsConfig: LiquidationsConfig.fromPartial({}) + }; +} +export const QueryLiquidationsConfigurationResponse = { + typeUrl: "/dydxprotocol.clob.QueryLiquidationsConfigurationResponse", + encode(message: QueryLiquidationsConfigurationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidationsConfig !== undefined) { + LiquidationsConfig.encode(message.liquidationsConfig, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLiquidationsConfigurationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLiquidationsConfigurationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidationsConfig = LiquidationsConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryLiquidationsConfigurationResponse { + const message = createBaseQueryLiquidationsConfigurationResponse(); + message.liquidationsConfig = object.liquidationsConfig !== undefined && object.liquidationsConfig !== null ? LiquidationsConfig.fromPartial(object.liquidationsConfig) : undefined; + return message; + }, + fromAmino(object: QueryLiquidationsConfigurationResponseAmino): QueryLiquidationsConfigurationResponse { + const message = createBaseQueryLiquidationsConfigurationResponse(); + if (object.liquidations_config !== undefined && object.liquidations_config !== null) { + message.liquidationsConfig = LiquidationsConfig.fromAmino(object.liquidations_config); + } + return message; + }, + toAmino(message: QueryLiquidationsConfigurationResponse): QueryLiquidationsConfigurationResponseAmino { + const obj: any = {}; + obj.liquidations_config = message.liquidationsConfig ? LiquidationsConfig.toAmino(message.liquidationsConfig) : undefined; + return obj; + }, + fromAminoMsg(object: QueryLiquidationsConfigurationResponseAminoMsg): QueryLiquidationsConfigurationResponse { + return QueryLiquidationsConfigurationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLiquidationsConfigurationResponseProtoMsg): QueryLiquidationsConfigurationResponse { + return QueryLiquidationsConfigurationResponse.decode(message.value); + }, + toProto(message: QueryLiquidationsConfigurationResponse): Uint8Array { + return QueryLiquidationsConfigurationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLiquidationsConfigurationResponse): QueryLiquidationsConfigurationResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.QueryLiquidationsConfigurationResponse", + value: QueryLiquidationsConfigurationResponse.encode(message).finish() + }; + } +}; +function createBaseStreamOrderbookUpdatesRequest(): StreamOrderbookUpdatesRequest { + return { + clobPairId: [], + subaccountIds: [] + }; +} +export const StreamOrderbookUpdatesRequest = { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdatesRequest", + encode(message: StreamOrderbookUpdatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.clobPairId) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.subaccountIds) { + SubaccountId.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamOrderbookUpdatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookUpdatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.clobPairId.push(reader.uint32()); + } + } else { + message.clobPairId.push(reader.uint32()); + } + break; + case 2: + message.subaccountIds.push(SubaccountId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamOrderbookUpdatesRequest { + const message = createBaseStreamOrderbookUpdatesRequest(); + message.clobPairId = object.clobPairId?.map(e => e) || []; + message.subaccountIds = object.subaccountIds?.map(e => SubaccountId.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StreamOrderbookUpdatesRequestAmino): StreamOrderbookUpdatesRequest { + const message = createBaseStreamOrderbookUpdatesRequest(); + message.clobPairId = object.clob_pair_id?.map(e => e) || []; + message.subaccountIds = object.subaccount_ids?.map(e => SubaccountId.fromAmino(e)) || []; + return message; + }, + toAmino(message: StreamOrderbookUpdatesRequest): StreamOrderbookUpdatesRequestAmino { + const obj: any = {}; + if (message.clobPairId) { + obj.clob_pair_id = message.clobPairId.map(e => e); + } else { + obj.clob_pair_id = message.clobPairId; + } + if (message.subaccountIds) { + obj.subaccount_ids = message.subaccountIds.map(e => e ? SubaccountId.toAmino(e) : undefined); + } else { + obj.subaccount_ids = message.subaccountIds; + } + return obj; + }, + fromAminoMsg(object: StreamOrderbookUpdatesRequestAminoMsg): StreamOrderbookUpdatesRequest { + return StreamOrderbookUpdatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: StreamOrderbookUpdatesRequestProtoMsg): StreamOrderbookUpdatesRequest { + return StreamOrderbookUpdatesRequest.decode(message.value); + }, + toProto(message: StreamOrderbookUpdatesRequest): Uint8Array { + return StreamOrderbookUpdatesRequest.encode(message).finish(); + }, + toProtoMsg(message: StreamOrderbookUpdatesRequest): StreamOrderbookUpdatesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdatesRequest", + value: StreamOrderbookUpdatesRequest.encode(message).finish() + }; + } +}; +function createBaseStreamOrderbookUpdatesResponse(): StreamOrderbookUpdatesResponse { + return { + updates: [] + }; +} +export const StreamOrderbookUpdatesResponse = { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdatesResponse", + encode(message: StreamOrderbookUpdatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.updates) { + StreamUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamOrderbookUpdatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookUpdatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(StreamUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamOrderbookUpdatesResponse { + const message = createBaseStreamOrderbookUpdatesResponse(); + message.updates = object.updates?.map(e => StreamUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StreamOrderbookUpdatesResponseAmino): StreamOrderbookUpdatesResponse { + const message = createBaseStreamOrderbookUpdatesResponse(); + message.updates = object.updates?.map(e => StreamUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: StreamOrderbookUpdatesResponse): StreamOrderbookUpdatesResponseAmino { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? StreamUpdate.toAmino(e) : undefined); + } else { + obj.updates = message.updates; + } + return obj; + }, + fromAminoMsg(object: StreamOrderbookUpdatesResponseAminoMsg): StreamOrderbookUpdatesResponse { + return StreamOrderbookUpdatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: StreamOrderbookUpdatesResponseProtoMsg): StreamOrderbookUpdatesResponse { + return StreamOrderbookUpdatesResponse.decode(message.value); + }, + toProto(message: StreamOrderbookUpdatesResponse): Uint8Array { + return StreamOrderbookUpdatesResponse.encode(message).finish(); + }, + toProtoMsg(message: StreamOrderbookUpdatesResponse): StreamOrderbookUpdatesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdatesResponse", + value: StreamOrderbookUpdatesResponse.encode(message).finish() + }; + } +}; +function createBaseStreamUpdate(): StreamUpdate { + return { + orderbookUpdate: undefined, + orderFill: undefined, + takerOrder: undefined, + subaccountUpdate: undefined, + blockHeight: 0, + execMode: 0 + }; +} +export const StreamUpdate = { + typeUrl: "/dydxprotocol.clob.StreamUpdate", + encode(message: StreamUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderbookUpdate !== undefined) { + StreamOrderbookUpdate.encode(message.orderbookUpdate, writer.uint32(10).fork()).ldelim(); + } + if (message.orderFill !== undefined) { + StreamOrderbookFill.encode(message.orderFill, writer.uint32(18).fork()).ldelim(); + } + if (message.takerOrder !== undefined) { + StreamTakerOrder.encode(message.takerOrder, writer.uint32(26).fork()).ldelim(); + } + if (message.subaccountUpdate !== undefined) { + StreamSubaccountUpdate.encode(message.subaccountUpdate, writer.uint32(34).fork()).ldelim(); + } + if (message.blockHeight !== 0) { + writer.uint32(40).uint32(message.blockHeight); + } + if (message.execMode !== 0) { + writer.uint32(48).uint32(message.execMode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderbookUpdate = StreamOrderbookUpdate.decode(reader, reader.uint32()); + break; + case 2: + message.orderFill = StreamOrderbookFill.decode(reader, reader.uint32()); + break; + case 3: + message.takerOrder = StreamTakerOrder.decode(reader, reader.uint32()); + break; + case 4: + message.subaccountUpdate = StreamSubaccountUpdate.decode(reader, reader.uint32()); + break; + case 5: + message.blockHeight = reader.uint32(); + break; + case 6: + message.execMode = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamUpdate { + const message = createBaseStreamUpdate(); + message.orderbookUpdate = object.orderbookUpdate !== undefined && object.orderbookUpdate !== null ? StreamOrderbookUpdate.fromPartial(object.orderbookUpdate) : undefined; + message.orderFill = object.orderFill !== undefined && object.orderFill !== null ? StreamOrderbookFill.fromPartial(object.orderFill) : undefined; + message.takerOrder = object.takerOrder !== undefined && object.takerOrder !== null ? StreamTakerOrder.fromPartial(object.takerOrder) : undefined; + message.subaccountUpdate = object.subaccountUpdate !== undefined && object.subaccountUpdate !== null ? StreamSubaccountUpdate.fromPartial(object.subaccountUpdate) : undefined; + message.blockHeight = object.blockHeight ?? 0; + message.execMode = object.execMode ?? 0; + return message; + }, + fromAmino(object: StreamUpdateAmino): StreamUpdate { + const message = createBaseStreamUpdate(); + if (object.orderbook_update !== undefined && object.orderbook_update !== null) { + message.orderbookUpdate = StreamOrderbookUpdate.fromAmino(object.orderbook_update); + } + if (object.order_fill !== undefined && object.order_fill !== null) { + message.orderFill = StreamOrderbookFill.fromAmino(object.order_fill); + } + if (object.taker_order !== undefined && object.taker_order !== null) { + message.takerOrder = StreamTakerOrder.fromAmino(object.taker_order); + } + if (object.subaccount_update !== undefined && object.subaccount_update !== null) { + message.subaccountUpdate = StreamSubaccountUpdate.fromAmino(object.subaccount_update); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + if (object.exec_mode !== undefined && object.exec_mode !== null) { + message.execMode = object.exec_mode; + } + return message; + }, + toAmino(message: StreamUpdate): StreamUpdateAmino { + const obj: any = {}; + obj.orderbook_update = message.orderbookUpdate ? StreamOrderbookUpdate.toAmino(message.orderbookUpdate) : undefined; + obj.order_fill = message.orderFill ? StreamOrderbookFill.toAmino(message.orderFill) : undefined; + obj.taker_order = message.takerOrder ? StreamTakerOrder.toAmino(message.takerOrder) : undefined; + obj.subaccount_update = message.subaccountUpdate ? StreamSubaccountUpdate.toAmino(message.subaccountUpdate) : undefined; + obj.block_height = message.blockHeight === 0 ? undefined : message.blockHeight; + obj.exec_mode = message.execMode === 0 ? undefined : message.execMode; + return obj; + }, + fromAminoMsg(object: StreamUpdateAminoMsg): StreamUpdate { + return StreamUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: StreamUpdateProtoMsg): StreamUpdate { + return StreamUpdate.decode(message.value); + }, + toProto(message: StreamUpdate): Uint8Array { + return StreamUpdate.encode(message).finish(); + }, + toProtoMsg(message: StreamUpdate): StreamUpdateProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamUpdate", + value: StreamUpdate.encode(message).finish() + }; + } +}; +function createBaseStreamOrderbookUpdate(): StreamOrderbookUpdate { + return { + updates: [], + snapshot: false + }; +} +export const StreamOrderbookUpdate = { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdate", + encode(message: StreamOrderbookUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.updates) { + OffChainUpdateV1.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.snapshot === true) { + writer.uint32(16).bool(message.snapshot); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamOrderbookUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(OffChainUpdateV1.decode(reader, reader.uint32())); + break; + case 2: + message.snapshot = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamOrderbookUpdate { + const message = createBaseStreamOrderbookUpdate(); + message.updates = object.updates?.map(e => OffChainUpdateV1.fromPartial(e)) || []; + message.snapshot = object.snapshot ?? false; + return message; + }, + fromAmino(object: StreamOrderbookUpdateAmino): StreamOrderbookUpdate { + const message = createBaseStreamOrderbookUpdate(); + message.updates = object.updates?.map(e => OffChainUpdateV1.fromAmino(e)) || []; + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = object.snapshot; + } + return message; + }, + toAmino(message: StreamOrderbookUpdate): StreamOrderbookUpdateAmino { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? OffChainUpdateV1.toAmino(e) : undefined); + } else { + obj.updates = message.updates; + } + obj.snapshot = message.snapshot === false ? undefined : message.snapshot; + return obj; + }, + fromAminoMsg(object: StreamOrderbookUpdateAminoMsg): StreamOrderbookUpdate { + return StreamOrderbookUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: StreamOrderbookUpdateProtoMsg): StreamOrderbookUpdate { + return StreamOrderbookUpdate.decode(message.value); + }, + toProto(message: StreamOrderbookUpdate): Uint8Array { + return StreamOrderbookUpdate.encode(message).finish(); + }, + toProtoMsg(message: StreamOrderbookUpdate): StreamOrderbookUpdateProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamOrderbookUpdate", + value: StreamOrderbookUpdate.encode(message).finish() + }; + } +}; +function createBaseStreamOrderbookFill(): StreamOrderbookFill { + return { + clobMatch: undefined, + orders: [], + fillAmounts: [] + }; +} +export const StreamOrderbookFill = { + typeUrl: "/dydxprotocol.clob.StreamOrderbookFill", + encode(message: StreamOrderbookFill, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clobMatch !== undefined) { + ClobMatch.encode(message.clobMatch, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.orders) { + Order.encode(v!, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).fork(); + for (const v of message.fillAmounts) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamOrderbookFill { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookFill(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobMatch = ClobMatch.decode(reader, reader.uint32()); + break; + case 2: + message.orders.push(Order.decode(reader, reader.uint32())); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fillAmounts.push(reader.uint64()); + } + } else { + message.fillAmounts.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamOrderbookFill { + const message = createBaseStreamOrderbookFill(); + message.clobMatch = object.clobMatch !== undefined && object.clobMatch !== null ? ClobMatch.fromPartial(object.clobMatch) : undefined; + message.orders = object.orders?.map(e => Order.fromPartial(e)) || []; + message.fillAmounts = object.fillAmounts?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: StreamOrderbookFillAmino): StreamOrderbookFill { + const message = createBaseStreamOrderbookFill(); + if (object.clob_match !== undefined && object.clob_match !== null) { + message.clobMatch = ClobMatch.fromAmino(object.clob_match); + } + message.orders = object.orders?.map(e => Order.fromAmino(e)) || []; + message.fillAmounts = object.fill_amounts?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: StreamOrderbookFill): StreamOrderbookFillAmino { + const obj: any = {}; + obj.clob_match = message.clobMatch ? ClobMatch.toAmino(message.clobMatch) : undefined; + if (message.orders) { + obj.orders = message.orders.map(e => e ? Order.toAmino(e) : undefined); + } else { + obj.orders = message.orders; + } + if (message.fillAmounts) { + obj.fill_amounts = message.fillAmounts.map(e => e.toString()); + } else { + obj.fill_amounts = message.fillAmounts; + } + return obj; + }, + fromAminoMsg(object: StreamOrderbookFillAminoMsg): StreamOrderbookFill { + return StreamOrderbookFill.fromAmino(object.value); + }, + fromProtoMsg(message: StreamOrderbookFillProtoMsg): StreamOrderbookFill { + return StreamOrderbookFill.decode(message.value); + }, + toProto(message: StreamOrderbookFill): Uint8Array { + return StreamOrderbookFill.encode(message).finish(); + }, + toProtoMsg(message: StreamOrderbookFill): StreamOrderbookFillProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamOrderbookFill", + value: StreamOrderbookFill.encode(message).finish() + }; + } +}; +function createBaseStreamTakerOrder(): StreamTakerOrder { + return { + order: undefined, + liquidationOrder: undefined, + takerOrderStatus: undefined + }; +} +export const StreamTakerOrder = { + typeUrl: "/dydxprotocol.clob.StreamTakerOrder", + encode(message: StreamTakerOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.liquidationOrder !== undefined) { + StreamLiquidationOrder.encode(message.liquidationOrder, writer.uint32(18).fork()).ldelim(); + } + if (message.takerOrderStatus !== undefined) { + StreamTakerOrderStatus.encode(message.takerOrderStatus, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamTakerOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamTakerOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = Order.decode(reader, reader.uint32()); + break; + case 2: + message.liquidationOrder = StreamLiquidationOrder.decode(reader, reader.uint32()); + break; + case 3: + message.takerOrderStatus = StreamTakerOrderStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamTakerOrder { + const message = createBaseStreamTakerOrder(); + message.order = object.order !== undefined && object.order !== null ? Order.fromPartial(object.order) : undefined; + message.liquidationOrder = object.liquidationOrder !== undefined && object.liquidationOrder !== null ? StreamLiquidationOrder.fromPartial(object.liquidationOrder) : undefined; + message.takerOrderStatus = object.takerOrderStatus !== undefined && object.takerOrderStatus !== null ? StreamTakerOrderStatus.fromPartial(object.takerOrderStatus) : undefined; + return message; + }, + fromAmino(object: StreamTakerOrderAmino): StreamTakerOrder { + const message = createBaseStreamTakerOrder(); + if (object.order !== undefined && object.order !== null) { + message.order = Order.fromAmino(object.order); + } + if (object.liquidation_order !== undefined && object.liquidation_order !== null) { + message.liquidationOrder = StreamLiquidationOrder.fromAmino(object.liquidation_order); + } + if (object.taker_order_status !== undefined && object.taker_order_status !== null) { + message.takerOrderStatus = StreamTakerOrderStatus.fromAmino(object.taker_order_status); + } + return message; + }, + toAmino(message: StreamTakerOrder): StreamTakerOrderAmino { + const obj: any = {}; + obj.order = message.order ? Order.toAmino(message.order) : undefined; + obj.liquidation_order = message.liquidationOrder ? StreamLiquidationOrder.toAmino(message.liquidationOrder) : undefined; + obj.taker_order_status = message.takerOrderStatus ? StreamTakerOrderStatus.toAmino(message.takerOrderStatus) : undefined; + return obj; + }, + fromAminoMsg(object: StreamTakerOrderAminoMsg): StreamTakerOrder { + return StreamTakerOrder.fromAmino(object.value); + }, + fromProtoMsg(message: StreamTakerOrderProtoMsg): StreamTakerOrder { + return StreamTakerOrder.decode(message.value); + }, + toProto(message: StreamTakerOrder): Uint8Array { + return StreamTakerOrder.encode(message).finish(); + }, + toProtoMsg(message: StreamTakerOrder): StreamTakerOrderProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamTakerOrder", + value: StreamTakerOrder.encode(message).finish() + }; + } +}; +function createBaseStreamTakerOrderStatus(): StreamTakerOrderStatus { + return { + orderStatus: 0, + remainingQuantums: BigInt(0), + optimisticallyFilledQuantums: BigInt(0) + }; +} +export const StreamTakerOrderStatus = { + typeUrl: "/dydxprotocol.clob.StreamTakerOrderStatus", + encode(message: StreamTakerOrderStatus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderStatus !== 0) { + writer.uint32(8).uint32(message.orderStatus); + } + if (message.remainingQuantums !== BigInt(0)) { + writer.uint32(16).uint64(message.remainingQuantums); + } + if (message.optimisticallyFilledQuantums !== BigInt(0)) { + writer.uint32(24).uint64(message.optimisticallyFilledQuantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamTakerOrderStatus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamTakerOrderStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderStatus = reader.uint32(); + break; + case 2: + message.remainingQuantums = reader.uint64(); + break; + case 3: + message.optimisticallyFilledQuantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamTakerOrderStatus { + const message = createBaseStreamTakerOrderStatus(); + message.orderStatus = object.orderStatus ?? 0; + message.remainingQuantums = object.remainingQuantums !== undefined && object.remainingQuantums !== null ? BigInt(object.remainingQuantums.toString()) : BigInt(0); + message.optimisticallyFilledQuantums = object.optimisticallyFilledQuantums !== undefined && object.optimisticallyFilledQuantums !== null ? BigInt(object.optimisticallyFilledQuantums.toString()) : BigInt(0); + return message; + }, + fromAmino(object: StreamTakerOrderStatusAmino): StreamTakerOrderStatus { + const message = createBaseStreamTakerOrderStatus(); + if (object.order_status !== undefined && object.order_status !== null) { + message.orderStatus = object.order_status; + } + if (object.remaining_quantums !== undefined && object.remaining_quantums !== null) { + message.remainingQuantums = BigInt(object.remaining_quantums); + } + if (object.optimistically_filled_quantums !== undefined && object.optimistically_filled_quantums !== null) { + message.optimisticallyFilledQuantums = BigInt(object.optimistically_filled_quantums); + } + return message; + }, + toAmino(message: StreamTakerOrderStatus): StreamTakerOrderStatusAmino { + const obj: any = {}; + obj.order_status = message.orderStatus === 0 ? undefined : message.orderStatus; + obj.remaining_quantums = message.remainingQuantums !== BigInt(0) ? message.remainingQuantums.toString() : undefined; + obj.optimistically_filled_quantums = message.optimisticallyFilledQuantums !== BigInt(0) ? message.optimisticallyFilledQuantums.toString() : undefined; + return obj; + }, + fromAminoMsg(object: StreamTakerOrderStatusAminoMsg): StreamTakerOrderStatus { + return StreamTakerOrderStatus.fromAmino(object.value); + }, + fromProtoMsg(message: StreamTakerOrderStatusProtoMsg): StreamTakerOrderStatus { + return StreamTakerOrderStatus.decode(message.value); + }, + toProto(message: StreamTakerOrderStatus): Uint8Array { + return StreamTakerOrderStatus.encode(message).finish(); + }, + toProtoMsg(message: StreamTakerOrderStatus): StreamTakerOrderStatusProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.StreamTakerOrderStatus", + value: StreamTakerOrderStatus.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.amino.ts new file mode 100644 index 00000000..fa0fc9a1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.amino.ts @@ -0,0 +1,49 @@ +//@ts-nocheck +import { MsgProposedOperations, MsgPlaceOrder, MsgCancelOrder, MsgBatchCancel, MsgCreateClobPair, MsgUpdateClobPair, MsgUpdateEquityTierLimitConfiguration, MsgUpdateBlockRateLimitConfiguration, MsgUpdateLiquidationsConfig } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.clob.MsgProposedOperations": { + aminoType: "/dydxprotocol.clob.MsgProposedOperations", + toAmino: MsgProposedOperations.toAmino, + fromAmino: MsgProposedOperations.fromAmino + }, + "/dydxprotocol.clob.MsgPlaceOrder": { + aminoType: "/dydxprotocol.clob.MsgPlaceOrder", + toAmino: MsgPlaceOrder.toAmino, + fromAmino: MsgPlaceOrder.fromAmino + }, + "/dydxprotocol.clob.MsgCancelOrder": { + aminoType: "/dydxprotocol.clob.MsgCancelOrder", + toAmino: MsgCancelOrder.toAmino, + fromAmino: MsgCancelOrder.fromAmino + }, + "/dydxprotocol.clob.MsgBatchCancel": { + aminoType: "/dydxprotocol.clob.MsgBatchCancel", + toAmino: MsgBatchCancel.toAmino, + fromAmino: MsgBatchCancel.fromAmino + }, + "/dydxprotocol.clob.MsgCreateClobPair": { + aminoType: "/dydxprotocol.clob.MsgCreateClobPair", + toAmino: MsgCreateClobPair.toAmino, + fromAmino: MsgCreateClobPair.fromAmino + }, + "/dydxprotocol.clob.MsgUpdateClobPair": { + aminoType: "/dydxprotocol.clob.MsgUpdateClobPair", + toAmino: MsgUpdateClobPair.toAmino, + fromAmino: MsgUpdateClobPair.fromAmino + }, + "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration": { + aminoType: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration", + toAmino: MsgUpdateEquityTierLimitConfiguration.toAmino, + fromAmino: MsgUpdateEquityTierLimitConfiguration.fromAmino + }, + "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration": { + aminoType: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", + toAmino: MsgUpdateBlockRateLimitConfiguration.toAmino, + fromAmino: MsgUpdateBlockRateLimitConfiguration.fromAmino + }, + "/dydxprotocol.clob.MsgUpdateLiquidationsConfig": { + aminoType: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig", + toAmino: MsgUpdateLiquidationsConfig.toAmino, + fromAmino: MsgUpdateLiquidationsConfig.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.registry.ts new file mode 100644 index 00000000..c53fb89b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.registry.ts @@ -0,0 +1,179 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgProposedOperations, MsgPlaceOrder, MsgCancelOrder, MsgBatchCancel, MsgCreateClobPair, MsgUpdateClobPair, MsgUpdateEquityTierLimitConfiguration, MsgUpdateBlockRateLimitConfiguration, MsgUpdateLiquidationsConfig } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.clob.MsgProposedOperations", MsgProposedOperations], ["/dydxprotocol.clob.MsgPlaceOrder", MsgPlaceOrder], ["/dydxprotocol.clob.MsgCancelOrder", MsgCancelOrder], ["/dydxprotocol.clob.MsgBatchCancel", MsgBatchCancel], ["/dydxprotocol.clob.MsgCreateClobPair", MsgCreateClobPair], ["/dydxprotocol.clob.MsgUpdateClobPair", MsgUpdateClobPair], ["/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration", MsgUpdateEquityTierLimitConfiguration], ["/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", MsgUpdateBlockRateLimitConfiguration], ["/dydxprotocol.clob.MsgUpdateLiquidationsConfig", MsgUpdateLiquidationsConfig]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + proposedOperations(value: MsgProposedOperations) { + return { + typeUrl: "/dydxprotocol.clob.MsgProposedOperations", + value: MsgProposedOperations.encode(value).finish() + }; + }, + placeOrder(value: MsgPlaceOrder) { + return { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrder", + value: MsgPlaceOrder.encode(value).finish() + }; + }, + cancelOrder(value: MsgCancelOrder) { + return { + typeUrl: "/dydxprotocol.clob.MsgCancelOrder", + value: MsgCancelOrder.encode(value).finish() + }; + }, + batchCancel(value: MsgBatchCancel) { + return { + typeUrl: "/dydxprotocol.clob.MsgBatchCancel", + value: MsgBatchCancel.encode(value).finish() + }; + }, + createClobPair(value: MsgCreateClobPair) { + return { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPair", + value: MsgCreateClobPair.encode(value).finish() + }; + }, + updateClobPair(value: MsgUpdateClobPair) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPair", + value: MsgUpdateClobPair.encode(value).finish() + }; + }, + updateEquityTierLimitConfiguration(value: MsgUpdateEquityTierLimitConfiguration) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration", + value: MsgUpdateEquityTierLimitConfiguration.encode(value).finish() + }; + }, + updateBlockRateLimitConfiguration(value: MsgUpdateBlockRateLimitConfiguration) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", + value: MsgUpdateBlockRateLimitConfiguration.encode(value).finish() + }; + }, + updateLiquidationsConfig(value: MsgUpdateLiquidationsConfig) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig", + value: MsgUpdateLiquidationsConfig.encode(value).finish() + }; + } + }, + withTypeUrl: { + proposedOperations(value: MsgProposedOperations) { + return { + typeUrl: "/dydxprotocol.clob.MsgProposedOperations", + value + }; + }, + placeOrder(value: MsgPlaceOrder) { + return { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrder", + value + }; + }, + cancelOrder(value: MsgCancelOrder) { + return { + typeUrl: "/dydxprotocol.clob.MsgCancelOrder", + value + }; + }, + batchCancel(value: MsgBatchCancel) { + return { + typeUrl: "/dydxprotocol.clob.MsgBatchCancel", + value + }; + }, + createClobPair(value: MsgCreateClobPair) { + return { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPair", + value + }; + }, + updateClobPair(value: MsgUpdateClobPair) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPair", + value + }; + }, + updateEquityTierLimitConfiguration(value: MsgUpdateEquityTierLimitConfiguration) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration", + value + }; + }, + updateBlockRateLimitConfiguration(value: MsgUpdateBlockRateLimitConfiguration) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", + value + }; + }, + updateLiquidationsConfig(value: MsgUpdateLiquidationsConfig) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig", + value + }; + } + }, + fromPartial: { + proposedOperations(value: MsgProposedOperations) { + return { + typeUrl: "/dydxprotocol.clob.MsgProposedOperations", + value: MsgProposedOperations.fromPartial(value) + }; + }, + placeOrder(value: MsgPlaceOrder) { + return { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrder", + value: MsgPlaceOrder.fromPartial(value) + }; + }, + cancelOrder(value: MsgCancelOrder) { + return { + typeUrl: "/dydxprotocol.clob.MsgCancelOrder", + value: MsgCancelOrder.fromPartial(value) + }; + }, + batchCancel(value: MsgBatchCancel) { + return { + typeUrl: "/dydxprotocol.clob.MsgBatchCancel", + value: MsgBatchCancel.fromPartial(value) + }; + }, + createClobPair(value: MsgCreateClobPair) { + return { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPair", + value: MsgCreateClobPair.fromPartial(value) + }; + }, + updateClobPair(value: MsgUpdateClobPair) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPair", + value: MsgUpdateClobPair.fromPartial(value) + }; + }, + updateEquityTierLimitConfiguration(value: MsgUpdateEquityTierLimitConfiguration) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration", + value: MsgUpdateEquityTierLimitConfiguration.fromPartial(value) + }; + }, + updateBlockRateLimitConfiguration(value: MsgUpdateBlockRateLimitConfiguration) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", + value: MsgUpdateBlockRateLimitConfiguration.fromPartial(value) + }; + }, + updateLiquidationsConfig(value: MsgUpdateLiquidationsConfig) { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig", + value: MsgUpdateLiquidationsConfig.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.rpc.msg.ts new file mode 100644 index 00000000..959f22a2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.rpc.msg.ts @@ -0,0 +1,99 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgProposedOperations, MsgProposedOperationsResponse, MsgPlaceOrder, MsgPlaceOrderResponse, MsgCancelOrder, MsgCancelOrderResponse, MsgBatchCancel, MsgBatchCancelResponse, MsgCreateClobPair, MsgCreateClobPairResponse, MsgUpdateClobPair, MsgUpdateClobPairResponse, MsgUpdateEquityTierLimitConfiguration, MsgUpdateEquityTierLimitConfigurationResponse, MsgUpdateBlockRateLimitConfiguration, MsgUpdateBlockRateLimitConfigurationResponse, MsgUpdateLiquidationsConfig, MsgUpdateLiquidationsConfigResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * ProposedOperations is a temporary message used by block proposers + * for matching orders as part of the ABCI++ workaround. + */ + proposedOperations(request: MsgProposedOperations): Promise; + /** PlaceOrder allows accounts to place orders on the orderbook. */ + placeOrder(request: MsgPlaceOrder): Promise; + /** CancelOrder allows accounts to cancel existing orders on the orderbook. */ + cancelOrder(request: MsgCancelOrder): Promise; + /** BatchCancel allows accounts to cancel a batch of orders on the orderbook. */ + batchCancel(request: MsgBatchCancel): Promise; + /** CreateClobPair creates a new clob pair. */ + createClobPair(request: MsgCreateClobPair): Promise; + /** + * UpdateClobPair sets the status of a clob pair. Should return an error + * if the authority is not in the clob keeper's set of authorities, + * if the ClobPair id is not found in state, or if the update includes + * an unsupported status transition. + */ + updateClobPair(request: MsgUpdateClobPair): Promise; + /** + * UpdateEquityTierLimitConfiguration updates the equity tier limit + * configuration in state. + */ + updateEquityTierLimitConfiguration(request: MsgUpdateEquityTierLimitConfiguration): Promise; + /** + * UpdateBlockRateLimitConfiguration updates the block rate limit + * configuration in state. + */ + updateBlockRateLimitConfiguration(request: MsgUpdateBlockRateLimitConfiguration): Promise; + /** UpdateLiquidationsConfig updates the liquidations configuration in state. */ + updateLiquidationsConfig(request: MsgUpdateLiquidationsConfig): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.proposedOperations = this.proposedOperations.bind(this); + this.placeOrder = this.placeOrder.bind(this); + this.cancelOrder = this.cancelOrder.bind(this); + this.batchCancel = this.batchCancel.bind(this); + this.createClobPair = this.createClobPair.bind(this); + this.updateClobPair = this.updateClobPair.bind(this); + this.updateEquityTierLimitConfiguration = this.updateEquityTierLimitConfiguration.bind(this); + this.updateBlockRateLimitConfiguration = this.updateBlockRateLimitConfiguration.bind(this); + this.updateLiquidationsConfig = this.updateLiquidationsConfig.bind(this); + } + proposedOperations(request: MsgProposedOperations): Promise { + const data = MsgProposedOperations.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "ProposedOperations", data); + return promise.then(data => MsgProposedOperationsResponse.decode(new BinaryReader(data))); + } + placeOrder(request: MsgPlaceOrder): Promise { + const data = MsgPlaceOrder.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "PlaceOrder", data); + return promise.then(data => MsgPlaceOrderResponse.decode(new BinaryReader(data))); + } + cancelOrder(request: MsgCancelOrder): Promise { + const data = MsgCancelOrder.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "CancelOrder", data); + return promise.then(data => MsgCancelOrderResponse.decode(new BinaryReader(data))); + } + batchCancel(request: MsgBatchCancel): Promise { + const data = MsgBatchCancel.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "BatchCancel", data); + return promise.then(data => MsgBatchCancelResponse.decode(new BinaryReader(data))); + } + createClobPair(request: MsgCreateClobPair): Promise { + const data = MsgCreateClobPair.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "CreateClobPair", data); + return promise.then(data => MsgCreateClobPairResponse.decode(new BinaryReader(data))); + } + updateClobPair(request: MsgUpdateClobPair): Promise { + const data = MsgUpdateClobPair.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "UpdateClobPair", data); + return promise.then(data => MsgUpdateClobPairResponse.decode(new BinaryReader(data))); + } + updateEquityTierLimitConfiguration(request: MsgUpdateEquityTierLimitConfiguration): Promise { + const data = MsgUpdateEquityTierLimitConfiguration.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "UpdateEquityTierLimitConfiguration", data); + return promise.then(data => MsgUpdateEquityTierLimitConfigurationResponse.decode(new BinaryReader(data))); + } + updateBlockRateLimitConfiguration(request: MsgUpdateBlockRateLimitConfiguration): Promise { + const data = MsgUpdateBlockRateLimitConfiguration.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "UpdateBlockRateLimitConfiguration", data); + return promise.then(data => MsgUpdateBlockRateLimitConfigurationResponse.decode(new BinaryReader(data))); + } + updateLiquidationsConfig(request: MsgUpdateLiquidationsConfig): Promise { + const data = MsgUpdateLiquidationsConfig.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "UpdateLiquidationsConfig", data); + return promise.then(data => MsgUpdateLiquidationsConfigResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.ts new file mode 100644 index 00000000..26b1cda5 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/clob/tx.ts @@ -0,0 +1,1927 @@ +//@ts-nocheck +import { Order, OrderAmino, OrderSDKType, OrderId, OrderIdAmino, OrderIdSDKType } from "./order"; +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { ClobPair, ClobPairAmino, ClobPairSDKType } from "./clob_pair"; +import { EquityTierLimitConfiguration, EquityTierLimitConfigurationAmino, EquityTierLimitConfigurationSDKType } from "./equity_tier_limit_config"; +import { BlockRateLimitConfiguration, BlockRateLimitConfigurationAmino, BlockRateLimitConfigurationSDKType } from "./block_rate_limit_config"; +import { LiquidationsConfig, LiquidationsConfigAmino, LiquidationsConfigSDKType } from "./liquidations_config"; +import { ClobMatch, ClobMatchAmino, ClobMatchSDKType } from "./matches"; +import { OrderRemoval, OrderRemovalAmino, OrderRemovalSDKType } from "./order_removals"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** MsgCreateClobPair is a message used by x/gov for creating a new clob pair. */ +export interface MsgCreateClobPair { + /** The address that controls the module. */ + authority: string; + /** `clob_pair` defines parameters for the new clob pair. */ + clobPair: ClobPair; +} +export interface MsgCreateClobPairProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPair"; + value: Uint8Array; +} +/** MsgCreateClobPair is a message used by x/gov for creating a new clob pair. */ +export interface MsgCreateClobPairAmino { + /** The address that controls the module. */ + authority?: string; + /** `clob_pair` defines parameters for the new clob pair. */ + clob_pair?: ClobPairAmino; +} +export interface MsgCreateClobPairAminoMsg { + type: "/dydxprotocol.clob.MsgCreateClobPair"; + value: MsgCreateClobPairAmino; +} +/** MsgCreateClobPair is a message used by x/gov for creating a new clob pair. */ +export interface MsgCreateClobPairSDKType { + authority: string; + clob_pair: ClobPairSDKType; +} +/** MsgCreateClobPairResponse defines the CreateClobPair response type. */ +export interface MsgCreateClobPairResponse {} +export interface MsgCreateClobPairResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPairResponse"; + value: Uint8Array; +} +/** MsgCreateClobPairResponse defines the CreateClobPair response type. */ +export interface MsgCreateClobPairResponseAmino {} +export interface MsgCreateClobPairResponseAminoMsg { + type: "/dydxprotocol.clob.MsgCreateClobPairResponse"; + value: MsgCreateClobPairResponseAmino; +} +/** MsgCreateClobPairResponse defines the CreateClobPair response type. */ +export interface MsgCreateClobPairResponseSDKType {} +/** + * MsgProposedOperations is a message injected by block proposers to + * specify the operations that occurred in a block. + */ +export interface MsgProposedOperations { + /** The list of operations proposed by the block proposer. */ + operationsQueue: OperationRaw[]; +} +export interface MsgProposedOperationsProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgProposedOperations"; + value: Uint8Array; +} +/** + * MsgProposedOperations is a message injected by block proposers to + * specify the operations that occurred in a block. + */ +export interface MsgProposedOperationsAmino { + /** The list of operations proposed by the block proposer. */ + operations_queue?: OperationRawAmino[]; +} +export interface MsgProposedOperationsAminoMsg { + type: "/dydxprotocol.clob.MsgProposedOperations"; + value: MsgProposedOperationsAmino; +} +/** + * MsgProposedOperations is a message injected by block proposers to + * specify the operations that occurred in a block. + */ +export interface MsgProposedOperationsSDKType { + operations_queue: OperationRawSDKType[]; +} +/** + * MsgProposedOperationsResponse is the response type of the message injected + * by block proposers to specify the operations that occurred in a block. + */ +export interface MsgProposedOperationsResponse {} +export interface MsgProposedOperationsResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgProposedOperationsResponse"; + value: Uint8Array; +} +/** + * MsgProposedOperationsResponse is the response type of the message injected + * by block proposers to specify the operations that occurred in a block. + */ +export interface MsgProposedOperationsResponseAmino {} +export interface MsgProposedOperationsResponseAminoMsg { + type: "/dydxprotocol.clob.MsgProposedOperationsResponse"; + value: MsgProposedOperationsResponseAmino; +} +/** + * MsgProposedOperationsResponse is the response type of the message injected + * by block proposers to specify the operations that occurred in a block. + */ +export interface MsgProposedOperationsResponseSDKType {} +/** MsgPlaceOrder is a request type used for placing orders. */ +export interface MsgPlaceOrder { + order: Order; +} +export interface MsgPlaceOrderProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrder"; + value: Uint8Array; +} +/** MsgPlaceOrder is a request type used for placing orders. */ +export interface MsgPlaceOrderAmino { + order?: OrderAmino; +} +export interface MsgPlaceOrderAminoMsg { + type: "/dydxprotocol.clob.MsgPlaceOrder"; + value: MsgPlaceOrderAmino; +} +/** MsgPlaceOrder is a request type used for placing orders. */ +export interface MsgPlaceOrderSDKType { + order: OrderSDKType; +} +/** MsgPlaceOrderResponse is a response type used for placing orders. */ +export interface MsgPlaceOrderResponse {} +export interface MsgPlaceOrderResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrderResponse"; + value: Uint8Array; +} +/** MsgPlaceOrderResponse is a response type used for placing orders. */ +export interface MsgPlaceOrderResponseAmino {} +export interface MsgPlaceOrderResponseAminoMsg { + type: "/dydxprotocol.clob.MsgPlaceOrderResponse"; + value: MsgPlaceOrderResponseAmino; +} +/** MsgPlaceOrderResponse is a response type used for placing orders. */ +export interface MsgPlaceOrderResponseSDKType {} +/** MsgCancelOrder is a request type used for canceling orders. */ +export interface MsgCancelOrder { + orderId: OrderId; + /** + * The last block this order cancellation can be executed at. + * Used only for Short-Term orders and must be zero for stateful orders. + */ + goodTilBlock?: number; + /** + * good_til_block_time represents the unix timestamp (in seconds) at which a + * stateful order cancellation will be considered expired. The + * good_til_block_time is always evaluated against the previous block's + * `BlockTime` instead of the block in which the order is committed. + * This value must be zero for Short-Term orders. + */ + goodTilBlockTime?: number; +} +export interface MsgCancelOrderProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgCancelOrder"; + value: Uint8Array; +} +/** MsgCancelOrder is a request type used for canceling orders. */ +export interface MsgCancelOrderAmino { + order_id?: OrderIdAmino; + /** + * The last block this order cancellation can be executed at. + * Used only for Short-Term orders and must be zero for stateful orders. + */ + good_til_block?: number; + /** + * good_til_block_time represents the unix timestamp (in seconds) at which a + * stateful order cancellation will be considered expired. The + * good_til_block_time is always evaluated against the previous block's + * `BlockTime` instead of the block in which the order is committed. + * This value must be zero for Short-Term orders. + */ + good_til_block_time?: number; +} +export interface MsgCancelOrderAminoMsg { + type: "/dydxprotocol.clob.MsgCancelOrder"; + value: MsgCancelOrderAmino; +} +/** MsgCancelOrder is a request type used for canceling orders. */ +export interface MsgCancelOrderSDKType { + order_id: OrderIdSDKType; + good_til_block?: number; + good_til_block_time?: number; +} +/** MsgCancelOrderResponse is a response type used for canceling orders. */ +export interface MsgCancelOrderResponse {} +export interface MsgCancelOrderResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgCancelOrderResponse"; + value: Uint8Array; +} +/** MsgCancelOrderResponse is a response type used for canceling orders. */ +export interface MsgCancelOrderResponseAmino {} +export interface MsgCancelOrderResponseAminoMsg { + type: "/dydxprotocol.clob.MsgCancelOrderResponse"; + value: MsgCancelOrderResponseAmino; +} +/** MsgCancelOrderResponse is a response type used for canceling orders. */ +export interface MsgCancelOrderResponseSDKType {} +/** + * MsgBatchCancel is a request type used for batch canceling orders. + * This msg is not atomic. Cancels will be performed optimistically even + * if some cancels are invalid or fail. + */ +export interface MsgBatchCancel { + /** The subaccount this batch cancel will be applied for. */ + subaccountId: SubaccountId; + /** The batch of short term orders that will be cancelled. */ + shortTermCancels: OrderBatch[]; + /** The last block the short term order cancellations can be executed at. */ + goodTilBlock: number; +} +export interface MsgBatchCancelProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgBatchCancel"; + value: Uint8Array; +} +/** + * MsgBatchCancel is a request type used for batch canceling orders. + * This msg is not atomic. Cancels will be performed optimistically even + * if some cancels are invalid or fail. + */ +export interface MsgBatchCancelAmino { + /** The subaccount this batch cancel will be applied for. */ + subaccount_id?: SubaccountIdAmino; + /** The batch of short term orders that will be cancelled. */ + short_term_cancels?: OrderBatchAmino[]; + /** The last block the short term order cancellations can be executed at. */ + good_til_block?: number; +} +export interface MsgBatchCancelAminoMsg { + type: "/dydxprotocol.clob.MsgBatchCancel"; + value: MsgBatchCancelAmino; +} +/** + * MsgBatchCancel is a request type used for batch canceling orders. + * This msg is not atomic. Cancels will be performed optimistically even + * if some cancels are invalid or fail. + */ +export interface MsgBatchCancelSDKType { + subaccount_id: SubaccountIdSDKType; + short_term_cancels: OrderBatchSDKType[]; + good_til_block: number; +} +/** + * OrderBatch represents a batch of orders all belonging to a single clob pair + * id. Along with a subaccount id and an order flag, is used to represent a + * batch of orders that share the same subaccount, order flag, and clob pair id. + */ +export interface OrderBatch { + /** The Clob Pair ID all orders in this order batch belong to. */ + clobPairId: number; + /** + * List of client ids in this order batch. + * Note that this is serialized as a uint32 instead of a fixed32 to + * avoid issues when decoding repeated packed fixed32. + */ + clientIds: number[]; +} +export interface OrderBatchProtoMsg { + typeUrl: "/dydxprotocol.clob.OrderBatch"; + value: Uint8Array; +} +/** + * OrderBatch represents a batch of orders all belonging to a single clob pair + * id. Along with a subaccount id and an order flag, is used to represent a + * batch of orders that share the same subaccount, order flag, and clob pair id. + */ +export interface OrderBatchAmino { + /** The Clob Pair ID all orders in this order batch belong to. */ + clob_pair_id?: number; + /** + * List of client ids in this order batch. + * Note that this is serialized as a uint32 instead of a fixed32 to + * avoid issues when decoding repeated packed fixed32. + */ + client_ids?: number[]; +} +export interface OrderBatchAminoMsg { + type: "/dydxprotocol.clob.OrderBatch"; + value: OrderBatchAmino; +} +/** + * OrderBatch represents a batch of orders all belonging to a single clob pair + * id. Along with a subaccount id and an order flag, is used to represent a + * batch of orders that share the same subaccount, order flag, and clob pair id. + */ +export interface OrderBatchSDKType { + clob_pair_id: number; + client_ids: number[]; +} +/** + * MsgBatchCancelResponse is a response type used for batch canceling orders. + * It indicates which cancel orders have succeeded or failed. + */ +export interface MsgBatchCancelResponse { + /** A batch of short term cancel orders that have succeeded. */ + shortTermSucceeded: OrderBatch[]; + /** A batch of short term cancel orders that have failed. */ + shortTermFailed: OrderBatch[]; +} +export interface MsgBatchCancelResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgBatchCancelResponse"; + value: Uint8Array; +} +/** + * MsgBatchCancelResponse is a response type used for batch canceling orders. + * It indicates which cancel orders have succeeded or failed. + */ +export interface MsgBatchCancelResponseAmino { + /** A batch of short term cancel orders that have succeeded. */ + short_term_succeeded?: OrderBatchAmino[]; + /** A batch of short term cancel orders that have failed. */ + short_term_failed?: OrderBatchAmino[]; +} +export interface MsgBatchCancelResponseAminoMsg { + type: "/dydxprotocol.clob.MsgBatchCancelResponse"; + value: MsgBatchCancelResponseAmino; +} +/** + * MsgBatchCancelResponse is a response type used for batch canceling orders. + * It indicates which cancel orders have succeeded or failed. + */ +export interface MsgBatchCancelResponseSDKType { + short_term_succeeded: OrderBatchSDKType[]; + short_term_failed: OrderBatchSDKType[]; +} +/** MsgUpdateClobPair is a request type used for updating a ClobPair in state. */ +export interface MsgUpdateClobPair { + /** Authority is the address that may send this message. */ + authority: string; + /** `clob_pair` is the ClobPair to write to state. */ + clobPair: ClobPair; +} +export interface MsgUpdateClobPairProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPair"; + value: Uint8Array; +} +/** MsgUpdateClobPair is a request type used for updating a ClobPair in state. */ +export interface MsgUpdateClobPairAmino { + /** Authority is the address that may send this message. */ + authority?: string; + /** `clob_pair` is the ClobPair to write to state. */ + clob_pair?: ClobPairAmino; +} +export interface MsgUpdateClobPairAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateClobPair"; + value: MsgUpdateClobPairAmino; +} +/** MsgUpdateClobPair is a request type used for updating a ClobPair in state. */ +export interface MsgUpdateClobPairSDKType { + authority: string; + clob_pair: ClobPairSDKType; +} +/** + * MsgUpdateClobPairResponse is a response type used for setting a ClobPair's + * status. + */ +export interface MsgUpdateClobPairResponse {} +export interface MsgUpdateClobPairResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPairResponse"; + value: Uint8Array; +} +/** + * MsgUpdateClobPairResponse is a response type used for setting a ClobPair's + * status. + */ +export interface MsgUpdateClobPairResponseAmino {} +export interface MsgUpdateClobPairResponseAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateClobPairResponse"; + value: MsgUpdateClobPairResponseAmino; +} +/** + * MsgUpdateClobPairResponse is a response type used for setting a ClobPair's + * status. + */ +export interface MsgUpdateClobPairResponseSDKType {} +/** + * OperationRaw represents an operation in the proposed operations. + * Note that the `order_placement` operation is a signed message. + */ +export interface OperationRaw { + match?: ClobMatch; + shortTermOrderPlacement?: Uint8Array; + orderRemoval?: OrderRemoval; +} +export interface OperationRawProtoMsg { + typeUrl: "/dydxprotocol.clob.OperationRaw"; + value: Uint8Array; +} +/** + * OperationRaw represents an operation in the proposed operations. + * Note that the `order_placement` operation is a signed message. + */ +export interface OperationRawAmino { + match?: ClobMatchAmino; + short_term_order_placement?: string; + order_removal?: OrderRemovalAmino; +} +export interface OperationRawAminoMsg { + type: "/dydxprotocol.clob.OperationRaw"; + value: OperationRawAmino; +} +/** + * OperationRaw represents an operation in the proposed operations. + * Note that the `order_placement` operation is a signed message. + */ +export interface OperationRawSDKType { + match?: ClobMatchSDKType; + short_term_order_placement?: Uint8Array; + order_removal?: OrderRemovalSDKType; +} +/** + * MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration + * request type. + */ +export interface MsgUpdateEquityTierLimitConfiguration { + authority: string; + /** + * Defines the equity tier limit configuration to update to. All fields must + * be set. + */ + equityTierLimitConfig: EquityTierLimitConfiguration; +} +export interface MsgUpdateEquityTierLimitConfigurationProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration"; + value: Uint8Array; +} +/** + * MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration + * request type. + */ +export interface MsgUpdateEquityTierLimitConfigurationAmino { + authority?: string; + /** + * Defines the equity tier limit configuration to update to. All fields must + * be set. + */ + equity_tier_limit_config?: EquityTierLimitConfigurationAmino; +} +export interface MsgUpdateEquityTierLimitConfigurationAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration"; + value: MsgUpdateEquityTierLimitConfigurationAmino; +} +/** + * MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration + * request type. + */ +export interface MsgUpdateEquityTierLimitConfigurationSDKType { + authority: string; + equity_tier_limit_config: EquityTierLimitConfigurationSDKType; +} +/** + * MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration + * response type. + */ +export interface MsgUpdateEquityTierLimitConfigurationResponse {} +export interface MsgUpdateEquityTierLimitConfigurationResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfigurationResponse"; + value: Uint8Array; +} +/** + * MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration + * response type. + */ +export interface MsgUpdateEquityTierLimitConfigurationResponseAmino {} +export interface MsgUpdateEquityTierLimitConfigurationResponseAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfigurationResponse"; + value: MsgUpdateEquityTierLimitConfigurationResponseAmino; +} +/** + * MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration + * response type. + */ +export interface MsgUpdateEquityTierLimitConfigurationResponseSDKType {} +/** + * MsgUpdateBlockRateLimitConfiguration is the Msg/BlockRateLimitConfiguration + * request type. + */ +export interface MsgUpdateBlockRateLimitConfiguration { + authority: string; + /** + * Defines the block rate limit configuration to update to. All fields must be + * set. + */ + blockRateLimitConfig: BlockRateLimitConfiguration; +} +export interface MsgUpdateBlockRateLimitConfigurationProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration"; + value: Uint8Array; +} +/** + * MsgUpdateBlockRateLimitConfiguration is the Msg/BlockRateLimitConfiguration + * request type. + */ +export interface MsgUpdateBlockRateLimitConfigurationAmino { + authority?: string; + /** + * Defines the block rate limit configuration to update to. All fields must be + * set. + */ + block_rate_limit_config?: BlockRateLimitConfigurationAmino; +} +export interface MsgUpdateBlockRateLimitConfigurationAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration"; + value: MsgUpdateBlockRateLimitConfigurationAmino; +} +/** + * MsgUpdateBlockRateLimitConfiguration is the Msg/BlockRateLimitConfiguration + * request type. + */ +export interface MsgUpdateBlockRateLimitConfigurationSDKType { + authority: string; + block_rate_limit_config: BlockRateLimitConfigurationSDKType; +} +/** + * MsgUpdateBlockRateLimitConfiguration is a response type for updating the + * liquidations config. + */ +export interface MsgUpdateBlockRateLimitConfigurationResponse {} +export interface MsgUpdateBlockRateLimitConfigurationResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse"; + value: Uint8Array; +} +/** + * MsgUpdateBlockRateLimitConfiguration is a response type for updating the + * liquidations config. + */ +export interface MsgUpdateBlockRateLimitConfigurationResponseAmino {} +export interface MsgUpdateBlockRateLimitConfigurationResponseAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse"; + value: MsgUpdateBlockRateLimitConfigurationResponseAmino; +} +/** + * MsgUpdateBlockRateLimitConfiguration is a response type for updating the + * liquidations config. + */ +export interface MsgUpdateBlockRateLimitConfigurationResponseSDKType {} +/** + * MsgUpdateLiquidationsConfig is a request type for updating the liquidations + * config. + */ +export interface MsgUpdateLiquidationsConfig { + /** Authority is the address that may send this message. */ + authority: string; + /** + * Defines the liquidations configuration to update to. All fields must + * be set. + */ + liquidationsConfig: LiquidationsConfig; +} +export interface MsgUpdateLiquidationsConfigProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig"; + value: Uint8Array; +} +/** + * MsgUpdateLiquidationsConfig is a request type for updating the liquidations + * config. + */ +export interface MsgUpdateLiquidationsConfigAmino { + /** Authority is the address that may send this message. */ + authority?: string; + /** + * Defines the liquidations configuration to update to. All fields must + * be set. + */ + liquidations_config?: LiquidationsConfigAmino; +} +export interface MsgUpdateLiquidationsConfigAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig"; + value: MsgUpdateLiquidationsConfigAmino; +} +/** + * MsgUpdateLiquidationsConfig is a request type for updating the liquidations + * config. + */ +export interface MsgUpdateLiquidationsConfigSDKType { + authority: string; + liquidations_config: LiquidationsConfigSDKType; +} +/** MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type. */ +export interface MsgUpdateLiquidationsConfigResponse {} +export interface MsgUpdateLiquidationsConfigResponseProtoMsg { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse"; + value: Uint8Array; +} +/** MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type. */ +export interface MsgUpdateLiquidationsConfigResponseAmino {} +export interface MsgUpdateLiquidationsConfigResponseAminoMsg { + type: "/dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse"; + value: MsgUpdateLiquidationsConfigResponseAmino; +} +/** MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type. */ +export interface MsgUpdateLiquidationsConfigResponseSDKType {} +function createBaseMsgCreateClobPair(): MsgCreateClobPair { + return { + authority: "", + clobPair: ClobPair.fromPartial({}) + }; +} +export const MsgCreateClobPair = { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPair", + encode(message: MsgCreateClobPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.clobPair !== undefined) { + ClobPair.encode(message.clobPair, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClobPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClobPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.clobPair = ClobPair.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateClobPair { + const message = createBaseMsgCreateClobPair(); + message.authority = object.authority ?? ""; + message.clobPair = object.clobPair !== undefined && object.clobPair !== null ? ClobPair.fromPartial(object.clobPair) : undefined; + return message; + }, + fromAmino(object: MsgCreateClobPairAmino): MsgCreateClobPair { + const message = createBaseMsgCreateClobPair(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.clob_pair !== undefined && object.clob_pair !== null) { + message.clobPair = ClobPair.fromAmino(object.clob_pair); + } + return message; + }, + toAmino(message: MsgCreateClobPair): MsgCreateClobPairAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.clob_pair = message.clobPair ? ClobPair.toAmino(message.clobPair) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateClobPairAminoMsg): MsgCreateClobPair { + return MsgCreateClobPair.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateClobPairProtoMsg): MsgCreateClobPair { + return MsgCreateClobPair.decode(message.value); + }, + toProto(message: MsgCreateClobPair): Uint8Array { + return MsgCreateClobPair.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClobPair): MsgCreateClobPairProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPair", + value: MsgCreateClobPair.encode(message).finish() + }; + } +}; +function createBaseMsgCreateClobPairResponse(): MsgCreateClobPairResponse { + return {}; +} +export const MsgCreateClobPairResponse = { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPairResponse", + encode(_: MsgCreateClobPairResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClobPairResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClobPairResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateClobPairResponse { + const message = createBaseMsgCreateClobPairResponse(); + return message; + }, + fromAmino(_: MsgCreateClobPairResponseAmino): MsgCreateClobPairResponse { + const message = createBaseMsgCreateClobPairResponse(); + return message; + }, + toAmino(_: MsgCreateClobPairResponse): MsgCreateClobPairResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateClobPairResponseAminoMsg): MsgCreateClobPairResponse { + return MsgCreateClobPairResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateClobPairResponseProtoMsg): MsgCreateClobPairResponse { + return MsgCreateClobPairResponse.decode(message.value); + }, + toProto(message: MsgCreateClobPairResponse): Uint8Array { + return MsgCreateClobPairResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClobPairResponse): MsgCreateClobPairResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgCreateClobPairResponse", + value: MsgCreateClobPairResponse.encode(message).finish() + }; + } +}; +function createBaseMsgProposedOperations(): MsgProposedOperations { + return { + operationsQueue: [] + }; +} +export const MsgProposedOperations = { + typeUrl: "/dydxprotocol.clob.MsgProposedOperations", + encode(message: MsgProposedOperations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.operationsQueue) { + OperationRaw.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgProposedOperations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgProposedOperations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operationsQueue.push(OperationRaw.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgProposedOperations { + const message = createBaseMsgProposedOperations(); + message.operationsQueue = object.operationsQueue?.map(e => OperationRaw.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgProposedOperationsAmino): MsgProposedOperations { + const message = createBaseMsgProposedOperations(); + message.operationsQueue = object.operations_queue?.map(e => OperationRaw.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgProposedOperations): MsgProposedOperationsAmino { + const obj: any = {}; + if (message.operationsQueue) { + obj.operations_queue = message.operationsQueue.map(e => e ? OperationRaw.toAmino(e) : undefined); + } else { + obj.operations_queue = message.operationsQueue; + } + return obj; + }, + fromAminoMsg(object: MsgProposedOperationsAminoMsg): MsgProposedOperations { + return MsgProposedOperations.fromAmino(object.value); + }, + fromProtoMsg(message: MsgProposedOperationsProtoMsg): MsgProposedOperations { + return MsgProposedOperations.decode(message.value); + }, + toProto(message: MsgProposedOperations): Uint8Array { + return MsgProposedOperations.encode(message).finish(); + }, + toProtoMsg(message: MsgProposedOperations): MsgProposedOperationsProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgProposedOperations", + value: MsgProposedOperations.encode(message).finish() + }; + } +}; +function createBaseMsgProposedOperationsResponse(): MsgProposedOperationsResponse { + return {}; +} +export const MsgProposedOperationsResponse = { + typeUrl: "/dydxprotocol.clob.MsgProposedOperationsResponse", + encode(_: MsgProposedOperationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgProposedOperationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgProposedOperationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgProposedOperationsResponse { + const message = createBaseMsgProposedOperationsResponse(); + return message; + }, + fromAmino(_: MsgProposedOperationsResponseAmino): MsgProposedOperationsResponse { + const message = createBaseMsgProposedOperationsResponse(); + return message; + }, + toAmino(_: MsgProposedOperationsResponse): MsgProposedOperationsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgProposedOperationsResponseAminoMsg): MsgProposedOperationsResponse { + return MsgProposedOperationsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgProposedOperationsResponseProtoMsg): MsgProposedOperationsResponse { + return MsgProposedOperationsResponse.decode(message.value); + }, + toProto(message: MsgProposedOperationsResponse): Uint8Array { + return MsgProposedOperationsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgProposedOperationsResponse): MsgProposedOperationsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgProposedOperationsResponse", + value: MsgProposedOperationsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgPlaceOrder(): MsgPlaceOrder { + return { + order: Order.fromPartial({}) + }; +} +export const MsgPlaceOrder = { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrder", + encode(message: MsgPlaceOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPlaceOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPlaceOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = Order.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPlaceOrder { + const message = createBaseMsgPlaceOrder(); + message.order = object.order !== undefined && object.order !== null ? Order.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: MsgPlaceOrderAmino): MsgPlaceOrder { + const message = createBaseMsgPlaceOrder(); + if (object.order !== undefined && object.order !== null) { + message.order = Order.fromAmino(object.order); + } + return message; + }, + toAmino(message: MsgPlaceOrder): MsgPlaceOrderAmino { + const obj: any = {}; + obj.order = message.order ? Order.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: MsgPlaceOrderAminoMsg): MsgPlaceOrder { + return MsgPlaceOrder.fromAmino(object.value); + }, + fromProtoMsg(message: MsgPlaceOrderProtoMsg): MsgPlaceOrder { + return MsgPlaceOrder.decode(message.value); + }, + toProto(message: MsgPlaceOrder): Uint8Array { + return MsgPlaceOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgPlaceOrder): MsgPlaceOrderProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrder", + value: MsgPlaceOrder.encode(message).finish() + }; + } +}; +function createBaseMsgPlaceOrderResponse(): MsgPlaceOrderResponse { + return {}; +} +export const MsgPlaceOrderResponse = { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrderResponse", + encode(_: MsgPlaceOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPlaceOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPlaceOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgPlaceOrderResponse { + const message = createBaseMsgPlaceOrderResponse(); + return message; + }, + fromAmino(_: MsgPlaceOrderResponseAmino): MsgPlaceOrderResponse { + const message = createBaseMsgPlaceOrderResponse(); + return message; + }, + toAmino(_: MsgPlaceOrderResponse): MsgPlaceOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPlaceOrderResponseAminoMsg): MsgPlaceOrderResponse { + return MsgPlaceOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgPlaceOrderResponseProtoMsg): MsgPlaceOrderResponse { + return MsgPlaceOrderResponse.decode(message.value); + }, + toProto(message: MsgPlaceOrderResponse): Uint8Array { + return MsgPlaceOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPlaceOrderResponse): MsgPlaceOrderResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgPlaceOrderResponse", + value: MsgPlaceOrderResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCancelOrder(): MsgCancelOrder { + return { + orderId: OrderId.fromPartial({}), + goodTilBlock: undefined, + goodTilBlockTime: undefined + }; +} +export const MsgCancelOrder = { + typeUrl: "/dydxprotocol.clob.MsgCancelOrder", + encode(message: MsgCancelOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderId !== undefined) { + OrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.goodTilBlock !== undefined) { + writer.uint32(16).uint32(message.goodTilBlock); + } + if (message.goodTilBlockTime !== undefined) { + writer.uint32(29).fixed32(message.goodTilBlockTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = OrderId.decode(reader, reader.uint32()); + break; + case 2: + message.goodTilBlock = reader.uint32(); + break; + case 3: + message.goodTilBlockTime = reader.fixed32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelOrder { + const message = createBaseMsgCancelOrder(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? OrderId.fromPartial(object.orderId) : undefined; + message.goodTilBlock = object.goodTilBlock ?? undefined; + message.goodTilBlockTime = object.goodTilBlockTime ?? undefined; + return message; + }, + fromAmino(object: MsgCancelOrderAmino): MsgCancelOrder { + const message = createBaseMsgCancelOrder(); + if (object.order_id !== undefined && object.order_id !== null) { + message.orderId = OrderId.fromAmino(object.order_id); + } + if (object.good_til_block !== undefined && object.good_til_block !== null) { + message.goodTilBlock = object.good_til_block; + } + if (object.good_til_block_time !== undefined && object.good_til_block_time !== null) { + message.goodTilBlockTime = object.good_til_block_time; + } + return message; + }, + toAmino(message: MsgCancelOrder): MsgCancelOrderAmino { + const obj: any = {}; + obj.order_id = message.orderId ? OrderId.toAmino(message.orderId) : undefined; + obj.good_til_block = message.goodTilBlock === null ? undefined : message.goodTilBlock; + obj.good_til_block_time = message.goodTilBlockTime === null ? undefined : message.goodTilBlockTime; + return obj; + }, + fromAminoMsg(object: MsgCancelOrderAminoMsg): MsgCancelOrder { + return MsgCancelOrder.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelOrderProtoMsg): MsgCancelOrder { + return MsgCancelOrder.decode(message.value); + }, + toProto(message: MsgCancelOrder): Uint8Array { + return MsgCancelOrder.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelOrder): MsgCancelOrderProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgCancelOrder", + value: MsgCancelOrder.encode(message).finish() + }; + } +}; +function createBaseMsgCancelOrderResponse(): MsgCancelOrderResponse { + return {}; +} +export const MsgCancelOrderResponse = { + typeUrl: "/dydxprotocol.clob.MsgCancelOrderResponse", + encode(_: MsgCancelOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCancelOrderResponse { + const message = createBaseMsgCancelOrderResponse(); + return message; + }, + fromAmino(_: MsgCancelOrderResponseAmino): MsgCancelOrderResponse { + const message = createBaseMsgCancelOrderResponse(); + return message; + }, + toAmino(_: MsgCancelOrderResponse): MsgCancelOrderResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelOrderResponseAminoMsg): MsgCancelOrderResponse { + return MsgCancelOrderResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelOrderResponseProtoMsg): MsgCancelOrderResponse { + return MsgCancelOrderResponse.decode(message.value); + }, + toProto(message: MsgCancelOrderResponse): Uint8Array { + return MsgCancelOrderResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelOrderResponse): MsgCancelOrderResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgCancelOrderResponse", + value: MsgCancelOrderResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBatchCancel(): MsgBatchCancel { + return { + subaccountId: SubaccountId.fromPartial({}), + shortTermCancels: [], + goodTilBlock: 0 + }; +} +export const MsgBatchCancel = { + typeUrl: "/dydxprotocol.clob.MsgBatchCancel", + encode(message: MsgBatchCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.shortTermCancels) { + OrderBatch.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.goodTilBlock !== 0) { + writer.uint32(24).uint32(message.goodTilBlock); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.shortTermCancels.push(OrderBatch.decode(reader, reader.uint32())); + break; + case 3: + message.goodTilBlock = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBatchCancel { + const message = createBaseMsgBatchCancel(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; + message.shortTermCancels = object.shortTermCancels?.map(e => OrderBatch.fromPartial(e)) || []; + message.goodTilBlock = object.goodTilBlock ?? 0; + return message; + }, + fromAmino(object: MsgBatchCancelAmino): MsgBatchCancel { + const message = createBaseMsgBatchCancel(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = SubaccountId.fromAmino(object.subaccount_id); + } + message.shortTermCancels = object.short_term_cancels?.map(e => OrderBatch.fromAmino(e)) || []; + if (object.good_til_block !== undefined && object.good_til_block !== null) { + message.goodTilBlock = object.good_til_block; + } + return message; + }, + toAmino(message: MsgBatchCancel): MsgBatchCancelAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? SubaccountId.toAmino(message.subaccountId) : undefined; + if (message.shortTermCancels) { + obj.short_term_cancels = message.shortTermCancels.map(e => e ? OrderBatch.toAmino(e) : undefined); + } else { + obj.short_term_cancels = message.shortTermCancels; + } + obj.good_til_block = message.goodTilBlock === 0 ? undefined : message.goodTilBlock; + return obj; + }, + fromAminoMsg(object: MsgBatchCancelAminoMsg): MsgBatchCancel { + return MsgBatchCancel.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelProtoMsg): MsgBatchCancel { + return MsgBatchCancel.decode(message.value); + }, + toProto(message: MsgBatchCancel): Uint8Array { + return MsgBatchCancel.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancel): MsgBatchCancelProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgBatchCancel", + value: MsgBatchCancel.encode(message).finish() + }; + } +}; +function createBaseOrderBatch(): OrderBatch { + return { + clobPairId: 0, + clientIds: [] + }; +} +export const OrderBatch = { + typeUrl: "/dydxprotocol.clob.OrderBatch", + encode(message: OrderBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clobPairId !== 0) { + writer.uint32(8).uint32(message.clobPairId); + } + writer.uint32(18).fork(); + for (const v of message.clientIds) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderBatch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobPairId = reader.uint32(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.clientIds.push(reader.uint32()); + } + } else { + message.clientIds.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderBatch { + const message = createBaseOrderBatch(); + message.clobPairId = object.clobPairId ?? 0; + message.clientIds = object.clientIds?.map(e => e) || []; + return message; + }, + fromAmino(object: OrderBatchAmino): OrderBatch { + const message = createBaseOrderBatch(); + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + message.clientIds = object.client_ids?.map(e => e) || []; + return message; + }, + toAmino(message: OrderBatch): OrderBatchAmino { + const obj: any = {}; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + if (message.clientIds) { + obj.client_ids = message.clientIds.map(e => e); + } else { + obj.client_ids = message.clientIds; + } + return obj; + }, + fromAminoMsg(object: OrderBatchAminoMsg): OrderBatch { + return OrderBatch.fromAmino(object.value); + }, + fromProtoMsg(message: OrderBatchProtoMsg): OrderBatch { + return OrderBatch.decode(message.value); + }, + toProto(message: OrderBatch): Uint8Array { + return OrderBatch.encode(message).finish(); + }, + toProtoMsg(message: OrderBatch): OrderBatchProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.OrderBatch", + value: OrderBatch.encode(message).finish() + }; + } +}; +function createBaseMsgBatchCancelResponse(): MsgBatchCancelResponse { + return { + shortTermSucceeded: [], + shortTermFailed: [] + }; +} +export const MsgBatchCancelResponse = { + typeUrl: "/dydxprotocol.clob.MsgBatchCancelResponse", + encode(message: MsgBatchCancelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.shortTermSucceeded) { + OrderBatch.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.shortTermFailed) { + OrderBatch.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBatchCancelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBatchCancelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shortTermSucceeded.push(OrderBatch.decode(reader, reader.uint32())); + break; + case 2: + message.shortTermFailed.push(OrderBatch.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBatchCancelResponse { + const message = createBaseMsgBatchCancelResponse(); + message.shortTermSucceeded = object.shortTermSucceeded?.map(e => OrderBatch.fromPartial(e)) || []; + message.shortTermFailed = object.shortTermFailed?.map(e => OrderBatch.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBatchCancelResponseAmino): MsgBatchCancelResponse { + const message = createBaseMsgBatchCancelResponse(); + message.shortTermSucceeded = object.short_term_succeeded?.map(e => OrderBatch.fromAmino(e)) || []; + message.shortTermFailed = object.short_term_failed?.map(e => OrderBatch.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBatchCancelResponse): MsgBatchCancelResponseAmino { + const obj: any = {}; + if (message.shortTermSucceeded) { + obj.short_term_succeeded = message.shortTermSucceeded.map(e => e ? OrderBatch.toAmino(e) : undefined); + } else { + obj.short_term_succeeded = message.shortTermSucceeded; + } + if (message.shortTermFailed) { + obj.short_term_failed = message.shortTermFailed.map(e => e ? OrderBatch.toAmino(e) : undefined); + } else { + obj.short_term_failed = message.shortTermFailed; + } + return obj; + }, + fromAminoMsg(object: MsgBatchCancelResponseAminoMsg): MsgBatchCancelResponse { + return MsgBatchCancelResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBatchCancelResponseProtoMsg): MsgBatchCancelResponse { + return MsgBatchCancelResponse.decode(message.value); + }, + toProto(message: MsgBatchCancelResponse): Uint8Array { + return MsgBatchCancelResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBatchCancelResponse): MsgBatchCancelResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgBatchCancelResponse", + value: MsgBatchCancelResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateClobPair(): MsgUpdateClobPair { + return { + authority: "", + clobPair: ClobPair.fromPartial({}) + }; +} +export const MsgUpdateClobPair = { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPair", + encode(message: MsgUpdateClobPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.clobPair !== undefined) { + ClobPair.encode(message.clobPair, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClobPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClobPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.clobPair = ClobPair.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateClobPair { + const message = createBaseMsgUpdateClobPair(); + message.authority = object.authority ?? ""; + message.clobPair = object.clobPair !== undefined && object.clobPair !== null ? ClobPair.fromPartial(object.clobPair) : undefined; + return message; + }, + fromAmino(object: MsgUpdateClobPairAmino): MsgUpdateClobPair { + const message = createBaseMsgUpdateClobPair(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.clob_pair !== undefined && object.clob_pair !== null) { + message.clobPair = ClobPair.fromAmino(object.clob_pair); + } + return message; + }, + toAmino(message: MsgUpdateClobPair): MsgUpdateClobPairAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.clob_pair = message.clobPair ? ClobPair.toAmino(message.clobPair) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateClobPairAminoMsg): MsgUpdateClobPair { + return MsgUpdateClobPair.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateClobPairProtoMsg): MsgUpdateClobPair { + return MsgUpdateClobPair.decode(message.value); + }, + toProto(message: MsgUpdateClobPair): Uint8Array { + return MsgUpdateClobPair.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClobPair): MsgUpdateClobPairProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPair", + value: MsgUpdateClobPair.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateClobPairResponse(): MsgUpdateClobPairResponse { + return {}; +} +export const MsgUpdateClobPairResponse = { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPairResponse", + encode(_: MsgUpdateClobPairResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClobPairResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClobPairResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateClobPairResponse { + const message = createBaseMsgUpdateClobPairResponse(); + return message; + }, + fromAmino(_: MsgUpdateClobPairResponseAmino): MsgUpdateClobPairResponse { + const message = createBaseMsgUpdateClobPairResponse(); + return message; + }, + toAmino(_: MsgUpdateClobPairResponse): MsgUpdateClobPairResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateClobPairResponseAminoMsg): MsgUpdateClobPairResponse { + return MsgUpdateClobPairResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateClobPairResponseProtoMsg): MsgUpdateClobPairResponse { + return MsgUpdateClobPairResponse.decode(message.value); + }, + toProto(message: MsgUpdateClobPairResponse): Uint8Array { + return MsgUpdateClobPairResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClobPairResponse): MsgUpdateClobPairResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateClobPairResponse", + value: MsgUpdateClobPairResponse.encode(message).finish() + }; + } +}; +function createBaseOperationRaw(): OperationRaw { + return { + match: undefined, + shortTermOrderPlacement: undefined, + orderRemoval: undefined + }; +} +export const OperationRaw = { + typeUrl: "/dydxprotocol.clob.OperationRaw", + encode(message: OperationRaw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.match !== undefined) { + ClobMatch.encode(message.match, writer.uint32(10).fork()).ldelim(); + } + if (message.shortTermOrderPlacement !== undefined) { + writer.uint32(18).bytes(message.shortTermOrderPlacement); + } + if (message.orderRemoval !== undefined) { + OrderRemoval.encode(message.orderRemoval, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OperationRaw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOperationRaw(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.match = ClobMatch.decode(reader, reader.uint32()); + break; + case 2: + message.shortTermOrderPlacement = reader.bytes(); + break; + case 3: + message.orderRemoval = OrderRemoval.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OperationRaw { + const message = createBaseOperationRaw(); + message.match = object.match !== undefined && object.match !== null ? ClobMatch.fromPartial(object.match) : undefined; + message.shortTermOrderPlacement = object.shortTermOrderPlacement ?? undefined; + message.orderRemoval = object.orderRemoval !== undefined && object.orderRemoval !== null ? OrderRemoval.fromPartial(object.orderRemoval) : undefined; + return message; + }, + fromAmino(object: OperationRawAmino): OperationRaw { + const message = createBaseOperationRaw(); + if (object.match !== undefined && object.match !== null) { + message.match = ClobMatch.fromAmino(object.match); + } + if (object.short_term_order_placement !== undefined && object.short_term_order_placement !== null) { + message.shortTermOrderPlacement = bytesFromBase64(object.short_term_order_placement); + } + if (object.order_removal !== undefined && object.order_removal !== null) { + message.orderRemoval = OrderRemoval.fromAmino(object.order_removal); + } + return message; + }, + toAmino(message: OperationRaw): OperationRawAmino { + const obj: any = {}; + obj.match = message.match ? ClobMatch.toAmino(message.match) : undefined; + obj.short_term_order_placement = message.shortTermOrderPlacement ? base64FromBytes(message.shortTermOrderPlacement) : undefined; + obj.order_removal = message.orderRemoval ? OrderRemoval.toAmino(message.orderRemoval) : undefined; + return obj; + }, + fromAminoMsg(object: OperationRawAminoMsg): OperationRaw { + return OperationRaw.fromAmino(object.value); + }, + fromProtoMsg(message: OperationRawProtoMsg): OperationRaw { + return OperationRaw.decode(message.value); + }, + toProto(message: OperationRaw): Uint8Array { + return OperationRaw.encode(message).finish(); + }, + toProtoMsg(message: OperationRaw): OperationRawProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.OperationRaw", + value: OperationRaw.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateEquityTierLimitConfiguration(): MsgUpdateEquityTierLimitConfiguration { + return { + authority: "", + equityTierLimitConfig: EquityTierLimitConfiguration.fromPartial({}) + }; +} +export const MsgUpdateEquityTierLimitConfiguration = { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration", + encode(message: MsgUpdateEquityTierLimitConfiguration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.equityTierLimitConfig !== undefined) { + EquityTierLimitConfiguration.encode(message.equityTierLimitConfig, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateEquityTierLimitConfiguration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateEquityTierLimitConfiguration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.equityTierLimitConfig = EquityTierLimitConfiguration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateEquityTierLimitConfiguration { + const message = createBaseMsgUpdateEquityTierLimitConfiguration(); + message.authority = object.authority ?? ""; + message.equityTierLimitConfig = object.equityTierLimitConfig !== undefined && object.equityTierLimitConfig !== null ? EquityTierLimitConfiguration.fromPartial(object.equityTierLimitConfig) : undefined; + return message; + }, + fromAmino(object: MsgUpdateEquityTierLimitConfigurationAmino): MsgUpdateEquityTierLimitConfiguration { + const message = createBaseMsgUpdateEquityTierLimitConfiguration(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.equity_tier_limit_config !== undefined && object.equity_tier_limit_config !== null) { + message.equityTierLimitConfig = EquityTierLimitConfiguration.fromAmino(object.equity_tier_limit_config); + } + return message; + }, + toAmino(message: MsgUpdateEquityTierLimitConfiguration): MsgUpdateEquityTierLimitConfigurationAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.equity_tier_limit_config = message.equityTierLimitConfig ? EquityTierLimitConfiguration.toAmino(message.equityTierLimitConfig) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateEquityTierLimitConfigurationAminoMsg): MsgUpdateEquityTierLimitConfiguration { + return MsgUpdateEquityTierLimitConfiguration.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateEquityTierLimitConfigurationProtoMsg): MsgUpdateEquityTierLimitConfiguration { + return MsgUpdateEquityTierLimitConfiguration.decode(message.value); + }, + toProto(message: MsgUpdateEquityTierLimitConfiguration): Uint8Array { + return MsgUpdateEquityTierLimitConfiguration.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateEquityTierLimitConfiguration): MsgUpdateEquityTierLimitConfigurationProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration", + value: MsgUpdateEquityTierLimitConfiguration.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateEquityTierLimitConfigurationResponse(): MsgUpdateEquityTierLimitConfigurationResponse { + return {}; +} +export const MsgUpdateEquityTierLimitConfigurationResponse = { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfigurationResponse", + encode(_: MsgUpdateEquityTierLimitConfigurationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateEquityTierLimitConfigurationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateEquityTierLimitConfigurationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateEquityTierLimitConfigurationResponse { + const message = createBaseMsgUpdateEquityTierLimitConfigurationResponse(); + return message; + }, + fromAmino(_: MsgUpdateEquityTierLimitConfigurationResponseAmino): MsgUpdateEquityTierLimitConfigurationResponse { + const message = createBaseMsgUpdateEquityTierLimitConfigurationResponse(); + return message; + }, + toAmino(_: MsgUpdateEquityTierLimitConfigurationResponse): MsgUpdateEquityTierLimitConfigurationResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateEquityTierLimitConfigurationResponseAminoMsg): MsgUpdateEquityTierLimitConfigurationResponse { + return MsgUpdateEquityTierLimitConfigurationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateEquityTierLimitConfigurationResponseProtoMsg): MsgUpdateEquityTierLimitConfigurationResponse { + return MsgUpdateEquityTierLimitConfigurationResponse.decode(message.value); + }, + toProto(message: MsgUpdateEquityTierLimitConfigurationResponse): Uint8Array { + return MsgUpdateEquityTierLimitConfigurationResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateEquityTierLimitConfigurationResponse): MsgUpdateEquityTierLimitConfigurationResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfigurationResponse", + value: MsgUpdateEquityTierLimitConfigurationResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateBlockRateLimitConfiguration(): MsgUpdateBlockRateLimitConfiguration { + return { + authority: "", + blockRateLimitConfig: BlockRateLimitConfiguration.fromPartial({}) + }; +} +export const MsgUpdateBlockRateLimitConfiguration = { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", + encode(message: MsgUpdateBlockRateLimitConfiguration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.blockRateLimitConfig !== undefined) { + BlockRateLimitConfiguration.encode(message.blockRateLimitConfig, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateBlockRateLimitConfiguration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateBlockRateLimitConfiguration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 3: + message.blockRateLimitConfig = BlockRateLimitConfiguration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateBlockRateLimitConfiguration { + const message = createBaseMsgUpdateBlockRateLimitConfiguration(); + message.authority = object.authority ?? ""; + message.blockRateLimitConfig = object.blockRateLimitConfig !== undefined && object.blockRateLimitConfig !== null ? BlockRateLimitConfiguration.fromPartial(object.blockRateLimitConfig) : undefined; + return message; + }, + fromAmino(object: MsgUpdateBlockRateLimitConfigurationAmino): MsgUpdateBlockRateLimitConfiguration { + const message = createBaseMsgUpdateBlockRateLimitConfiguration(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.block_rate_limit_config !== undefined && object.block_rate_limit_config !== null) { + message.blockRateLimitConfig = BlockRateLimitConfiguration.fromAmino(object.block_rate_limit_config); + } + return message; + }, + toAmino(message: MsgUpdateBlockRateLimitConfiguration): MsgUpdateBlockRateLimitConfigurationAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.block_rate_limit_config = message.blockRateLimitConfig ? BlockRateLimitConfiguration.toAmino(message.blockRateLimitConfig) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateBlockRateLimitConfigurationAminoMsg): MsgUpdateBlockRateLimitConfiguration { + return MsgUpdateBlockRateLimitConfiguration.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateBlockRateLimitConfigurationProtoMsg): MsgUpdateBlockRateLimitConfiguration { + return MsgUpdateBlockRateLimitConfiguration.decode(message.value); + }, + toProto(message: MsgUpdateBlockRateLimitConfiguration): Uint8Array { + return MsgUpdateBlockRateLimitConfiguration.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateBlockRateLimitConfiguration): MsgUpdateBlockRateLimitConfigurationProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", + value: MsgUpdateBlockRateLimitConfiguration.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateBlockRateLimitConfigurationResponse(): MsgUpdateBlockRateLimitConfigurationResponse { + return {}; +} +export const MsgUpdateBlockRateLimitConfigurationResponse = { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse", + encode(_: MsgUpdateBlockRateLimitConfigurationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateBlockRateLimitConfigurationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateBlockRateLimitConfigurationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateBlockRateLimitConfigurationResponse { + const message = createBaseMsgUpdateBlockRateLimitConfigurationResponse(); + return message; + }, + fromAmino(_: MsgUpdateBlockRateLimitConfigurationResponseAmino): MsgUpdateBlockRateLimitConfigurationResponse { + const message = createBaseMsgUpdateBlockRateLimitConfigurationResponse(); + return message; + }, + toAmino(_: MsgUpdateBlockRateLimitConfigurationResponse): MsgUpdateBlockRateLimitConfigurationResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateBlockRateLimitConfigurationResponseAminoMsg): MsgUpdateBlockRateLimitConfigurationResponse { + return MsgUpdateBlockRateLimitConfigurationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateBlockRateLimitConfigurationResponseProtoMsg): MsgUpdateBlockRateLimitConfigurationResponse { + return MsgUpdateBlockRateLimitConfigurationResponse.decode(message.value); + }, + toProto(message: MsgUpdateBlockRateLimitConfigurationResponse): Uint8Array { + return MsgUpdateBlockRateLimitConfigurationResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateBlockRateLimitConfigurationResponse): MsgUpdateBlockRateLimitConfigurationResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse", + value: MsgUpdateBlockRateLimitConfigurationResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateLiquidationsConfig(): MsgUpdateLiquidationsConfig { + return { + authority: "", + liquidationsConfig: LiquidationsConfig.fromPartial({}) + }; +} +export const MsgUpdateLiquidationsConfig = { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig", + encode(message: MsgUpdateLiquidationsConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.liquidationsConfig !== undefined) { + LiquidationsConfig.encode(message.liquidationsConfig, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateLiquidationsConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateLiquidationsConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.liquidationsConfig = LiquidationsConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateLiquidationsConfig { + const message = createBaseMsgUpdateLiquidationsConfig(); + message.authority = object.authority ?? ""; + message.liquidationsConfig = object.liquidationsConfig !== undefined && object.liquidationsConfig !== null ? LiquidationsConfig.fromPartial(object.liquidationsConfig) : undefined; + return message; + }, + fromAmino(object: MsgUpdateLiquidationsConfigAmino): MsgUpdateLiquidationsConfig { + const message = createBaseMsgUpdateLiquidationsConfig(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.liquidations_config !== undefined && object.liquidations_config !== null) { + message.liquidationsConfig = LiquidationsConfig.fromAmino(object.liquidations_config); + } + return message; + }, + toAmino(message: MsgUpdateLiquidationsConfig): MsgUpdateLiquidationsConfigAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.liquidations_config = message.liquidationsConfig ? LiquidationsConfig.toAmino(message.liquidationsConfig) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateLiquidationsConfigAminoMsg): MsgUpdateLiquidationsConfig { + return MsgUpdateLiquidationsConfig.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateLiquidationsConfigProtoMsg): MsgUpdateLiquidationsConfig { + return MsgUpdateLiquidationsConfig.decode(message.value); + }, + toProto(message: MsgUpdateLiquidationsConfig): Uint8Array { + return MsgUpdateLiquidationsConfig.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateLiquidationsConfig): MsgUpdateLiquidationsConfigProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfig", + value: MsgUpdateLiquidationsConfig.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateLiquidationsConfigResponse(): MsgUpdateLiquidationsConfigResponse { + return {}; +} +export const MsgUpdateLiquidationsConfigResponse = { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse", + encode(_: MsgUpdateLiquidationsConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateLiquidationsConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateLiquidationsConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateLiquidationsConfigResponse { + const message = createBaseMsgUpdateLiquidationsConfigResponse(); + return message; + }, + fromAmino(_: MsgUpdateLiquidationsConfigResponseAmino): MsgUpdateLiquidationsConfigResponse { + const message = createBaseMsgUpdateLiquidationsConfigResponse(); + return message; + }, + toAmino(_: MsgUpdateLiquidationsConfigResponse): MsgUpdateLiquidationsConfigResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateLiquidationsConfigResponseAminoMsg): MsgUpdateLiquidationsConfigResponse { + return MsgUpdateLiquidationsConfigResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateLiquidationsConfigResponseProtoMsg): MsgUpdateLiquidationsConfigResponse { + return MsgUpdateLiquidationsConfigResponse.decode(message.value); + }, + toProto(message: MsgUpdateLiquidationsConfigResponse): Uint8Array { + return MsgUpdateLiquidationsConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateLiquidationsConfigResponse): MsgUpdateLiquidationsConfigResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse", + value: MsgUpdateLiquidationsConfigResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/bridge/bridge.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/bridge/bridge.ts new file mode 100644 index 00000000..73c8310f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/bridge/bridge.ts @@ -0,0 +1,161 @@ +//@ts-nocheck +import { BridgeEvent, BridgeEventAmino, BridgeEventSDKType } from "../../bridge/bridge_event"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * AddBridgeEventsRequest is a request message that contains a list of new + * bridge events. The events should be contiguous and sorted by (unique) id. + */ +export interface AddBridgeEventsRequest { + bridgeEvents: BridgeEvent[]; +} +export interface AddBridgeEventsRequestProtoMsg { + typeUrl: "/dydxprotocol.daemons.bridge.AddBridgeEventsRequest"; + value: Uint8Array; +} +/** + * AddBridgeEventsRequest is a request message that contains a list of new + * bridge events. The events should be contiguous and sorted by (unique) id. + */ +export interface AddBridgeEventsRequestAmino { + bridge_events?: BridgeEventAmino[]; +} +export interface AddBridgeEventsRequestAminoMsg { + type: "/dydxprotocol.daemons.bridge.AddBridgeEventsRequest"; + value: AddBridgeEventsRequestAmino; +} +/** + * AddBridgeEventsRequest is a request message that contains a list of new + * bridge events. The events should be contiguous and sorted by (unique) id. + */ +export interface AddBridgeEventsRequestSDKType { + bridge_events: BridgeEventSDKType[]; +} +/** AddBridgeEventsResponse is a response message for BridgeEventRequest. */ +export interface AddBridgeEventsResponse {} +export interface AddBridgeEventsResponseProtoMsg { + typeUrl: "/dydxprotocol.daemons.bridge.AddBridgeEventsResponse"; + value: Uint8Array; +} +/** AddBridgeEventsResponse is a response message for BridgeEventRequest. */ +export interface AddBridgeEventsResponseAmino {} +export interface AddBridgeEventsResponseAminoMsg { + type: "/dydxprotocol.daemons.bridge.AddBridgeEventsResponse"; + value: AddBridgeEventsResponseAmino; +} +/** AddBridgeEventsResponse is a response message for BridgeEventRequest. */ +export interface AddBridgeEventsResponseSDKType {} +function createBaseAddBridgeEventsRequest(): AddBridgeEventsRequest { + return { + bridgeEvents: [] + }; +} +export const AddBridgeEventsRequest = { + typeUrl: "/dydxprotocol.daemons.bridge.AddBridgeEventsRequest", + encode(message: AddBridgeEventsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.bridgeEvents) { + BridgeEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddBridgeEventsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddBridgeEventsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bridgeEvents.push(BridgeEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddBridgeEventsRequest { + const message = createBaseAddBridgeEventsRequest(); + message.bridgeEvents = object.bridgeEvents?.map(e => BridgeEvent.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AddBridgeEventsRequestAmino): AddBridgeEventsRequest { + const message = createBaseAddBridgeEventsRequest(); + message.bridgeEvents = object.bridge_events?.map(e => BridgeEvent.fromAmino(e)) || []; + return message; + }, + toAmino(message: AddBridgeEventsRequest): AddBridgeEventsRequestAmino { + const obj: any = {}; + if (message.bridgeEvents) { + obj.bridge_events = message.bridgeEvents.map(e => e ? BridgeEvent.toAmino(e) : undefined); + } else { + obj.bridge_events = message.bridgeEvents; + } + return obj; + }, + fromAminoMsg(object: AddBridgeEventsRequestAminoMsg): AddBridgeEventsRequest { + return AddBridgeEventsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: AddBridgeEventsRequestProtoMsg): AddBridgeEventsRequest { + return AddBridgeEventsRequest.decode(message.value); + }, + toProto(message: AddBridgeEventsRequest): Uint8Array { + return AddBridgeEventsRequest.encode(message).finish(); + }, + toProtoMsg(message: AddBridgeEventsRequest): AddBridgeEventsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.bridge.AddBridgeEventsRequest", + value: AddBridgeEventsRequest.encode(message).finish() + }; + } +}; +function createBaseAddBridgeEventsResponse(): AddBridgeEventsResponse { + return {}; +} +export const AddBridgeEventsResponse = { + typeUrl: "/dydxprotocol.daemons.bridge.AddBridgeEventsResponse", + encode(_: AddBridgeEventsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddBridgeEventsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddBridgeEventsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): AddBridgeEventsResponse { + const message = createBaseAddBridgeEventsResponse(); + return message; + }, + fromAmino(_: AddBridgeEventsResponseAmino): AddBridgeEventsResponse { + const message = createBaseAddBridgeEventsResponse(); + return message; + }, + toAmino(_: AddBridgeEventsResponse): AddBridgeEventsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: AddBridgeEventsResponseAminoMsg): AddBridgeEventsResponse { + return AddBridgeEventsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: AddBridgeEventsResponseProtoMsg): AddBridgeEventsResponse { + return AddBridgeEventsResponse.decode(message.value); + }, + toProto(message: AddBridgeEventsResponse): Uint8Array { + return AddBridgeEventsResponse.encode(message).finish(); + }, + toProtoMsg(message: AddBridgeEventsResponse): AddBridgeEventsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.bridge.AddBridgeEventsResponse", + value: AddBridgeEventsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/liquidation/liquidation.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/liquidation/liquidation.ts new file mode 100644 index 00000000..19fa7e24 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/liquidation/liquidation.ts @@ -0,0 +1,232 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../../subaccounts/subaccount"; +import { SubaccountOpenPositionInfo, SubaccountOpenPositionInfoAmino, SubaccountOpenPositionInfoSDKType } from "../../clob/liquidations"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * LiquidateSubaccountsRequest is a request message that contains a list of + * subaccount ids that potentially need to be liquidated. The list of subaccount + * ids should not contain duplicates. The application should re-verify these + * subaccount ids against current state before liquidating their positions. + */ +export interface LiquidateSubaccountsRequest { + /** The block height at which the liquidation daemon is processing. */ + blockHeight: number; + /** The list of liquidatable subaccount ids. */ + liquidatableSubaccountIds: SubaccountId[]; + /** The list of subaccount ids with negative total net collateral. */ + negativeTncSubaccountIds: SubaccountId[]; + subaccountOpenPositionInfo: SubaccountOpenPositionInfo[]; +} +export interface LiquidateSubaccountsRequestProtoMsg { + typeUrl: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsRequest"; + value: Uint8Array; +} +/** + * LiquidateSubaccountsRequest is a request message that contains a list of + * subaccount ids that potentially need to be liquidated. The list of subaccount + * ids should not contain duplicates. The application should re-verify these + * subaccount ids against current state before liquidating their positions. + */ +export interface LiquidateSubaccountsRequestAmino { + /** The block height at which the liquidation daemon is processing. */ + block_height?: number; + /** The list of liquidatable subaccount ids. */ + liquidatable_subaccount_ids?: SubaccountIdAmino[]; + /** The list of subaccount ids with negative total net collateral. */ + negative_tnc_subaccount_ids?: SubaccountIdAmino[]; + subaccount_open_position_info?: SubaccountOpenPositionInfoAmino[]; +} +export interface LiquidateSubaccountsRequestAminoMsg { + type: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsRequest"; + value: LiquidateSubaccountsRequestAmino; +} +/** + * LiquidateSubaccountsRequest is a request message that contains a list of + * subaccount ids that potentially need to be liquidated. The list of subaccount + * ids should not contain duplicates. The application should re-verify these + * subaccount ids against current state before liquidating their positions. + */ +export interface LiquidateSubaccountsRequestSDKType { + block_height: number; + liquidatable_subaccount_ids: SubaccountIdSDKType[]; + negative_tnc_subaccount_ids: SubaccountIdSDKType[]; + subaccount_open_position_info: SubaccountOpenPositionInfoSDKType[]; +} +/** + * LiquidateSubaccountsResponse is a response message for + * LiquidateSubaccountsRequest. + */ +export interface LiquidateSubaccountsResponse {} +export interface LiquidateSubaccountsResponseProtoMsg { + typeUrl: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsResponse"; + value: Uint8Array; +} +/** + * LiquidateSubaccountsResponse is a response message for + * LiquidateSubaccountsRequest. + */ +export interface LiquidateSubaccountsResponseAmino {} +export interface LiquidateSubaccountsResponseAminoMsg { + type: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsResponse"; + value: LiquidateSubaccountsResponseAmino; +} +/** + * LiquidateSubaccountsResponse is a response message for + * LiquidateSubaccountsRequest. + */ +export interface LiquidateSubaccountsResponseSDKType {} +function createBaseLiquidateSubaccountsRequest(): LiquidateSubaccountsRequest { + return { + blockHeight: 0, + liquidatableSubaccountIds: [], + negativeTncSubaccountIds: [], + subaccountOpenPositionInfo: [] + }; +} +export const LiquidateSubaccountsRequest = { + typeUrl: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsRequest", + encode(message: LiquidateSubaccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== 0) { + writer.uint32(8).uint32(message.blockHeight); + } + for (const v of message.liquidatableSubaccountIds) { + SubaccountId.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.negativeTncSubaccountIds) { + SubaccountId.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.subaccountOpenPositionInfo) { + SubaccountOpenPositionInfo.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidateSubaccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidateSubaccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint32(); + break; + case 2: + message.liquidatableSubaccountIds.push(SubaccountId.decode(reader, reader.uint32())); + break; + case 3: + message.negativeTncSubaccountIds.push(SubaccountId.decode(reader, reader.uint32())); + break; + case 4: + message.subaccountOpenPositionInfo.push(SubaccountOpenPositionInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidateSubaccountsRequest { + const message = createBaseLiquidateSubaccountsRequest(); + message.blockHeight = object.blockHeight ?? 0; + message.liquidatableSubaccountIds = object.liquidatableSubaccountIds?.map(e => SubaccountId.fromPartial(e)) || []; + message.negativeTncSubaccountIds = object.negativeTncSubaccountIds?.map(e => SubaccountId.fromPartial(e)) || []; + message.subaccountOpenPositionInfo = object.subaccountOpenPositionInfo?.map(e => SubaccountOpenPositionInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LiquidateSubaccountsRequestAmino): LiquidateSubaccountsRequest { + const message = createBaseLiquidateSubaccountsRequest(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + message.liquidatableSubaccountIds = object.liquidatable_subaccount_ids?.map(e => SubaccountId.fromAmino(e)) || []; + message.negativeTncSubaccountIds = object.negative_tnc_subaccount_ids?.map(e => SubaccountId.fromAmino(e)) || []; + message.subaccountOpenPositionInfo = object.subaccount_open_position_info?.map(e => SubaccountOpenPositionInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: LiquidateSubaccountsRequest): LiquidateSubaccountsRequestAmino { + const obj: any = {}; + obj.block_height = message.blockHeight === 0 ? undefined : message.blockHeight; + if (message.liquidatableSubaccountIds) { + obj.liquidatable_subaccount_ids = message.liquidatableSubaccountIds.map(e => e ? SubaccountId.toAmino(e) : undefined); + } else { + obj.liquidatable_subaccount_ids = message.liquidatableSubaccountIds; + } + if (message.negativeTncSubaccountIds) { + obj.negative_tnc_subaccount_ids = message.negativeTncSubaccountIds.map(e => e ? SubaccountId.toAmino(e) : undefined); + } else { + obj.negative_tnc_subaccount_ids = message.negativeTncSubaccountIds; + } + if (message.subaccountOpenPositionInfo) { + obj.subaccount_open_position_info = message.subaccountOpenPositionInfo.map(e => e ? SubaccountOpenPositionInfo.toAmino(e) : undefined); + } else { + obj.subaccount_open_position_info = message.subaccountOpenPositionInfo; + } + return obj; + }, + fromAminoMsg(object: LiquidateSubaccountsRequestAminoMsg): LiquidateSubaccountsRequest { + return LiquidateSubaccountsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidateSubaccountsRequestProtoMsg): LiquidateSubaccountsRequest { + return LiquidateSubaccountsRequest.decode(message.value); + }, + toProto(message: LiquidateSubaccountsRequest): Uint8Array { + return LiquidateSubaccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: LiquidateSubaccountsRequest): LiquidateSubaccountsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsRequest", + value: LiquidateSubaccountsRequest.encode(message).finish() + }; + } +}; +function createBaseLiquidateSubaccountsResponse(): LiquidateSubaccountsResponse { + return {}; +} +export const LiquidateSubaccountsResponse = { + typeUrl: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsResponse", + encode(_: LiquidateSubaccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidateSubaccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidateSubaccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): LiquidateSubaccountsResponse { + const message = createBaseLiquidateSubaccountsResponse(); + return message; + }, + fromAmino(_: LiquidateSubaccountsResponseAmino): LiquidateSubaccountsResponse { + const message = createBaseLiquidateSubaccountsResponse(); + return message; + }, + toAmino(_: LiquidateSubaccountsResponse): LiquidateSubaccountsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: LiquidateSubaccountsResponseAminoMsg): LiquidateSubaccountsResponse { + return LiquidateSubaccountsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidateSubaccountsResponseProtoMsg): LiquidateSubaccountsResponse { + return LiquidateSubaccountsResponse.decode(message.value); + }, + toProto(message: LiquidateSubaccountsResponse): Uint8Array { + return LiquidateSubaccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: LiquidateSubaccountsResponse): LiquidateSubaccountsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.liquidation.LiquidateSubaccountsResponse", + value: LiquidateSubaccountsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/pricefeed/price_feed.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/pricefeed/price_feed.ts new file mode 100644 index 00000000..cbe29c9e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/daemons/pricefeed/price_feed.ts @@ -0,0 +1,366 @@ +//@ts-nocheck +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** UpdateMarketPriceRequest is a request message updating market prices. */ +export interface UpdateMarketPricesRequest { + marketPriceUpdates: MarketPriceUpdate[]; +} +export interface UpdateMarketPricesRequestProtoMsg { + typeUrl: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesRequest"; + value: Uint8Array; +} +/** UpdateMarketPriceRequest is a request message updating market prices. */ +export interface UpdateMarketPricesRequestAmino { + market_price_updates?: MarketPriceUpdateAmino[]; +} +export interface UpdateMarketPricesRequestAminoMsg { + type: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesRequest"; + value: UpdateMarketPricesRequestAmino; +} +/** UpdateMarketPriceRequest is a request message updating market prices. */ +export interface UpdateMarketPricesRequestSDKType { + market_price_updates: MarketPriceUpdateSDKType[]; +} +/** UpdateMarketPricesResponse is a response message for updating market prices. */ +export interface UpdateMarketPricesResponse {} +export interface UpdateMarketPricesResponseProtoMsg { + typeUrl: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesResponse"; + value: Uint8Array; +} +/** UpdateMarketPricesResponse is a response message for updating market prices. */ +export interface UpdateMarketPricesResponseAmino {} +export interface UpdateMarketPricesResponseAminoMsg { + type: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesResponse"; + value: UpdateMarketPricesResponseAmino; +} +/** UpdateMarketPricesResponse is a response message for updating market prices. */ +export interface UpdateMarketPricesResponseSDKType {} +/** ExchangePrice represents a specific exchange's market price */ +export interface ExchangePrice { + exchangeId: string; + price: bigint; + lastUpdateTime?: Date; +} +export interface ExchangePriceProtoMsg { + typeUrl: "/dydxprotocol.daemons.pricefeed.ExchangePrice"; + value: Uint8Array; +} +/** ExchangePrice represents a specific exchange's market price */ +export interface ExchangePriceAmino { + exchange_id?: string; + price?: string; + last_update_time?: string; +} +export interface ExchangePriceAminoMsg { + type: "/dydxprotocol.daemons.pricefeed.ExchangePrice"; + value: ExchangePriceAmino; +} +/** ExchangePrice represents a specific exchange's market price */ +export interface ExchangePriceSDKType { + exchange_id: string; + price: bigint; + last_update_time?: Date; +} +/** MarketPriceUpdate represents an update to a single market */ +export interface MarketPriceUpdate { + marketId: number; + exchangePrices: ExchangePrice[]; +} +export interface MarketPriceUpdateProtoMsg { + typeUrl: "/dydxprotocol.daemons.pricefeed.MarketPriceUpdate"; + value: Uint8Array; +} +/** MarketPriceUpdate represents an update to a single market */ +export interface MarketPriceUpdateAmino { + market_id?: number; + exchange_prices?: ExchangePriceAmino[]; +} +export interface MarketPriceUpdateAminoMsg { + type: "/dydxprotocol.daemons.pricefeed.MarketPriceUpdate"; + value: MarketPriceUpdateAmino; +} +/** MarketPriceUpdate represents an update to a single market */ +export interface MarketPriceUpdateSDKType { + market_id: number; + exchange_prices: ExchangePriceSDKType[]; +} +function createBaseUpdateMarketPricesRequest(): UpdateMarketPricesRequest { + return { + marketPriceUpdates: [] + }; +} +export const UpdateMarketPricesRequest = { + typeUrl: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesRequest", + encode(message: UpdateMarketPricesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketPriceUpdates) { + MarketPriceUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMarketPricesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateMarketPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketPriceUpdates.push(MarketPriceUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateMarketPricesRequest { + const message = createBaseUpdateMarketPricesRequest(); + message.marketPriceUpdates = object.marketPriceUpdates?.map(e => MarketPriceUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateMarketPricesRequestAmino): UpdateMarketPricesRequest { + const message = createBaseUpdateMarketPricesRequest(); + message.marketPriceUpdates = object.market_price_updates?.map(e => MarketPriceUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateMarketPricesRequest): UpdateMarketPricesRequestAmino { + const obj: any = {}; + if (message.marketPriceUpdates) { + obj.market_price_updates = message.marketPriceUpdates.map(e => e ? MarketPriceUpdate.toAmino(e) : undefined); + } else { + obj.market_price_updates = message.marketPriceUpdates; + } + return obj; + }, + fromAminoMsg(object: UpdateMarketPricesRequestAminoMsg): UpdateMarketPricesRequest { + return UpdateMarketPricesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateMarketPricesRequestProtoMsg): UpdateMarketPricesRequest { + return UpdateMarketPricesRequest.decode(message.value); + }, + toProto(message: UpdateMarketPricesRequest): Uint8Array { + return UpdateMarketPricesRequest.encode(message).finish(); + }, + toProtoMsg(message: UpdateMarketPricesRequest): UpdateMarketPricesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesRequest", + value: UpdateMarketPricesRequest.encode(message).finish() + }; + } +}; +function createBaseUpdateMarketPricesResponse(): UpdateMarketPricesResponse { + return {}; +} +export const UpdateMarketPricesResponse = { + typeUrl: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesResponse", + encode(_: UpdateMarketPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMarketPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateMarketPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): UpdateMarketPricesResponse { + const message = createBaseUpdateMarketPricesResponse(); + return message; + }, + fromAmino(_: UpdateMarketPricesResponseAmino): UpdateMarketPricesResponse { + const message = createBaseUpdateMarketPricesResponse(); + return message; + }, + toAmino(_: UpdateMarketPricesResponse): UpdateMarketPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: UpdateMarketPricesResponseAminoMsg): UpdateMarketPricesResponse { + return UpdateMarketPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateMarketPricesResponseProtoMsg): UpdateMarketPricesResponse { + return UpdateMarketPricesResponse.decode(message.value); + }, + toProto(message: UpdateMarketPricesResponse): Uint8Array { + return UpdateMarketPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: UpdateMarketPricesResponse): UpdateMarketPricesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.pricefeed.UpdateMarketPricesResponse", + value: UpdateMarketPricesResponse.encode(message).finish() + }; + } +}; +function createBaseExchangePrice(): ExchangePrice { + return { + exchangeId: "", + price: BigInt(0), + lastUpdateTime: undefined + }; +} +export const ExchangePrice = { + typeUrl: "/dydxprotocol.daemons.pricefeed.ExchangePrice", + encode(message: ExchangePrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exchangeId !== "") { + writer.uint32(10).string(message.exchangeId); + } + if (message.price !== BigInt(0)) { + writer.uint32(16).uint64(message.price); + } + if (message.lastUpdateTime !== undefined) { + Timestamp.encode(toTimestamp(message.lastUpdateTime), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExchangePrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangePrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exchangeId = reader.string(); + break; + case 2: + message.price = reader.uint64(); + break; + case 3: + message.lastUpdateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExchangePrice { + const message = createBaseExchangePrice(); + message.exchangeId = object.exchangeId ?? ""; + message.price = object.price !== undefined && object.price !== null ? BigInt(object.price.toString()) : BigInt(0); + message.lastUpdateTime = object.lastUpdateTime ?? undefined; + return message; + }, + fromAmino(object: ExchangePriceAmino): ExchangePrice { + const message = createBaseExchangePrice(); + if (object.exchange_id !== undefined && object.exchange_id !== null) { + message.exchangeId = object.exchange_id; + } + if (object.price !== undefined && object.price !== null) { + message.price = BigInt(object.price); + } + if (object.last_update_time !== undefined && object.last_update_time !== null) { + message.lastUpdateTime = fromTimestamp(Timestamp.fromAmino(object.last_update_time)); + } + return message; + }, + toAmino(message: ExchangePrice): ExchangePriceAmino { + const obj: any = {}; + obj.exchange_id = message.exchangeId === "" ? undefined : message.exchangeId; + obj.price = message.price !== BigInt(0) ? message.price.toString() : undefined; + obj.last_update_time = message.lastUpdateTime ? Timestamp.toAmino(toTimestamp(message.lastUpdateTime)) : undefined; + return obj; + }, + fromAminoMsg(object: ExchangePriceAminoMsg): ExchangePrice { + return ExchangePrice.fromAmino(object.value); + }, + fromProtoMsg(message: ExchangePriceProtoMsg): ExchangePrice { + return ExchangePrice.decode(message.value); + }, + toProto(message: ExchangePrice): Uint8Array { + return ExchangePrice.encode(message).finish(); + }, + toProtoMsg(message: ExchangePrice): ExchangePriceProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.pricefeed.ExchangePrice", + value: ExchangePrice.encode(message).finish() + }; + } +}; +function createBaseMarketPriceUpdate(): MarketPriceUpdate { + return { + marketId: 0, + exchangePrices: [] + }; +} +export const MarketPriceUpdate = { + typeUrl: "/dydxprotocol.daemons.pricefeed.MarketPriceUpdate", + encode(message: MarketPriceUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== 0) { + writer.uint32(8).uint32(message.marketId); + } + for (const v of message.exchangePrices) { + ExchangePrice.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketPriceUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketPriceUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.uint32(); + break; + case 2: + message.exchangePrices.push(ExchangePrice.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketPriceUpdate { + const message = createBaseMarketPriceUpdate(); + message.marketId = object.marketId ?? 0; + message.exchangePrices = object.exchangePrices?.map(e => ExchangePrice.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MarketPriceUpdateAmino): MarketPriceUpdate { + const message = createBaseMarketPriceUpdate(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + message.exchangePrices = object.exchange_prices?.map(e => ExchangePrice.fromAmino(e)) || []; + return message; + }, + toAmino(message: MarketPriceUpdate): MarketPriceUpdateAmino { + const obj: any = {}; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + if (message.exchangePrices) { + obj.exchange_prices = message.exchangePrices.map(e => e ? ExchangePrice.toAmino(e) : undefined); + } else { + obj.exchange_prices = message.exchangePrices; + } + return obj; + }, + fromAminoMsg(object: MarketPriceUpdateAminoMsg): MarketPriceUpdate { + return MarketPriceUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: MarketPriceUpdateProtoMsg): MarketPriceUpdate { + return MarketPriceUpdate.decode(message.value); + }, + toProto(message: MarketPriceUpdate): Uint8Array { + return MarketPriceUpdate.encode(message).finish(); + }, + toProtoMsg(message: MarketPriceUpdate): MarketPriceUpdateProtoMsg { + return { + typeUrl: "/dydxprotocol.daemons.pricefeed.MarketPriceUpdate", + value: MarketPriceUpdate.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/block_message_ids.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/block_message_ids.ts new file mode 100644 index 00000000..0c74c57e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/block_message_ids.ts @@ -0,0 +1,113 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * BlockMessageIds stores the id of each message that should be processed at a + * given block height. + */ +export interface BlockMessageIds { + /** + * ids stores a list of DelayedMessage ids that should be processed at a given + * block height. + */ + ids: number[]; +} +export interface BlockMessageIdsProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.BlockMessageIds"; + value: Uint8Array; +} +/** + * BlockMessageIds stores the id of each message that should be processed at a + * given block height. + */ +export interface BlockMessageIdsAmino { + /** + * ids stores a list of DelayedMessage ids that should be processed at a given + * block height. + */ + ids?: number[]; +} +export interface BlockMessageIdsAminoMsg { + type: "/dydxprotocol.delaymsg.BlockMessageIds"; + value: BlockMessageIdsAmino; +} +/** + * BlockMessageIds stores the id of each message that should be processed at a + * given block height. + */ +export interface BlockMessageIdsSDKType { + ids: number[]; +} +function createBaseBlockMessageIds(): BlockMessageIds { + return { + ids: [] + }; +} +export const BlockMessageIds = { + typeUrl: "/dydxprotocol.delaymsg.BlockMessageIds", + encode(message: BlockMessageIds, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.ids) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockMessageIds { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockMessageIds(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.ids.push(reader.uint32()); + } + } else { + message.ids.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockMessageIds { + const message = createBaseBlockMessageIds(); + message.ids = object.ids?.map(e => e) || []; + return message; + }, + fromAmino(object: BlockMessageIdsAmino): BlockMessageIds { + const message = createBaseBlockMessageIds(); + message.ids = object.ids?.map(e => e) || []; + return message; + }, + toAmino(message: BlockMessageIds): BlockMessageIdsAmino { + const obj: any = {}; + if (message.ids) { + obj.ids = message.ids.map(e => e); + } else { + obj.ids = message.ids; + } + return obj; + }, + fromAminoMsg(object: BlockMessageIdsAminoMsg): BlockMessageIds { + return BlockMessageIds.fromAmino(object.value); + }, + fromProtoMsg(message: BlockMessageIdsProtoMsg): BlockMessageIds { + return BlockMessageIds.decode(message.value); + }, + toProto(message: BlockMessageIds): Uint8Array { + return BlockMessageIds.encode(message).finish(); + }, + toProtoMsg(message: BlockMessageIds): BlockMessageIdsProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.BlockMessageIds", + value: BlockMessageIds.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/delayed_message.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/delayed_message.ts new file mode 100644 index 00000000..1dcb5802 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/delayed_message.ts @@ -0,0 +1,122 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** DelayedMessage is a message that is delayed until a certain block height. */ +export interface DelayedMessage { + /** The ID of the delayed message. */ + id: number; + /** The message to be executed. */ + msg?: Any; + /** The block height at which the message should be executed. */ + blockHeight: number; +} +export interface DelayedMessageProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.DelayedMessage"; + value: Uint8Array; +} +/** DelayedMessage is a message that is delayed until a certain block height. */ +export interface DelayedMessageAmino { + /** The ID of the delayed message. */ + id?: number; + /** The message to be executed. */ + msg?: AnyAmino; + /** The block height at which the message should be executed. */ + block_height?: number; +} +export interface DelayedMessageAminoMsg { + type: "/dydxprotocol.delaymsg.DelayedMessage"; + value: DelayedMessageAmino; +} +/** DelayedMessage is a message that is delayed until a certain block height. */ +export interface DelayedMessageSDKType { + id: number; + msg?: AnySDKType; + block_height: number; +} +function createBaseDelayedMessage(): DelayedMessage { + return { + id: 0, + msg: undefined, + blockHeight: 0 + }; +} +export const DelayedMessage = { + typeUrl: "/dydxprotocol.delaymsg.DelayedMessage", + encode(message: DelayedMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.msg !== undefined) { + Any.encode(message.msg, writer.uint32(18).fork()).ldelim(); + } + if (message.blockHeight !== 0) { + writer.uint32(24).uint32(message.blockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DelayedMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelayedMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.msg = Any.decode(reader, reader.uint32()); + break; + case 3: + message.blockHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelayedMessage { + const message = createBaseDelayedMessage(); + message.id = object.id ?? 0; + message.msg = object.msg !== undefined && object.msg !== null ? Any.fromPartial(object.msg) : undefined; + message.blockHeight = object.blockHeight ?? 0; + return message; + }, + fromAmino(object: DelayedMessageAmino): DelayedMessage { + const message = createBaseDelayedMessage(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = Any.fromAmino(object.msg); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + return message; + }, + toAmino(message: DelayedMessage): DelayedMessageAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.msg = message.msg ? Any.toAmino(message.msg) : undefined; + obj.block_height = message.blockHeight === 0 ? undefined : message.blockHeight; + return obj; + }, + fromAminoMsg(object: DelayedMessageAminoMsg): DelayedMessage { + return DelayedMessage.fromAmino(object.value); + }, + fromProtoMsg(message: DelayedMessageProtoMsg): DelayedMessage { + return DelayedMessage.decode(message.value); + }, + toProto(message: DelayedMessage): Uint8Array { + return DelayedMessage.encode(message).finish(); + }, + toProtoMsg(message: DelayedMessage): DelayedMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.DelayedMessage", + value: DelayedMessage.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/genesis.ts new file mode 100644 index 00000000..1ea45df4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/genesis.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { DelayedMessage, DelayedMessageAmino, DelayedMessageSDKType } from "./delayed_message"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the delaymsg module's genesis state. */ +export interface GenesisState { + /** delayed_messages is a list of delayed messages. */ + delayedMessages: DelayedMessage[]; + /** next_delayed_message_id is the id to be assigned to next delayed message. */ + nextDelayedMessageId: number; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the delaymsg module's genesis state. */ +export interface GenesisStateAmino { + /** delayed_messages is a list of delayed messages. */ + delayed_messages?: DelayedMessageAmino[]; + /** next_delayed_message_id is the id to be assigned to next delayed message. */ + next_delayed_message_id?: number; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.delaymsg.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the delaymsg module's genesis state. */ +export interface GenesisStateSDKType { + delayed_messages: DelayedMessageSDKType[]; + next_delayed_message_id: number; +} +function createBaseGenesisState(): GenesisState { + return { + delayedMessages: [], + nextDelayedMessageId: 0 + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.delaymsg.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delayedMessages) { + DelayedMessage.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextDelayedMessageId !== 0) { + writer.uint32(16).uint32(message.nextDelayedMessageId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delayedMessages.push(DelayedMessage.decode(reader, reader.uint32())); + break; + case 2: + message.nextDelayedMessageId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.delayedMessages = object.delayedMessages?.map(e => DelayedMessage.fromPartial(e)) || []; + message.nextDelayedMessageId = object.nextDelayedMessageId ?? 0; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.delayedMessages = object.delayed_messages?.map(e => DelayedMessage.fromAmino(e)) || []; + if (object.next_delayed_message_id !== undefined && object.next_delayed_message_id !== null) { + message.nextDelayedMessageId = object.next_delayed_message_id; + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.delayedMessages) { + obj.delayed_messages = message.delayedMessages.map(e => e ? DelayedMessage.toAmino(e) : undefined); + } else { + obj.delayed_messages = message.delayedMessages; + } + obj.next_delayed_message_id = message.nextDelayedMessageId === 0 ? undefined : message.nextDelayedMessageId; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/query.rpc.Query.ts new file mode 100644 index 00000000..9951bebb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/query.rpc.Query.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryNextDelayedMessageIdRequest, QueryNextDelayedMessageIdResponse, QueryMessageRequest, QueryMessageResponse, QueryBlockMessageIdsRequest, QueryBlockMessageIdsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the next DelayedMessage's id. */ + nextDelayedMessageId(request?: QueryNextDelayedMessageIdRequest): Promise; + /** Queries the DelayedMessage by id. */ + message(request: QueryMessageRequest): Promise; + /** Queries the DelayedMessages at a given block height. */ + blockMessageIds(request: QueryBlockMessageIdsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.nextDelayedMessageId = this.nextDelayedMessageId.bind(this); + this.message = this.message.bind(this); + this.blockMessageIds = this.blockMessageIds.bind(this); + } + nextDelayedMessageId(request: QueryNextDelayedMessageIdRequest = {}): Promise { + const data = QueryNextDelayedMessageIdRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.delaymsg.Query", "NextDelayedMessageId", data); + return promise.then(data => QueryNextDelayedMessageIdResponse.decode(new BinaryReader(data))); + } + message(request: QueryMessageRequest): Promise { + const data = QueryMessageRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.delaymsg.Query", "Message", data); + return promise.then(data => QueryMessageResponse.decode(new BinaryReader(data))); + } + blockMessageIds(request: QueryBlockMessageIdsRequest): Promise { + const data = QueryBlockMessageIdsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.delaymsg.Query", "BlockMessageIds", data); + return promise.then(data => QueryBlockMessageIdsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + nextDelayedMessageId(request?: QueryNextDelayedMessageIdRequest): Promise { + return queryService.nextDelayedMessageId(request); + }, + message(request: QueryMessageRequest): Promise { + return queryService.message(request); + }, + blockMessageIds(request: QueryBlockMessageIdsRequest): Promise { + return queryService.blockMessageIds(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/query.ts new file mode 100644 index 00000000..099d37c8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/query.ts @@ -0,0 +1,529 @@ +//@ts-nocheck +import { DelayedMessage, DelayedMessageAmino, DelayedMessageSDKType } from "./delayed_message"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * QueryNextDelayedMessageIdRequest is the request type for the + * NextDelayedMessageId RPC method. + */ +export interface QueryNextDelayedMessageIdRequest {} +export interface QueryNextDelayedMessageIdRequestProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdRequest"; + value: Uint8Array; +} +/** + * QueryNextDelayedMessageIdRequest is the request type for the + * NextDelayedMessageId RPC method. + */ +export interface QueryNextDelayedMessageIdRequestAmino {} +export interface QueryNextDelayedMessageIdRequestAminoMsg { + type: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdRequest"; + value: QueryNextDelayedMessageIdRequestAmino; +} +/** + * QueryNextDelayedMessageIdRequest is the request type for the + * NextDelayedMessageId RPC method. + */ +export interface QueryNextDelayedMessageIdRequestSDKType {} +/** + * QueryNextDelayedMessageIdResponse is the response type for the + * NextDelayedMessageId RPC method. + */ +export interface QueryNextDelayedMessageIdResponse { + nextDelayedMessageId: number; +} +export interface QueryNextDelayedMessageIdResponseProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdResponse"; + value: Uint8Array; +} +/** + * QueryNextDelayedMessageIdResponse is the response type for the + * NextDelayedMessageId RPC method. + */ +export interface QueryNextDelayedMessageIdResponseAmino { + next_delayed_message_id?: number; +} +export interface QueryNextDelayedMessageIdResponseAminoMsg { + type: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdResponse"; + value: QueryNextDelayedMessageIdResponseAmino; +} +/** + * QueryNextDelayedMessageIdResponse is the response type for the + * NextDelayedMessageId RPC method. + */ +export interface QueryNextDelayedMessageIdResponseSDKType { + next_delayed_message_id: number; +} +/** QueryMessageRequest is the request type for the Message RPC method. */ +export interface QueryMessageRequest { + id: number; +} +export interface QueryMessageRequestProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.QueryMessageRequest"; + value: Uint8Array; +} +/** QueryMessageRequest is the request type for the Message RPC method. */ +export interface QueryMessageRequestAmino { + id?: number; +} +export interface QueryMessageRequestAminoMsg { + type: "/dydxprotocol.delaymsg.QueryMessageRequest"; + value: QueryMessageRequestAmino; +} +/** QueryMessageRequest is the request type for the Message RPC method. */ +export interface QueryMessageRequestSDKType { + id: number; +} +/** QueryGetMessageResponse is the response type for the Message RPC method. */ +export interface QueryMessageResponse { + message?: DelayedMessage; +} +export interface QueryMessageResponseProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.QueryMessageResponse"; + value: Uint8Array; +} +/** QueryGetMessageResponse is the response type for the Message RPC method. */ +export interface QueryMessageResponseAmino { + message?: DelayedMessageAmino; +} +export interface QueryMessageResponseAminoMsg { + type: "/dydxprotocol.delaymsg.QueryMessageResponse"; + value: QueryMessageResponseAmino; +} +/** QueryGetMessageResponse is the response type for the Message RPC method. */ +export interface QueryMessageResponseSDKType { + message?: DelayedMessageSDKType; +} +/** + * QueryBlockMessageIdsRequest is the request type for the BlockMessageIds + * RPC method. + */ +export interface QueryBlockMessageIdsRequest { + blockHeight: number; +} +export interface QueryBlockMessageIdsRequestProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.QueryBlockMessageIdsRequest"; + value: Uint8Array; +} +/** + * QueryBlockMessageIdsRequest is the request type for the BlockMessageIds + * RPC method. + */ +export interface QueryBlockMessageIdsRequestAmino { + block_height?: number; +} +export interface QueryBlockMessageIdsRequestAminoMsg { + type: "/dydxprotocol.delaymsg.QueryBlockMessageIdsRequest"; + value: QueryBlockMessageIdsRequestAmino; +} +/** + * QueryBlockMessageIdsRequest is the request type for the BlockMessageIds + * RPC method. + */ +export interface QueryBlockMessageIdsRequestSDKType { + block_height: number; +} +/** + * QueryGetBlockMessageIdsResponse is the response type for the BlockMessageIds + * RPC method. + */ +export interface QueryBlockMessageIdsResponse { + messageIds: number[]; +} +export interface QueryBlockMessageIdsResponseProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.QueryBlockMessageIdsResponse"; + value: Uint8Array; +} +/** + * QueryGetBlockMessageIdsResponse is the response type for the BlockMessageIds + * RPC method. + */ +export interface QueryBlockMessageIdsResponseAmino { + message_ids?: number[]; +} +export interface QueryBlockMessageIdsResponseAminoMsg { + type: "/dydxprotocol.delaymsg.QueryBlockMessageIdsResponse"; + value: QueryBlockMessageIdsResponseAmino; +} +/** + * QueryGetBlockMessageIdsResponse is the response type for the BlockMessageIds + * RPC method. + */ +export interface QueryBlockMessageIdsResponseSDKType { + message_ids: number[]; +} +function createBaseQueryNextDelayedMessageIdRequest(): QueryNextDelayedMessageIdRequest { + return {}; +} +export const QueryNextDelayedMessageIdRequest = { + typeUrl: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdRequest", + encode(_: QueryNextDelayedMessageIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextDelayedMessageIdRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextDelayedMessageIdRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryNextDelayedMessageIdRequest { + const message = createBaseQueryNextDelayedMessageIdRequest(); + return message; + }, + fromAmino(_: QueryNextDelayedMessageIdRequestAmino): QueryNextDelayedMessageIdRequest { + const message = createBaseQueryNextDelayedMessageIdRequest(); + return message; + }, + toAmino(_: QueryNextDelayedMessageIdRequest): QueryNextDelayedMessageIdRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryNextDelayedMessageIdRequestAminoMsg): QueryNextDelayedMessageIdRequest { + return QueryNextDelayedMessageIdRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNextDelayedMessageIdRequestProtoMsg): QueryNextDelayedMessageIdRequest { + return QueryNextDelayedMessageIdRequest.decode(message.value); + }, + toProto(message: QueryNextDelayedMessageIdRequest): Uint8Array { + return QueryNextDelayedMessageIdRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNextDelayedMessageIdRequest): QueryNextDelayedMessageIdRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdRequest", + value: QueryNextDelayedMessageIdRequest.encode(message).finish() + }; + } +}; +function createBaseQueryNextDelayedMessageIdResponse(): QueryNextDelayedMessageIdResponse { + return { + nextDelayedMessageId: 0 + }; +} +export const QueryNextDelayedMessageIdResponse = { + typeUrl: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdResponse", + encode(message: QueryNextDelayedMessageIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextDelayedMessageId !== 0) { + writer.uint32(8).uint32(message.nextDelayedMessageId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextDelayedMessageIdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextDelayedMessageIdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextDelayedMessageId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextDelayedMessageIdResponse { + const message = createBaseQueryNextDelayedMessageIdResponse(); + message.nextDelayedMessageId = object.nextDelayedMessageId ?? 0; + return message; + }, + fromAmino(object: QueryNextDelayedMessageIdResponseAmino): QueryNextDelayedMessageIdResponse { + const message = createBaseQueryNextDelayedMessageIdResponse(); + if (object.next_delayed_message_id !== undefined && object.next_delayed_message_id !== null) { + message.nextDelayedMessageId = object.next_delayed_message_id; + } + return message; + }, + toAmino(message: QueryNextDelayedMessageIdResponse): QueryNextDelayedMessageIdResponseAmino { + const obj: any = {}; + obj.next_delayed_message_id = message.nextDelayedMessageId === 0 ? undefined : message.nextDelayedMessageId; + return obj; + }, + fromAminoMsg(object: QueryNextDelayedMessageIdResponseAminoMsg): QueryNextDelayedMessageIdResponse { + return QueryNextDelayedMessageIdResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNextDelayedMessageIdResponseProtoMsg): QueryNextDelayedMessageIdResponse { + return QueryNextDelayedMessageIdResponse.decode(message.value); + }, + toProto(message: QueryNextDelayedMessageIdResponse): Uint8Array { + return QueryNextDelayedMessageIdResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNextDelayedMessageIdResponse): QueryNextDelayedMessageIdResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.QueryNextDelayedMessageIdResponse", + value: QueryNextDelayedMessageIdResponse.encode(message).finish() + }; + } +}; +function createBaseQueryMessageRequest(): QueryMessageRequest { + return { + id: 0 + }; +} +export const QueryMessageRequest = { + typeUrl: "/dydxprotocol.delaymsg.QueryMessageRequest", + encode(message: QueryMessageRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMessageRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMessageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMessageRequest { + const message = createBaseQueryMessageRequest(); + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: QueryMessageRequestAmino): QueryMessageRequest { + const message = createBaseQueryMessageRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryMessageRequest): QueryMessageRequestAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryMessageRequestAminoMsg): QueryMessageRequest { + return QueryMessageRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMessageRequestProtoMsg): QueryMessageRequest { + return QueryMessageRequest.decode(message.value); + }, + toProto(message: QueryMessageRequest): Uint8Array { + return QueryMessageRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMessageRequest): QueryMessageRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.QueryMessageRequest", + value: QueryMessageRequest.encode(message).finish() + }; + } +}; +function createBaseQueryMessageResponse(): QueryMessageResponse { + return { + message: undefined + }; +} +export const QueryMessageResponse = { + typeUrl: "/dydxprotocol.delaymsg.QueryMessageResponse", + encode(message: QueryMessageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== undefined) { + DelayedMessage.encode(message.message, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMessageResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = DelayedMessage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMessageResponse { + const message = createBaseQueryMessageResponse(); + message.message = object.message !== undefined && object.message !== null ? DelayedMessage.fromPartial(object.message) : undefined; + return message; + }, + fromAmino(object: QueryMessageResponseAmino): QueryMessageResponse { + const message = createBaseQueryMessageResponse(); + if (object.message !== undefined && object.message !== null) { + message.message = DelayedMessage.fromAmino(object.message); + } + return message; + }, + toAmino(message: QueryMessageResponse): QueryMessageResponseAmino { + const obj: any = {}; + obj.message = message.message ? DelayedMessage.toAmino(message.message) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMessageResponseAminoMsg): QueryMessageResponse { + return QueryMessageResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMessageResponseProtoMsg): QueryMessageResponse { + return QueryMessageResponse.decode(message.value); + }, + toProto(message: QueryMessageResponse): Uint8Array { + return QueryMessageResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMessageResponse): QueryMessageResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.QueryMessageResponse", + value: QueryMessageResponse.encode(message).finish() + }; + } +}; +function createBaseQueryBlockMessageIdsRequest(): QueryBlockMessageIdsRequest { + return { + blockHeight: 0 + }; +} +export const QueryBlockMessageIdsRequest = { + typeUrl: "/dydxprotocol.delaymsg.QueryBlockMessageIdsRequest", + encode(message: QueryBlockMessageIdsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== 0) { + writer.uint32(8).uint32(message.blockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBlockMessageIdsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBlockMessageIdsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBlockMessageIdsRequest { + const message = createBaseQueryBlockMessageIdsRequest(); + message.blockHeight = object.blockHeight ?? 0; + return message; + }, + fromAmino(object: QueryBlockMessageIdsRequestAmino): QueryBlockMessageIdsRequest { + const message = createBaseQueryBlockMessageIdsRequest(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + return message; + }, + toAmino(message: QueryBlockMessageIdsRequest): QueryBlockMessageIdsRequestAmino { + const obj: any = {}; + obj.block_height = message.blockHeight === 0 ? undefined : message.blockHeight; + return obj; + }, + fromAminoMsg(object: QueryBlockMessageIdsRequestAminoMsg): QueryBlockMessageIdsRequest { + return QueryBlockMessageIdsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBlockMessageIdsRequestProtoMsg): QueryBlockMessageIdsRequest { + return QueryBlockMessageIdsRequest.decode(message.value); + }, + toProto(message: QueryBlockMessageIdsRequest): Uint8Array { + return QueryBlockMessageIdsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBlockMessageIdsRequest): QueryBlockMessageIdsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.QueryBlockMessageIdsRequest", + value: QueryBlockMessageIdsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryBlockMessageIdsResponse(): QueryBlockMessageIdsResponse { + return { + messageIds: [] + }; +} +export const QueryBlockMessageIdsResponse = { + typeUrl: "/dydxprotocol.delaymsg.QueryBlockMessageIdsResponse", + encode(message: QueryBlockMessageIdsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.messageIds) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBlockMessageIdsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBlockMessageIdsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.messageIds.push(reader.uint32()); + } + } else { + message.messageIds.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBlockMessageIdsResponse { + const message = createBaseQueryBlockMessageIdsResponse(); + message.messageIds = object.messageIds?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryBlockMessageIdsResponseAmino): QueryBlockMessageIdsResponse { + const message = createBaseQueryBlockMessageIdsResponse(); + message.messageIds = object.message_ids?.map(e => e) || []; + return message; + }, + toAmino(message: QueryBlockMessageIdsResponse): QueryBlockMessageIdsResponseAmino { + const obj: any = {}; + if (message.messageIds) { + obj.message_ids = message.messageIds.map(e => e); + } else { + obj.message_ids = message.messageIds; + } + return obj; + }, + fromAminoMsg(object: QueryBlockMessageIdsResponseAminoMsg): QueryBlockMessageIdsResponse { + return QueryBlockMessageIdsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryBlockMessageIdsResponseProtoMsg): QueryBlockMessageIdsResponse { + return QueryBlockMessageIdsResponse.decode(message.value); + }, + toProto(message: QueryBlockMessageIdsResponse): Uint8Array { + return QueryBlockMessageIdsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBlockMessageIdsResponse): QueryBlockMessageIdsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.QueryBlockMessageIdsResponse", + value: QueryBlockMessageIdsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.amino.ts new file mode 100644 index 00000000..edbfb962 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgDelayMessage } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.delaymsg.MsgDelayMessage": { + aminoType: "/dydxprotocol.delaymsg.MsgDelayMessage", + toAmino: MsgDelayMessage.toAmino, + fromAmino: MsgDelayMessage.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.registry.ts new file mode 100644 index 00000000..3d8e8ec7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgDelayMessage } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.delaymsg.MsgDelayMessage", MsgDelayMessage]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + delayMessage(value: MsgDelayMessage) { + return { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessage", + value: MsgDelayMessage.encode(value).finish() + }; + } + }, + withTypeUrl: { + delayMessage(value: MsgDelayMessage) { + return { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessage", + value + }; + } + }, + fromPartial: { + delayMessage(value: MsgDelayMessage) { + return { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessage", + value: MsgDelayMessage.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.rpc.msg.ts new file mode 100644 index 00000000..11ab6376 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.rpc.msg.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgDelayMessage, MsgDelayMessageResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * DelayMessage delays the execution of a message for a given number of + * blocks. + */ + delayMessage(request: MsgDelayMessage): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.delayMessage = this.delayMessage.bind(this); + } + delayMessage(request: MsgDelayMessage): Promise { + const data = MsgDelayMessage.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.delaymsg.Msg", "DelayMessage", data); + return promise.then(data => MsgDelayMessageResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.ts new file mode 100644 index 00000000..da7940f2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/delaymsg/tx.ts @@ -0,0 +1,205 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgDelayMessage is a request type for the DelayMessage method. */ +export interface MsgDelayMessage { + authority: string; + /** The message to be delayed. */ + msg?: Any; + /** The number of blocks to delay the message for. */ + delayBlocks: number; +} +export interface MsgDelayMessageProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessage"; + value: Uint8Array; +} +/** MsgDelayMessage is a request type for the DelayMessage method. */ +export interface MsgDelayMessageAmino { + authority?: string; + /** The message to be delayed. */ + msg?: AnyAmino; + /** The number of blocks to delay the message for. */ + delay_blocks?: number; +} +export interface MsgDelayMessageAminoMsg { + type: "/dydxprotocol.delaymsg.MsgDelayMessage"; + value: MsgDelayMessageAmino; +} +/** MsgDelayMessage is a request type for the DelayMessage method. */ +export interface MsgDelayMessageSDKType { + authority: string; + msg?: AnySDKType; + delay_blocks: number; +} +/** MsgDelayMessageResponse is a response type for the DelayMessage method. */ +export interface MsgDelayMessageResponse { + /** The id of the created delayed message. */ + id: bigint; +} +export interface MsgDelayMessageResponseProtoMsg { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessageResponse"; + value: Uint8Array; +} +/** MsgDelayMessageResponse is a response type for the DelayMessage method. */ +export interface MsgDelayMessageResponseAmino { + /** The id of the created delayed message. */ + id?: string; +} +export interface MsgDelayMessageResponseAminoMsg { + type: "/dydxprotocol.delaymsg.MsgDelayMessageResponse"; + value: MsgDelayMessageResponseAmino; +} +/** MsgDelayMessageResponse is a response type for the DelayMessage method. */ +export interface MsgDelayMessageResponseSDKType { + id: bigint; +} +function createBaseMsgDelayMessage(): MsgDelayMessage { + return { + authority: "", + msg: undefined, + delayBlocks: 0 + }; +} +export const MsgDelayMessage = { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessage", + encode(message: MsgDelayMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.msg !== undefined) { + Any.encode(message.msg, writer.uint32(18).fork()).ldelim(); + } + if (message.delayBlocks !== 0) { + writer.uint32(24).uint32(message.delayBlocks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelayMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelayMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.msg = Any.decode(reader, reader.uint32()); + break; + case 3: + message.delayBlocks = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDelayMessage { + const message = createBaseMsgDelayMessage(); + message.authority = object.authority ?? ""; + message.msg = object.msg !== undefined && object.msg !== null ? Any.fromPartial(object.msg) : undefined; + message.delayBlocks = object.delayBlocks ?? 0; + return message; + }, + fromAmino(object: MsgDelayMessageAmino): MsgDelayMessage { + const message = createBaseMsgDelayMessage(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = Any.fromAmino(object.msg); + } + if (object.delay_blocks !== undefined && object.delay_blocks !== null) { + message.delayBlocks = object.delay_blocks; + } + return message; + }, + toAmino(message: MsgDelayMessage): MsgDelayMessageAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.msg = message.msg ? Any.toAmino(message.msg) : undefined; + obj.delay_blocks = message.delayBlocks === 0 ? undefined : message.delayBlocks; + return obj; + }, + fromAminoMsg(object: MsgDelayMessageAminoMsg): MsgDelayMessage { + return MsgDelayMessage.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDelayMessageProtoMsg): MsgDelayMessage { + return MsgDelayMessage.decode(message.value); + }, + toProto(message: MsgDelayMessage): Uint8Array { + return MsgDelayMessage.encode(message).finish(); + }, + toProtoMsg(message: MsgDelayMessage): MsgDelayMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessage", + value: MsgDelayMessage.encode(message).finish() + }; + } +}; +function createBaseMsgDelayMessageResponse(): MsgDelayMessageResponse { + return { + id: BigInt(0) + }; +} +export const MsgDelayMessageResponse = { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessageResponse", + encode(message: MsgDelayMessageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelayMessageResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelayMessageResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDelayMessageResponse { + const message = createBaseMsgDelayMessageResponse(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgDelayMessageResponseAmino): MsgDelayMessageResponse { + const message = createBaseMsgDelayMessageResponse(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: MsgDelayMessageResponse): MsgDelayMessageResponseAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgDelayMessageResponseAminoMsg): MsgDelayMessageResponse { + return MsgDelayMessageResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDelayMessageResponseProtoMsg): MsgDelayMessageResponse { + return MsgDelayMessageResponse.decode(message.value); + }, + toProto(message: MsgDelayMessageResponse): Uint8Array { + return MsgDelayMessageResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDelayMessageResponse): MsgDelayMessageResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.delaymsg.MsgDelayMessageResponse", + value: MsgDelayMessageResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/epoch_info.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/epoch_info.ts new file mode 100644 index 00000000..2c11558c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/epoch_info.ts @@ -0,0 +1,239 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** EpochInfo stores metadata of an epoch timer. */ +export interface EpochInfo { + /** name is the unique identifier. */ + name: string; + /** + * next_tick indicates when the next epoch starts (in Unix Epoch seconds), + * if `EpochInfo` has been initialized. + * If `EpochInfo` is not initialized yet, `next_tick` indicates the earliest + * initialization time (see `is_initialized` below). + */ + nextTick: number; + /** duration of the epoch in seconds. */ + duration: number; + /** + * current epoch is the number of the current epoch. + * 0 if `next_tick` has never been reached, positive otherwise. + */ + currentEpoch: number; + /** + * current_epoch_start_block indicates the block height when the current + * epoch started. 0 if `current_epoch` is 0. + */ + currentEpochStartBlock: number; + /** + * is_initialized indicates whether the `EpochInfo` has been initialized + * and started ticking. + * An `EpochInfo` is initialized when all below conditions are true: + * - Not yet initialized + * - `BlockHeight` >= 2 + * - `BlockTime` >= `next_tick` + */ + isInitialized: boolean; + /** + * fast_forward_next_tick specifies whether during initialization, `next_tick` + * should be fast-forwarded to be greater than the current block time. + * If `false`, the original `next_tick` value is + * unchanged during initialization. + * If `true`, `next_tick` will be set to the smallest value `x` greater than + * the current block time such that `(x - next_tick) % duration = 0`. + */ + fastForwardNextTick: boolean; +} +export interface EpochInfoProtoMsg { + typeUrl: "/dydxprotocol.epochs.EpochInfo"; + value: Uint8Array; +} +/** EpochInfo stores metadata of an epoch timer. */ +export interface EpochInfoAmino { + /** name is the unique identifier. */ + name?: string; + /** + * next_tick indicates when the next epoch starts (in Unix Epoch seconds), + * if `EpochInfo` has been initialized. + * If `EpochInfo` is not initialized yet, `next_tick` indicates the earliest + * initialization time (see `is_initialized` below). + */ + next_tick?: number; + /** duration of the epoch in seconds. */ + duration?: number; + /** + * current epoch is the number of the current epoch. + * 0 if `next_tick` has never been reached, positive otherwise. + */ + current_epoch?: number; + /** + * current_epoch_start_block indicates the block height when the current + * epoch started. 0 if `current_epoch` is 0. + */ + current_epoch_start_block?: number; + /** + * is_initialized indicates whether the `EpochInfo` has been initialized + * and started ticking. + * An `EpochInfo` is initialized when all below conditions are true: + * - Not yet initialized + * - `BlockHeight` >= 2 + * - `BlockTime` >= `next_tick` + */ + is_initialized?: boolean; + /** + * fast_forward_next_tick specifies whether during initialization, `next_tick` + * should be fast-forwarded to be greater than the current block time. + * If `false`, the original `next_tick` value is + * unchanged during initialization. + * If `true`, `next_tick` will be set to the smallest value `x` greater than + * the current block time such that `(x - next_tick) % duration = 0`. + */ + fast_forward_next_tick?: boolean; +} +export interface EpochInfoAminoMsg { + type: "/dydxprotocol.epochs.EpochInfo"; + value: EpochInfoAmino; +} +/** EpochInfo stores metadata of an epoch timer. */ +export interface EpochInfoSDKType { + name: string; + next_tick: number; + duration: number; + current_epoch: number; + current_epoch_start_block: number; + is_initialized: boolean; + fast_forward_next_tick: boolean; +} +function createBaseEpochInfo(): EpochInfo { + return { + name: "", + nextTick: 0, + duration: 0, + currentEpoch: 0, + currentEpochStartBlock: 0, + isInitialized: false, + fastForwardNextTick: false + }; +} +export const EpochInfo = { + typeUrl: "/dydxprotocol.epochs.EpochInfo", + encode(message: EpochInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.nextTick !== 0) { + writer.uint32(16).uint32(message.nextTick); + } + if (message.duration !== 0) { + writer.uint32(24).uint32(message.duration); + } + if (message.currentEpoch !== 0) { + writer.uint32(32).uint32(message.currentEpoch); + } + if (message.currentEpochStartBlock !== 0) { + writer.uint32(40).uint32(message.currentEpochStartBlock); + } + if (message.isInitialized === true) { + writer.uint32(48).bool(message.isInitialized); + } + if (message.fastForwardNextTick === true) { + writer.uint32(56).bool(message.fastForwardNextTick); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EpochInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEpochInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.nextTick = reader.uint32(); + break; + case 3: + message.duration = reader.uint32(); + break; + case 4: + message.currentEpoch = reader.uint32(); + break; + case 5: + message.currentEpochStartBlock = reader.uint32(); + break; + case 6: + message.isInitialized = reader.bool(); + break; + case 7: + message.fastForwardNextTick = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EpochInfo { + const message = createBaseEpochInfo(); + message.name = object.name ?? ""; + message.nextTick = object.nextTick ?? 0; + message.duration = object.duration ?? 0; + message.currentEpoch = object.currentEpoch ?? 0; + message.currentEpochStartBlock = object.currentEpochStartBlock ?? 0; + message.isInitialized = object.isInitialized ?? false; + message.fastForwardNextTick = object.fastForwardNextTick ?? false; + return message; + }, + fromAmino(object: EpochInfoAmino): EpochInfo { + const message = createBaseEpochInfo(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.next_tick !== undefined && object.next_tick !== null) { + message.nextTick = object.next_tick; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = object.duration; + } + if (object.current_epoch !== undefined && object.current_epoch !== null) { + message.currentEpoch = object.current_epoch; + } + if (object.current_epoch_start_block !== undefined && object.current_epoch_start_block !== null) { + message.currentEpochStartBlock = object.current_epoch_start_block; + } + if (object.is_initialized !== undefined && object.is_initialized !== null) { + message.isInitialized = object.is_initialized; + } + if (object.fast_forward_next_tick !== undefined && object.fast_forward_next_tick !== null) { + message.fastForwardNextTick = object.fast_forward_next_tick; + } + return message; + }, + toAmino(message: EpochInfo): EpochInfoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.next_tick = message.nextTick === 0 ? undefined : message.nextTick; + obj.duration = message.duration === 0 ? undefined : message.duration; + obj.current_epoch = message.currentEpoch === 0 ? undefined : message.currentEpoch; + obj.current_epoch_start_block = message.currentEpochStartBlock === 0 ? undefined : message.currentEpochStartBlock; + obj.is_initialized = message.isInitialized === false ? undefined : message.isInitialized; + obj.fast_forward_next_tick = message.fastForwardNextTick === false ? undefined : message.fastForwardNextTick; + return obj; + }, + fromAminoMsg(object: EpochInfoAminoMsg): EpochInfo { + return EpochInfo.fromAmino(object.value); + }, + fromProtoMsg(message: EpochInfoProtoMsg): EpochInfo { + return EpochInfo.decode(message.value); + }, + toProto(message: EpochInfo): Uint8Array { + return EpochInfo.encode(message).finish(); + }, + toProtoMsg(message: EpochInfo): EpochInfoProtoMsg { + return { + typeUrl: "/dydxprotocol.epochs.EpochInfo", + value: EpochInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/genesis.ts new file mode 100644 index 00000000..2bf7801c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/genesis.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { EpochInfo, EpochInfoAmino, EpochInfoSDKType } from "./epoch_info"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the epochs module's genesis state. */ +export interface GenesisState { + epochInfoList: EpochInfo[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.epochs.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the epochs module's genesis state. */ +export interface GenesisStateAmino { + epoch_info_list?: EpochInfoAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.epochs.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the epochs module's genesis state. */ +export interface GenesisStateSDKType { + epoch_info_list: EpochInfoSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + epochInfoList: [] + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.epochs.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.epochInfoList) { + EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochInfoList.push(EpochInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.epochInfoList = object.epochInfoList?.map(e => EpochInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.epochInfoList = object.epoch_info_list?.map(e => EpochInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.epochInfoList) { + obj.epoch_info_list = message.epochInfoList.map(e => e ? EpochInfo.toAmino(e) : undefined); + } else { + obj.epoch_info_list = message.epochInfoList; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.epochs.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/query.rpc.Query.ts new file mode 100644 index 00000000..f6e87fbd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/query.rpc.Query.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryGetEpochInfoRequest, QueryEpochInfoResponse, QueryAllEpochInfoRequest, QueryEpochInfoAllResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a EpochInfo by name. */ + epochInfo(request: QueryGetEpochInfoRequest): Promise; + /** Queries a list of EpochInfo items. */ + epochInfoAll(request?: QueryAllEpochInfoRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.epochInfo = this.epochInfo.bind(this); + this.epochInfoAll = this.epochInfoAll.bind(this); + } + epochInfo(request: QueryGetEpochInfoRequest): Promise { + const data = QueryGetEpochInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.epochs.Query", "EpochInfo", data); + return promise.then(data => QueryEpochInfoResponse.decode(new BinaryReader(data))); + } + epochInfoAll(request: QueryAllEpochInfoRequest = { + pagination: undefined + }): Promise { + const data = QueryAllEpochInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.epochs.Query", "EpochInfoAll", data); + return promise.then(data => QueryEpochInfoAllResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + epochInfo(request: QueryGetEpochInfoRequest): Promise { + return queryService.epochInfo(request); + }, + epochInfoAll(request?: QueryAllEpochInfoRequest): Promise { + return queryService.epochInfoAll(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/query.ts new file mode 100644 index 00000000..25b16d5e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/epochs/query.ts @@ -0,0 +1,353 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { EpochInfo, EpochInfoAmino, EpochInfoSDKType } from "./epoch_info"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryGetEpochInfoRequest is request type for the GetEpochInfo RPC method. */ +export interface QueryGetEpochInfoRequest { + name: string; +} +export interface QueryGetEpochInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.epochs.QueryGetEpochInfoRequest"; + value: Uint8Array; +} +/** QueryGetEpochInfoRequest is request type for the GetEpochInfo RPC method. */ +export interface QueryGetEpochInfoRequestAmino { + name?: string; +} +export interface QueryGetEpochInfoRequestAminoMsg { + type: "/dydxprotocol.epochs.QueryGetEpochInfoRequest"; + value: QueryGetEpochInfoRequestAmino; +} +/** QueryGetEpochInfoRequest is request type for the GetEpochInfo RPC method. */ +export interface QueryGetEpochInfoRequestSDKType { + name: string; +} +/** QueryEpochInfoResponse is response type for the GetEpochInfo RPC method. */ +export interface QueryEpochInfoResponse { + epochInfo: EpochInfo; +} +export interface QueryEpochInfoResponseProtoMsg { + typeUrl: "/dydxprotocol.epochs.QueryEpochInfoResponse"; + value: Uint8Array; +} +/** QueryEpochInfoResponse is response type for the GetEpochInfo RPC method. */ +export interface QueryEpochInfoResponseAmino { + epoch_info?: EpochInfoAmino; +} +export interface QueryEpochInfoResponseAminoMsg { + type: "/dydxprotocol.epochs.QueryEpochInfoResponse"; + value: QueryEpochInfoResponseAmino; +} +/** QueryEpochInfoResponse is response type for the GetEpochInfo RPC method. */ +export interface QueryEpochInfoResponseSDKType { + epoch_info: EpochInfoSDKType; +} +/** QueryAllEpochInfoRequest is request type for the AllEpochInfo RPC method. */ +export interface QueryAllEpochInfoRequest { + pagination?: PageRequest; +} +export interface QueryAllEpochInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.epochs.QueryAllEpochInfoRequest"; + value: Uint8Array; +} +/** QueryAllEpochInfoRequest is request type for the AllEpochInfo RPC method. */ +export interface QueryAllEpochInfoRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllEpochInfoRequestAminoMsg { + type: "/dydxprotocol.epochs.QueryAllEpochInfoRequest"; + value: QueryAllEpochInfoRequestAmino; +} +/** QueryAllEpochInfoRequest is request type for the AllEpochInfo RPC method. */ +export interface QueryAllEpochInfoRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryEpochInfoAllResponse is response type for the AllEpochInfo RPC method. */ +export interface QueryEpochInfoAllResponse { + epochInfo: EpochInfo[]; + pagination?: PageResponse; +} +export interface QueryEpochInfoAllResponseProtoMsg { + typeUrl: "/dydxprotocol.epochs.QueryEpochInfoAllResponse"; + value: Uint8Array; +} +/** QueryEpochInfoAllResponse is response type for the AllEpochInfo RPC method. */ +export interface QueryEpochInfoAllResponseAmino { + epoch_info?: EpochInfoAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryEpochInfoAllResponseAminoMsg { + type: "/dydxprotocol.epochs.QueryEpochInfoAllResponse"; + value: QueryEpochInfoAllResponseAmino; +} +/** QueryEpochInfoAllResponse is response type for the AllEpochInfo RPC method. */ +export interface QueryEpochInfoAllResponseSDKType { + epoch_info: EpochInfoSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryGetEpochInfoRequest(): QueryGetEpochInfoRequest { + return { + name: "" + }; +} +export const QueryGetEpochInfoRequest = { + typeUrl: "/dydxprotocol.epochs.QueryGetEpochInfoRequest", + encode(message: QueryGetEpochInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetEpochInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetEpochInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetEpochInfoRequest { + const message = createBaseQueryGetEpochInfoRequest(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: QueryGetEpochInfoRequestAmino): QueryGetEpochInfoRequest { + const message = createBaseQueryGetEpochInfoRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: QueryGetEpochInfoRequest): QueryGetEpochInfoRequestAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: QueryGetEpochInfoRequestAminoMsg): QueryGetEpochInfoRequest { + return QueryGetEpochInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetEpochInfoRequestProtoMsg): QueryGetEpochInfoRequest { + return QueryGetEpochInfoRequest.decode(message.value); + }, + toProto(message: QueryGetEpochInfoRequest): Uint8Array { + return QueryGetEpochInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetEpochInfoRequest): QueryGetEpochInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.epochs.QueryGetEpochInfoRequest", + value: QueryGetEpochInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEpochInfoResponse(): QueryEpochInfoResponse { + return { + epochInfo: EpochInfo.fromPartial({}) + }; +} +export const QueryEpochInfoResponse = { + typeUrl: "/dydxprotocol.epochs.QueryEpochInfoResponse", + encode(message: QueryEpochInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochInfo !== undefined) { + EpochInfo.encode(message.epochInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEpochInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEpochInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochInfo = EpochInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEpochInfoResponse { + const message = createBaseQueryEpochInfoResponse(); + message.epochInfo = object.epochInfo !== undefined && object.epochInfo !== null ? EpochInfo.fromPartial(object.epochInfo) : undefined; + return message; + }, + fromAmino(object: QueryEpochInfoResponseAmino): QueryEpochInfoResponse { + const message = createBaseQueryEpochInfoResponse(); + if (object.epoch_info !== undefined && object.epoch_info !== null) { + message.epochInfo = EpochInfo.fromAmino(object.epoch_info); + } + return message; + }, + toAmino(message: QueryEpochInfoResponse): QueryEpochInfoResponseAmino { + const obj: any = {}; + obj.epoch_info = message.epochInfo ? EpochInfo.toAmino(message.epochInfo) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEpochInfoResponseAminoMsg): QueryEpochInfoResponse { + return QueryEpochInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEpochInfoResponseProtoMsg): QueryEpochInfoResponse { + return QueryEpochInfoResponse.decode(message.value); + }, + toProto(message: QueryEpochInfoResponse): Uint8Array { + return QueryEpochInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEpochInfoResponse): QueryEpochInfoResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.epochs.QueryEpochInfoResponse", + value: QueryEpochInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllEpochInfoRequest(): QueryAllEpochInfoRequest { + return { + pagination: undefined + }; +} +export const QueryAllEpochInfoRequest = { + typeUrl: "/dydxprotocol.epochs.QueryAllEpochInfoRequest", + encode(message: QueryAllEpochInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllEpochInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllEpochInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllEpochInfoRequest { + const message = createBaseQueryAllEpochInfoRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllEpochInfoRequestAmino): QueryAllEpochInfoRequest { + const message = createBaseQueryAllEpochInfoRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllEpochInfoRequest): QueryAllEpochInfoRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllEpochInfoRequestAminoMsg): QueryAllEpochInfoRequest { + return QueryAllEpochInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllEpochInfoRequestProtoMsg): QueryAllEpochInfoRequest { + return QueryAllEpochInfoRequest.decode(message.value); + }, + toProto(message: QueryAllEpochInfoRequest): Uint8Array { + return QueryAllEpochInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllEpochInfoRequest): QueryAllEpochInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.epochs.QueryAllEpochInfoRequest", + value: QueryAllEpochInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEpochInfoAllResponse(): QueryEpochInfoAllResponse { + return { + epochInfo: [], + pagination: undefined + }; +} +export const QueryEpochInfoAllResponse = { + typeUrl: "/dydxprotocol.epochs.QueryEpochInfoAllResponse", + encode(message: QueryEpochInfoAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.epochInfo) { + EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEpochInfoAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEpochInfoAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochInfo.push(EpochInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEpochInfoAllResponse { + const message = createBaseQueryEpochInfoAllResponse(); + message.epochInfo = object.epochInfo?.map(e => EpochInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryEpochInfoAllResponseAmino): QueryEpochInfoAllResponse { + const message = createBaseQueryEpochInfoAllResponse(); + message.epochInfo = object.epoch_info?.map(e => EpochInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryEpochInfoAllResponse): QueryEpochInfoAllResponseAmino { + const obj: any = {}; + if (message.epochInfo) { + obj.epoch_info = message.epochInfo.map(e => e ? EpochInfo.toAmino(e) : undefined); + } else { + obj.epoch_info = message.epochInfo; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEpochInfoAllResponseAminoMsg): QueryEpochInfoAllResponse { + return QueryEpochInfoAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEpochInfoAllResponseProtoMsg): QueryEpochInfoAllResponse { + return QueryEpochInfoAllResponse.decode(message.value); + }, + toProto(message: QueryEpochInfoAllResponse): Uint8Array { + return QueryEpochInfoAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEpochInfoAllResponse): QueryEpochInfoAllResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.epochs.QueryEpochInfoAllResponse", + value: QueryEpochInfoAllResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/genesis.ts new file mode 100644 index 00000000..586b2998 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/genesis.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { PerpetualFeeParams, PerpetualFeeParamsAmino, PerpetualFeeParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the feetiers module's genesis state. */ +export interface GenesisState { + /** The parameters for perpetual fees. */ + params: PerpetualFeeParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.feetiers.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the feetiers module's genesis state. */ +export interface GenesisStateAmino { + /** The parameters for perpetual fees. */ + params?: PerpetualFeeParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.feetiers.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the feetiers module's genesis state. */ +export interface GenesisStateSDKType { + params: PerpetualFeeParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: PerpetualFeeParams.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.feetiers.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + PerpetualFeeParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = PerpetualFeeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? PerpetualFeeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = PerpetualFeeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? PerpetualFeeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/params.ts new file mode 100644 index 00000000..3e687199 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/params.ts @@ -0,0 +1,259 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** PerpetualFeeParams defines the parameters for perpetual fees. */ +export interface PerpetualFeeParams { + /** Sorted fee tiers (lowest requirements first). */ + tiers: PerpetualFeeTier[]; +} +export interface PerpetualFeeParamsProtoMsg { + typeUrl: "/dydxprotocol.feetiers.PerpetualFeeParams"; + value: Uint8Array; +} +/** PerpetualFeeParams defines the parameters for perpetual fees. */ +export interface PerpetualFeeParamsAmino { + /** Sorted fee tiers (lowest requirements first). */ + tiers?: PerpetualFeeTierAmino[]; +} +export interface PerpetualFeeParamsAminoMsg { + type: "/dydxprotocol.feetiers.PerpetualFeeParams"; + value: PerpetualFeeParamsAmino; +} +/** PerpetualFeeParams defines the parameters for perpetual fees. */ +export interface PerpetualFeeParamsSDKType { + tiers: PerpetualFeeTierSDKType[]; +} +/** A fee tier for perpetuals */ +export interface PerpetualFeeTier { + /** Human-readable name of the tier, e.g. "Gold". */ + name: string; + /** The trader's absolute volume requirement in quote quantums. */ + absoluteVolumeRequirement: bigint; + /** The total volume share requirement. */ + totalVolumeShareRequirementPpm: number; + /** The maker volume share requirement. */ + makerVolumeShareRequirementPpm: number; + /** The maker fee once this tier is reached. */ + makerFeePpm: number; + /** The taker fee once this tier is reached. */ + takerFeePpm: number; +} +export interface PerpetualFeeTierProtoMsg { + typeUrl: "/dydxprotocol.feetiers.PerpetualFeeTier"; + value: Uint8Array; +} +/** A fee tier for perpetuals */ +export interface PerpetualFeeTierAmino { + /** Human-readable name of the tier, e.g. "Gold". */ + name?: string; + /** The trader's absolute volume requirement in quote quantums. */ + absolute_volume_requirement?: string; + /** The total volume share requirement. */ + total_volume_share_requirement_ppm?: number; + /** The maker volume share requirement. */ + maker_volume_share_requirement_ppm?: number; + /** The maker fee once this tier is reached. */ + maker_fee_ppm?: number; + /** The taker fee once this tier is reached. */ + taker_fee_ppm?: number; +} +export interface PerpetualFeeTierAminoMsg { + type: "/dydxprotocol.feetiers.PerpetualFeeTier"; + value: PerpetualFeeTierAmino; +} +/** A fee tier for perpetuals */ +export interface PerpetualFeeTierSDKType { + name: string; + absolute_volume_requirement: bigint; + total_volume_share_requirement_ppm: number; + maker_volume_share_requirement_ppm: number; + maker_fee_ppm: number; + taker_fee_ppm: number; +} +function createBasePerpetualFeeParams(): PerpetualFeeParams { + return { + tiers: [] + }; +} +export const PerpetualFeeParams = { + typeUrl: "/dydxprotocol.feetiers.PerpetualFeeParams", + encode(message: PerpetualFeeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.tiers) { + PerpetualFeeTier.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualFeeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualFeeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tiers.push(PerpetualFeeTier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualFeeParams { + const message = createBasePerpetualFeeParams(); + message.tiers = object.tiers?.map(e => PerpetualFeeTier.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PerpetualFeeParamsAmino): PerpetualFeeParams { + const message = createBasePerpetualFeeParams(); + message.tiers = object.tiers?.map(e => PerpetualFeeTier.fromAmino(e)) || []; + return message; + }, + toAmino(message: PerpetualFeeParams): PerpetualFeeParamsAmino { + const obj: any = {}; + if (message.tiers) { + obj.tiers = message.tiers.map(e => e ? PerpetualFeeTier.toAmino(e) : undefined); + } else { + obj.tiers = message.tiers; + } + return obj; + }, + fromAminoMsg(object: PerpetualFeeParamsAminoMsg): PerpetualFeeParams { + return PerpetualFeeParams.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualFeeParamsProtoMsg): PerpetualFeeParams { + return PerpetualFeeParams.decode(message.value); + }, + toProto(message: PerpetualFeeParams): Uint8Array { + return PerpetualFeeParams.encode(message).finish(); + }, + toProtoMsg(message: PerpetualFeeParams): PerpetualFeeParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.PerpetualFeeParams", + value: PerpetualFeeParams.encode(message).finish() + }; + } +}; +function createBasePerpetualFeeTier(): PerpetualFeeTier { + return { + name: "", + absoluteVolumeRequirement: BigInt(0), + totalVolumeShareRequirementPpm: 0, + makerVolumeShareRequirementPpm: 0, + makerFeePpm: 0, + takerFeePpm: 0 + }; +} +export const PerpetualFeeTier = { + typeUrl: "/dydxprotocol.feetiers.PerpetualFeeTier", + encode(message: PerpetualFeeTier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.absoluteVolumeRequirement !== BigInt(0)) { + writer.uint32(16).uint64(message.absoluteVolumeRequirement); + } + if (message.totalVolumeShareRequirementPpm !== 0) { + writer.uint32(24).uint32(message.totalVolumeShareRequirementPpm); + } + if (message.makerVolumeShareRequirementPpm !== 0) { + writer.uint32(32).uint32(message.makerVolumeShareRequirementPpm); + } + if (message.makerFeePpm !== 0) { + writer.uint32(40).sint32(message.makerFeePpm); + } + if (message.takerFeePpm !== 0) { + writer.uint32(48).sint32(message.takerFeePpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualFeeTier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualFeeTier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.absoluteVolumeRequirement = reader.uint64(); + break; + case 3: + message.totalVolumeShareRequirementPpm = reader.uint32(); + break; + case 4: + message.makerVolumeShareRequirementPpm = reader.uint32(); + break; + case 5: + message.makerFeePpm = reader.sint32(); + break; + case 6: + message.takerFeePpm = reader.sint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualFeeTier { + const message = createBasePerpetualFeeTier(); + message.name = object.name ?? ""; + message.absoluteVolumeRequirement = object.absoluteVolumeRequirement !== undefined && object.absoluteVolumeRequirement !== null ? BigInt(object.absoluteVolumeRequirement.toString()) : BigInt(0); + message.totalVolumeShareRequirementPpm = object.totalVolumeShareRequirementPpm ?? 0; + message.makerVolumeShareRequirementPpm = object.makerVolumeShareRequirementPpm ?? 0; + message.makerFeePpm = object.makerFeePpm ?? 0; + message.takerFeePpm = object.takerFeePpm ?? 0; + return message; + }, + fromAmino(object: PerpetualFeeTierAmino): PerpetualFeeTier { + const message = createBasePerpetualFeeTier(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.absolute_volume_requirement !== undefined && object.absolute_volume_requirement !== null) { + message.absoluteVolumeRequirement = BigInt(object.absolute_volume_requirement); + } + if (object.total_volume_share_requirement_ppm !== undefined && object.total_volume_share_requirement_ppm !== null) { + message.totalVolumeShareRequirementPpm = object.total_volume_share_requirement_ppm; + } + if (object.maker_volume_share_requirement_ppm !== undefined && object.maker_volume_share_requirement_ppm !== null) { + message.makerVolumeShareRequirementPpm = object.maker_volume_share_requirement_ppm; + } + if (object.maker_fee_ppm !== undefined && object.maker_fee_ppm !== null) { + message.makerFeePpm = object.maker_fee_ppm; + } + if (object.taker_fee_ppm !== undefined && object.taker_fee_ppm !== null) { + message.takerFeePpm = object.taker_fee_ppm; + } + return message; + }, + toAmino(message: PerpetualFeeTier): PerpetualFeeTierAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.absolute_volume_requirement = message.absoluteVolumeRequirement !== BigInt(0) ? message.absoluteVolumeRequirement.toString() : undefined; + obj.total_volume_share_requirement_ppm = message.totalVolumeShareRequirementPpm === 0 ? undefined : message.totalVolumeShareRequirementPpm; + obj.maker_volume_share_requirement_ppm = message.makerVolumeShareRequirementPpm === 0 ? undefined : message.makerVolumeShareRequirementPpm; + obj.maker_fee_ppm = message.makerFeePpm === 0 ? undefined : message.makerFeePpm; + obj.taker_fee_ppm = message.takerFeePpm === 0 ? undefined : message.takerFeePpm; + return obj; + }, + fromAminoMsg(object: PerpetualFeeTierAminoMsg): PerpetualFeeTier { + return PerpetualFeeTier.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualFeeTierProtoMsg): PerpetualFeeTier { + return PerpetualFeeTier.decode(message.value); + }, + toProto(message: PerpetualFeeTier): Uint8Array { + return PerpetualFeeTier.encode(message).finish(); + }, + toProtoMsg(message: PerpetualFeeTier): PerpetualFeeTierProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.PerpetualFeeTier", + value: PerpetualFeeTier.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/query.rpc.Query.ts new file mode 100644 index 00000000..c374651d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/query.rpc.Query.ts @@ -0,0 +1,42 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryPerpetualFeeParamsRequest, QueryPerpetualFeeParamsResponse, QueryUserFeeTierRequest, QueryUserFeeTierResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the PerpetualFeeParams. */ + perpetualFeeParams(request?: QueryPerpetualFeeParamsRequest): Promise; + /** Queries a user's fee tier */ + userFeeTier(request: QueryUserFeeTierRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.perpetualFeeParams = this.perpetualFeeParams.bind(this); + this.userFeeTier = this.userFeeTier.bind(this); + } + perpetualFeeParams(request: QueryPerpetualFeeParamsRequest = {}): Promise { + const data = QueryPerpetualFeeParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.feetiers.Query", "PerpetualFeeParams", data); + return promise.then(data => QueryPerpetualFeeParamsResponse.decode(new BinaryReader(data))); + } + userFeeTier(request: QueryUserFeeTierRequest): Promise { + const data = QueryUserFeeTierRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.feetiers.Query", "UserFeeTier", data); + return promise.then(data => QueryUserFeeTierResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + perpetualFeeParams(request?: QueryPerpetualFeeParamsRequest): Promise { + return queryService.perpetualFeeParams(request); + }, + userFeeTier(request: QueryUserFeeTierRequest): Promise { + return queryService.userFeeTier(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/query.ts new file mode 100644 index 00000000..9b85d2dd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/query.ts @@ -0,0 +1,351 @@ +//@ts-nocheck +import { PerpetualFeeParams, PerpetualFeeParamsAmino, PerpetualFeeParamsSDKType, PerpetualFeeTier, PerpetualFeeTierAmino, PerpetualFeeTierSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * QueryPerpetualFeeParamsRequest is a request type for the PerpetualFeeParams + * RPC method. + */ +export interface QueryPerpetualFeeParamsRequest {} +export interface QueryPerpetualFeeParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsRequest"; + value: Uint8Array; +} +/** + * QueryPerpetualFeeParamsRequest is a request type for the PerpetualFeeParams + * RPC method. + */ +export interface QueryPerpetualFeeParamsRequestAmino {} +export interface QueryPerpetualFeeParamsRequestAminoMsg { + type: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsRequest"; + value: QueryPerpetualFeeParamsRequestAmino; +} +/** + * QueryPerpetualFeeParamsRequest is a request type for the PerpetualFeeParams + * RPC method. + */ +export interface QueryPerpetualFeeParamsRequestSDKType {} +/** + * QueryPerpetualFeeParamsResponse is a response type for the PerpetualFeeParams + * RPC method. + */ +export interface QueryPerpetualFeeParamsResponse { + params: PerpetualFeeParams; +} +export interface QueryPerpetualFeeParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsResponse"; + value: Uint8Array; +} +/** + * QueryPerpetualFeeParamsResponse is a response type for the PerpetualFeeParams + * RPC method. + */ +export interface QueryPerpetualFeeParamsResponseAmino { + params?: PerpetualFeeParamsAmino; +} +export interface QueryPerpetualFeeParamsResponseAminoMsg { + type: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsResponse"; + value: QueryPerpetualFeeParamsResponseAmino; +} +/** + * QueryPerpetualFeeParamsResponse is a response type for the PerpetualFeeParams + * RPC method. + */ +export interface QueryPerpetualFeeParamsResponseSDKType { + params: PerpetualFeeParamsSDKType; +} +/** QueryUserFeeTierRequest is a request type for the UserFeeTier RPC method. */ +export interface QueryUserFeeTierRequest { + user: string; +} +export interface QueryUserFeeTierRequestProtoMsg { + typeUrl: "/dydxprotocol.feetiers.QueryUserFeeTierRequest"; + value: Uint8Array; +} +/** QueryUserFeeTierRequest is a request type for the UserFeeTier RPC method. */ +export interface QueryUserFeeTierRequestAmino { + user?: string; +} +export interface QueryUserFeeTierRequestAminoMsg { + type: "/dydxprotocol.feetiers.QueryUserFeeTierRequest"; + value: QueryUserFeeTierRequestAmino; +} +/** QueryUserFeeTierRequest is a request type for the UserFeeTier RPC method. */ +export interface QueryUserFeeTierRequestSDKType { + user: string; +} +/** QueryUserFeeTierResponse is a request type for the UserFeeTier RPC method. */ +export interface QueryUserFeeTierResponse { + /** Index of the fee tier in the list queried from PerpetualFeeParams. */ + index: number; + tier?: PerpetualFeeTier; +} +export interface QueryUserFeeTierResponseProtoMsg { + typeUrl: "/dydxprotocol.feetiers.QueryUserFeeTierResponse"; + value: Uint8Array; +} +/** QueryUserFeeTierResponse is a request type for the UserFeeTier RPC method. */ +export interface QueryUserFeeTierResponseAmino { + /** Index of the fee tier in the list queried from PerpetualFeeParams. */ + index?: number; + tier?: PerpetualFeeTierAmino; +} +export interface QueryUserFeeTierResponseAminoMsg { + type: "/dydxprotocol.feetiers.QueryUserFeeTierResponse"; + value: QueryUserFeeTierResponseAmino; +} +/** QueryUserFeeTierResponse is a request type for the UserFeeTier RPC method. */ +export interface QueryUserFeeTierResponseSDKType { + index: number; + tier?: PerpetualFeeTierSDKType; +} +function createBaseQueryPerpetualFeeParamsRequest(): QueryPerpetualFeeParamsRequest { + return {}; +} +export const QueryPerpetualFeeParamsRequest = { + typeUrl: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsRequest", + encode(_: QueryPerpetualFeeParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualFeeParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualFeeParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryPerpetualFeeParamsRequest { + const message = createBaseQueryPerpetualFeeParamsRequest(); + return message; + }, + fromAmino(_: QueryPerpetualFeeParamsRequestAmino): QueryPerpetualFeeParamsRequest { + const message = createBaseQueryPerpetualFeeParamsRequest(); + return message; + }, + toAmino(_: QueryPerpetualFeeParamsRequest): QueryPerpetualFeeParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPerpetualFeeParamsRequestAminoMsg): QueryPerpetualFeeParamsRequest { + return QueryPerpetualFeeParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualFeeParamsRequestProtoMsg): QueryPerpetualFeeParamsRequest { + return QueryPerpetualFeeParamsRequest.decode(message.value); + }, + toProto(message: QueryPerpetualFeeParamsRequest): Uint8Array { + return QueryPerpetualFeeParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualFeeParamsRequest): QueryPerpetualFeeParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsRequest", + value: QueryPerpetualFeeParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPerpetualFeeParamsResponse(): QueryPerpetualFeeParamsResponse { + return { + params: PerpetualFeeParams.fromPartial({}) + }; +} +export const QueryPerpetualFeeParamsResponse = { + typeUrl: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsResponse", + encode(message: QueryPerpetualFeeParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + PerpetualFeeParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualFeeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualFeeParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = PerpetualFeeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPerpetualFeeParamsResponse { + const message = createBaseQueryPerpetualFeeParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? PerpetualFeeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryPerpetualFeeParamsResponseAmino): QueryPerpetualFeeParamsResponse { + const message = createBaseQueryPerpetualFeeParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = PerpetualFeeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryPerpetualFeeParamsResponse): QueryPerpetualFeeParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? PerpetualFeeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPerpetualFeeParamsResponseAminoMsg): QueryPerpetualFeeParamsResponse { + return QueryPerpetualFeeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualFeeParamsResponseProtoMsg): QueryPerpetualFeeParamsResponse { + return QueryPerpetualFeeParamsResponse.decode(message.value); + }, + toProto(message: QueryPerpetualFeeParamsResponse): Uint8Array { + return QueryPerpetualFeeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualFeeParamsResponse): QueryPerpetualFeeParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.QueryPerpetualFeeParamsResponse", + value: QueryPerpetualFeeParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUserFeeTierRequest(): QueryUserFeeTierRequest { + return { + user: "" + }; +} +export const QueryUserFeeTierRequest = { + typeUrl: "/dydxprotocol.feetiers.QueryUserFeeTierRequest", + encode(message: QueryUserFeeTierRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.user !== "") { + writer.uint32(10).string(message.user); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserFeeTierRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserFeeTierRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.user = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserFeeTierRequest { + const message = createBaseQueryUserFeeTierRequest(); + message.user = object.user ?? ""; + return message; + }, + fromAmino(object: QueryUserFeeTierRequestAmino): QueryUserFeeTierRequest { + const message = createBaseQueryUserFeeTierRequest(); + if (object.user !== undefined && object.user !== null) { + message.user = object.user; + } + return message; + }, + toAmino(message: QueryUserFeeTierRequest): QueryUserFeeTierRequestAmino { + const obj: any = {}; + obj.user = message.user === "" ? undefined : message.user; + return obj; + }, + fromAminoMsg(object: QueryUserFeeTierRequestAminoMsg): QueryUserFeeTierRequest { + return QueryUserFeeTierRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUserFeeTierRequestProtoMsg): QueryUserFeeTierRequest { + return QueryUserFeeTierRequest.decode(message.value); + }, + toProto(message: QueryUserFeeTierRequest): Uint8Array { + return QueryUserFeeTierRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUserFeeTierRequest): QueryUserFeeTierRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.QueryUserFeeTierRequest", + value: QueryUserFeeTierRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUserFeeTierResponse(): QueryUserFeeTierResponse { + return { + index: 0, + tier: undefined + }; +} +export const QueryUserFeeTierResponse = { + typeUrl: "/dydxprotocol.feetiers.QueryUserFeeTierResponse", + encode(message: QueryUserFeeTierResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.tier !== undefined) { + PerpetualFeeTier.encode(message.tier, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserFeeTierResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserFeeTierResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.tier = PerpetualFeeTier.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserFeeTierResponse { + const message = createBaseQueryUserFeeTierResponse(); + message.index = object.index ?? 0; + message.tier = object.tier !== undefined && object.tier !== null ? PerpetualFeeTier.fromPartial(object.tier) : undefined; + return message; + }, + fromAmino(object: QueryUserFeeTierResponseAmino): QueryUserFeeTierResponse { + const message = createBaseQueryUserFeeTierResponse(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.tier !== undefined && object.tier !== null) { + message.tier = PerpetualFeeTier.fromAmino(object.tier); + } + return message; + }, + toAmino(message: QueryUserFeeTierResponse): QueryUserFeeTierResponseAmino { + const obj: any = {}; + obj.index = message.index === 0 ? undefined : message.index; + obj.tier = message.tier ? PerpetualFeeTier.toAmino(message.tier) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUserFeeTierResponseAminoMsg): QueryUserFeeTierResponse { + return QueryUserFeeTierResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUserFeeTierResponseProtoMsg): QueryUserFeeTierResponse { + return QueryUserFeeTierResponse.decode(message.value); + }, + toProto(message: QueryUserFeeTierResponse): Uint8Array { + return QueryUserFeeTierResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUserFeeTierResponse): QueryUserFeeTierResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.QueryUserFeeTierResponse", + value: QueryUserFeeTierResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.amino.ts new file mode 100644 index 00000000..b3a0826d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdatePerpetualFeeParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams": { + aminoType: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams", + toAmino: MsgUpdatePerpetualFeeParams.toAmino, + fromAmino: MsgUpdatePerpetualFeeParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.registry.ts new file mode 100644 index 00000000..56c385a9 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdatePerpetualFeeParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams", MsgUpdatePerpetualFeeParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updatePerpetualFeeParams(value: MsgUpdatePerpetualFeeParams) { + return { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams", + value: MsgUpdatePerpetualFeeParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updatePerpetualFeeParams(value: MsgUpdatePerpetualFeeParams) { + return { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams", + value + }; + } + }, + fromPartial: { + updatePerpetualFeeParams(value: MsgUpdatePerpetualFeeParams) { + return { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams", + value: MsgUpdatePerpetualFeeParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.rpc.msg.ts new file mode 100644 index 00000000..daba2cf0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.rpc.msg.ts @@ -0,0 +1,21 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgUpdatePerpetualFeeParams, MsgUpdatePerpetualFeeParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** UpdatePerpetualFeeParams updates the PerpetualFeeParams in state. */ + updatePerpetualFeeParams(request: MsgUpdatePerpetualFeeParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updatePerpetualFeeParams = this.updatePerpetualFeeParams.bind(this); + } + updatePerpetualFeeParams(request: MsgUpdatePerpetualFeeParams): Promise { + const data = MsgUpdatePerpetualFeeParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.feetiers.Msg", "UpdatePerpetualFeeParams", data); + return promise.then(data => MsgUpdatePerpetualFeeParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.ts new file mode 100644 index 00000000..b4e7631b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/feetiers/tx.ts @@ -0,0 +1,176 @@ +//@ts-nocheck +import { PerpetualFeeParams, PerpetualFeeParamsAmino, PerpetualFeeParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgUpdatePerpetualFeeParams is the Msg/UpdatePerpetualFeeParams request type. */ +export interface MsgUpdatePerpetualFeeParams { + authority: string; + /** Defines the parameters to update. All parameters must be supplied. */ + params: PerpetualFeeParams; +} +export interface MsgUpdatePerpetualFeeParamsProtoMsg { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams"; + value: Uint8Array; +} +/** MsgUpdatePerpetualFeeParams is the Msg/UpdatePerpetualFeeParams request type. */ +export interface MsgUpdatePerpetualFeeParamsAmino { + authority?: string; + /** Defines the parameters to update. All parameters must be supplied. */ + params?: PerpetualFeeParamsAmino; +} +export interface MsgUpdatePerpetualFeeParamsAminoMsg { + type: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams"; + value: MsgUpdatePerpetualFeeParamsAmino; +} +/** MsgUpdatePerpetualFeeParams is the Msg/UpdatePerpetualFeeParams request type. */ +export interface MsgUpdatePerpetualFeeParamsSDKType { + authority: string; + params: PerpetualFeeParamsSDKType; +} +/** + * MsgUpdatePerpetualFeeParamsResponse is the Msg/UpdatePerpetualFeeParams + * response type. + */ +export interface MsgUpdatePerpetualFeeParamsResponse {} +export interface MsgUpdatePerpetualFeeParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdatePerpetualFeeParamsResponse is the Msg/UpdatePerpetualFeeParams + * response type. + */ +export interface MsgUpdatePerpetualFeeParamsResponseAmino {} +export interface MsgUpdatePerpetualFeeParamsResponseAminoMsg { + type: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParamsResponse"; + value: MsgUpdatePerpetualFeeParamsResponseAmino; +} +/** + * MsgUpdatePerpetualFeeParamsResponse is the Msg/UpdatePerpetualFeeParams + * response type. + */ +export interface MsgUpdatePerpetualFeeParamsResponseSDKType {} +function createBaseMsgUpdatePerpetualFeeParams(): MsgUpdatePerpetualFeeParams { + return { + authority: "", + params: PerpetualFeeParams.fromPartial({}) + }; +} +export const MsgUpdatePerpetualFeeParams = { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams", + encode(message: MsgUpdatePerpetualFeeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + PerpetualFeeParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdatePerpetualFeeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePerpetualFeeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = PerpetualFeeParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdatePerpetualFeeParams { + const message = createBaseMsgUpdatePerpetualFeeParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? PerpetualFeeParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdatePerpetualFeeParamsAmino): MsgUpdatePerpetualFeeParams { + const message = createBaseMsgUpdatePerpetualFeeParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = PerpetualFeeParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdatePerpetualFeeParams): MsgUpdatePerpetualFeeParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? PerpetualFeeParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdatePerpetualFeeParamsAminoMsg): MsgUpdatePerpetualFeeParams { + return MsgUpdatePerpetualFeeParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdatePerpetualFeeParamsProtoMsg): MsgUpdatePerpetualFeeParams { + return MsgUpdatePerpetualFeeParams.decode(message.value); + }, + toProto(message: MsgUpdatePerpetualFeeParams): Uint8Array { + return MsgUpdatePerpetualFeeParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdatePerpetualFeeParams): MsgUpdatePerpetualFeeParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParams", + value: MsgUpdatePerpetualFeeParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdatePerpetualFeeParamsResponse(): MsgUpdatePerpetualFeeParamsResponse { + return {}; +} +export const MsgUpdatePerpetualFeeParamsResponse = { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParamsResponse", + encode(_: MsgUpdatePerpetualFeeParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdatePerpetualFeeParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePerpetualFeeParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdatePerpetualFeeParamsResponse { + const message = createBaseMsgUpdatePerpetualFeeParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdatePerpetualFeeParamsResponseAmino): MsgUpdatePerpetualFeeParamsResponse { + const message = createBaseMsgUpdatePerpetualFeeParamsResponse(); + return message; + }, + toAmino(_: MsgUpdatePerpetualFeeParamsResponse): MsgUpdatePerpetualFeeParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdatePerpetualFeeParamsResponseAminoMsg): MsgUpdatePerpetualFeeParamsResponse { + return MsgUpdatePerpetualFeeParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdatePerpetualFeeParamsResponseProtoMsg): MsgUpdatePerpetualFeeParamsResponse { + return MsgUpdatePerpetualFeeParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdatePerpetualFeeParamsResponse): Uint8Array { + return MsgUpdatePerpetualFeeParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdatePerpetualFeeParamsResponse): MsgUpdatePerpetualFeeParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.feetiers.MsgUpdatePerpetualFeeParamsResponse", + value: MsgUpdatePerpetualFeeParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/genesis.ts new file mode 100644 index 00000000..f71da567 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/genesis.ts @@ -0,0 +1,66 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the govplus module's genesis state. */ +export interface GenesisState {} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.govplus.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the govplus module's genesis state. */ +export interface GenesisStateAmino {} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.govplus.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the govplus module's genesis state. */ +export interface GenesisStateSDKType {} +function createBaseGenesisState(): GenesisState { + return {}; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.govplus.GenesisState", + encode(_: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GenesisState { + const message = createBaseGenesisState(); + return message; + }, + fromAmino(_: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + return message; + }, + toAmino(_: GenesisState): GenesisStateAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.govplus.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/query.rpc.Query.ts new file mode 100644 index 00000000..2d4519c3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/query.rpc.Query.ts @@ -0,0 +1,16 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +/** Query defines the gRPC querier service. */ +export interface Query {} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return {}; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/query.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/query.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.amino.ts new file mode 100644 index 00000000..4009fcdd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgSlashValidator } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.govplus.MsgSlashValidator": { + aminoType: "/dydxprotocol.govplus.MsgSlashValidator", + toAmino: MsgSlashValidator.toAmino, + fromAmino: MsgSlashValidator.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.registry.ts new file mode 100644 index 00000000..13d09722 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSlashValidator } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.govplus.MsgSlashValidator", MsgSlashValidator]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + slashValidator(value: MsgSlashValidator) { + return { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidator", + value: MsgSlashValidator.encode(value).finish() + }; + } + }, + withTypeUrl: { + slashValidator(value: MsgSlashValidator) { + return { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidator", + value + }; + } + }, + fromPartial: { + slashValidator(value: MsgSlashValidator) { + return { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidator", + value: MsgSlashValidator.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.rpc.msg.ts new file mode 100644 index 00000000..412cfa0a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.rpc.msg.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgSlashValidator, MsgSlashValidatorResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * SlashValidator is exposed to allow slashing of a misbehaving validator via + * governance. + */ + slashValidator(request: MsgSlashValidator): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.slashValidator = this.slashValidator.bind(this); + } + slashValidator(request: MsgSlashValidator): Promise { + const data = MsgSlashValidator.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.govplus.Msg", "SlashValidator", data); + return promise.then(data => MsgSlashValidatorResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.ts new file mode 100644 index 00000000..015edc1e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/govplus/tx.ts @@ -0,0 +1,259 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { Decimal } from "@cosmjs/math"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** MsgSlashValidator is the Msg/SlashValidator request type. */ +export interface MsgSlashValidator { + authority: string; + /** Consensus address of the validator to slash */ + validatorAddress: string; + /** + * Colloquially, the height at which the validator is deemed to have + * misbehaved. In practice, this is the height used to determine the targets + * of the slash. For example, undelegating after this height will not escape + * slashing. This height should be set to a recent height at the time of the + * proposal to prevent delegators from undelegating during the vote period. + * i.e. infraction_height <= proposal submission height. + * + * NB: At the time this message is applied, this height must have occured + * equal to or less than an unbonding period in the past in order for the + * slash to be effective. + * i.e. time(proposal pass height) - time(infraction_height) < unbonding + * period + */ + infractionHeight: number; + /** + * Tokens of the validator at the specified height. Used to compute the slash + * amount. The x/staking HistoricalInfo query endpoint can be used to find + * this. + */ + tokensAtInfractionHeight: Uint8Array; + /** + * Multiplier for how much of the validator's stake should be slashed. + * slash_factor * tokens_at_infraction_height = tokens slashed + */ + slashFactor: string; +} +export interface MsgSlashValidatorProtoMsg { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidator"; + value: Uint8Array; +} +/** MsgSlashValidator is the Msg/SlashValidator request type. */ +export interface MsgSlashValidatorAmino { + authority?: string; + /** Consensus address of the validator to slash */ + validator_address?: string; + /** + * Colloquially, the height at which the validator is deemed to have + * misbehaved. In practice, this is the height used to determine the targets + * of the slash. For example, undelegating after this height will not escape + * slashing. This height should be set to a recent height at the time of the + * proposal to prevent delegators from undelegating during the vote period. + * i.e. infraction_height <= proposal submission height. + * + * NB: At the time this message is applied, this height must have occured + * equal to or less than an unbonding period in the past in order for the + * slash to be effective. + * i.e. time(proposal pass height) - time(infraction_height) < unbonding + * period + */ + infraction_height?: number; + /** + * Tokens of the validator at the specified height. Used to compute the slash + * amount. The x/staking HistoricalInfo query endpoint can be used to find + * this. + */ + tokens_at_infraction_height?: string; + /** + * Multiplier for how much of the validator's stake should be slashed. + * slash_factor * tokens_at_infraction_height = tokens slashed + */ + slash_factor: string; +} +export interface MsgSlashValidatorAminoMsg { + type: "/dydxprotocol.govplus.MsgSlashValidator"; + value: MsgSlashValidatorAmino; +} +/** MsgSlashValidator is the Msg/SlashValidator request type. */ +export interface MsgSlashValidatorSDKType { + authority: string; + validator_address: string; + infraction_height: number; + tokens_at_infraction_height: Uint8Array; + slash_factor: string; +} +/** MsgSlashValidatorResponse is the Msg/SlashValidator response type. */ +export interface MsgSlashValidatorResponse {} +export interface MsgSlashValidatorResponseProtoMsg { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidatorResponse"; + value: Uint8Array; +} +/** MsgSlashValidatorResponse is the Msg/SlashValidator response type. */ +export interface MsgSlashValidatorResponseAmino {} +export interface MsgSlashValidatorResponseAminoMsg { + type: "/dydxprotocol.govplus.MsgSlashValidatorResponse"; + value: MsgSlashValidatorResponseAmino; +} +/** MsgSlashValidatorResponse is the Msg/SlashValidator response type. */ +export interface MsgSlashValidatorResponseSDKType {} +function createBaseMsgSlashValidator(): MsgSlashValidator { + return { + authority: "", + validatorAddress: "", + infractionHeight: 0, + tokensAtInfractionHeight: new Uint8Array(), + slashFactor: "" + }; +} +export const MsgSlashValidator = { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidator", + encode(message: MsgSlashValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.infractionHeight !== 0) { + writer.uint32(24).uint32(message.infractionHeight); + } + if (message.tokensAtInfractionHeight.length !== 0) { + writer.uint32(34).bytes(message.tokensAtInfractionHeight); + } + if (message.slashFactor !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.slashFactor, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSlashValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSlashValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.infractionHeight = reader.uint32(); + break; + case 4: + message.tokensAtInfractionHeight = reader.bytes(); + break; + case 5: + message.slashFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSlashValidator { + const message = createBaseMsgSlashValidator(); + message.authority = object.authority ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.infractionHeight = object.infractionHeight ?? 0; + message.tokensAtInfractionHeight = object.tokensAtInfractionHeight ?? new Uint8Array(); + message.slashFactor = object.slashFactor ?? ""; + return message; + }, + fromAmino(object: MsgSlashValidatorAmino): MsgSlashValidator { + const message = createBaseMsgSlashValidator(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.infraction_height !== undefined && object.infraction_height !== null) { + message.infractionHeight = object.infraction_height; + } + if (object.tokens_at_infraction_height !== undefined && object.tokens_at_infraction_height !== null) { + message.tokensAtInfractionHeight = bytesFromBase64(object.tokens_at_infraction_height); + } + if (object.slash_factor !== undefined && object.slash_factor !== null) { + message.slashFactor = object.slash_factor; + } + return message; + }, + toAmino(message: MsgSlashValidator): MsgSlashValidatorAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.infraction_height = message.infractionHeight === 0 ? undefined : message.infractionHeight; + obj.tokens_at_infraction_height = message.tokensAtInfractionHeight ? base64FromBytes(message.tokensAtInfractionHeight) : undefined; + obj.slash_factor = message.slashFactor ?? ""; + return obj; + }, + fromAminoMsg(object: MsgSlashValidatorAminoMsg): MsgSlashValidator { + return MsgSlashValidator.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSlashValidatorProtoMsg): MsgSlashValidator { + return MsgSlashValidator.decode(message.value); + }, + toProto(message: MsgSlashValidator): Uint8Array { + return MsgSlashValidator.encode(message).finish(); + }, + toProtoMsg(message: MsgSlashValidator): MsgSlashValidatorProtoMsg { + return { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidator", + value: MsgSlashValidator.encode(message).finish() + }; + } +}; +function createBaseMsgSlashValidatorResponse(): MsgSlashValidatorResponse { + return {}; +} +export const MsgSlashValidatorResponse = { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidatorResponse", + encode(_: MsgSlashValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSlashValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSlashValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSlashValidatorResponse { + const message = createBaseMsgSlashValidatorResponse(); + return message; + }, + fromAmino(_: MsgSlashValidatorResponseAmino): MsgSlashValidatorResponse { + const message = createBaseMsgSlashValidatorResponse(); + return message; + }, + toAmino(_: MsgSlashValidatorResponse): MsgSlashValidatorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSlashValidatorResponseAminoMsg): MsgSlashValidatorResponse { + return MsgSlashValidatorResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSlashValidatorResponseProtoMsg): MsgSlashValidatorResponse { + return MsgSlashValidatorResponse.decode(message.value); + }, + toProto(message: MsgSlashValidatorResponse): Uint8Array { + return MsgSlashValidatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSlashValidatorResponse): MsgSlashValidatorResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.govplus.MsgSlashValidatorResponse", + value: MsgSlashValidatorResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/events/events.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/events/events.ts new file mode 100644 index 00000000..c55b51c0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/events/events.ts @@ -0,0 +1,4897 @@ +//@ts-nocheck +import { IndexerSubaccountId, IndexerSubaccountIdAmino, IndexerSubaccountIdSDKType, IndexerPerpetualPosition, IndexerPerpetualPositionAmino, IndexerPerpetualPositionSDKType, IndexerAssetPosition, IndexerAssetPositionAmino, IndexerAssetPositionSDKType } from "../protocol/v1/subaccount"; +import { IndexerOrder, IndexerOrderAmino, IndexerOrderSDKType, IndexerOrderId, IndexerOrderIdAmino, IndexerOrderIdSDKType, ClobPairStatus } from "../protocol/v1/clob"; +import { OrderRemovalReason } from "../shared/removal_reason"; +import { PerpetualMarketType } from "../protocol/v1/perpetual"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** Type is the type for funding values. */ +export enum FundingEventV1_Type { + /** TYPE_UNSPECIFIED - Unspecified type. */ + TYPE_UNSPECIFIED = 0, + /** + * TYPE_PREMIUM_SAMPLE - Premium sample is the combined value from all premium votes during a + * `funding-sample` epoch. + */ + TYPE_PREMIUM_SAMPLE = 1, + /** + * TYPE_FUNDING_RATE_AND_INDEX - Funding rate is the final funding rate combining all premium samples + * during a `funding-tick` epoch. + */ + TYPE_FUNDING_RATE_AND_INDEX = 2, + /** + * TYPE_PREMIUM_VOTE - TODO(DEC-1513): Investigate whether premium vote values need to be + * sent to indexer. + */ + TYPE_PREMIUM_VOTE = 3, + UNRECOGNIZED = -1, +} +export const FundingEventV1_TypeSDKType = FundingEventV1_Type; +export const FundingEventV1_TypeAmino = FundingEventV1_Type; +export function fundingEventV1_TypeFromJSON(object: any): FundingEventV1_Type { + switch (object) { + case 0: + case "TYPE_UNSPECIFIED": + return FundingEventV1_Type.TYPE_UNSPECIFIED; + case 1: + case "TYPE_PREMIUM_SAMPLE": + return FundingEventV1_Type.TYPE_PREMIUM_SAMPLE; + case 2: + case "TYPE_FUNDING_RATE_AND_INDEX": + return FundingEventV1_Type.TYPE_FUNDING_RATE_AND_INDEX; + case 3: + case "TYPE_PREMIUM_VOTE": + return FundingEventV1_Type.TYPE_PREMIUM_VOTE; + case -1: + case "UNRECOGNIZED": + default: + return FundingEventV1_Type.UNRECOGNIZED; + } +} +export function fundingEventV1_TypeToJSON(object: FundingEventV1_Type): string { + switch (object) { + case FundingEventV1_Type.TYPE_UNSPECIFIED: + return "TYPE_UNSPECIFIED"; + case FundingEventV1_Type.TYPE_PREMIUM_SAMPLE: + return "TYPE_PREMIUM_SAMPLE"; + case FundingEventV1_Type.TYPE_FUNDING_RATE_AND_INDEX: + return "TYPE_FUNDING_RATE_AND_INDEX"; + case FundingEventV1_Type.TYPE_PREMIUM_VOTE: + return "TYPE_PREMIUM_VOTE"; + case FundingEventV1_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * FundingUpdate is used for funding update events and includes a funding + * value and an optional funding index that correspond to a perpetual market. + */ +export interface FundingUpdateV1 { + /** The id of the perpetual market. */ + perpetualId: number; + /** + * funding value (in parts-per-million) can be premium vote, premium sample, + * or funding rate. + */ + fundingValuePpm: number; + /** + * funding index is required if and only if parent `FundingEvent` type is + * `TYPE_FUNDING_RATE_AND_INDEX`. + */ + fundingIndex: Uint8Array; +} +export interface FundingUpdateV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.FundingUpdateV1"; + value: Uint8Array; +} +/** + * FundingUpdate is used for funding update events and includes a funding + * value and an optional funding index that correspond to a perpetual market. + */ +export interface FundingUpdateV1Amino { + /** The id of the perpetual market. */ + perpetual_id?: number; + /** + * funding value (in parts-per-million) can be premium vote, premium sample, + * or funding rate. + */ + funding_value_ppm?: number; + /** + * funding index is required if and only if parent `FundingEvent` type is + * `TYPE_FUNDING_RATE_AND_INDEX`. + */ + funding_index?: string; +} +export interface FundingUpdateV1AminoMsg { + type: "/dydxprotocol.indexer.events.FundingUpdateV1"; + value: FundingUpdateV1Amino; +} +/** + * FundingUpdate is used for funding update events and includes a funding + * value and an optional funding index that correspond to a perpetual market. + */ +export interface FundingUpdateV1SDKType { + perpetual_id: number; + funding_value_ppm: number; + funding_index: Uint8Array; +} +/** + * FundingEvent message contains a list of per-market funding values. The + * funding values in the list is of the same type and the types are: which can + * have one of the following types: + * 1. Premium vote: votes on the premium values injected by block proposers. + * 2. Premium sample: combined value from all premium votes during a + * `funding-sample` epoch. + * 3. Funding rate and index: final funding rate combining all premium samples + * during a `funding-tick` epoch and funding index accordingly updated with + * `funding rate * price`. + */ +export interface FundingEventV1 { + /** + * updates is a list of per-market funding updates for all existing perpetual + * markets. The list is sorted by `perpetualId`s which are unique. + */ + updates: FundingUpdateV1[]; + /** type stores the type of funding updates. */ + type: FundingEventV1_Type; +} +export interface FundingEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.FundingEventV1"; + value: Uint8Array; +} +/** + * FundingEvent message contains a list of per-market funding values. The + * funding values in the list is of the same type and the types are: which can + * have one of the following types: + * 1. Premium vote: votes on the premium values injected by block proposers. + * 2. Premium sample: combined value from all premium votes during a + * `funding-sample` epoch. + * 3. Funding rate and index: final funding rate combining all premium samples + * during a `funding-tick` epoch and funding index accordingly updated with + * `funding rate * price`. + */ +export interface FundingEventV1Amino { + /** + * updates is a list of per-market funding updates for all existing perpetual + * markets. The list is sorted by `perpetualId`s which are unique. + */ + updates?: FundingUpdateV1Amino[]; + /** type stores the type of funding updates. */ + type?: FundingEventV1_Type; +} +export interface FundingEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.FundingEventV1"; + value: FundingEventV1Amino; +} +/** + * FundingEvent message contains a list of per-market funding values. The + * funding values in the list is of the same type and the types are: which can + * have one of the following types: + * 1. Premium vote: votes on the premium values injected by block proposers. + * 2. Premium sample: combined value from all premium votes during a + * `funding-sample` epoch. + * 3. Funding rate and index: final funding rate combining all premium samples + * during a `funding-tick` epoch and funding index accordingly updated with + * `funding rate * price`. + */ +export interface FundingEventV1SDKType { + updates: FundingUpdateV1SDKType[]; + type: FundingEventV1_Type; +} +/** + * MarketEvent message contains all the information about a market event on + * the dYdX chain. + */ +export interface MarketEventV1 { + /** market id. */ + marketId: number; + priceUpdate?: MarketPriceUpdateEventV1; + marketCreate?: MarketCreateEventV1; + marketModify?: MarketModifyEventV1; +} +export interface MarketEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.MarketEventV1"; + value: Uint8Array; +} +/** + * MarketEvent message contains all the information about a market event on + * the dYdX chain. + */ +export interface MarketEventV1Amino { + /** market id. */ + market_id?: number; + price_update?: MarketPriceUpdateEventV1Amino; + market_create?: MarketCreateEventV1Amino; + market_modify?: MarketModifyEventV1Amino; +} +export interface MarketEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.MarketEventV1"; + value: MarketEventV1Amino; +} +/** + * MarketEvent message contains all the information about a market event on + * the dYdX chain. + */ +export interface MarketEventV1SDKType { + market_id: number; + price_update?: MarketPriceUpdateEventV1SDKType; + market_create?: MarketCreateEventV1SDKType; + market_modify?: MarketModifyEventV1SDKType; +} +/** + * MarketPriceUpdateEvent message contains all the information about a price + * update on the dYdX chain. + */ +export interface MarketPriceUpdateEventV1 { + /** + * price_with_exponent. Multiply by 10 ^ Exponent to get the human readable + * price in dollars. For example if `Exponent == -5` then a `exponent_price` + * of `1,000,000,000` represents “$10,000`. + */ + priceWithExponent: bigint; +} +export interface MarketPriceUpdateEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.MarketPriceUpdateEventV1"; + value: Uint8Array; +} +/** + * MarketPriceUpdateEvent message contains all the information about a price + * update on the dYdX chain. + */ +export interface MarketPriceUpdateEventV1Amino { + /** + * price_with_exponent. Multiply by 10 ^ Exponent to get the human readable + * price in dollars. For example if `Exponent == -5` then a `exponent_price` + * of `1,000,000,000` represents “$10,000`. + */ + price_with_exponent?: string; +} +export interface MarketPriceUpdateEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.MarketPriceUpdateEventV1"; + value: MarketPriceUpdateEventV1Amino; +} +/** + * MarketPriceUpdateEvent message contains all the information about a price + * update on the dYdX chain. + */ +export interface MarketPriceUpdateEventV1SDKType { + price_with_exponent: bigint; +} +/** shared fields between MarketCreateEvent and MarketModifyEvent */ +export interface MarketBaseEventV1 { + /** String representation of the market pair, e.g. `BTC-USD` */ + pair: string; + /** + * The minimum allowable change in the Price value for a given update. + * Measured as 1e-6. + */ + minPriceChangePpm: number; +} +export interface MarketBaseEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.MarketBaseEventV1"; + value: Uint8Array; +} +/** shared fields between MarketCreateEvent and MarketModifyEvent */ +export interface MarketBaseEventV1Amino { + /** String representation of the market pair, e.g. `BTC-USD` */ + pair?: string; + /** + * The minimum allowable change in the Price value for a given update. + * Measured as 1e-6. + */ + min_price_change_ppm?: number; +} +export interface MarketBaseEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.MarketBaseEventV1"; + value: MarketBaseEventV1Amino; +} +/** shared fields between MarketCreateEvent and MarketModifyEvent */ +export interface MarketBaseEventV1SDKType { + pair: string; + min_price_change_ppm: number; +} +/** + * MarketCreateEvent message contains all the information about a new market on + * the dYdX chain. + */ +export interface MarketCreateEventV1 { + base?: MarketBaseEventV1; + /** + * Static value. The exponent of the price. + * For example if Exponent == -5 then a `exponent_price` of 1,000,000,000 + * represents $10,000. Therefore 10 ^ Exponent represents the smallest + * price step (in dollars) that can be recorded. + */ + exponent: number; +} +export interface MarketCreateEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.MarketCreateEventV1"; + value: Uint8Array; +} +/** + * MarketCreateEvent message contains all the information about a new market on + * the dYdX chain. + */ +export interface MarketCreateEventV1Amino { + base?: MarketBaseEventV1Amino; + /** + * Static value. The exponent of the price. + * For example if Exponent == -5 then a `exponent_price` of 1,000,000,000 + * represents $10,000. Therefore 10 ^ Exponent represents the smallest + * price step (in dollars) that can be recorded. + */ + exponent?: number; +} +export interface MarketCreateEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.MarketCreateEventV1"; + value: MarketCreateEventV1Amino; +} +/** + * MarketCreateEvent message contains all the information about a new market on + * the dYdX chain. + */ +export interface MarketCreateEventV1SDKType { + base?: MarketBaseEventV1SDKType; + exponent: number; +} +/** + * MarketModifyEvent message contains all the information about a market update + * on the dYdX chain + */ +export interface MarketModifyEventV1 { + base?: MarketBaseEventV1; +} +export interface MarketModifyEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.MarketModifyEventV1"; + value: Uint8Array; +} +/** + * MarketModifyEvent message contains all the information about a market update + * on the dYdX chain + */ +export interface MarketModifyEventV1Amino { + base?: MarketBaseEventV1Amino; +} +export interface MarketModifyEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.MarketModifyEventV1"; + value: MarketModifyEventV1Amino; +} +/** + * MarketModifyEvent message contains all the information about a market update + * on the dYdX chain + */ +export interface MarketModifyEventV1SDKType { + base?: MarketBaseEventV1SDKType; +} +/** SourceOfFunds is the source of funds in a transfer event. */ +export interface SourceOfFunds { + subaccountId?: IndexerSubaccountId; + address?: string; +} +export interface SourceOfFundsProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.SourceOfFunds"; + value: Uint8Array; +} +/** SourceOfFunds is the source of funds in a transfer event. */ +export interface SourceOfFundsAmino { + subaccount_id?: IndexerSubaccountIdAmino; + address?: string; +} +export interface SourceOfFundsAminoMsg { + type: "/dydxprotocol.indexer.events.SourceOfFunds"; + value: SourceOfFundsAmino; +} +/** SourceOfFunds is the source of funds in a transfer event. */ +export interface SourceOfFundsSDKType { + subaccount_id?: IndexerSubaccountIdSDKType; + address?: string; +} +/** + * TransferEvent message contains all the information about a transfer, + * deposit-to-subaccount, or withdraw-from-subaccount on the dYdX chain. + * When a subaccount is involved, a SubaccountUpdateEvent message will + * be produced with the updated asset positions. + */ +export interface TransferEventV1 { + senderSubaccountId?: IndexerSubaccountId; + recipientSubaccountId?: IndexerSubaccountId; + /** Id of the asset transfered. */ + assetId: number; + /** The amount of asset in quantums to transfer. */ + amount: bigint; + /** + * The sender is one of below + * - a subaccount ID (in transfer and withdraw events). + * - a wallet address (in deposit events). + */ + sender?: SourceOfFunds; + /** + * The recipient is one of below + * - a subaccount ID (in transfer and deposit events). + * - a wallet address (in withdraw events). + */ + recipient?: SourceOfFunds; +} +export interface TransferEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.TransferEventV1"; + value: Uint8Array; +} +/** + * TransferEvent message contains all the information about a transfer, + * deposit-to-subaccount, or withdraw-from-subaccount on the dYdX chain. + * When a subaccount is involved, a SubaccountUpdateEvent message will + * be produced with the updated asset positions. + */ +export interface TransferEventV1Amino { + sender_subaccount_id?: IndexerSubaccountIdAmino; + recipient_subaccount_id?: IndexerSubaccountIdAmino; + /** Id of the asset transfered. */ + asset_id?: number; + /** The amount of asset in quantums to transfer. */ + amount?: string; + /** + * The sender is one of below + * - a subaccount ID (in transfer and withdraw events). + * - a wallet address (in deposit events). + */ + sender?: SourceOfFundsAmino; + /** + * The recipient is one of below + * - a subaccount ID (in transfer and deposit events). + * - a wallet address (in withdraw events). + */ + recipient?: SourceOfFundsAmino; +} +export interface TransferEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.TransferEventV1"; + value: TransferEventV1Amino; +} +/** + * TransferEvent message contains all the information about a transfer, + * deposit-to-subaccount, or withdraw-from-subaccount on the dYdX chain. + * When a subaccount is involved, a SubaccountUpdateEvent message will + * be produced with the updated asset positions. + */ +export interface TransferEventV1SDKType { + sender_subaccount_id?: IndexerSubaccountIdSDKType; + recipient_subaccount_id?: IndexerSubaccountIdSDKType; + asset_id: number; + amount: bigint; + sender?: SourceOfFundsSDKType; + recipient?: SourceOfFundsSDKType; +} +/** + * OrderFillEvent message contains all the information from an order match in + * the dYdX chain. This includes the maker/taker orders that matched and the + * amount filled. + */ +export interface OrderFillEventV1 { + makerOrder: IndexerOrder; + order?: IndexerOrder; + liquidationOrder?: LiquidationOrderV1; + /** Fill amount in base quantums. */ + fillAmount: bigint; + /** Maker fee in USDC quantums. */ + makerFee: bigint; + /** + * Taker fee in USDC quantums. If the taker order is a liquidation, then this + * represents the special liquidation fee, not the standard taker fee. + */ + takerFee: bigint; + /** Total filled of the maker order in base quantums. */ + totalFilledMaker: bigint; + /** Total filled of the taker order in base quantums. */ + totalFilledTaker: bigint; + /** rev share for affiliates in USDC quantums. */ + affiliateRevShare: bigint; +} +export interface OrderFillEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.OrderFillEventV1"; + value: Uint8Array; +} +/** + * OrderFillEvent message contains all the information from an order match in + * the dYdX chain. This includes the maker/taker orders that matched and the + * amount filled. + */ +export interface OrderFillEventV1Amino { + maker_order?: IndexerOrderAmino; + order?: IndexerOrderAmino; + liquidation_order?: LiquidationOrderV1Amino; + /** Fill amount in base quantums. */ + fill_amount?: string; + /** Maker fee in USDC quantums. */ + maker_fee?: string; + /** + * Taker fee in USDC quantums. If the taker order is a liquidation, then this + * represents the special liquidation fee, not the standard taker fee. + */ + taker_fee?: string; + /** Total filled of the maker order in base quantums. */ + total_filled_maker?: string; + /** Total filled of the taker order in base quantums. */ + total_filled_taker?: string; + /** rev share for affiliates in USDC quantums. */ + affiliate_rev_share?: string; +} +export interface OrderFillEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.OrderFillEventV1"; + value: OrderFillEventV1Amino; +} +/** + * OrderFillEvent message contains all the information from an order match in + * the dYdX chain. This includes the maker/taker orders that matched and the + * amount filled. + */ +export interface OrderFillEventV1SDKType { + maker_order: IndexerOrderSDKType; + order?: IndexerOrderSDKType; + liquidation_order?: LiquidationOrderV1SDKType; + fill_amount: bigint; + maker_fee: bigint; + taker_fee: bigint; + total_filled_maker: bigint; + total_filled_taker: bigint; + affiliate_rev_share: bigint; +} +/** + * DeleveragingEvent message contains all the information for a deleveraging + * on the dYdX chain. This includes the liquidated/offsetting subaccounts and + * the amount filled. + */ +export interface DeleveragingEventV1 { + /** ID of the subaccount that was liquidated. */ + liquidated: IndexerSubaccountId; + /** ID of the subaccount that was used to offset the position. */ + offsetting: IndexerSubaccountId; + /** The ID of the perpetual that was liquidated. */ + perpetualId: number; + /** + * The amount filled between the liquidated and offsetting position, in + * base quantums. + */ + fillAmount: bigint; + /** Total quote quantums filled. */ + totalQuoteQuantums: bigint; + /** `true` if liquidating a short position, `false` otherwise. */ + isBuy: boolean; + /** + * `true` if the deleveraging event is for final settlement, indicating + * the match occurred at the oracle price rather than bankruptcy price. + * When this flag is `false`, the fill price is the bankruptcy price + * of the liquidated subaccount. + */ + isFinalSettlement: boolean; +} +export interface DeleveragingEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.DeleveragingEventV1"; + value: Uint8Array; +} +/** + * DeleveragingEvent message contains all the information for a deleveraging + * on the dYdX chain. This includes the liquidated/offsetting subaccounts and + * the amount filled. + */ +export interface DeleveragingEventV1Amino { + /** ID of the subaccount that was liquidated. */ + liquidated?: IndexerSubaccountIdAmino; + /** ID of the subaccount that was used to offset the position. */ + offsetting?: IndexerSubaccountIdAmino; + /** The ID of the perpetual that was liquidated. */ + perpetual_id?: number; + /** + * The amount filled between the liquidated and offsetting position, in + * base quantums. + */ + fill_amount?: string; + /** Total quote quantums filled. */ + total_quote_quantums?: string; + /** `true` if liquidating a short position, `false` otherwise. */ + is_buy?: boolean; + /** + * `true` if the deleveraging event is for final settlement, indicating + * the match occurred at the oracle price rather than bankruptcy price. + * When this flag is `false`, the fill price is the bankruptcy price + * of the liquidated subaccount. + */ + is_final_settlement?: boolean; +} +export interface DeleveragingEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.DeleveragingEventV1"; + value: DeleveragingEventV1Amino; +} +/** + * DeleveragingEvent message contains all the information for a deleveraging + * on the dYdX chain. This includes the liquidated/offsetting subaccounts and + * the amount filled. + */ +export interface DeleveragingEventV1SDKType { + liquidated: IndexerSubaccountIdSDKType; + offsetting: IndexerSubaccountIdSDKType; + perpetual_id: number; + fill_amount: bigint; + total_quote_quantums: bigint; + is_buy: boolean; + is_final_settlement: boolean; +} +/** + * LiquidationOrder represents the liquidation taker order to be included in a + * liquidation order fill event. + */ +export interface LiquidationOrderV1 { + /** ID of the subaccount that was liquidated. */ + liquidated: IndexerSubaccountId; + /** The ID of the clob pair involved in the liquidation. */ + clobPairId: number; + /** The ID of the perpetual involved in the liquidation. */ + perpetualId: number; + /** + * The total size of the liquidation order including any unfilled size, + * in base quantums. + */ + totalSize: bigint; + /** `true` if liquidating a short position, `false` otherwise. */ + isBuy: boolean; + /** + * The fillable price in subticks. + * This represents the lower-price-bound for liquidating longs + * and the upper-price-bound for liquidating shorts. + * Must be a multiple of ClobPair.SubticksPerTick + * (where `ClobPair.Id = orderId.ClobPairId`). + */ + subticks: bigint; +} +export interface LiquidationOrderV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.LiquidationOrderV1"; + value: Uint8Array; +} +/** + * LiquidationOrder represents the liquidation taker order to be included in a + * liquidation order fill event. + */ +export interface LiquidationOrderV1Amino { + /** ID of the subaccount that was liquidated. */ + liquidated?: IndexerSubaccountIdAmino; + /** The ID of the clob pair involved in the liquidation. */ + clob_pair_id?: number; + /** The ID of the perpetual involved in the liquidation. */ + perpetual_id?: number; + /** + * The total size of the liquidation order including any unfilled size, + * in base quantums. + */ + total_size?: string; + /** `true` if liquidating a short position, `false` otherwise. */ + is_buy?: boolean; + /** + * The fillable price in subticks. + * This represents the lower-price-bound for liquidating longs + * and the upper-price-bound for liquidating shorts. + * Must be a multiple of ClobPair.SubticksPerTick + * (where `ClobPair.Id = orderId.ClobPairId`). + */ + subticks?: string; +} +export interface LiquidationOrderV1AminoMsg { + type: "/dydxprotocol.indexer.events.LiquidationOrderV1"; + value: LiquidationOrderV1Amino; +} +/** + * LiquidationOrder represents the liquidation taker order to be included in a + * liquidation order fill event. + */ +export interface LiquidationOrderV1SDKType { + liquidated: IndexerSubaccountIdSDKType; + clob_pair_id: number; + perpetual_id: number; + total_size: bigint; + is_buy: boolean; + subticks: bigint; +} +/** + * SubaccountUpdateEvent message contains information about an update to a + * subaccount in the dYdX chain. This includes the list of updated perpetual + * and asset positions for the subaccount. + * Note: This event message will contain all the updates to a subaccount + * at the end of a block which is why multiple asset/perpetual position + * updates may exist. + */ +export interface SubaccountUpdateEventV1 { + subaccountId?: IndexerSubaccountId; + updatedPerpetualPositions: IndexerPerpetualPosition[]; + updatedAssetPositions: IndexerAssetPosition[]; +} +export interface SubaccountUpdateEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.SubaccountUpdateEventV1"; + value: Uint8Array; +} +/** + * SubaccountUpdateEvent message contains information about an update to a + * subaccount in the dYdX chain. This includes the list of updated perpetual + * and asset positions for the subaccount. + * Note: This event message will contain all the updates to a subaccount + * at the end of a block which is why multiple asset/perpetual position + * updates may exist. + */ +export interface SubaccountUpdateEventV1Amino { + subaccount_id?: IndexerSubaccountIdAmino; + updated_perpetual_positions?: IndexerPerpetualPositionAmino[]; + updated_asset_positions?: IndexerAssetPositionAmino[]; +} +export interface SubaccountUpdateEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.SubaccountUpdateEventV1"; + value: SubaccountUpdateEventV1Amino; +} +/** + * SubaccountUpdateEvent message contains information about an update to a + * subaccount in the dYdX chain. This includes the list of updated perpetual + * and asset positions for the subaccount. + * Note: This event message will contain all the updates to a subaccount + * at the end of a block which is why multiple asset/perpetual position + * updates may exist. + */ +export interface SubaccountUpdateEventV1SDKType { + subaccount_id?: IndexerSubaccountIdSDKType; + updated_perpetual_positions: IndexerPerpetualPositionSDKType[]; + updated_asset_positions: IndexerAssetPositionSDKType[]; +} +/** + * StatefulOrderEvent message contains information about a change to a stateful + * order. Currently, this is either the placement of a long-term order, the + * placement or triggering of a conditional order, or the removal of a + * stateful order. + */ +export interface StatefulOrderEventV1 { + /** @deprecated */ + orderPlace?: StatefulOrderEventV1_StatefulOrderPlacementV1; + orderRemoval?: StatefulOrderEventV1_StatefulOrderRemovalV1; + conditionalOrderPlacement?: StatefulOrderEventV1_ConditionalOrderPlacementV1; + conditionalOrderTriggered?: StatefulOrderEventV1_ConditionalOrderTriggeredV1; + longTermOrderPlacement?: StatefulOrderEventV1_LongTermOrderPlacementV1; + orderReplacement?: StatefulOrderEventV1_LongTermOrderReplacementV1; +} +export interface StatefulOrderEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderEventV1"; + value: Uint8Array; +} +/** + * StatefulOrderEvent message contains information about a change to a stateful + * order. Currently, this is either the placement of a long-term order, the + * placement or triggering of a conditional order, or the removal of a + * stateful order. + */ +export interface StatefulOrderEventV1Amino { + /** @deprecated */ + order_place?: StatefulOrderEventV1_StatefulOrderPlacementV1Amino; + order_removal?: StatefulOrderEventV1_StatefulOrderRemovalV1Amino; + conditional_order_placement?: StatefulOrderEventV1_ConditionalOrderPlacementV1Amino; + conditional_order_triggered?: StatefulOrderEventV1_ConditionalOrderTriggeredV1Amino; + long_term_order_placement?: StatefulOrderEventV1_LongTermOrderPlacementV1Amino; + order_replacement?: StatefulOrderEventV1_LongTermOrderReplacementV1Amino; +} +export interface StatefulOrderEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.StatefulOrderEventV1"; + value: StatefulOrderEventV1Amino; +} +/** + * StatefulOrderEvent message contains information about a change to a stateful + * order. Currently, this is either the placement of a long-term order, the + * placement or triggering of a conditional order, or the removal of a + * stateful order. + */ +export interface StatefulOrderEventV1SDKType { + /** @deprecated */ + order_place?: StatefulOrderEventV1_StatefulOrderPlacementV1SDKType; + order_removal?: StatefulOrderEventV1_StatefulOrderRemovalV1SDKType; + conditional_order_placement?: StatefulOrderEventV1_ConditionalOrderPlacementV1SDKType; + conditional_order_triggered?: StatefulOrderEventV1_ConditionalOrderTriggeredV1SDKType; + long_term_order_placement?: StatefulOrderEventV1_LongTermOrderPlacementV1SDKType; + order_replacement?: StatefulOrderEventV1_LongTermOrderReplacementV1SDKType; +} +/** + * A stateful order placement contains an order. + * Deprecated in favor of LongTermOrderPlacementV1. + */ +export interface StatefulOrderEventV1_StatefulOrderPlacementV1 { + order?: IndexerOrder; +} +export interface StatefulOrderEventV1_StatefulOrderPlacementV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderPlacementV1"; + value: Uint8Array; +} +/** + * A stateful order placement contains an order. + * Deprecated in favor of LongTermOrderPlacementV1. + */ +export interface StatefulOrderEventV1_StatefulOrderPlacementV1Amino { + order?: IndexerOrderAmino; +} +export interface StatefulOrderEventV1_StatefulOrderPlacementV1AminoMsg { + type: "/dydxprotocol.indexer.events.StatefulOrderPlacementV1"; + value: StatefulOrderEventV1_StatefulOrderPlacementV1Amino; +} +/** + * A stateful order placement contains an order. + * Deprecated in favor of LongTermOrderPlacementV1. + */ +export interface StatefulOrderEventV1_StatefulOrderPlacementV1SDKType { + order?: IndexerOrderSDKType; +} +/** + * A stateful order removal contains the id of an order that was already + * placed and is now removed and the reason for the removal. + */ +export interface StatefulOrderEventV1_StatefulOrderRemovalV1 { + removedOrderId?: IndexerOrderId; + reason: OrderRemovalReason; +} +export interface StatefulOrderEventV1_StatefulOrderRemovalV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderRemovalV1"; + value: Uint8Array; +} +/** + * A stateful order removal contains the id of an order that was already + * placed and is now removed and the reason for the removal. + */ +export interface StatefulOrderEventV1_StatefulOrderRemovalV1Amino { + removed_order_id?: IndexerOrderIdAmino; + reason?: OrderRemovalReason; +} +export interface StatefulOrderEventV1_StatefulOrderRemovalV1AminoMsg { + type: "/dydxprotocol.indexer.events.StatefulOrderRemovalV1"; + value: StatefulOrderEventV1_StatefulOrderRemovalV1Amino; +} +/** + * A stateful order removal contains the id of an order that was already + * placed and is now removed and the reason for the removal. + */ +export interface StatefulOrderEventV1_StatefulOrderRemovalV1SDKType { + removed_order_id?: IndexerOrderIdSDKType; + reason: OrderRemovalReason; +} +/** + * A conditional order placement contains an order. The order is newly-placed + * and untriggered when this event is emitted. + */ +export interface StatefulOrderEventV1_ConditionalOrderPlacementV1 { + order?: IndexerOrder; +} +export interface StatefulOrderEventV1_ConditionalOrderPlacementV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.ConditionalOrderPlacementV1"; + value: Uint8Array; +} +/** + * A conditional order placement contains an order. The order is newly-placed + * and untriggered when this event is emitted. + */ +export interface StatefulOrderEventV1_ConditionalOrderPlacementV1Amino { + order?: IndexerOrderAmino; +} +export interface StatefulOrderEventV1_ConditionalOrderPlacementV1AminoMsg { + type: "/dydxprotocol.indexer.events.ConditionalOrderPlacementV1"; + value: StatefulOrderEventV1_ConditionalOrderPlacementV1Amino; +} +/** + * A conditional order placement contains an order. The order is newly-placed + * and untriggered when this event is emitted. + */ +export interface StatefulOrderEventV1_ConditionalOrderPlacementV1SDKType { + order?: IndexerOrderSDKType; +} +/** + * A conditional order trigger event contains an order id and is emitted when + * an order is triggered. + */ +export interface StatefulOrderEventV1_ConditionalOrderTriggeredV1 { + triggeredOrderId?: IndexerOrderId; +} +export interface StatefulOrderEventV1_ConditionalOrderTriggeredV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.ConditionalOrderTriggeredV1"; + value: Uint8Array; +} +/** + * A conditional order trigger event contains an order id and is emitted when + * an order is triggered. + */ +export interface StatefulOrderEventV1_ConditionalOrderTriggeredV1Amino { + triggered_order_id?: IndexerOrderIdAmino; +} +export interface StatefulOrderEventV1_ConditionalOrderTriggeredV1AminoMsg { + type: "/dydxprotocol.indexer.events.ConditionalOrderTriggeredV1"; + value: StatefulOrderEventV1_ConditionalOrderTriggeredV1Amino; +} +/** + * A conditional order trigger event contains an order id and is emitted when + * an order is triggered. + */ +export interface StatefulOrderEventV1_ConditionalOrderTriggeredV1SDKType { + triggered_order_id?: IndexerOrderIdSDKType; +} +/** A long term order placement contains an order. */ +export interface StatefulOrderEventV1_LongTermOrderPlacementV1 { + order?: IndexerOrder; +} +export interface StatefulOrderEventV1_LongTermOrderPlacementV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.LongTermOrderPlacementV1"; + value: Uint8Array; +} +/** A long term order placement contains an order. */ +export interface StatefulOrderEventV1_LongTermOrderPlacementV1Amino { + order?: IndexerOrderAmino; +} +export interface StatefulOrderEventV1_LongTermOrderPlacementV1AminoMsg { + type: "/dydxprotocol.indexer.events.LongTermOrderPlacementV1"; + value: StatefulOrderEventV1_LongTermOrderPlacementV1Amino; +} +/** A long term order placement contains an order. */ +export interface StatefulOrderEventV1_LongTermOrderPlacementV1SDKType { + order?: IndexerOrderSDKType; +} +/** A long term order replacement contains an old order ID and the new order. */ +export interface StatefulOrderEventV1_LongTermOrderReplacementV1 { + /** vault replaces orders with a different order ID */ + oldOrderId?: IndexerOrderId; + order?: IndexerOrder; +} +export interface StatefulOrderEventV1_LongTermOrderReplacementV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.LongTermOrderReplacementV1"; + value: Uint8Array; +} +/** A long term order replacement contains an old order ID and the new order. */ +export interface StatefulOrderEventV1_LongTermOrderReplacementV1Amino { + /** vault replaces orders with a different order ID */ + old_order_id?: IndexerOrderIdAmino; + order?: IndexerOrderAmino; +} +export interface StatefulOrderEventV1_LongTermOrderReplacementV1AminoMsg { + type: "/dydxprotocol.indexer.events.LongTermOrderReplacementV1"; + value: StatefulOrderEventV1_LongTermOrderReplacementV1Amino; +} +/** A long term order replacement contains an old order ID and the new order. */ +export interface StatefulOrderEventV1_LongTermOrderReplacementV1SDKType { + old_order_id?: IndexerOrderIdSDKType; + order?: IndexerOrderSDKType; +} +/** + * AssetCreateEventV1 message contains all the information about an new Asset on + * the dYdX chain. + */ +export interface AssetCreateEventV1 { + /** Unique, sequentially-generated. */ + id: number; + /** + * The human readable symbol of the `Asset` (e.g. `USDC`, `ATOM`). + * Must be uppercase, unique and correspond to the canonical symbol of the + * full coin. + */ + symbol: string; + /** `true` if this `Asset` has a valid `MarketId` value. */ + hasMarket: boolean; + /** + * The `Id` of the `Market` associated with this `Asset`. It acts as the + * oracle price for the purposes of calculating collateral + * and margin requirements. + */ + marketId: number; + /** + * The exponent for converting an atomic amount (1 'quantum') + * to a full coin. For example, if `atomic_resolution = -8` + * then an `asset_position` with `base_quantums = 1e8` is equivalent to + * a position size of one full coin. + */ + atomicResolution: number; +} +export interface AssetCreateEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.AssetCreateEventV1"; + value: Uint8Array; +} +/** + * AssetCreateEventV1 message contains all the information about an new Asset on + * the dYdX chain. + */ +export interface AssetCreateEventV1Amino { + /** Unique, sequentially-generated. */ + id?: number; + /** + * The human readable symbol of the `Asset` (e.g. `USDC`, `ATOM`). + * Must be uppercase, unique and correspond to the canonical symbol of the + * full coin. + */ + symbol?: string; + /** `true` if this `Asset` has a valid `MarketId` value. */ + has_market?: boolean; + /** + * The `Id` of the `Market` associated with this `Asset`. It acts as the + * oracle price for the purposes of calculating collateral + * and margin requirements. + */ + market_id?: number; + /** + * The exponent for converting an atomic amount (1 'quantum') + * to a full coin. For example, if `atomic_resolution = -8` + * then an `asset_position` with `base_quantums = 1e8` is equivalent to + * a position size of one full coin. + */ + atomic_resolution?: number; +} +export interface AssetCreateEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.AssetCreateEventV1"; + value: AssetCreateEventV1Amino; +} +/** + * AssetCreateEventV1 message contains all the information about an new Asset on + * the dYdX chain. + */ +export interface AssetCreateEventV1SDKType { + id: number; + symbol: string; + has_market: boolean; + market_id: number; + atomic_resolution: number; +} +/** + * PerpetualMarketCreateEventV1 message contains all the information about a + * new Perpetual Market on the dYdX chain. + * Deprecated. See PerpetualMarketCreateEventV2 for the most up to date message + * for the event to create a new Perpetual Market. + */ +/** @deprecated */ +export interface PerpetualMarketCreateEventV1 { + /** + * Unique Perpetual id. + * Defined in perpetuals.perpetual + */ + id: number; + /** + * Unique clob pair Id associated with this perpetual market + * Defined in clob.clob_pair + */ + clobPairId: number; + /** + * The name of the `Perpetual` (e.g. `BTC-USD`). + * Defined in perpetuals.perpetual + */ + ticker: string; + /** + * Unique id of market param associated with this perpetual market. + * Defined in perpetuals.perpetual + */ + marketId: number; + /** Status of the CLOB */ + status: ClobPairStatus; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + * Defined in clob.clob_pair + */ + quantumConversionExponent: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + * Defined in perpetuals.perpetual + */ + atomicResolution: number; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + * Defined in clob.clob_pair + */ + subticksPerTick: number; + /** + * Minimum increment in the size of orders on the CLOB, in base quantums. + * Defined in clob.clob_pair + */ + stepBaseQuantums: bigint; + /** + * The liquidity_tier that this perpetual is associated with. + * Defined in perpetuals.perpetual + */ + liquidityTier: number; +} +export interface PerpetualMarketCreateEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV1"; + value: Uint8Array; +} +/** + * PerpetualMarketCreateEventV1 message contains all the information about a + * new Perpetual Market on the dYdX chain. + * Deprecated. See PerpetualMarketCreateEventV2 for the most up to date message + * for the event to create a new Perpetual Market. + */ +/** @deprecated */ +export interface PerpetualMarketCreateEventV1Amino { + /** + * Unique Perpetual id. + * Defined in perpetuals.perpetual + */ + id?: number; + /** + * Unique clob pair Id associated with this perpetual market + * Defined in clob.clob_pair + */ + clob_pair_id?: number; + /** + * The name of the `Perpetual` (e.g. `BTC-USD`). + * Defined in perpetuals.perpetual + */ + ticker?: string; + /** + * Unique id of market param associated with this perpetual market. + * Defined in perpetuals.perpetual + */ + market_id?: number; + /** Status of the CLOB */ + status?: ClobPairStatus; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + * Defined in clob.clob_pair + */ + quantum_conversion_exponent?: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + * Defined in perpetuals.perpetual + */ + atomic_resolution?: number; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + * Defined in clob.clob_pair + */ + subticks_per_tick?: number; + /** + * Minimum increment in the size of orders on the CLOB, in base quantums. + * Defined in clob.clob_pair + */ + step_base_quantums?: string; + /** + * The liquidity_tier that this perpetual is associated with. + * Defined in perpetuals.perpetual + */ + liquidity_tier?: number; +} +export interface PerpetualMarketCreateEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV1"; + value: PerpetualMarketCreateEventV1Amino; +} +/** + * PerpetualMarketCreateEventV1 message contains all the information about a + * new Perpetual Market on the dYdX chain. + * Deprecated. See PerpetualMarketCreateEventV2 for the most up to date message + * for the event to create a new Perpetual Market. + */ +/** @deprecated */ +export interface PerpetualMarketCreateEventV1SDKType { + id: number; + clob_pair_id: number; + ticker: string; + market_id: number; + status: ClobPairStatus; + quantum_conversion_exponent: number; + atomic_resolution: number; + subticks_per_tick: number; + step_base_quantums: bigint; + liquidity_tier: number; +} +/** + * PerpetualMarketCreateEventV2 message contains all the information about a + * new Perpetual Market on the dYdX chain. + */ +export interface PerpetualMarketCreateEventV2 { + /** + * Unique Perpetual id. + * Defined in perpetuals.perpetual + */ + id: number; + /** + * Unique clob pair Id associated with this perpetual market + * Defined in clob.clob_pair + */ + clobPairId: number; + /** + * The name of the `Perpetual` (e.g. `BTC-USD`). + * Defined in perpetuals.perpetual + */ + ticker: string; + /** + * Unique id of market param associated with this perpetual market. + * Defined in perpetuals.perpetual + */ + marketId: number; + /** Status of the CLOB */ + status: ClobPairStatus; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + * Defined in clob.clob_pair + */ + quantumConversionExponent: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + * Defined in perpetuals.perpetual + */ + atomicResolution: number; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + * Defined in clob.clob_pair + */ + subticksPerTick: number; + /** + * Minimum increment in the size of orders on the CLOB, in base quantums. + * Defined in clob.clob_pair + */ + stepBaseQuantums: bigint; + /** + * The liquidity_tier that this perpetual is associated with. + * Defined in perpetuals.perpetual + */ + liquidityTier: number; + /** Market type of the perpetual. */ + marketType: PerpetualMarketType; +} +export interface PerpetualMarketCreateEventV2ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV2"; + value: Uint8Array; +} +/** + * PerpetualMarketCreateEventV2 message contains all the information about a + * new Perpetual Market on the dYdX chain. + */ +export interface PerpetualMarketCreateEventV2Amino { + /** + * Unique Perpetual id. + * Defined in perpetuals.perpetual + */ + id?: number; + /** + * Unique clob pair Id associated with this perpetual market + * Defined in clob.clob_pair + */ + clob_pair_id?: number; + /** + * The name of the `Perpetual` (e.g. `BTC-USD`). + * Defined in perpetuals.perpetual + */ + ticker?: string; + /** + * Unique id of market param associated with this perpetual market. + * Defined in perpetuals.perpetual + */ + market_id?: number; + /** Status of the CLOB */ + status?: ClobPairStatus; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + * Defined in clob.clob_pair + */ + quantum_conversion_exponent?: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + * Defined in perpetuals.perpetual + */ + atomic_resolution?: number; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + * Defined in clob.clob_pair + */ + subticks_per_tick?: number; + /** + * Minimum increment in the size of orders on the CLOB, in base quantums. + * Defined in clob.clob_pair + */ + step_base_quantums?: string; + /** + * The liquidity_tier that this perpetual is associated with. + * Defined in perpetuals.perpetual + */ + liquidity_tier?: number; + /** Market type of the perpetual. */ + market_type?: PerpetualMarketType; +} +export interface PerpetualMarketCreateEventV2AminoMsg { + type: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV2"; + value: PerpetualMarketCreateEventV2Amino; +} +/** + * PerpetualMarketCreateEventV2 message contains all the information about a + * new Perpetual Market on the dYdX chain. + */ +export interface PerpetualMarketCreateEventV2SDKType { + id: number; + clob_pair_id: number; + ticker: string; + market_id: number; + status: ClobPairStatus; + quantum_conversion_exponent: number; + atomic_resolution: number; + subticks_per_tick: number; + step_base_quantums: bigint; + liquidity_tier: number; + market_type: PerpetualMarketType; +} +/** + * LiquidityTierUpsertEventV1 message contains all the information to + * create/update a Liquidity Tier on the dYdX chain. + */ +export interface LiquidityTierUpsertEventV1 { + /** Unique id. */ + id: number; + /** The name of the tier purely for mnemonic purposes, e.g. "Gold". */ + name: string; + /** + * The margin fraction needed to open a position. + * In parts-per-million. + */ + initialMarginPpm: number; + /** + * The fraction of the initial-margin that the maintenance-margin is, + * e.g. 50%. In parts-per-million. + */ + maintenanceFractionPpm: number; + /** + * The maximum position size at which the margin requirements are + * not increased over the default values. Above this position size, + * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. + */ + /** @deprecated */ + basePositionNotional: bigint; +} +export interface LiquidityTierUpsertEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV1"; + value: Uint8Array; +} +/** + * LiquidityTierUpsertEventV1 message contains all the information to + * create/update a Liquidity Tier on the dYdX chain. + */ +export interface LiquidityTierUpsertEventV1Amino { + /** Unique id. */ + id?: number; + /** The name of the tier purely for mnemonic purposes, e.g. "Gold". */ + name?: string; + /** + * The margin fraction needed to open a position. + * In parts-per-million. + */ + initial_margin_ppm?: number; + /** + * The fraction of the initial-margin that the maintenance-margin is, + * e.g. 50%. In parts-per-million. + */ + maintenance_fraction_ppm?: number; + /** + * The maximum position size at which the margin requirements are + * not increased over the default values. Above this position size, + * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. + */ + /** @deprecated */ + base_position_notional?: string; +} +export interface LiquidityTierUpsertEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV1"; + value: LiquidityTierUpsertEventV1Amino; +} +/** + * LiquidityTierUpsertEventV1 message contains all the information to + * create/update a Liquidity Tier on the dYdX chain. + */ +export interface LiquidityTierUpsertEventV1SDKType { + id: number; + name: string; + initial_margin_ppm: number; + maintenance_fraction_ppm: number; + /** @deprecated */ + base_position_notional: bigint; +} +/** + * UpdateClobPairEventV1 message contains all the information about an update to + * a clob pair on the dYdX chain. + */ +export interface UpdateClobPairEventV1 { + /** + * Unique clob pair Id associated with this perpetual market + * Defined in clob.clob_pair + */ + clobPairId: number; + /** Status of the CLOB */ + status: ClobPairStatus; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + * Defined in clob.clob_pair + */ + quantumConversionExponent: number; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + * Defined in clob.clob_pair + */ + subticksPerTick: number; + /** + * Minimum increment in the size of orders on the CLOB, in base quantums. + * Defined in clob.clob_pair + */ + stepBaseQuantums: bigint; +} +export interface UpdateClobPairEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.UpdateClobPairEventV1"; + value: Uint8Array; +} +/** + * UpdateClobPairEventV1 message contains all the information about an update to + * a clob pair on the dYdX chain. + */ +export interface UpdateClobPairEventV1Amino { + /** + * Unique clob pair Id associated with this perpetual market + * Defined in clob.clob_pair + */ + clob_pair_id?: number; + /** Status of the CLOB */ + status?: ClobPairStatus; + /** + * `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum + * per Subtick. + * Defined in clob.clob_pair + */ + quantum_conversion_exponent?: number; + /** + * Defines the tick size of the orderbook by defining how many subticks + * are in one tick. That is, the subticks of any valid order must be a + * multiple of this value. Generally this value should start `>= 100`to + * allow room for decreasing it. + * Defined in clob.clob_pair + */ + subticks_per_tick?: number; + /** + * Minimum increment in the size of orders on the CLOB, in base quantums. + * Defined in clob.clob_pair + */ + step_base_quantums?: string; +} +export interface UpdateClobPairEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.UpdateClobPairEventV1"; + value: UpdateClobPairEventV1Amino; +} +/** + * UpdateClobPairEventV1 message contains all the information about an update to + * a clob pair on the dYdX chain. + */ +export interface UpdateClobPairEventV1SDKType { + clob_pair_id: number; + status: ClobPairStatus; + quantum_conversion_exponent: number; + subticks_per_tick: number; + step_base_quantums: bigint; +} +/** + * UpdatePerpetualEventV1 message contains all the information about an update + * to a perpetual on the dYdX chain. + */ +export interface UpdatePerpetualEventV1 { + /** + * Unique Perpetual id. + * Defined in perpetuals.perpetual + */ + id: number; + /** + * The name of the `Perpetual` (e.g. `BTC-USD`). + * Defined in perpetuals.perpetual + */ + ticker: string; + /** + * Unique id of market param associated with this perpetual market. + * Defined in perpetuals.perpetual + */ + marketId: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + * Defined in perpetuals.perpetual + */ + atomicResolution: number; + /** + * The liquidity_tier that this perpetual is associated with. + * Defined in perpetuals.perpetual + */ + liquidityTier: number; +} +export interface UpdatePerpetualEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.UpdatePerpetualEventV1"; + value: Uint8Array; +} +/** + * UpdatePerpetualEventV1 message contains all the information about an update + * to a perpetual on the dYdX chain. + */ +export interface UpdatePerpetualEventV1Amino { + /** + * Unique Perpetual id. + * Defined in perpetuals.perpetual + */ + id?: number; + /** + * The name of the `Perpetual` (e.g. `BTC-USD`). + * Defined in perpetuals.perpetual + */ + ticker?: string; + /** + * Unique id of market param associated with this perpetual market. + * Defined in perpetuals.perpetual + */ + market_id?: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + * Defined in perpetuals.perpetual + */ + atomic_resolution?: number; + /** + * The liquidity_tier that this perpetual is associated with. + * Defined in perpetuals.perpetual + */ + liquidity_tier?: number; +} +export interface UpdatePerpetualEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.UpdatePerpetualEventV1"; + value: UpdatePerpetualEventV1Amino; +} +/** + * UpdatePerpetualEventV1 message contains all the information about an update + * to a perpetual on the dYdX chain. + */ +export interface UpdatePerpetualEventV1SDKType { + id: number; + ticker: string; + market_id: number; + atomic_resolution: number; + liquidity_tier: number; +} +/** + * TradingRewardsEventV1 is communicates all trading rewards for all accounts + * that receive trade rewards in the block. + */ +export interface TradingRewardsEventV1 { + /** The list of all trading rewards in the block. */ + tradingRewards: AddressTradingReward[]; +} +export interface TradingRewardsEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.TradingRewardsEventV1"; + value: Uint8Array; +} +/** + * TradingRewardsEventV1 is communicates all trading rewards for all accounts + * that receive trade rewards in the block. + */ +export interface TradingRewardsEventV1Amino { + /** The list of all trading rewards in the block. */ + trading_rewards?: AddressTradingRewardAmino[]; +} +export interface TradingRewardsEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.TradingRewardsEventV1"; + value: TradingRewardsEventV1Amino; +} +/** + * TradingRewardsEventV1 is communicates all trading rewards for all accounts + * that receive trade rewards in the block. + */ +export interface TradingRewardsEventV1SDKType { + trading_rewards: AddressTradingRewardSDKType[]; +} +/** + * AddressTradingReward contains info on an instance of an address receiving a + * reward + */ +export interface AddressTradingReward { + /** The address of the wallet that will receive the trading reward. */ + owner: string; + /** + * The amount of trading rewards earned by the address above in denoms. 1e18 + * denoms is equivalent to a single coin. + */ + denomAmount: Uint8Array; +} +export interface AddressTradingRewardProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.AddressTradingReward"; + value: Uint8Array; +} +/** + * AddressTradingReward contains info on an instance of an address receiving a + * reward + */ +export interface AddressTradingRewardAmino { + /** The address of the wallet that will receive the trading reward. */ + owner?: string; + /** + * The amount of trading rewards earned by the address above in denoms. 1e18 + * denoms is equivalent to a single coin. + */ + denom_amount?: string; +} +export interface AddressTradingRewardAminoMsg { + type: "/dydxprotocol.indexer.events.AddressTradingReward"; + value: AddressTradingRewardAmino; +} +/** + * AddressTradingReward contains info on an instance of an address receiving a + * reward + */ +export interface AddressTradingRewardSDKType { + owner: string; + denom_amount: Uint8Array; +} +/** OpenInterestUpdateEventV1 is used for open interest update events */ +export interface OpenInterestUpdateEventV1 { + /** The list of all open interest updates in the block. */ + openInterestUpdates: OpenInterestUpdate[]; +} +export interface OpenInterestUpdateEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.OpenInterestUpdateEventV1"; + value: Uint8Array; +} +/** OpenInterestUpdateEventV1 is used for open interest update events */ +export interface OpenInterestUpdateEventV1Amino { + /** The list of all open interest updates in the block. */ + open_interest_updates?: OpenInterestUpdateAmino[]; +} +export interface OpenInterestUpdateEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.OpenInterestUpdateEventV1"; + value: OpenInterestUpdateEventV1Amino; +} +/** OpenInterestUpdateEventV1 is used for open interest update events */ +export interface OpenInterestUpdateEventV1SDKType { + open_interest_updates: OpenInterestUpdateSDKType[]; +} +/** OpenInterestUpdate contains a single open interest update for a perpetual */ +export interface OpenInterestUpdate { + /** The ID of the perpetual market. */ + perpetualId: number; + /** The new open interest value for the perpetual market. */ + openInterest: Uint8Array; +} +export interface OpenInterestUpdateProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.OpenInterestUpdate"; + value: Uint8Array; +} +/** OpenInterestUpdate contains a single open interest update for a perpetual */ +export interface OpenInterestUpdateAmino { + /** The ID of the perpetual market. */ + perpetual_id?: number; + /** The new open interest value for the perpetual market. */ + open_interest?: string; +} +export interface OpenInterestUpdateAminoMsg { + type: "/dydxprotocol.indexer.events.OpenInterestUpdate"; + value: OpenInterestUpdateAmino; +} +/** OpenInterestUpdate contains a single open interest update for a perpetual */ +export interface OpenInterestUpdateSDKType { + perpetual_id: number; + open_interest: Uint8Array; +} +/** + * LiquidationEventV2 message contains all the information needed to update + * the liquidity tiers. It contains all the fields from V1 along with the + * open interest caps. + */ +export interface LiquidityTierUpsertEventV2 { + /** Unique id. */ + id: number; + /** The name of the tier purely for mnemonic purposes, e.g. "Gold". */ + name: string; + /** + * The margin fraction needed to open a position. + * In parts-per-million. + */ + initialMarginPpm: number; + /** + * The fraction of the initial-margin that the maintenance-margin is, + * e.g. 50%. In parts-per-million. + */ + maintenanceFractionPpm: number; + /** + * The maximum position size at which the margin requirements are + * not increased over the default values. Above this position size, + * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. + */ + /** @deprecated */ + basePositionNotional: bigint; + /** Lower cap of open interest in quote quantums. optional */ + openInterestLowerCap: bigint; + /** Upper cap of open interest in quote quantums. */ + openInterestUpperCap: bigint; +} +export interface LiquidityTierUpsertEventV2ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV2"; + value: Uint8Array; +} +/** + * LiquidationEventV2 message contains all the information needed to update + * the liquidity tiers. It contains all the fields from V1 along with the + * open interest caps. + */ +export interface LiquidityTierUpsertEventV2Amino { + /** Unique id. */ + id?: number; + /** The name of the tier purely for mnemonic purposes, e.g. "Gold". */ + name?: string; + /** + * The margin fraction needed to open a position. + * In parts-per-million. + */ + initial_margin_ppm?: number; + /** + * The fraction of the initial-margin that the maintenance-margin is, + * e.g. 50%. In parts-per-million. + */ + maintenance_fraction_ppm?: number; + /** + * The maximum position size at which the margin requirements are + * not increased over the default values. Above this position size, + * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. + */ + /** @deprecated */ + base_position_notional?: string; + /** Lower cap of open interest in quote quantums. optional */ + open_interest_lower_cap?: string; + /** Upper cap of open interest in quote quantums. */ + open_interest_upper_cap?: string; +} +export interface LiquidityTierUpsertEventV2AminoMsg { + type: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV2"; + value: LiquidityTierUpsertEventV2Amino; +} +/** + * LiquidationEventV2 message contains all the information needed to update + * the liquidity tiers. It contains all the fields from V1 along with the + * open interest caps. + */ +export interface LiquidityTierUpsertEventV2SDKType { + id: number; + name: string; + initial_margin_ppm: number; + maintenance_fraction_ppm: number; + /** @deprecated */ + base_position_notional: bigint; + open_interest_lower_cap: bigint; + open_interest_upper_cap: bigint; +} +/** Event emitted when a referee is registered with an affiliate. */ +export interface RegisterAffiliateEventV1 { + /** Address of the referee being registered. */ + referee: string; + /** Address of the affiliate associated with the referee. */ + affiliate: string; + /** Block number at which the affiliate was registered. */ + registeredAtBlock: bigint; +} +export interface RegisterAffiliateEventV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.events.RegisterAffiliateEventV1"; + value: Uint8Array; +} +/** Event emitted when a referee is registered with an affiliate. */ +export interface RegisterAffiliateEventV1Amino { + /** Address of the referee being registered. */ + referee?: string; + /** Address of the affiliate associated with the referee. */ + affiliate?: string; + /** Block number at which the affiliate was registered. */ + registered_at_block?: string; +} +export interface RegisterAffiliateEventV1AminoMsg { + type: "/dydxprotocol.indexer.events.RegisterAffiliateEventV1"; + value: RegisterAffiliateEventV1Amino; +} +/** Event emitted when a referee is registered with an affiliate. */ +export interface RegisterAffiliateEventV1SDKType { + referee: string; + affiliate: string; + registered_at_block: bigint; +} +function createBaseFundingUpdateV1(): FundingUpdateV1 { + return { + perpetualId: 0, + fundingValuePpm: 0, + fundingIndex: new Uint8Array() + }; +} +export const FundingUpdateV1 = { + typeUrl: "/dydxprotocol.indexer.events.FundingUpdateV1", + encode(message: FundingUpdateV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (message.fundingValuePpm !== 0) { + writer.uint32(16).int32(message.fundingValuePpm); + } + if (message.fundingIndex.length !== 0) { + writer.uint32(26).bytes(message.fundingIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FundingUpdateV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFundingUpdateV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.fundingValuePpm = reader.int32(); + break; + case 3: + message.fundingIndex = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FundingUpdateV1 { + const message = createBaseFundingUpdateV1(); + message.perpetualId = object.perpetualId ?? 0; + message.fundingValuePpm = object.fundingValuePpm ?? 0; + message.fundingIndex = object.fundingIndex ?? new Uint8Array(); + return message; + }, + fromAmino(object: FundingUpdateV1Amino): FundingUpdateV1 { + const message = createBaseFundingUpdateV1(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.funding_value_ppm !== undefined && object.funding_value_ppm !== null) { + message.fundingValuePpm = object.funding_value_ppm; + } + if (object.funding_index !== undefined && object.funding_index !== null) { + message.fundingIndex = bytesFromBase64(object.funding_index); + } + return message; + }, + toAmino(message: FundingUpdateV1): FundingUpdateV1Amino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.funding_value_ppm = message.fundingValuePpm === 0 ? undefined : message.fundingValuePpm; + obj.funding_index = message.fundingIndex ? base64FromBytes(message.fundingIndex) : undefined; + return obj; + }, + fromAminoMsg(object: FundingUpdateV1AminoMsg): FundingUpdateV1 { + return FundingUpdateV1.fromAmino(object.value); + }, + fromProtoMsg(message: FundingUpdateV1ProtoMsg): FundingUpdateV1 { + return FundingUpdateV1.decode(message.value); + }, + toProto(message: FundingUpdateV1): Uint8Array { + return FundingUpdateV1.encode(message).finish(); + }, + toProtoMsg(message: FundingUpdateV1): FundingUpdateV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.FundingUpdateV1", + value: FundingUpdateV1.encode(message).finish() + }; + } +}; +function createBaseFundingEventV1(): FundingEventV1 { + return { + updates: [], + type: 0 + }; +} +export const FundingEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.FundingEventV1", + encode(message: FundingEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.updates) { + FundingUpdateV1.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FundingEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFundingEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(FundingUpdateV1.decode(reader, reader.uint32())); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FundingEventV1 { + const message = createBaseFundingEventV1(); + message.updates = object.updates?.map(e => FundingUpdateV1.fromPartial(e)) || []; + message.type = object.type ?? 0; + return message; + }, + fromAmino(object: FundingEventV1Amino): FundingEventV1 { + const message = createBaseFundingEventV1(); + message.updates = object.updates?.map(e => FundingUpdateV1.fromAmino(e)) || []; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: FundingEventV1): FundingEventV1Amino { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? FundingUpdateV1.toAmino(e) : undefined); + } else { + obj.updates = message.updates; + } + obj.type = message.type === 0 ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: FundingEventV1AminoMsg): FundingEventV1 { + return FundingEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: FundingEventV1ProtoMsg): FundingEventV1 { + return FundingEventV1.decode(message.value); + }, + toProto(message: FundingEventV1): Uint8Array { + return FundingEventV1.encode(message).finish(); + }, + toProtoMsg(message: FundingEventV1): FundingEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.FundingEventV1", + value: FundingEventV1.encode(message).finish() + }; + } +}; +function createBaseMarketEventV1(): MarketEventV1 { + return { + marketId: 0, + priceUpdate: undefined, + marketCreate: undefined, + marketModify: undefined + }; +} +export const MarketEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.MarketEventV1", + encode(message: MarketEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== 0) { + writer.uint32(8).uint32(message.marketId); + } + if (message.priceUpdate !== undefined) { + MarketPriceUpdateEventV1.encode(message.priceUpdate, writer.uint32(18).fork()).ldelim(); + } + if (message.marketCreate !== undefined) { + MarketCreateEventV1.encode(message.marketCreate, writer.uint32(26).fork()).ldelim(); + } + if (message.marketModify !== undefined) { + MarketModifyEventV1.encode(message.marketModify, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.uint32(); + break; + case 2: + message.priceUpdate = MarketPriceUpdateEventV1.decode(reader, reader.uint32()); + break; + case 3: + message.marketCreate = MarketCreateEventV1.decode(reader, reader.uint32()); + break; + case 4: + message.marketModify = MarketModifyEventV1.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketEventV1 { + const message = createBaseMarketEventV1(); + message.marketId = object.marketId ?? 0; + message.priceUpdate = object.priceUpdate !== undefined && object.priceUpdate !== null ? MarketPriceUpdateEventV1.fromPartial(object.priceUpdate) : undefined; + message.marketCreate = object.marketCreate !== undefined && object.marketCreate !== null ? MarketCreateEventV1.fromPartial(object.marketCreate) : undefined; + message.marketModify = object.marketModify !== undefined && object.marketModify !== null ? MarketModifyEventV1.fromPartial(object.marketModify) : undefined; + return message; + }, + fromAmino(object: MarketEventV1Amino): MarketEventV1 { + const message = createBaseMarketEventV1(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.price_update !== undefined && object.price_update !== null) { + message.priceUpdate = MarketPriceUpdateEventV1.fromAmino(object.price_update); + } + if (object.market_create !== undefined && object.market_create !== null) { + message.marketCreate = MarketCreateEventV1.fromAmino(object.market_create); + } + if (object.market_modify !== undefined && object.market_modify !== null) { + message.marketModify = MarketModifyEventV1.fromAmino(object.market_modify); + } + return message; + }, + toAmino(message: MarketEventV1): MarketEventV1Amino { + const obj: any = {}; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.price_update = message.priceUpdate ? MarketPriceUpdateEventV1.toAmino(message.priceUpdate) : undefined; + obj.market_create = message.marketCreate ? MarketCreateEventV1.toAmino(message.marketCreate) : undefined; + obj.market_modify = message.marketModify ? MarketModifyEventV1.toAmino(message.marketModify) : undefined; + return obj; + }, + fromAminoMsg(object: MarketEventV1AminoMsg): MarketEventV1 { + return MarketEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: MarketEventV1ProtoMsg): MarketEventV1 { + return MarketEventV1.decode(message.value); + }, + toProto(message: MarketEventV1): Uint8Array { + return MarketEventV1.encode(message).finish(); + }, + toProtoMsg(message: MarketEventV1): MarketEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.MarketEventV1", + value: MarketEventV1.encode(message).finish() + }; + } +}; +function createBaseMarketPriceUpdateEventV1(): MarketPriceUpdateEventV1 { + return { + priceWithExponent: BigInt(0) + }; +} +export const MarketPriceUpdateEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.MarketPriceUpdateEventV1", + encode(message: MarketPriceUpdateEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.priceWithExponent !== BigInt(0)) { + writer.uint32(8).uint64(message.priceWithExponent); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketPriceUpdateEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketPriceUpdateEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceWithExponent = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketPriceUpdateEventV1 { + const message = createBaseMarketPriceUpdateEventV1(); + message.priceWithExponent = object.priceWithExponent !== undefined && object.priceWithExponent !== null ? BigInt(object.priceWithExponent.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MarketPriceUpdateEventV1Amino): MarketPriceUpdateEventV1 { + const message = createBaseMarketPriceUpdateEventV1(); + if (object.price_with_exponent !== undefined && object.price_with_exponent !== null) { + message.priceWithExponent = BigInt(object.price_with_exponent); + } + return message; + }, + toAmino(message: MarketPriceUpdateEventV1): MarketPriceUpdateEventV1Amino { + const obj: any = {}; + obj.price_with_exponent = message.priceWithExponent !== BigInt(0) ? message.priceWithExponent.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MarketPriceUpdateEventV1AminoMsg): MarketPriceUpdateEventV1 { + return MarketPriceUpdateEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: MarketPriceUpdateEventV1ProtoMsg): MarketPriceUpdateEventV1 { + return MarketPriceUpdateEventV1.decode(message.value); + }, + toProto(message: MarketPriceUpdateEventV1): Uint8Array { + return MarketPriceUpdateEventV1.encode(message).finish(); + }, + toProtoMsg(message: MarketPriceUpdateEventV1): MarketPriceUpdateEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.MarketPriceUpdateEventV1", + value: MarketPriceUpdateEventV1.encode(message).finish() + }; + } +}; +function createBaseMarketBaseEventV1(): MarketBaseEventV1 { + return { + pair: "", + minPriceChangePpm: 0 + }; +} +export const MarketBaseEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.MarketBaseEventV1", + encode(message: MarketBaseEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pair !== "") { + writer.uint32(10).string(message.pair); + } + if (message.minPriceChangePpm !== 0) { + writer.uint32(16).uint32(message.minPriceChangePpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketBaseEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketBaseEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pair = reader.string(); + break; + case 2: + message.minPriceChangePpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketBaseEventV1 { + const message = createBaseMarketBaseEventV1(); + message.pair = object.pair ?? ""; + message.minPriceChangePpm = object.minPriceChangePpm ?? 0; + return message; + }, + fromAmino(object: MarketBaseEventV1Amino): MarketBaseEventV1 { + const message = createBaseMarketBaseEventV1(); + if (object.pair !== undefined && object.pair !== null) { + message.pair = object.pair; + } + if (object.min_price_change_ppm !== undefined && object.min_price_change_ppm !== null) { + message.minPriceChangePpm = object.min_price_change_ppm; + } + return message; + }, + toAmino(message: MarketBaseEventV1): MarketBaseEventV1Amino { + const obj: any = {}; + obj.pair = message.pair === "" ? undefined : message.pair; + obj.min_price_change_ppm = message.minPriceChangePpm === 0 ? undefined : message.minPriceChangePpm; + return obj; + }, + fromAminoMsg(object: MarketBaseEventV1AminoMsg): MarketBaseEventV1 { + return MarketBaseEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: MarketBaseEventV1ProtoMsg): MarketBaseEventV1 { + return MarketBaseEventV1.decode(message.value); + }, + toProto(message: MarketBaseEventV1): Uint8Array { + return MarketBaseEventV1.encode(message).finish(); + }, + toProtoMsg(message: MarketBaseEventV1): MarketBaseEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.MarketBaseEventV1", + value: MarketBaseEventV1.encode(message).finish() + }; + } +}; +function createBaseMarketCreateEventV1(): MarketCreateEventV1 { + return { + base: undefined, + exponent: 0 + }; +} +export const MarketCreateEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.MarketCreateEventV1", + encode(message: MarketCreateEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.base !== undefined) { + MarketBaseEventV1.encode(message.base, writer.uint32(10).fork()).ldelim(); + } + if (message.exponent !== 0) { + writer.uint32(16).sint32(message.exponent); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketCreateEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketCreateEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.base = MarketBaseEventV1.decode(reader, reader.uint32()); + break; + case 2: + message.exponent = reader.sint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketCreateEventV1 { + const message = createBaseMarketCreateEventV1(); + message.base = object.base !== undefined && object.base !== null ? MarketBaseEventV1.fromPartial(object.base) : undefined; + message.exponent = object.exponent ?? 0; + return message; + }, + fromAmino(object: MarketCreateEventV1Amino): MarketCreateEventV1 { + const message = createBaseMarketCreateEventV1(); + if (object.base !== undefined && object.base !== null) { + message.base = MarketBaseEventV1.fromAmino(object.base); + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + return message; + }, + toAmino(message: MarketCreateEventV1): MarketCreateEventV1Amino { + const obj: any = {}; + obj.base = message.base ? MarketBaseEventV1.toAmino(message.base) : undefined; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + return obj; + }, + fromAminoMsg(object: MarketCreateEventV1AminoMsg): MarketCreateEventV1 { + return MarketCreateEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: MarketCreateEventV1ProtoMsg): MarketCreateEventV1 { + return MarketCreateEventV1.decode(message.value); + }, + toProto(message: MarketCreateEventV1): Uint8Array { + return MarketCreateEventV1.encode(message).finish(); + }, + toProtoMsg(message: MarketCreateEventV1): MarketCreateEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.MarketCreateEventV1", + value: MarketCreateEventV1.encode(message).finish() + }; + } +}; +function createBaseMarketModifyEventV1(): MarketModifyEventV1 { + return { + base: undefined + }; +} +export const MarketModifyEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.MarketModifyEventV1", + encode(message: MarketModifyEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.base !== undefined) { + MarketBaseEventV1.encode(message.base, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketModifyEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketModifyEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.base = MarketBaseEventV1.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketModifyEventV1 { + const message = createBaseMarketModifyEventV1(); + message.base = object.base !== undefined && object.base !== null ? MarketBaseEventV1.fromPartial(object.base) : undefined; + return message; + }, + fromAmino(object: MarketModifyEventV1Amino): MarketModifyEventV1 { + const message = createBaseMarketModifyEventV1(); + if (object.base !== undefined && object.base !== null) { + message.base = MarketBaseEventV1.fromAmino(object.base); + } + return message; + }, + toAmino(message: MarketModifyEventV1): MarketModifyEventV1Amino { + const obj: any = {}; + obj.base = message.base ? MarketBaseEventV1.toAmino(message.base) : undefined; + return obj; + }, + fromAminoMsg(object: MarketModifyEventV1AminoMsg): MarketModifyEventV1 { + return MarketModifyEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: MarketModifyEventV1ProtoMsg): MarketModifyEventV1 { + return MarketModifyEventV1.decode(message.value); + }, + toProto(message: MarketModifyEventV1): Uint8Array { + return MarketModifyEventV1.encode(message).finish(); + }, + toProtoMsg(message: MarketModifyEventV1): MarketModifyEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.MarketModifyEventV1", + value: MarketModifyEventV1.encode(message).finish() + }; + } +}; +function createBaseSourceOfFunds(): SourceOfFunds { + return { + subaccountId: undefined, + address: undefined + }; +} +export const SourceOfFunds = { + typeUrl: "/dydxprotocol.indexer.events.SourceOfFunds", + encode(message: SourceOfFunds, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + IndexerSubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.address !== undefined) { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceOfFunds { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceOfFunds(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SourceOfFunds { + const message = createBaseSourceOfFunds(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? IndexerSubaccountId.fromPartial(object.subaccountId) : undefined; + message.address = object.address ?? undefined; + return message; + }, + fromAmino(object: SourceOfFundsAmino): SourceOfFunds { + const message = createBaseSourceOfFunds(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = IndexerSubaccountId.fromAmino(object.subaccount_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: SourceOfFunds): SourceOfFundsAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? IndexerSubaccountId.toAmino(message.subaccountId) : undefined; + obj.address = message.address === null ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: SourceOfFundsAminoMsg): SourceOfFunds { + return SourceOfFunds.fromAmino(object.value); + }, + fromProtoMsg(message: SourceOfFundsProtoMsg): SourceOfFunds { + return SourceOfFunds.decode(message.value); + }, + toProto(message: SourceOfFunds): Uint8Array { + return SourceOfFunds.encode(message).finish(); + }, + toProtoMsg(message: SourceOfFunds): SourceOfFundsProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.SourceOfFunds", + value: SourceOfFunds.encode(message).finish() + }; + } +}; +function createBaseTransferEventV1(): TransferEventV1 { + return { + senderSubaccountId: undefined, + recipientSubaccountId: undefined, + assetId: 0, + amount: BigInt(0), + sender: undefined, + recipient: undefined + }; +} +export const TransferEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.TransferEventV1", + encode(message: TransferEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.senderSubaccountId !== undefined) { + IndexerSubaccountId.encode(message.senderSubaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.recipientSubaccountId !== undefined) { + IndexerSubaccountId.encode(message.recipientSubaccountId, writer.uint32(18).fork()).ldelim(); + } + if (message.assetId !== 0) { + writer.uint32(24).uint32(message.assetId); + } + if (message.amount !== BigInt(0)) { + writer.uint32(32).uint64(message.amount); + } + if (message.sender !== undefined) { + SourceOfFunds.encode(message.sender, writer.uint32(42).fork()).ldelim(); + } + if (message.recipient !== undefined) { + SourceOfFunds.encode(message.recipient, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TransferEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransferEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.senderSubaccountId = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.recipientSubaccountId = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 3: + message.assetId = reader.uint32(); + break; + case 4: + message.amount = reader.uint64(); + break; + case 5: + message.sender = SourceOfFunds.decode(reader, reader.uint32()); + break; + case 6: + message.recipient = SourceOfFunds.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TransferEventV1 { + const message = createBaseTransferEventV1(); + message.senderSubaccountId = object.senderSubaccountId !== undefined && object.senderSubaccountId !== null ? IndexerSubaccountId.fromPartial(object.senderSubaccountId) : undefined; + message.recipientSubaccountId = object.recipientSubaccountId !== undefined && object.recipientSubaccountId !== null ? IndexerSubaccountId.fromPartial(object.recipientSubaccountId) : undefined; + message.assetId = object.assetId ?? 0; + message.amount = object.amount !== undefined && object.amount !== null ? BigInt(object.amount.toString()) : BigInt(0); + message.sender = object.sender !== undefined && object.sender !== null ? SourceOfFunds.fromPartial(object.sender) : undefined; + message.recipient = object.recipient !== undefined && object.recipient !== null ? SourceOfFunds.fromPartial(object.recipient) : undefined; + return message; + }, + fromAmino(object: TransferEventV1Amino): TransferEventV1 { + const message = createBaseTransferEventV1(); + if (object.sender_subaccount_id !== undefined && object.sender_subaccount_id !== null) { + message.senderSubaccountId = IndexerSubaccountId.fromAmino(object.sender_subaccount_id); + } + if (object.recipient_subaccount_id !== undefined && object.recipient_subaccount_id !== null) { + message.recipientSubaccountId = IndexerSubaccountId.fromAmino(object.recipient_subaccount_id); + } + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = BigInt(object.amount); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = SourceOfFunds.fromAmino(object.sender); + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = SourceOfFunds.fromAmino(object.recipient); + } + return message; + }, + toAmino(message: TransferEventV1): TransferEventV1Amino { + const obj: any = {}; + obj.sender_subaccount_id = message.senderSubaccountId ? IndexerSubaccountId.toAmino(message.senderSubaccountId) : undefined; + obj.recipient_subaccount_id = message.recipientSubaccountId ? IndexerSubaccountId.toAmino(message.recipientSubaccountId) : undefined; + obj.asset_id = message.assetId === 0 ? undefined : message.assetId; + obj.amount = message.amount !== BigInt(0) ? message.amount.toString() : undefined; + obj.sender = message.sender ? SourceOfFunds.toAmino(message.sender) : undefined; + obj.recipient = message.recipient ? SourceOfFunds.toAmino(message.recipient) : undefined; + return obj; + }, + fromAminoMsg(object: TransferEventV1AminoMsg): TransferEventV1 { + return TransferEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: TransferEventV1ProtoMsg): TransferEventV1 { + return TransferEventV1.decode(message.value); + }, + toProto(message: TransferEventV1): Uint8Array { + return TransferEventV1.encode(message).finish(); + }, + toProtoMsg(message: TransferEventV1): TransferEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.TransferEventV1", + value: TransferEventV1.encode(message).finish() + }; + } +}; +function createBaseOrderFillEventV1(): OrderFillEventV1 { + return { + makerOrder: IndexerOrder.fromPartial({}), + order: undefined, + liquidationOrder: undefined, + fillAmount: BigInt(0), + makerFee: BigInt(0), + takerFee: BigInt(0), + totalFilledMaker: BigInt(0), + totalFilledTaker: BigInt(0), + affiliateRevShare: BigInt(0) + }; +} +export const OrderFillEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.OrderFillEventV1", + encode(message: OrderFillEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.makerOrder !== undefined) { + IndexerOrder.encode(message.makerOrder, writer.uint32(10).fork()).ldelim(); + } + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + if (message.liquidationOrder !== undefined) { + LiquidationOrderV1.encode(message.liquidationOrder, writer.uint32(34).fork()).ldelim(); + } + if (message.fillAmount !== BigInt(0)) { + writer.uint32(24).uint64(message.fillAmount); + } + if (message.makerFee !== BigInt(0)) { + writer.uint32(40).sint64(message.makerFee); + } + if (message.takerFee !== BigInt(0)) { + writer.uint32(48).sint64(message.takerFee); + } + if (message.totalFilledMaker !== BigInt(0)) { + writer.uint32(56).uint64(message.totalFilledMaker); + } + if (message.totalFilledTaker !== BigInt(0)) { + writer.uint32(64).uint64(message.totalFilledTaker); + } + if (message.affiliateRevShare !== BigInt(0)) { + writer.uint32(72).uint64(message.affiliateRevShare); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderFillEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderFillEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.makerOrder = IndexerOrder.decode(reader, reader.uint32()); + break; + case 2: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + case 4: + message.liquidationOrder = LiquidationOrderV1.decode(reader, reader.uint32()); + break; + case 3: + message.fillAmount = reader.uint64(); + break; + case 5: + message.makerFee = reader.sint64(); + break; + case 6: + message.takerFee = reader.sint64(); + break; + case 7: + message.totalFilledMaker = reader.uint64(); + break; + case 8: + message.totalFilledTaker = reader.uint64(); + break; + case 9: + message.affiliateRevShare = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderFillEventV1 { + const message = createBaseOrderFillEventV1(); + message.makerOrder = object.makerOrder !== undefined && object.makerOrder !== null ? IndexerOrder.fromPartial(object.makerOrder) : undefined; + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + message.liquidationOrder = object.liquidationOrder !== undefined && object.liquidationOrder !== null ? LiquidationOrderV1.fromPartial(object.liquidationOrder) : undefined; + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + message.makerFee = object.makerFee !== undefined && object.makerFee !== null ? BigInt(object.makerFee.toString()) : BigInt(0); + message.takerFee = object.takerFee !== undefined && object.takerFee !== null ? BigInt(object.takerFee.toString()) : BigInt(0); + message.totalFilledMaker = object.totalFilledMaker !== undefined && object.totalFilledMaker !== null ? BigInt(object.totalFilledMaker.toString()) : BigInt(0); + message.totalFilledTaker = object.totalFilledTaker !== undefined && object.totalFilledTaker !== null ? BigInt(object.totalFilledTaker.toString()) : BigInt(0); + message.affiliateRevShare = object.affiliateRevShare !== undefined && object.affiliateRevShare !== null ? BigInt(object.affiliateRevShare.toString()) : BigInt(0); + return message; + }, + fromAmino(object: OrderFillEventV1Amino): OrderFillEventV1 { + const message = createBaseOrderFillEventV1(); + if (object.maker_order !== undefined && object.maker_order !== null) { + message.makerOrder = IndexerOrder.fromAmino(object.maker_order); + } + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + if (object.liquidation_order !== undefined && object.liquidation_order !== null) { + message.liquidationOrder = LiquidationOrderV1.fromAmino(object.liquidation_order); + } + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + if (object.maker_fee !== undefined && object.maker_fee !== null) { + message.makerFee = BigInt(object.maker_fee); + } + if (object.taker_fee !== undefined && object.taker_fee !== null) { + message.takerFee = BigInt(object.taker_fee); + } + if (object.total_filled_maker !== undefined && object.total_filled_maker !== null) { + message.totalFilledMaker = BigInt(object.total_filled_maker); + } + if (object.total_filled_taker !== undefined && object.total_filled_taker !== null) { + message.totalFilledTaker = BigInt(object.total_filled_taker); + } + if (object.affiliate_rev_share !== undefined && object.affiliate_rev_share !== null) { + message.affiliateRevShare = BigInt(object.affiliate_rev_share); + } + return message; + }, + toAmino(message: OrderFillEventV1): OrderFillEventV1Amino { + const obj: any = {}; + obj.maker_order = message.makerOrder ? IndexerOrder.toAmino(message.makerOrder) : undefined; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + obj.liquidation_order = message.liquidationOrder ? LiquidationOrderV1.toAmino(message.liquidationOrder) : undefined; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + obj.maker_fee = message.makerFee !== BigInt(0) ? message.makerFee.toString() : undefined; + obj.taker_fee = message.takerFee !== BigInt(0) ? message.takerFee.toString() : undefined; + obj.total_filled_maker = message.totalFilledMaker !== BigInt(0) ? message.totalFilledMaker.toString() : undefined; + obj.total_filled_taker = message.totalFilledTaker !== BigInt(0) ? message.totalFilledTaker.toString() : undefined; + obj.affiliate_rev_share = message.affiliateRevShare !== BigInt(0) ? message.affiliateRevShare.toString() : undefined; + return obj; + }, + fromAminoMsg(object: OrderFillEventV1AminoMsg): OrderFillEventV1 { + return OrderFillEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: OrderFillEventV1ProtoMsg): OrderFillEventV1 { + return OrderFillEventV1.decode(message.value); + }, + toProto(message: OrderFillEventV1): Uint8Array { + return OrderFillEventV1.encode(message).finish(); + }, + toProtoMsg(message: OrderFillEventV1): OrderFillEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.OrderFillEventV1", + value: OrderFillEventV1.encode(message).finish() + }; + } +}; +function createBaseDeleveragingEventV1(): DeleveragingEventV1 { + return { + liquidated: IndexerSubaccountId.fromPartial({}), + offsetting: IndexerSubaccountId.fromPartial({}), + perpetualId: 0, + fillAmount: BigInt(0), + totalQuoteQuantums: BigInt(0), + isBuy: false, + isFinalSettlement: false + }; +} +export const DeleveragingEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.DeleveragingEventV1", + encode(message: DeleveragingEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidated !== undefined) { + IndexerSubaccountId.encode(message.liquidated, writer.uint32(10).fork()).ldelim(); + } + if (message.offsetting !== undefined) { + IndexerSubaccountId.encode(message.offsetting, writer.uint32(18).fork()).ldelim(); + } + if (message.perpetualId !== 0) { + writer.uint32(24).uint32(message.perpetualId); + } + if (message.fillAmount !== BigInt(0)) { + writer.uint32(32).uint64(message.fillAmount); + } + if (message.totalQuoteQuantums !== BigInt(0)) { + writer.uint32(40).uint64(message.totalQuoteQuantums); + } + if (message.isBuy === true) { + writer.uint32(48).bool(message.isBuy); + } + if (message.isFinalSettlement === true) { + writer.uint32(56).bool(message.isFinalSettlement); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DeleveragingEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleveragingEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidated = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.offsetting = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 3: + message.perpetualId = reader.uint32(); + break; + case 4: + message.fillAmount = reader.uint64(); + break; + case 5: + message.totalQuoteQuantums = reader.uint64(); + break; + case 6: + message.isBuy = reader.bool(); + break; + case 7: + message.isFinalSettlement = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DeleveragingEventV1 { + const message = createBaseDeleveragingEventV1(); + message.liquidated = object.liquidated !== undefined && object.liquidated !== null ? IndexerSubaccountId.fromPartial(object.liquidated) : undefined; + message.offsetting = object.offsetting !== undefined && object.offsetting !== null ? IndexerSubaccountId.fromPartial(object.offsetting) : undefined; + message.perpetualId = object.perpetualId ?? 0; + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? BigInt(object.fillAmount.toString()) : BigInt(0); + message.totalQuoteQuantums = object.totalQuoteQuantums !== undefined && object.totalQuoteQuantums !== null ? BigInt(object.totalQuoteQuantums.toString()) : BigInt(0); + message.isBuy = object.isBuy ?? false; + message.isFinalSettlement = object.isFinalSettlement ?? false; + return message; + }, + fromAmino(object: DeleveragingEventV1Amino): DeleveragingEventV1 { + const message = createBaseDeleveragingEventV1(); + if (object.liquidated !== undefined && object.liquidated !== null) { + message.liquidated = IndexerSubaccountId.fromAmino(object.liquidated); + } + if (object.offsetting !== undefined && object.offsetting !== null) { + message.offsetting = IndexerSubaccountId.fromAmino(object.offsetting); + } + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.fill_amount !== undefined && object.fill_amount !== null) { + message.fillAmount = BigInt(object.fill_amount); + } + if (object.total_quote_quantums !== undefined && object.total_quote_quantums !== null) { + message.totalQuoteQuantums = BigInt(object.total_quote_quantums); + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.is_final_settlement !== undefined && object.is_final_settlement !== null) { + message.isFinalSettlement = object.is_final_settlement; + } + return message; + }, + toAmino(message: DeleveragingEventV1): DeleveragingEventV1Amino { + const obj: any = {}; + obj.liquidated = message.liquidated ? IndexerSubaccountId.toAmino(message.liquidated) : undefined; + obj.offsetting = message.offsetting ? IndexerSubaccountId.toAmino(message.offsetting) : undefined; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.fill_amount = message.fillAmount !== BigInt(0) ? message.fillAmount.toString() : undefined; + obj.total_quote_quantums = message.totalQuoteQuantums !== BigInt(0) ? message.totalQuoteQuantums.toString() : undefined; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.is_final_settlement = message.isFinalSettlement === false ? undefined : message.isFinalSettlement; + return obj; + }, + fromAminoMsg(object: DeleveragingEventV1AminoMsg): DeleveragingEventV1 { + return DeleveragingEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: DeleveragingEventV1ProtoMsg): DeleveragingEventV1 { + return DeleveragingEventV1.decode(message.value); + }, + toProto(message: DeleveragingEventV1): Uint8Array { + return DeleveragingEventV1.encode(message).finish(); + }, + toProtoMsg(message: DeleveragingEventV1): DeleveragingEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.DeleveragingEventV1", + value: DeleveragingEventV1.encode(message).finish() + }; + } +}; +function createBaseLiquidationOrderV1(): LiquidationOrderV1 { + return { + liquidated: IndexerSubaccountId.fromPartial({}), + clobPairId: 0, + perpetualId: 0, + totalSize: BigInt(0), + isBuy: false, + subticks: BigInt(0) + }; +} +export const LiquidationOrderV1 = { + typeUrl: "/dydxprotocol.indexer.events.LiquidationOrderV1", + encode(message: LiquidationOrderV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidated !== undefined) { + IndexerSubaccountId.encode(message.liquidated, writer.uint32(10).fork()).ldelim(); + } + if (message.clobPairId !== 0) { + writer.uint32(16).uint32(message.clobPairId); + } + if (message.perpetualId !== 0) { + writer.uint32(24).uint32(message.perpetualId); + } + if (message.totalSize !== BigInt(0)) { + writer.uint32(32).uint64(message.totalSize); + } + if (message.isBuy === true) { + writer.uint32(40).bool(message.isBuy); + } + if (message.subticks !== BigInt(0)) { + writer.uint32(48).uint64(message.subticks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidationOrderV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidationOrderV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidated = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.clobPairId = reader.uint32(); + break; + case 3: + message.perpetualId = reader.uint32(); + break; + case 4: + message.totalSize = reader.uint64(); + break; + case 5: + message.isBuy = reader.bool(); + break; + case 6: + message.subticks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidationOrderV1 { + const message = createBaseLiquidationOrderV1(); + message.liquidated = object.liquidated !== undefined && object.liquidated !== null ? IndexerSubaccountId.fromPartial(object.liquidated) : undefined; + message.clobPairId = object.clobPairId ?? 0; + message.perpetualId = object.perpetualId ?? 0; + message.totalSize = object.totalSize !== undefined && object.totalSize !== null ? BigInt(object.totalSize.toString()) : BigInt(0); + message.isBuy = object.isBuy ?? false; + message.subticks = object.subticks !== undefined && object.subticks !== null ? BigInt(object.subticks.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LiquidationOrderV1Amino): LiquidationOrderV1 { + const message = createBaseLiquidationOrderV1(); + if (object.liquidated !== undefined && object.liquidated !== null) { + message.liquidated = IndexerSubaccountId.fromAmino(object.liquidated); + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.total_size !== undefined && object.total_size !== null) { + message.totalSize = BigInt(object.total_size); + } + if (object.is_buy !== undefined && object.is_buy !== null) { + message.isBuy = object.is_buy; + } + if (object.subticks !== undefined && object.subticks !== null) { + message.subticks = BigInt(object.subticks); + } + return message; + }, + toAmino(message: LiquidationOrderV1): LiquidationOrderV1Amino { + const obj: any = {}; + obj.liquidated = message.liquidated ? IndexerSubaccountId.toAmino(message.liquidated) : undefined; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.total_size = message.totalSize !== BigInt(0) ? message.totalSize.toString() : undefined; + obj.is_buy = message.isBuy === false ? undefined : message.isBuy; + obj.subticks = message.subticks !== BigInt(0) ? message.subticks.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LiquidationOrderV1AminoMsg): LiquidationOrderV1 { + return LiquidationOrderV1.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidationOrderV1ProtoMsg): LiquidationOrderV1 { + return LiquidationOrderV1.decode(message.value); + }, + toProto(message: LiquidationOrderV1): Uint8Array { + return LiquidationOrderV1.encode(message).finish(); + }, + toProtoMsg(message: LiquidationOrderV1): LiquidationOrderV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.LiquidationOrderV1", + value: LiquidationOrderV1.encode(message).finish() + }; + } +}; +function createBaseSubaccountUpdateEventV1(): SubaccountUpdateEventV1 { + return { + subaccountId: undefined, + updatedPerpetualPositions: [], + updatedAssetPositions: [] + }; +} +export const SubaccountUpdateEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.SubaccountUpdateEventV1", + encode(message: SubaccountUpdateEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + IndexerSubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.updatedPerpetualPositions) { + IndexerPerpetualPosition.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.updatedAssetPositions) { + IndexerAssetPosition.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountUpdateEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountUpdateEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 3: + message.updatedPerpetualPositions.push(IndexerPerpetualPosition.decode(reader, reader.uint32())); + break; + case 4: + message.updatedAssetPositions.push(IndexerAssetPosition.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountUpdateEventV1 { + const message = createBaseSubaccountUpdateEventV1(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? IndexerSubaccountId.fromPartial(object.subaccountId) : undefined; + message.updatedPerpetualPositions = object.updatedPerpetualPositions?.map(e => IndexerPerpetualPosition.fromPartial(e)) || []; + message.updatedAssetPositions = object.updatedAssetPositions?.map(e => IndexerAssetPosition.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SubaccountUpdateEventV1Amino): SubaccountUpdateEventV1 { + const message = createBaseSubaccountUpdateEventV1(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = IndexerSubaccountId.fromAmino(object.subaccount_id); + } + message.updatedPerpetualPositions = object.updated_perpetual_positions?.map(e => IndexerPerpetualPosition.fromAmino(e)) || []; + message.updatedAssetPositions = object.updated_asset_positions?.map(e => IndexerAssetPosition.fromAmino(e)) || []; + return message; + }, + toAmino(message: SubaccountUpdateEventV1): SubaccountUpdateEventV1Amino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? IndexerSubaccountId.toAmino(message.subaccountId) : undefined; + if (message.updatedPerpetualPositions) { + obj.updated_perpetual_positions = message.updatedPerpetualPositions.map(e => e ? IndexerPerpetualPosition.toAmino(e) : undefined); + } else { + obj.updated_perpetual_positions = message.updatedPerpetualPositions; + } + if (message.updatedAssetPositions) { + obj.updated_asset_positions = message.updatedAssetPositions.map(e => e ? IndexerAssetPosition.toAmino(e) : undefined); + } else { + obj.updated_asset_positions = message.updatedAssetPositions; + } + return obj; + }, + fromAminoMsg(object: SubaccountUpdateEventV1AminoMsg): SubaccountUpdateEventV1 { + return SubaccountUpdateEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountUpdateEventV1ProtoMsg): SubaccountUpdateEventV1 { + return SubaccountUpdateEventV1.decode(message.value); + }, + toProto(message: SubaccountUpdateEventV1): Uint8Array { + return SubaccountUpdateEventV1.encode(message).finish(); + }, + toProtoMsg(message: SubaccountUpdateEventV1): SubaccountUpdateEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.SubaccountUpdateEventV1", + value: SubaccountUpdateEventV1.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderEventV1(): StatefulOrderEventV1 { + return { + orderPlace: undefined, + orderRemoval: undefined, + conditionalOrderPlacement: undefined, + conditionalOrderTriggered: undefined, + longTermOrderPlacement: undefined, + orderReplacement: undefined + }; +} +export const StatefulOrderEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderEventV1", + encode(message: StatefulOrderEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderPlace !== undefined) { + StatefulOrderEventV1_StatefulOrderPlacementV1.encode(message.orderPlace, writer.uint32(10).fork()).ldelim(); + } + if (message.orderRemoval !== undefined) { + StatefulOrderEventV1_StatefulOrderRemovalV1.encode(message.orderRemoval, writer.uint32(34).fork()).ldelim(); + } + if (message.conditionalOrderPlacement !== undefined) { + StatefulOrderEventV1_ConditionalOrderPlacementV1.encode(message.conditionalOrderPlacement, writer.uint32(42).fork()).ldelim(); + } + if (message.conditionalOrderTriggered !== undefined) { + StatefulOrderEventV1_ConditionalOrderTriggeredV1.encode(message.conditionalOrderTriggered, writer.uint32(50).fork()).ldelim(); + } + if (message.longTermOrderPlacement !== undefined) { + StatefulOrderEventV1_LongTermOrderPlacementV1.encode(message.longTermOrderPlacement, writer.uint32(58).fork()).ldelim(); + } + if (message.orderReplacement !== undefined) { + StatefulOrderEventV1_LongTermOrderReplacementV1.encode(message.orderReplacement, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderPlace = StatefulOrderEventV1_StatefulOrderPlacementV1.decode(reader, reader.uint32()); + break; + case 4: + message.orderRemoval = StatefulOrderEventV1_StatefulOrderRemovalV1.decode(reader, reader.uint32()); + break; + case 5: + message.conditionalOrderPlacement = StatefulOrderEventV1_ConditionalOrderPlacementV1.decode(reader, reader.uint32()); + break; + case 6: + message.conditionalOrderTriggered = StatefulOrderEventV1_ConditionalOrderTriggeredV1.decode(reader, reader.uint32()); + break; + case 7: + message.longTermOrderPlacement = StatefulOrderEventV1_LongTermOrderPlacementV1.decode(reader, reader.uint32()); + break; + case 8: + message.orderReplacement = StatefulOrderEventV1_LongTermOrderReplacementV1.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderEventV1 { + const message = createBaseStatefulOrderEventV1(); + message.orderPlace = object.orderPlace !== undefined && object.orderPlace !== null ? StatefulOrderEventV1_StatefulOrderPlacementV1.fromPartial(object.orderPlace) : undefined; + message.orderRemoval = object.orderRemoval !== undefined && object.orderRemoval !== null ? StatefulOrderEventV1_StatefulOrderRemovalV1.fromPartial(object.orderRemoval) : undefined; + message.conditionalOrderPlacement = object.conditionalOrderPlacement !== undefined && object.conditionalOrderPlacement !== null ? StatefulOrderEventV1_ConditionalOrderPlacementV1.fromPartial(object.conditionalOrderPlacement) : undefined; + message.conditionalOrderTriggered = object.conditionalOrderTriggered !== undefined && object.conditionalOrderTriggered !== null ? StatefulOrderEventV1_ConditionalOrderTriggeredV1.fromPartial(object.conditionalOrderTriggered) : undefined; + message.longTermOrderPlacement = object.longTermOrderPlacement !== undefined && object.longTermOrderPlacement !== null ? StatefulOrderEventV1_LongTermOrderPlacementV1.fromPartial(object.longTermOrderPlacement) : undefined; + message.orderReplacement = object.orderReplacement !== undefined && object.orderReplacement !== null ? StatefulOrderEventV1_LongTermOrderReplacementV1.fromPartial(object.orderReplacement) : undefined; + return message; + }, + fromAmino(object: StatefulOrderEventV1Amino): StatefulOrderEventV1 { + const message = createBaseStatefulOrderEventV1(); + if (object.order_place !== undefined && object.order_place !== null) { + message.orderPlace = StatefulOrderEventV1_StatefulOrderPlacementV1.fromAmino(object.order_place); + } + if (object.order_removal !== undefined && object.order_removal !== null) { + message.orderRemoval = StatefulOrderEventV1_StatefulOrderRemovalV1.fromAmino(object.order_removal); + } + if (object.conditional_order_placement !== undefined && object.conditional_order_placement !== null) { + message.conditionalOrderPlacement = StatefulOrderEventV1_ConditionalOrderPlacementV1.fromAmino(object.conditional_order_placement); + } + if (object.conditional_order_triggered !== undefined && object.conditional_order_triggered !== null) { + message.conditionalOrderTriggered = StatefulOrderEventV1_ConditionalOrderTriggeredV1.fromAmino(object.conditional_order_triggered); + } + if (object.long_term_order_placement !== undefined && object.long_term_order_placement !== null) { + message.longTermOrderPlacement = StatefulOrderEventV1_LongTermOrderPlacementV1.fromAmino(object.long_term_order_placement); + } + if (object.order_replacement !== undefined && object.order_replacement !== null) { + message.orderReplacement = StatefulOrderEventV1_LongTermOrderReplacementV1.fromAmino(object.order_replacement); + } + return message; + }, + toAmino(message: StatefulOrderEventV1): StatefulOrderEventV1Amino { + const obj: any = {}; + obj.order_place = message.orderPlace ? StatefulOrderEventV1_StatefulOrderPlacementV1.toAmino(message.orderPlace) : undefined; + obj.order_removal = message.orderRemoval ? StatefulOrderEventV1_StatefulOrderRemovalV1.toAmino(message.orderRemoval) : undefined; + obj.conditional_order_placement = message.conditionalOrderPlacement ? StatefulOrderEventV1_ConditionalOrderPlacementV1.toAmino(message.conditionalOrderPlacement) : undefined; + obj.conditional_order_triggered = message.conditionalOrderTriggered ? StatefulOrderEventV1_ConditionalOrderTriggeredV1.toAmino(message.conditionalOrderTriggered) : undefined; + obj.long_term_order_placement = message.longTermOrderPlacement ? StatefulOrderEventV1_LongTermOrderPlacementV1.toAmino(message.longTermOrderPlacement) : undefined; + obj.order_replacement = message.orderReplacement ? StatefulOrderEventV1_LongTermOrderReplacementV1.toAmino(message.orderReplacement) : undefined; + return obj; + }, + fromAminoMsg(object: StatefulOrderEventV1AminoMsg): StatefulOrderEventV1 { + return StatefulOrderEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderEventV1ProtoMsg): StatefulOrderEventV1 { + return StatefulOrderEventV1.decode(message.value); + }, + toProto(message: StatefulOrderEventV1): Uint8Array { + return StatefulOrderEventV1.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderEventV1): StatefulOrderEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderEventV1", + value: StatefulOrderEventV1.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderEventV1_StatefulOrderPlacementV1(): StatefulOrderEventV1_StatefulOrderPlacementV1 { + return { + order: undefined + }; +} +export const StatefulOrderEventV1_StatefulOrderPlacementV1 = { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderPlacementV1", + encode(message: StatefulOrderEventV1_StatefulOrderPlacementV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderEventV1_StatefulOrderPlacementV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderEventV1_StatefulOrderPlacementV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderEventV1_StatefulOrderPlacementV1 { + const message = createBaseStatefulOrderEventV1_StatefulOrderPlacementV1(); + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: StatefulOrderEventV1_StatefulOrderPlacementV1Amino): StatefulOrderEventV1_StatefulOrderPlacementV1 { + const message = createBaseStatefulOrderEventV1_StatefulOrderPlacementV1(); + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: StatefulOrderEventV1_StatefulOrderPlacementV1): StatefulOrderEventV1_StatefulOrderPlacementV1Amino { + const obj: any = {}; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: StatefulOrderEventV1_StatefulOrderPlacementV1AminoMsg): StatefulOrderEventV1_StatefulOrderPlacementV1 { + return StatefulOrderEventV1_StatefulOrderPlacementV1.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderEventV1_StatefulOrderPlacementV1ProtoMsg): StatefulOrderEventV1_StatefulOrderPlacementV1 { + return StatefulOrderEventV1_StatefulOrderPlacementV1.decode(message.value); + }, + toProto(message: StatefulOrderEventV1_StatefulOrderPlacementV1): Uint8Array { + return StatefulOrderEventV1_StatefulOrderPlacementV1.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderEventV1_StatefulOrderPlacementV1): StatefulOrderEventV1_StatefulOrderPlacementV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderPlacementV1", + value: StatefulOrderEventV1_StatefulOrderPlacementV1.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderEventV1_StatefulOrderRemovalV1(): StatefulOrderEventV1_StatefulOrderRemovalV1 { + return { + removedOrderId: undefined, + reason: 0 + }; +} +export const StatefulOrderEventV1_StatefulOrderRemovalV1 = { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderRemovalV1", + encode(message: StatefulOrderEventV1_StatefulOrderRemovalV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.removedOrderId !== undefined) { + IndexerOrderId.encode(message.removedOrderId, writer.uint32(10).fork()).ldelim(); + } + if (message.reason !== 0) { + writer.uint32(16).int32(message.reason); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderEventV1_StatefulOrderRemovalV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderEventV1_StatefulOrderRemovalV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.removedOrderId = IndexerOrderId.decode(reader, reader.uint32()); + break; + case 2: + message.reason = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderEventV1_StatefulOrderRemovalV1 { + const message = createBaseStatefulOrderEventV1_StatefulOrderRemovalV1(); + message.removedOrderId = object.removedOrderId !== undefined && object.removedOrderId !== null ? IndexerOrderId.fromPartial(object.removedOrderId) : undefined; + message.reason = object.reason ?? 0; + return message; + }, + fromAmino(object: StatefulOrderEventV1_StatefulOrderRemovalV1Amino): StatefulOrderEventV1_StatefulOrderRemovalV1 { + const message = createBaseStatefulOrderEventV1_StatefulOrderRemovalV1(); + if (object.removed_order_id !== undefined && object.removed_order_id !== null) { + message.removedOrderId = IndexerOrderId.fromAmino(object.removed_order_id); + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + return message; + }, + toAmino(message: StatefulOrderEventV1_StatefulOrderRemovalV1): StatefulOrderEventV1_StatefulOrderRemovalV1Amino { + const obj: any = {}; + obj.removed_order_id = message.removedOrderId ? IndexerOrderId.toAmino(message.removedOrderId) : undefined; + obj.reason = message.reason === 0 ? undefined : message.reason; + return obj; + }, + fromAminoMsg(object: StatefulOrderEventV1_StatefulOrderRemovalV1AminoMsg): StatefulOrderEventV1_StatefulOrderRemovalV1 { + return StatefulOrderEventV1_StatefulOrderRemovalV1.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderEventV1_StatefulOrderRemovalV1ProtoMsg): StatefulOrderEventV1_StatefulOrderRemovalV1 { + return StatefulOrderEventV1_StatefulOrderRemovalV1.decode(message.value); + }, + toProto(message: StatefulOrderEventV1_StatefulOrderRemovalV1): Uint8Array { + return StatefulOrderEventV1_StatefulOrderRemovalV1.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderEventV1_StatefulOrderRemovalV1): StatefulOrderEventV1_StatefulOrderRemovalV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.StatefulOrderRemovalV1", + value: StatefulOrderEventV1_StatefulOrderRemovalV1.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderEventV1_ConditionalOrderPlacementV1(): StatefulOrderEventV1_ConditionalOrderPlacementV1 { + return { + order: undefined + }; +} +export const StatefulOrderEventV1_ConditionalOrderPlacementV1 = { + typeUrl: "/dydxprotocol.indexer.events.ConditionalOrderPlacementV1", + encode(message: StatefulOrderEventV1_ConditionalOrderPlacementV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderEventV1_ConditionalOrderPlacementV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderEventV1_ConditionalOrderPlacementV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderEventV1_ConditionalOrderPlacementV1 { + const message = createBaseStatefulOrderEventV1_ConditionalOrderPlacementV1(); + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: StatefulOrderEventV1_ConditionalOrderPlacementV1Amino): StatefulOrderEventV1_ConditionalOrderPlacementV1 { + const message = createBaseStatefulOrderEventV1_ConditionalOrderPlacementV1(); + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: StatefulOrderEventV1_ConditionalOrderPlacementV1): StatefulOrderEventV1_ConditionalOrderPlacementV1Amino { + const obj: any = {}; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: StatefulOrderEventV1_ConditionalOrderPlacementV1AminoMsg): StatefulOrderEventV1_ConditionalOrderPlacementV1 { + return StatefulOrderEventV1_ConditionalOrderPlacementV1.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderEventV1_ConditionalOrderPlacementV1ProtoMsg): StatefulOrderEventV1_ConditionalOrderPlacementV1 { + return StatefulOrderEventV1_ConditionalOrderPlacementV1.decode(message.value); + }, + toProto(message: StatefulOrderEventV1_ConditionalOrderPlacementV1): Uint8Array { + return StatefulOrderEventV1_ConditionalOrderPlacementV1.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderEventV1_ConditionalOrderPlacementV1): StatefulOrderEventV1_ConditionalOrderPlacementV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.ConditionalOrderPlacementV1", + value: StatefulOrderEventV1_ConditionalOrderPlacementV1.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderEventV1_ConditionalOrderTriggeredV1(): StatefulOrderEventV1_ConditionalOrderTriggeredV1 { + return { + triggeredOrderId: undefined + }; +} +export const StatefulOrderEventV1_ConditionalOrderTriggeredV1 = { + typeUrl: "/dydxprotocol.indexer.events.ConditionalOrderTriggeredV1", + encode(message: StatefulOrderEventV1_ConditionalOrderTriggeredV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.triggeredOrderId !== undefined) { + IndexerOrderId.encode(message.triggeredOrderId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderEventV1_ConditionalOrderTriggeredV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderEventV1_ConditionalOrderTriggeredV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.triggeredOrderId = IndexerOrderId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderEventV1_ConditionalOrderTriggeredV1 { + const message = createBaseStatefulOrderEventV1_ConditionalOrderTriggeredV1(); + message.triggeredOrderId = object.triggeredOrderId !== undefined && object.triggeredOrderId !== null ? IndexerOrderId.fromPartial(object.triggeredOrderId) : undefined; + return message; + }, + fromAmino(object: StatefulOrderEventV1_ConditionalOrderTriggeredV1Amino): StatefulOrderEventV1_ConditionalOrderTriggeredV1 { + const message = createBaseStatefulOrderEventV1_ConditionalOrderTriggeredV1(); + if (object.triggered_order_id !== undefined && object.triggered_order_id !== null) { + message.triggeredOrderId = IndexerOrderId.fromAmino(object.triggered_order_id); + } + return message; + }, + toAmino(message: StatefulOrderEventV1_ConditionalOrderTriggeredV1): StatefulOrderEventV1_ConditionalOrderTriggeredV1Amino { + const obj: any = {}; + obj.triggered_order_id = message.triggeredOrderId ? IndexerOrderId.toAmino(message.triggeredOrderId) : undefined; + return obj; + }, + fromAminoMsg(object: StatefulOrderEventV1_ConditionalOrderTriggeredV1AminoMsg): StatefulOrderEventV1_ConditionalOrderTriggeredV1 { + return StatefulOrderEventV1_ConditionalOrderTriggeredV1.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderEventV1_ConditionalOrderTriggeredV1ProtoMsg): StatefulOrderEventV1_ConditionalOrderTriggeredV1 { + return StatefulOrderEventV1_ConditionalOrderTriggeredV1.decode(message.value); + }, + toProto(message: StatefulOrderEventV1_ConditionalOrderTriggeredV1): Uint8Array { + return StatefulOrderEventV1_ConditionalOrderTriggeredV1.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderEventV1_ConditionalOrderTriggeredV1): StatefulOrderEventV1_ConditionalOrderTriggeredV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.ConditionalOrderTriggeredV1", + value: StatefulOrderEventV1_ConditionalOrderTriggeredV1.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderEventV1_LongTermOrderPlacementV1(): StatefulOrderEventV1_LongTermOrderPlacementV1 { + return { + order: undefined + }; +} +export const StatefulOrderEventV1_LongTermOrderPlacementV1 = { + typeUrl: "/dydxprotocol.indexer.events.LongTermOrderPlacementV1", + encode(message: StatefulOrderEventV1_LongTermOrderPlacementV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderEventV1_LongTermOrderPlacementV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderEventV1_LongTermOrderPlacementV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderEventV1_LongTermOrderPlacementV1 { + const message = createBaseStatefulOrderEventV1_LongTermOrderPlacementV1(); + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: StatefulOrderEventV1_LongTermOrderPlacementV1Amino): StatefulOrderEventV1_LongTermOrderPlacementV1 { + const message = createBaseStatefulOrderEventV1_LongTermOrderPlacementV1(); + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: StatefulOrderEventV1_LongTermOrderPlacementV1): StatefulOrderEventV1_LongTermOrderPlacementV1Amino { + const obj: any = {}; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: StatefulOrderEventV1_LongTermOrderPlacementV1AminoMsg): StatefulOrderEventV1_LongTermOrderPlacementV1 { + return StatefulOrderEventV1_LongTermOrderPlacementV1.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderEventV1_LongTermOrderPlacementV1ProtoMsg): StatefulOrderEventV1_LongTermOrderPlacementV1 { + return StatefulOrderEventV1_LongTermOrderPlacementV1.decode(message.value); + }, + toProto(message: StatefulOrderEventV1_LongTermOrderPlacementV1): Uint8Array { + return StatefulOrderEventV1_LongTermOrderPlacementV1.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderEventV1_LongTermOrderPlacementV1): StatefulOrderEventV1_LongTermOrderPlacementV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.LongTermOrderPlacementV1", + value: StatefulOrderEventV1_LongTermOrderPlacementV1.encode(message).finish() + }; + } +}; +function createBaseStatefulOrderEventV1_LongTermOrderReplacementV1(): StatefulOrderEventV1_LongTermOrderReplacementV1 { + return { + oldOrderId: undefined, + order: undefined + }; +} +export const StatefulOrderEventV1_LongTermOrderReplacementV1 = { + typeUrl: "/dydxprotocol.indexer.events.LongTermOrderReplacementV1", + encode(message: StatefulOrderEventV1_LongTermOrderReplacementV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oldOrderId !== undefined) { + IndexerOrderId.encode(message.oldOrderId, writer.uint32(10).fork()).ldelim(); + } + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatefulOrderEventV1_LongTermOrderReplacementV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatefulOrderEventV1_LongTermOrderReplacementV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oldOrderId = IndexerOrderId.decode(reader, reader.uint32()); + break; + case 2: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatefulOrderEventV1_LongTermOrderReplacementV1 { + const message = createBaseStatefulOrderEventV1_LongTermOrderReplacementV1(); + message.oldOrderId = object.oldOrderId !== undefined && object.oldOrderId !== null ? IndexerOrderId.fromPartial(object.oldOrderId) : undefined; + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + return message; + }, + fromAmino(object: StatefulOrderEventV1_LongTermOrderReplacementV1Amino): StatefulOrderEventV1_LongTermOrderReplacementV1 { + const message = createBaseStatefulOrderEventV1_LongTermOrderReplacementV1(); + if (object.old_order_id !== undefined && object.old_order_id !== null) { + message.oldOrderId = IndexerOrderId.fromAmino(object.old_order_id); + } + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + return message; + }, + toAmino(message: StatefulOrderEventV1_LongTermOrderReplacementV1): StatefulOrderEventV1_LongTermOrderReplacementV1Amino { + const obj: any = {}; + obj.old_order_id = message.oldOrderId ? IndexerOrderId.toAmino(message.oldOrderId) : undefined; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + return obj; + }, + fromAminoMsg(object: StatefulOrderEventV1_LongTermOrderReplacementV1AminoMsg): StatefulOrderEventV1_LongTermOrderReplacementV1 { + return StatefulOrderEventV1_LongTermOrderReplacementV1.fromAmino(object.value); + }, + fromProtoMsg(message: StatefulOrderEventV1_LongTermOrderReplacementV1ProtoMsg): StatefulOrderEventV1_LongTermOrderReplacementV1 { + return StatefulOrderEventV1_LongTermOrderReplacementV1.decode(message.value); + }, + toProto(message: StatefulOrderEventV1_LongTermOrderReplacementV1): Uint8Array { + return StatefulOrderEventV1_LongTermOrderReplacementV1.encode(message).finish(); + }, + toProtoMsg(message: StatefulOrderEventV1_LongTermOrderReplacementV1): StatefulOrderEventV1_LongTermOrderReplacementV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.LongTermOrderReplacementV1", + value: StatefulOrderEventV1_LongTermOrderReplacementV1.encode(message).finish() + }; + } +}; +function createBaseAssetCreateEventV1(): AssetCreateEventV1 { + return { + id: 0, + symbol: "", + hasMarket: false, + marketId: 0, + atomicResolution: 0 + }; +} +export const AssetCreateEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.AssetCreateEventV1", + encode(message: AssetCreateEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.hasMarket === true) { + writer.uint32(24).bool(message.hasMarket); + } + if (message.marketId !== 0) { + writer.uint32(32).uint32(message.marketId); + } + if (message.atomicResolution !== 0) { + writer.uint32(40).sint32(message.atomicResolution); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AssetCreateEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAssetCreateEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.hasMarket = reader.bool(); + break; + case 4: + message.marketId = reader.uint32(); + break; + case 5: + message.atomicResolution = reader.sint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AssetCreateEventV1 { + const message = createBaseAssetCreateEventV1(); + message.id = object.id ?? 0; + message.symbol = object.symbol ?? ""; + message.hasMarket = object.hasMarket ?? false; + message.marketId = object.marketId ?? 0; + message.atomicResolution = object.atomicResolution ?? 0; + return message; + }, + fromAmino(object: AssetCreateEventV1Amino): AssetCreateEventV1 { + const message = createBaseAssetCreateEventV1(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.has_market !== undefined && object.has_market !== null) { + message.hasMarket = object.has_market; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.atomic_resolution !== undefined && object.atomic_resolution !== null) { + message.atomicResolution = object.atomic_resolution; + } + return message; + }, + toAmino(message: AssetCreateEventV1): AssetCreateEventV1Amino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.has_market = message.hasMarket === false ? undefined : message.hasMarket; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.atomic_resolution = message.atomicResolution === 0 ? undefined : message.atomicResolution; + return obj; + }, + fromAminoMsg(object: AssetCreateEventV1AminoMsg): AssetCreateEventV1 { + return AssetCreateEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: AssetCreateEventV1ProtoMsg): AssetCreateEventV1 { + return AssetCreateEventV1.decode(message.value); + }, + toProto(message: AssetCreateEventV1): Uint8Array { + return AssetCreateEventV1.encode(message).finish(); + }, + toProtoMsg(message: AssetCreateEventV1): AssetCreateEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.AssetCreateEventV1", + value: AssetCreateEventV1.encode(message).finish() + }; + } +}; +function createBasePerpetualMarketCreateEventV1(): PerpetualMarketCreateEventV1 { + return { + id: 0, + clobPairId: 0, + ticker: "", + marketId: 0, + status: 0, + quantumConversionExponent: 0, + atomicResolution: 0, + subticksPerTick: 0, + stepBaseQuantums: BigInt(0), + liquidityTier: 0 + }; +} +export const PerpetualMarketCreateEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV1", + encode(message: PerpetualMarketCreateEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.clobPairId !== 0) { + writer.uint32(16).uint32(message.clobPairId); + } + if (message.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.marketId !== 0) { + writer.uint32(32).uint32(message.marketId); + } + if (message.status !== 0) { + writer.uint32(40).int32(message.status); + } + if (message.quantumConversionExponent !== 0) { + writer.uint32(48).sint32(message.quantumConversionExponent); + } + if (message.atomicResolution !== 0) { + writer.uint32(56).sint32(message.atomicResolution); + } + if (message.subticksPerTick !== 0) { + writer.uint32(64).uint32(message.subticksPerTick); + } + if (message.stepBaseQuantums !== BigInt(0)) { + writer.uint32(72).uint64(message.stepBaseQuantums); + } + if (message.liquidityTier !== 0) { + writer.uint32(80).uint32(message.liquidityTier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketCreateEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketCreateEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.clobPairId = reader.uint32(); + break; + case 3: + message.ticker = reader.string(); + break; + case 4: + message.marketId = reader.uint32(); + break; + case 5: + message.status = reader.int32() as any; + break; + case 6: + message.quantumConversionExponent = reader.sint32(); + break; + case 7: + message.atomicResolution = reader.sint32(); + break; + case 8: + message.subticksPerTick = reader.uint32(); + break; + case 9: + message.stepBaseQuantums = reader.uint64(); + break; + case 10: + message.liquidityTier = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualMarketCreateEventV1 { + const message = createBasePerpetualMarketCreateEventV1(); + message.id = object.id ?? 0; + message.clobPairId = object.clobPairId ?? 0; + message.ticker = object.ticker ?? ""; + message.marketId = object.marketId ?? 0; + message.status = object.status ?? 0; + message.quantumConversionExponent = object.quantumConversionExponent ?? 0; + message.atomicResolution = object.atomicResolution ?? 0; + message.subticksPerTick = object.subticksPerTick ?? 0; + message.stepBaseQuantums = object.stepBaseQuantums !== undefined && object.stepBaseQuantums !== null ? BigInt(object.stepBaseQuantums.toString()) : BigInt(0); + message.liquidityTier = object.liquidityTier ?? 0; + return message; + }, + fromAmino(object: PerpetualMarketCreateEventV1Amino): PerpetualMarketCreateEventV1 { + const message = createBasePerpetualMarketCreateEventV1(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.quantum_conversion_exponent !== undefined && object.quantum_conversion_exponent !== null) { + message.quantumConversionExponent = object.quantum_conversion_exponent; + } + if (object.atomic_resolution !== undefined && object.atomic_resolution !== null) { + message.atomicResolution = object.atomic_resolution; + } + if (object.subticks_per_tick !== undefined && object.subticks_per_tick !== null) { + message.subticksPerTick = object.subticks_per_tick; + } + if (object.step_base_quantums !== undefined && object.step_base_quantums !== null) { + message.stepBaseQuantums = BigInt(object.step_base_quantums); + } + if (object.liquidity_tier !== undefined && object.liquidity_tier !== null) { + message.liquidityTier = object.liquidity_tier; + } + return message; + }, + toAmino(message: PerpetualMarketCreateEventV1): PerpetualMarketCreateEventV1Amino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.status = message.status === 0 ? undefined : message.status; + obj.quantum_conversion_exponent = message.quantumConversionExponent === 0 ? undefined : message.quantumConversionExponent; + obj.atomic_resolution = message.atomicResolution === 0 ? undefined : message.atomicResolution; + obj.subticks_per_tick = message.subticksPerTick === 0 ? undefined : message.subticksPerTick; + obj.step_base_quantums = message.stepBaseQuantums !== BigInt(0) ? message.stepBaseQuantums.toString() : undefined; + obj.liquidity_tier = message.liquidityTier === 0 ? undefined : message.liquidityTier; + return obj; + }, + fromAminoMsg(object: PerpetualMarketCreateEventV1AminoMsg): PerpetualMarketCreateEventV1 { + return PerpetualMarketCreateEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketCreateEventV1ProtoMsg): PerpetualMarketCreateEventV1 { + return PerpetualMarketCreateEventV1.decode(message.value); + }, + toProto(message: PerpetualMarketCreateEventV1): Uint8Array { + return PerpetualMarketCreateEventV1.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketCreateEventV1): PerpetualMarketCreateEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV1", + value: PerpetualMarketCreateEventV1.encode(message).finish() + }; + } +}; +function createBasePerpetualMarketCreateEventV2(): PerpetualMarketCreateEventV2 { + return { + id: 0, + clobPairId: 0, + ticker: "", + marketId: 0, + status: 0, + quantumConversionExponent: 0, + atomicResolution: 0, + subticksPerTick: 0, + stepBaseQuantums: BigInt(0), + liquidityTier: 0, + marketType: 0 + }; +} +export const PerpetualMarketCreateEventV2 = { + typeUrl: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV2", + encode(message: PerpetualMarketCreateEventV2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.clobPairId !== 0) { + writer.uint32(16).uint32(message.clobPairId); + } + if (message.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.marketId !== 0) { + writer.uint32(32).uint32(message.marketId); + } + if (message.status !== 0) { + writer.uint32(40).int32(message.status); + } + if (message.quantumConversionExponent !== 0) { + writer.uint32(48).sint32(message.quantumConversionExponent); + } + if (message.atomicResolution !== 0) { + writer.uint32(56).sint32(message.atomicResolution); + } + if (message.subticksPerTick !== 0) { + writer.uint32(64).uint32(message.subticksPerTick); + } + if (message.stepBaseQuantums !== BigInt(0)) { + writer.uint32(72).uint64(message.stepBaseQuantums); + } + if (message.liquidityTier !== 0) { + writer.uint32(80).uint32(message.liquidityTier); + } + if (message.marketType !== 0) { + writer.uint32(88).int32(message.marketType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualMarketCreateEventV2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualMarketCreateEventV2(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.clobPairId = reader.uint32(); + break; + case 3: + message.ticker = reader.string(); + break; + case 4: + message.marketId = reader.uint32(); + break; + case 5: + message.status = reader.int32() as any; + break; + case 6: + message.quantumConversionExponent = reader.sint32(); + break; + case 7: + message.atomicResolution = reader.sint32(); + break; + case 8: + message.subticksPerTick = reader.uint32(); + break; + case 9: + message.stepBaseQuantums = reader.uint64(); + break; + case 10: + message.liquidityTier = reader.uint32(); + break; + case 11: + message.marketType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualMarketCreateEventV2 { + const message = createBasePerpetualMarketCreateEventV2(); + message.id = object.id ?? 0; + message.clobPairId = object.clobPairId ?? 0; + message.ticker = object.ticker ?? ""; + message.marketId = object.marketId ?? 0; + message.status = object.status ?? 0; + message.quantumConversionExponent = object.quantumConversionExponent ?? 0; + message.atomicResolution = object.atomicResolution ?? 0; + message.subticksPerTick = object.subticksPerTick ?? 0; + message.stepBaseQuantums = object.stepBaseQuantums !== undefined && object.stepBaseQuantums !== null ? BigInt(object.stepBaseQuantums.toString()) : BigInt(0); + message.liquidityTier = object.liquidityTier ?? 0; + message.marketType = object.marketType ?? 0; + return message; + }, + fromAmino(object: PerpetualMarketCreateEventV2Amino): PerpetualMarketCreateEventV2 { + const message = createBasePerpetualMarketCreateEventV2(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.quantum_conversion_exponent !== undefined && object.quantum_conversion_exponent !== null) { + message.quantumConversionExponent = object.quantum_conversion_exponent; + } + if (object.atomic_resolution !== undefined && object.atomic_resolution !== null) { + message.atomicResolution = object.atomic_resolution; + } + if (object.subticks_per_tick !== undefined && object.subticks_per_tick !== null) { + message.subticksPerTick = object.subticks_per_tick; + } + if (object.step_base_quantums !== undefined && object.step_base_quantums !== null) { + message.stepBaseQuantums = BigInt(object.step_base_quantums); + } + if (object.liquidity_tier !== undefined && object.liquidity_tier !== null) { + message.liquidityTier = object.liquidity_tier; + } + if (object.market_type !== undefined && object.market_type !== null) { + message.marketType = object.market_type; + } + return message; + }, + toAmino(message: PerpetualMarketCreateEventV2): PerpetualMarketCreateEventV2Amino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.status = message.status === 0 ? undefined : message.status; + obj.quantum_conversion_exponent = message.quantumConversionExponent === 0 ? undefined : message.quantumConversionExponent; + obj.atomic_resolution = message.atomicResolution === 0 ? undefined : message.atomicResolution; + obj.subticks_per_tick = message.subticksPerTick === 0 ? undefined : message.subticksPerTick; + obj.step_base_quantums = message.stepBaseQuantums !== BigInt(0) ? message.stepBaseQuantums.toString() : undefined; + obj.liquidity_tier = message.liquidityTier === 0 ? undefined : message.liquidityTier; + obj.market_type = message.marketType === 0 ? undefined : message.marketType; + return obj; + }, + fromAminoMsg(object: PerpetualMarketCreateEventV2AminoMsg): PerpetualMarketCreateEventV2 { + return PerpetualMarketCreateEventV2.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualMarketCreateEventV2ProtoMsg): PerpetualMarketCreateEventV2 { + return PerpetualMarketCreateEventV2.decode(message.value); + }, + toProto(message: PerpetualMarketCreateEventV2): Uint8Array { + return PerpetualMarketCreateEventV2.encode(message).finish(); + }, + toProtoMsg(message: PerpetualMarketCreateEventV2): PerpetualMarketCreateEventV2ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.PerpetualMarketCreateEventV2", + value: PerpetualMarketCreateEventV2.encode(message).finish() + }; + } +}; +function createBaseLiquidityTierUpsertEventV1(): LiquidityTierUpsertEventV1 { + return { + id: 0, + name: "", + initialMarginPpm: 0, + maintenanceFractionPpm: 0, + basePositionNotional: BigInt(0) + }; +} +export const LiquidityTierUpsertEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV1", + encode(message: LiquidityTierUpsertEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.initialMarginPpm !== 0) { + writer.uint32(24).uint32(message.initialMarginPpm); + } + if (message.maintenanceFractionPpm !== 0) { + writer.uint32(32).uint32(message.maintenanceFractionPpm); + } + if (message.basePositionNotional !== BigInt(0)) { + writer.uint32(40).uint64(message.basePositionNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidityTierUpsertEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidityTierUpsertEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.initialMarginPpm = reader.uint32(); + break; + case 4: + message.maintenanceFractionPpm = reader.uint32(); + break; + case 5: + message.basePositionNotional = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidityTierUpsertEventV1 { + const message = createBaseLiquidityTierUpsertEventV1(); + message.id = object.id ?? 0; + message.name = object.name ?? ""; + message.initialMarginPpm = object.initialMarginPpm ?? 0; + message.maintenanceFractionPpm = object.maintenanceFractionPpm ?? 0; + message.basePositionNotional = object.basePositionNotional !== undefined && object.basePositionNotional !== null ? BigInt(object.basePositionNotional.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LiquidityTierUpsertEventV1Amino): LiquidityTierUpsertEventV1 { + const message = createBaseLiquidityTierUpsertEventV1(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.initial_margin_ppm !== undefined && object.initial_margin_ppm !== null) { + message.initialMarginPpm = object.initial_margin_ppm; + } + if (object.maintenance_fraction_ppm !== undefined && object.maintenance_fraction_ppm !== null) { + message.maintenanceFractionPpm = object.maintenance_fraction_ppm; + } + if (object.base_position_notional !== undefined && object.base_position_notional !== null) { + message.basePositionNotional = BigInt(object.base_position_notional); + } + return message; + }, + toAmino(message: LiquidityTierUpsertEventV1): LiquidityTierUpsertEventV1Amino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.name = message.name === "" ? undefined : message.name; + obj.initial_margin_ppm = message.initialMarginPpm === 0 ? undefined : message.initialMarginPpm; + obj.maintenance_fraction_ppm = message.maintenanceFractionPpm === 0 ? undefined : message.maintenanceFractionPpm; + obj.base_position_notional = message.basePositionNotional !== BigInt(0) ? message.basePositionNotional.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LiquidityTierUpsertEventV1AminoMsg): LiquidityTierUpsertEventV1 { + return LiquidityTierUpsertEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidityTierUpsertEventV1ProtoMsg): LiquidityTierUpsertEventV1 { + return LiquidityTierUpsertEventV1.decode(message.value); + }, + toProto(message: LiquidityTierUpsertEventV1): Uint8Array { + return LiquidityTierUpsertEventV1.encode(message).finish(); + }, + toProtoMsg(message: LiquidityTierUpsertEventV1): LiquidityTierUpsertEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV1", + value: LiquidityTierUpsertEventV1.encode(message).finish() + }; + } +}; +function createBaseUpdateClobPairEventV1(): UpdateClobPairEventV1 { + return { + clobPairId: 0, + status: 0, + quantumConversionExponent: 0, + subticksPerTick: 0, + stepBaseQuantums: BigInt(0) + }; +} +export const UpdateClobPairEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.UpdateClobPairEventV1", + encode(message: UpdateClobPairEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clobPairId !== 0) { + writer.uint32(8).uint32(message.clobPairId); + } + if (message.status !== 0) { + writer.uint32(16).int32(message.status); + } + if (message.quantumConversionExponent !== 0) { + writer.uint32(24).sint32(message.quantumConversionExponent); + } + if (message.subticksPerTick !== 0) { + writer.uint32(32).uint32(message.subticksPerTick); + } + if (message.stepBaseQuantums !== BigInt(0)) { + writer.uint32(40).uint64(message.stepBaseQuantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateClobPairEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateClobPairEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobPairId = reader.uint32(); + break; + case 2: + message.status = reader.int32() as any; + break; + case 3: + message.quantumConversionExponent = reader.sint32(); + break; + case 4: + message.subticksPerTick = reader.uint32(); + break; + case 5: + message.stepBaseQuantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateClobPairEventV1 { + const message = createBaseUpdateClobPairEventV1(); + message.clobPairId = object.clobPairId ?? 0; + message.status = object.status ?? 0; + message.quantumConversionExponent = object.quantumConversionExponent ?? 0; + message.subticksPerTick = object.subticksPerTick ?? 0; + message.stepBaseQuantums = object.stepBaseQuantums !== undefined && object.stepBaseQuantums !== null ? BigInt(object.stepBaseQuantums.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UpdateClobPairEventV1Amino): UpdateClobPairEventV1 { + const message = createBaseUpdateClobPairEventV1(); + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.quantum_conversion_exponent !== undefined && object.quantum_conversion_exponent !== null) { + message.quantumConversionExponent = object.quantum_conversion_exponent; + } + if (object.subticks_per_tick !== undefined && object.subticks_per_tick !== null) { + message.subticksPerTick = object.subticks_per_tick; + } + if (object.step_base_quantums !== undefined && object.step_base_quantums !== null) { + message.stepBaseQuantums = BigInt(object.step_base_quantums); + } + return message; + }, + toAmino(message: UpdateClobPairEventV1): UpdateClobPairEventV1Amino { + const obj: any = {}; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + obj.status = message.status === 0 ? undefined : message.status; + obj.quantum_conversion_exponent = message.quantumConversionExponent === 0 ? undefined : message.quantumConversionExponent; + obj.subticks_per_tick = message.subticksPerTick === 0 ? undefined : message.subticksPerTick; + obj.step_base_quantums = message.stepBaseQuantums !== BigInt(0) ? message.stepBaseQuantums.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UpdateClobPairEventV1AminoMsg): UpdateClobPairEventV1 { + return UpdateClobPairEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateClobPairEventV1ProtoMsg): UpdateClobPairEventV1 { + return UpdateClobPairEventV1.decode(message.value); + }, + toProto(message: UpdateClobPairEventV1): Uint8Array { + return UpdateClobPairEventV1.encode(message).finish(); + }, + toProtoMsg(message: UpdateClobPairEventV1): UpdateClobPairEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.UpdateClobPairEventV1", + value: UpdateClobPairEventV1.encode(message).finish() + }; + } +}; +function createBaseUpdatePerpetualEventV1(): UpdatePerpetualEventV1 { + return { + id: 0, + ticker: "", + marketId: 0, + atomicResolution: 0, + liquidityTier: 0 + }; +} +export const UpdatePerpetualEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.UpdatePerpetualEventV1", + encode(message: UpdatePerpetualEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.marketId !== 0) { + writer.uint32(24).uint32(message.marketId); + } + if (message.atomicResolution !== 0) { + writer.uint32(32).sint32(message.atomicResolution); + } + if (message.liquidityTier !== 0) { + writer.uint32(40).uint32(message.liquidityTier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdatePerpetualEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePerpetualEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.marketId = reader.uint32(); + break; + case 4: + message.atomicResolution = reader.sint32(); + break; + case 5: + message.liquidityTier = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdatePerpetualEventV1 { + const message = createBaseUpdatePerpetualEventV1(); + message.id = object.id ?? 0; + message.ticker = object.ticker ?? ""; + message.marketId = object.marketId ?? 0; + message.atomicResolution = object.atomicResolution ?? 0; + message.liquidityTier = object.liquidityTier ?? 0; + return message; + }, + fromAmino(object: UpdatePerpetualEventV1Amino): UpdatePerpetualEventV1 { + const message = createBaseUpdatePerpetualEventV1(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.atomic_resolution !== undefined && object.atomic_resolution !== null) { + message.atomicResolution = object.atomic_resolution; + } + if (object.liquidity_tier !== undefined && object.liquidity_tier !== null) { + message.liquidityTier = object.liquidity_tier; + } + return message; + }, + toAmino(message: UpdatePerpetualEventV1): UpdatePerpetualEventV1Amino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.atomic_resolution = message.atomicResolution === 0 ? undefined : message.atomicResolution; + obj.liquidity_tier = message.liquidityTier === 0 ? undefined : message.liquidityTier; + return obj; + }, + fromAminoMsg(object: UpdatePerpetualEventV1AminoMsg): UpdatePerpetualEventV1 { + return UpdatePerpetualEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: UpdatePerpetualEventV1ProtoMsg): UpdatePerpetualEventV1 { + return UpdatePerpetualEventV1.decode(message.value); + }, + toProto(message: UpdatePerpetualEventV1): Uint8Array { + return UpdatePerpetualEventV1.encode(message).finish(); + }, + toProtoMsg(message: UpdatePerpetualEventV1): UpdatePerpetualEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.UpdatePerpetualEventV1", + value: UpdatePerpetualEventV1.encode(message).finish() + }; + } +}; +function createBaseTradingRewardsEventV1(): TradingRewardsEventV1 { + return { + tradingRewards: [] + }; +} +export const TradingRewardsEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.TradingRewardsEventV1", + encode(message: TradingRewardsEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.tradingRewards) { + AddressTradingReward.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingRewardsEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingRewardsEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tradingRewards.push(AddressTradingReward.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TradingRewardsEventV1 { + const message = createBaseTradingRewardsEventV1(); + message.tradingRewards = object.tradingRewards?.map(e => AddressTradingReward.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TradingRewardsEventV1Amino): TradingRewardsEventV1 { + const message = createBaseTradingRewardsEventV1(); + message.tradingRewards = object.trading_rewards?.map(e => AddressTradingReward.fromAmino(e)) || []; + return message; + }, + toAmino(message: TradingRewardsEventV1): TradingRewardsEventV1Amino { + const obj: any = {}; + if (message.tradingRewards) { + obj.trading_rewards = message.tradingRewards.map(e => e ? AddressTradingReward.toAmino(e) : undefined); + } else { + obj.trading_rewards = message.tradingRewards; + } + return obj; + }, + fromAminoMsg(object: TradingRewardsEventV1AminoMsg): TradingRewardsEventV1 { + return TradingRewardsEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: TradingRewardsEventV1ProtoMsg): TradingRewardsEventV1 { + return TradingRewardsEventV1.decode(message.value); + }, + toProto(message: TradingRewardsEventV1): Uint8Array { + return TradingRewardsEventV1.encode(message).finish(); + }, + toProtoMsg(message: TradingRewardsEventV1): TradingRewardsEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.TradingRewardsEventV1", + value: TradingRewardsEventV1.encode(message).finish() + }; + } +}; +function createBaseAddressTradingReward(): AddressTradingReward { + return { + owner: "", + denomAmount: new Uint8Array() + }; +} +export const AddressTradingReward = { + typeUrl: "/dydxprotocol.indexer.events.AddressTradingReward", + encode(message: AddressTradingReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.denomAmount.length !== 0) { + writer.uint32(18).bytes(message.denomAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressTradingReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressTradingReward(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.denomAmount = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressTradingReward { + const message = createBaseAddressTradingReward(); + message.owner = object.owner ?? ""; + message.denomAmount = object.denomAmount ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressTradingRewardAmino): AddressTradingReward { + const message = createBaseAddressTradingReward(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.denom_amount !== undefined && object.denom_amount !== null) { + message.denomAmount = bytesFromBase64(object.denom_amount); + } + return message; + }, + toAmino(message: AddressTradingReward): AddressTradingRewardAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.denom_amount = message.denomAmount ? base64FromBytes(message.denomAmount) : undefined; + return obj; + }, + fromAminoMsg(object: AddressTradingRewardAminoMsg): AddressTradingReward { + return AddressTradingReward.fromAmino(object.value); + }, + fromProtoMsg(message: AddressTradingRewardProtoMsg): AddressTradingReward { + return AddressTradingReward.decode(message.value); + }, + toProto(message: AddressTradingReward): Uint8Array { + return AddressTradingReward.encode(message).finish(); + }, + toProtoMsg(message: AddressTradingReward): AddressTradingRewardProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.AddressTradingReward", + value: AddressTradingReward.encode(message).finish() + }; + } +}; +function createBaseOpenInterestUpdateEventV1(): OpenInterestUpdateEventV1 { + return { + openInterestUpdates: [] + }; +} +export const OpenInterestUpdateEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.OpenInterestUpdateEventV1", + encode(message: OpenInterestUpdateEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.openInterestUpdates) { + OpenInterestUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OpenInterestUpdateEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOpenInterestUpdateEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.openInterestUpdates.push(OpenInterestUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OpenInterestUpdateEventV1 { + const message = createBaseOpenInterestUpdateEventV1(); + message.openInterestUpdates = object.openInterestUpdates?.map(e => OpenInterestUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OpenInterestUpdateEventV1Amino): OpenInterestUpdateEventV1 { + const message = createBaseOpenInterestUpdateEventV1(); + message.openInterestUpdates = object.open_interest_updates?.map(e => OpenInterestUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: OpenInterestUpdateEventV1): OpenInterestUpdateEventV1Amino { + const obj: any = {}; + if (message.openInterestUpdates) { + obj.open_interest_updates = message.openInterestUpdates.map(e => e ? OpenInterestUpdate.toAmino(e) : undefined); + } else { + obj.open_interest_updates = message.openInterestUpdates; + } + return obj; + }, + fromAminoMsg(object: OpenInterestUpdateEventV1AminoMsg): OpenInterestUpdateEventV1 { + return OpenInterestUpdateEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: OpenInterestUpdateEventV1ProtoMsg): OpenInterestUpdateEventV1 { + return OpenInterestUpdateEventV1.decode(message.value); + }, + toProto(message: OpenInterestUpdateEventV1): Uint8Array { + return OpenInterestUpdateEventV1.encode(message).finish(); + }, + toProtoMsg(message: OpenInterestUpdateEventV1): OpenInterestUpdateEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.OpenInterestUpdateEventV1", + value: OpenInterestUpdateEventV1.encode(message).finish() + }; + } +}; +function createBaseOpenInterestUpdate(): OpenInterestUpdate { + return { + perpetualId: 0, + openInterest: new Uint8Array() + }; +} +export const OpenInterestUpdate = { + typeUrl: "/dydxprotocol.indexer.events.OpenInterestUpdate", + encode(message: OpenInterestUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (message.openInterest.length !== 0) { + writer.uint32(18).bytes(message.openInterest); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OpenInterestUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOpenInterestUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.openInterest = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OpenInterestUpdate { + const message = createBaseOpenInterestUpdate(); + message.perpetualId = object.perpetualId ?? 0; + message.openInterest = object.openInterest ?? new Uint8Array(); + return message; + }, + fromAmino(object: OpenInterestUpdateAmino): OpenInterestUpdate { + const message = createBaseOpenInterestUpdate(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.open_interest !== undefined && object.open_interest !== null) { + message.openInterest = bytesFromBase64(object.open_interest); + } + return message; + }, + toAmino(message: OpenInterestUpdate): OpenInterestUpdateAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.open_interest = message.openInterest ? base64FromBytes(message.openInterest) : undefined; + return obj; + }, + fromAminoMsg(object: OpenInterestUpdateAminoMsg): OpenInterestUpdate { + return OpenInterestUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: OpenInterestUpdateProtoMsg): OpenInterestUpdate { + return OpenInterestUpdate.decode(message.value); + }, + toProto(message: OpenInterestUpdate): Uint8Array { + return OpenInterestUpdate.encode(message).finish(); + }, + toProtoMsg(message: OpenInterestUpdate): OpenInterestUpdateProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.OpenInterestUpdate", + value: OpenInterestUpdate.encode(message).finish() + }; + } +}; +function createBaseLiquidityTierUpsertEventV2(): LiquidityTierUpsertEventV2 { + return { + id: 0, + name: "", + initialMarginPpm: 0, + maintenanceFractionPpm: 0, + basePositionNotional: BigInt(0), + openInterestLowerCap: BigInt(0), + openInterestUpperCap: BigInt(0) + }; +} +export const LiquidityTierUpsertEventV2 = { + typeUrl: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV2", + encode(message: LiquidityTierUpsertEventV2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.initialMarginPpm !== 0) { + writer.uint32(24).uint32(message.initialMarginPpm); + } + if (message.maintenanceFractionPpm !== 0) { + writer.uint32(32).uint32(message.maintenanceFractionPpm); + } + if (message.basePositionNotional !== BigInt(0)) { + writer.uint32(40).uint64(message.basePositionNotional); + } + if (message.openInterestLowerCap !== BigInt(0)) { + writer.uint32(48).uint64(message.openInterestLowerCap); + } + if (message.openInterestUpperCap !== BigInt(0)) { + writer.uint32(56).uint64(message.openInterestUpperCap); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidityTierUpsertEventV2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidityTierUpsertEventV2(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.initialMarginPpm = reader.uint32(); + break; + case 4: + message.maintenanceFractionPpm = reader.uint32(); + break; + case 5: + message.basePositionNotional = reader.uint64(); + break; + case 6: + message.openInterestLowerCap = reader.uint64(); + break; + case 7: + message.openInterestUpperCap = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidityTierUpsertEventV2 { + const message = createBaseLiquidityTierUpsertEventV2(); + message.id = object.id ?? 0; + message.name = object.name ?? ""; + message.initialMarginPpm = object.initialMarginPpm ?? 0; + message.maintenanceFractionPpm = object.maintenanceFractionPpm ?? 0; + message.basePositionNotional = object.basePositionNotional !== undefined && object.basePositionNotional !== null ? BigInt(object.basePositionNotional.toString()) : BigInt(0); + message.openInterestLowerCap = object.openInterestLowerCap !== undefined && object.openInterestLowerCap !== null ? BigInt(object.openInterestLowerCap.toString()) : BigInt(0); + message.openInterestUpperCap = object.openInterestUpperCap !== undefined && object.openInterestUpperCap !== null ? BigInt(object.openInterestUpperCap.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LiquidityTierUpsertEventV2Amino): LiquidityTierUpsertEventV2 { + const message = createBaseLiquidityTierUpsertEventV2(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.initial_margin_ppm !== undefined && object.initial_margin_ppm !== null) { + message.initialMarginPpm = object.initial_margin_ppm; + } + if (object.maintenance_fraction_ppm !== undefined && object.maintenance_fraction_ppm !== null) { + message.maintenanceFractionPpm = object.maintenance_fraction_ppm; + } + if (object.base_position_notional !== undefined && object.base_position_notional !== null) { + message.basePositionNotional = BigInt(object.base_position_notional); + } + if (object.open_interest_lower_cap !== undefined && object.open_interest_lower_cap !== null) { + message.openInterestLowerCap = BigInt(object.open_interest_lower_cap); + } + if (object.open_interest_upper_cap !== undefined && object.open_interest_upper_cap !== null) { + message.openInterestUpperCap = BigInt(object.open_interest_upper_cap); + } + return message; + }, + toAmino(message: LiquidityTierUpsertEventV2): LiquidityTierUpsertEventV2Amino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.name = message.name === "" ? undefined : message.name; + obj.initial_margin_ppm = message.initialMarginPpm === 0 ? undefined : message.initialMarginPpm; + obj.maintenance_fraction_ppm = message.maintenanceFractionPpm === 0 ? undefined : message.maintenanceFractionPpm; + obj.base_position_notional = message.basePositionNotional !== BigInt(0) ? message.basePositionNotional.toString() : undefined; + obj.open_interest_lower_cap = message.openInterestLowerCap !== BigInt(0) ? message.openInterestLowerCap.toString() : undefined; + obj.open_interest_upper_cap = message.openInterestUpperCap !== BigInt(0) ? message.openInterestUpperCap.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LiquidityTierUpsertEventV2AminoMsg): LiquidityTierUpsertEventV2 { + return LiquidityTierUpsertEventV2.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidityTierUpsertEventV2ProtoMsg): LiquidityTierUpsertEventV2 { + return LiquidityTierUpsertEventV2.decode(message.value); + }, + toProto(message: LiquidityTierUpsertEventV2): Uint8Array { + return LiquidityTierUpsertEventV2.encode(message).finish(); + }, + toProtoMsg(message: LiquidityTierUpsertEventV2): LiquidityTierUpsertEventV2ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV2", + value: LiquidityTierUpsertEventV2.encode(message).finish() + }; + } +}; +function createBaseRegisterAffiliateEventV1(): RegisterAffiliateEventV1 { + return { + referee: "", + affiliate: "", + registeredAtBlock: BigInt(0) + }; +} +export const RegisterAffiliateEventV1 = { + typeUrl: "/dydxprotocol.indexer.events.RegisterAffiliateEventV1", + encode(message: RegisterAffiliateEventV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.referee !== "") { + writer.uint32(10).string(message.referee); + } + if (message.affiliate !== "") { + writer.uint32(18).string(message.affiliate); + } + if (message.registeredAtBlock !== BigInt(0)) { + writer.uint32(24).uint64(message.registeredAtBlock); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RegisterAffiliateEventV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterAffiliateEventV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.referee = reader.string(); + break; + case 2: + message.affiliate = reader.string(); + break; + case 3: + message.registeredAtBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RegisterAffiliateEventV1 { + const message = createBaseRegisterAffiliateEventV1(); + message.referee = object.referee ?? ""; + message.affiliate = object.affiliate ?? ""; + message.registeredAtBlock = object.registeredAtBlock !== undefined && object.registeredAtBlock !== null ? BigInt(object.registeredAtBlock.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RegisterAffiliateEventV1Amino): RegisterAffiliateEventV1 { + const message = createBaseRegisterAffiliateEventV1(); + if (object.referee !== undefined && object.referee !== null) { + message.referee = object.referee; + } + if (object.affiliate !== undefined && object.affiliate !== null) { + message.affiliate = object.affiliate; + } + if (object.registered_at_block !== undefined && object.registered_at_block !== null) { + message.registeredAtBlock = BigInt(object.registered_at_block); + } + return message; + }, + toAmino(message: RegisterAffiliateEventV1): RegisterAffiliateEventV1Amino { + const obj: any = {}; + obj.referee = message.referee === "" ? undefined : message.referee; + obj.affiliate = message.affiliate === "" ? undefined : message.affiliate; + obj.registered_at_block = message.registeredAtBlock !== BigInt(0) ? message.registeredAtBlock.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RegisterAffiliateEventV1AminoMsg): RegisterAffiliateEventV1 { + return RegisterAffiliateEventV1.fromAmino(object.value); + }, + fromProtoMsg(message: RegisterAffiliateEventV1ProtoMsg): RegisterAffiliateEventV1 { + return RegisterAffiliateEventV1.decode(message.value); + }, + toProto(message: RegisterAffiliateEventV1): Uint8Array { + return RegisterAffiliateEventV1.encode(message).finish(); + }, + toProtoMsg(message: RegisterAffiliateEventV1): RegisterAffiliateEventV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.events.RegisterAffiliateEventV1", + value: RegisterAffiliateEventV1.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/indexer_manager/event.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/indexer_manager/event.ts new file mode 100644 index 00000000..13fb1f23 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/indexer_manager/event.ts @@ -0,0 +1,586 @@ +//@ts-nocheck +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../../helpers"; +/** enum to specify that the IndexerTendermintEvent is a block event. */ +export enum IndexerTendermintEvent_BlockEvent { + /** BLOCK_EVENT_UNSPECIFIED - Default value. This value is invalid and unused. */ + BLOCK_EVENT_UNSPECIFIED = 0, + /** + * BLOCK_EVENT_BEGIN_BLOCK - BLOCK_EVENT_BEGIN_BLOCK indicates that the event was generated during + * BeginBlock. + */ + BLOCK_EVENT_BEGIN_BLOCK = 1, + /** + * BLOCK_EVENT_END_BLOCK - BLOCK_EVENT_END_BLOCK indicates that the event was generated during + * EndBlock. + */ + BLOCK_EVENT_END_BLOCK = 2, + UNRECOGNIZED = -1, +} +export const IndexerTendermintEvent_BlockEventSDKType = IndexerTendermintEvent_BlockEvent; +export const IndexerTendermintEvent_BlockEventAmino = IndexerTendermintEvent_BlockEvent; +export function indexerTendermintEvent_BlockEventFromJSON(object: any): IndexerTendermintEvent_BlockEvent { + switch (object) { + case 0: + case "BLOCK_EVENT_UNSPECIFIED": + return IndexerTendermintEvent_BlockEvent.BLOCK_EVENT_UNSPECIFIED; + case 1: + case "BLOCK_EVENT_BEGIN_BLOCK": + return IndexerTendermintEvent_BlockEvent.BLOCK_EVENT_BEGIN_BLOCK; + case 2: + case "BLOCK_EVENT_END_BLOCK": + return IndexerTendermintEvent_BlockEvent.BLOCK_EVENT_END_BLOCK; + case -1: + case "UNRECOGNIZED": + default: + return IndexerTendermintEvent_BlockEvent.UNRECOGNIZED; + } +} +export function indexerTendermintEvent_BlockEventToJSON(object: IndexerTendermintEvent_BlockEvent): string { + switch (object) { + case IndexerTendermintEvent_BlockEvent.BLOCK_EVENT_UNSPECIFIED: + return "BLOCK_EVENT_UNSPECIFIED"; + case IndexerTendermintEvent_BlockEvent.BLOCK_EVENT_BEGIN_BLOCK: + return "BLOCK_EVENT_BEGIN_BLOCK"; + case IndexerTendermintEvent_BlockEvent.BLOCK_EVENT_END_BLOCK: + return "BLOCK_EVENT_END_BLOCK"; + case IndexerTendermintEvent_BlockEvent.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * IndexerTendermintEventWrapper is a wrapper around IndexerTendermintEvent, + * with an additional txn_hash field. + */ +export interface IndexerTendermintEventWrapper { + event?: IndexerTendermintEvent; + txnHash: string; +} +export interface IndexerTendermintEventWrapperProtoMsg { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEventWrapper"; + value: Uint8Array; +} +/** + * IndexerTendermintEventWrapper is a wrapper around IndexerTendermintEvent, + * with an additional txn_hash field. + */ +export interface IndexerTendermintEventWrapperAmino { + event?: IndexerTendermintEventAmino; + txn_hash?: string; +} +export interface IndexerTendermintEventWrapperAminoMsg { + type: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEventWrapper"; + value: IndexerTendermintEventWrapperAmino; +} +/** + * IndexerTendermintEventWrapper is a wrapper around IndexerTendermintEvent, + * with an additional txn_hash field. + */ +export interface IndexerTendermintEventWrapperSDKType { + event?: IndexerTendermintEventSDKType; + txn_hash: string; +} +/** + * IndexerEventsStoreValue represents the type of the value of the + * `IndexerEventsStore` in state. + */ +export interface IndexerEventsStoreValue { + events: IndexerTendermintEventWrapper[]; +} +export interface IndexerEventsStoreValueProtoMsg { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerEventsStoreValue"; + value: Uint8Array; +} +/** + * IndexerEventsStoreValue represents the type of the value of the + * `IndexerEventsStore` in state. + */ +export interface IndexerEventsStoreValueAmino { + events?: IndexerTendermintEventWrapperAmino[]; +} +export interface IndexerEventsStoreValueAminoMsg { + type: "/dydxprotocol.indexer.indexer_manager.IndexerEventsStoreValue"; + value: IndexerEventsStoreValueAmino; +} +/** + * IndexerEventsStoreValue represents the type of the value of the + * `IndexerEventsStore` in state. + */ +export interface IndexerEventsStoreValueSDKType { + events: IndexerTendermintEventWrapperSDKType[]; +} +/** + * IndexerTendermintEvent contains the base64 encoded event proto emitted from + * the dYdX application as well as additional metadata to determine the ordering + * of the event within the block and the subtype of the event. + */ +export interface IndexerTendermintEvent { + /** Subtype of the event e.g. "order_fill", "subaccount_update", etc. */ + subtype: string; + transactionIndex?: number; + blockEvent?: IndexerTendermintEvent_BlockEvent; + /** + * Index of the event within the list of events that happened either during a + * transaction or during processing of a block. + * TODO(DEC-537): Deprecate this field because events are already ordered. + */ + eventIndex: number; + /** Version of the event. */ + version: number; + /** Tendermint event bytes. */ + dataBytes: Uint8Array; +} +export interface IndexerTendermintEventProtoMsg { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEvent"; + value: Uint8Array; +} +/** + * IndexerTendermintEvent contains the base64 encoded event proto emitted from + * the dYdX application as well as additional metadata to determine the ordering + * of the event within the block and the subtype of the event. + */ +export interface IndexerTendermintEventAmino { + /** Subtype of the event e.g. "order_fill", "subaccount_update", etc. */ + subtype?: string; + transaction_index?: number; + block_event?: IndexerTendermintEvent_BlockEvent; + /** + * Index of the event within the list of events that happened either during a + * transaction or during processing of a block. + * TODO(DEC-537): Deprecate this field because events are already ordered. + */ + event_index?: number; + /** Version of the event. */ + version?: number; + /** Tendermint event bytes. */ + data_bytes?: string; +} +export interface IndexerTendermintEventAminoMsg { + type: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEvent"; + value: IndexerTendermintEventAmino; +} +/** + * IndexerTendermintEvent contains the base64 encoded event proto emitted from + * the dYdX application as well as additional metadata to determine the ordering + * of the event within the block and the subtype of the event. + */ +export interface IndexerTendermintEventSDKType { + subtype: string; + transaction_index?: number; + block_event?: IndexerTendermintEvent_BlockEvent; + event_index: number; + version: number; + data_bytes: Uint8Array; +} +/** + * IndexerTendermintBlock contains all the events for the block along with + * metadata for the block height, timestamp of the block and a list of all the + * hashes of the transactions within the block. The transaction hashes follow + * the ordering of the transactions as they appear within the block. + */ +export interface IndexerTendermintBlock { + height: number; + time: Date; + events: IndexerTendermintEvent[]; + txHashes: string[]; +} +export interface IndexerTendermintBlockProtoMsg { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintBlock"; + value: Uint8Array; +} +/** + * IndexerTendermintBlock contains all the events for the block along with + * metadata for the block height, timestamp of the block and a list of all the + * hashes of the transactions within the block. The transaction hashes follow + * the ordering of the transactions as they appear within the block. + */ +export interface IndexerTendermintBlockAmino { + height?: number; + time?: string; + events?: IndexerTendermintEventAmino[]; + tx_hashes?: string[]; +} +export interface IndexerTendermintBlockAminoMsg { + type: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintBlock"; + value: IndexerTendermintBlockAmino; +} +/** + * IndexerTendermintBlock contains all the events for the block along with + * metadata for the block height, timestamp of the block and a list of all the + * hashes of the transactions within the block. The transaction hashes follow + * the ordering of the transactions as they appear within the block. + */ +export interface IndexerTendermintBlockSDKType { + height: number; + time: Date; + events: IndexerTendermintEventSDKType[]; + tx_hashes: string[]; +} +function createBaseIndexerTendermintEventWrapper(): IndexerTendermintEventWrapper { + return { + event: undefined, + txnHash: "" + }; +} +export const IndexerTendermintEventWrapper = { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEventWrapper", + encode(message: IndexerTendermintEventWrapper, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.event !== undefined) { + IndexerTendermintEvent.encode(message.event, writer.uint32(10).fork()).ldelim(); + } + if (message.txnHash !== "") { + writer.uint32(18).string(message.txnHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerTendermintEventWrapper { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerTendermintEventWrapper(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.event = IndexerTendermintEvent.decode(reader, reader.uint32()); + break; + case 2: + message.txnHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerTendermintEventWrapper { + const message = createBaseIndexerTendermintEventWrapper(); + message.event = object.event !== undefined && object.event !== null ? IndexerTendermintEvent.fromPartial(object.event) : undefined; + message.txnHash = object.txnHash ?? ""; + return message; + }, + fromAmino(object: IndexerTendermintEventWrapperAmino): IndexerTendermintEventWrapper { + const message = createBaseIndexerTendermintEventWrapper(); + if (object.event !== undefined && object.event !== null) { + message.event = IndexerTendermintEvent.fromAmino(object.event); + } + if (object.txn_hash !== undefined && object.txn_hash !== null) { + message.txnHash = object.txn_hash; + } + return message; + }, + toAmino(message: IndexerTendermintEventWrapper): IndexerTendermintEventWrapperAmino { + const obj: any = {}; + obj.event = message.event ? IndexerTendermintEvent.toAmino(message.event) : undefined; + obj.txn_hash = message.txnHash === "" ? undefined : message.txnHash; + return obj; + }, + fromAminoMsg(object: IndexerTendermintEventWrapperAminoMsg): IndexerTendermintEventWrapper { + return IndexerTendermintEventWrapper.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerTendermintEventWrapperProtoMsg): IndexerTendermintEventWrapper { + return IndexerTendermintEventWrapper.decode(message.value); + }, + toProto(message: IndexerTendermintEventWrapper): Uint8Array { + return IndexerTendermintEventWrapper.encode(message).finish(); + }, + toProtoMsg(message: IndexerTendermintEventWrapper): IndexerTendermintEventWrapperProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEventWrapper", + value: IndexerTendermintEventWrapper.encode(message).finish() + }; + } +}; +function createBaseIndexerEventsStoreValue(): IndexerEventsStoreValue { + return { + events: [] + }; +} +export const IndexerEventsStoreValue = { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerEventsStoreValue", + encode(message: IndexerEventsStoreValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.events) { + IndexerTendermintEventWrapper.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerEventsStoreValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerEventsStoreValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(IndexerTendermintEventWrapper.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerEventsStoreValue { + const message = createBaseIndexerEventsStoreValue(); + message.events = object.events?.map(e => IndexerTendermintEventWrapper.fromPartial(e)) || []; + return message; + }, + fromAmino(object: IndexerEventsStoreValueAmino): IndexerEventsStoreValue { + const message = createBaseIndexerEventsStoreValue(); + message.events = object.events?.map(e => IndexerTendermintEventWrapper.fromAmino(e)) || []; + return message; + }, + toAmino(message: IndexerEventsStoreValue): IndexerEventsStoreValueAmino { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e ? IndexerTendermintEventWrapper.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: IndexerEventsStoreValueAminoMsg): IndexerEventsStoreValue { + return IndexerEventsStoreValue.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerEventsStoreValueProtoMsg): IndexerEventsStoreValue { + return IndexerEventsStoreValue.decode(message.value); + }, + toProto(message: IndexerEventsStoreValue): Uint8Array { + return IndexerEventsStoreValue.encode(message).finish(); + }, + toProtoMsg(message: IndexerEventsStoreValue): IndexerEventsStoreValueProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerEventsStoreValue", + value: IndexerEventsStoreValue.encode(message).finish() + }; + } +}; +function createBaseIndexerTendermintEvent(): IndexerTendermintEvent { + return { + subtype: "", + transactionIndex: undefined, + blockEvent: undefined, + eventIndex: 0, + version: 0, + dataBytes: new Uint8Array() + }; +} +export const IndexerTendermintEvent = { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEvent", + encode(message: IndexerTendermintEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subtype !== "") { + writer.uint32(10).string(message.subtype); + } + if (message.transactionIndex !== undefined) { + writer.uint32(24).uint32(message.transactionIndex); + } + if (message.blockEvent !== undefined) { + writer.uint32(32).int32(message.blockEvent); + } + if (message.eventIndex !== 0) { + writer.uint32(40).uint32(message.eventIndex); + } + if (message.version !== 0) { + writer.uint32(48).uint32(message.version); + } + if (message.dataBytes.length !== 0) { + writer.uint32(58).bytes(message.dataBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerTendermintEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerTendermintEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subtype = reader.string(); + break; + case 3: + message.transactionIndex = reader.uint32(); + break; + case 4: + message.blockEvent = reader.int32() as any; + break; + case 5: + message.eventIndex = reader.uint32(); + break; + case 6: + message.version = reader.uint32(); + break; + case 7: + message.dataBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerTendermintEvent { + const message = createBaseIndexerTendermintEvent(); + message.subtype = object.subtype ?? ""; + message.transactionIndex = object.transactionIndex ?? undefined; + message.blockEvent = object.blockEvent ?? undefined; + message.eventIndex = object.eventIndex ?? 0; + message.version = object.version ?? 0; + message.dataBytes = object.dataBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: IndexerTendermintEventAmino): IndexerTendermintEvent { + const message = createBaseIndexerTendermintEvent(); + if (object.subtype !== undefined && object.subtype !== null) { + message.subtype = object.subtype; + } + if (object.transaction_index !== undefined && object.transaction_index !== null) { + message.transactionIndex = object.transaction_index; + } + if (object.block_event !== undefined && object.block_event !== null) { + message.blockEvent = object.block_event; + } + if (object.event_index !== undefined && object.event_index !== null) { + message.eventIndex = object.event_index; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.data_bytes !== undefined && object.data_bytes !== null) { + message.dataBytes = bytesFromBase64(object.data_bytes); + } + return message; + }, + toAmino(message: IndexerTendermintEvent): IndexerTendermintEventAmino { + const obj: any = {}; + obj.subtype = message.subtype === "" ? undefined : message.subtype; + obj.transaction_index = message.transactionIndex === null ? undefined : message.transactionIndex; + obj.block_event = message.blockEvent === null ? undefined : message.blockEvent; + obj.event_index = message.eventIndex === 0 ? undefined : message.eventIndex; + obj.version = message.version === 0 ? undefined : message.version; + obj.data_bytes = message.dataBytes ? base64FromBytes(message.dataBytes) : undefined; + return obj; + }, + fromAminoMsg(object: IndexerTendermintEventAminoMsg): IndexerTendermintEvent { + return IndexerTendermintEvent.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerTendermintEventProtoMsg): IndexerTendermintEvent { + return IndexerTendermintEvent.decode(message.value); + }, + toProto(message: IndexerTendermintEvent): Uint8Array { + return IndexerTendermintEvent.encode(message).finish(); + }, + toProtoMsg(message: IndexerTendermintEvent): IndexerTendermintEventProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintEvent", + value: IndexerTendermintEvent.encode(message).finish() + }; + } +}; +function createBaseIndexerTendermintBlock(): IndexerTendermintBlock { + return { + height: 0, + time: new Date(), + events: [], + txHashes: [] + }; +} +export const IndexerTendermintBlock = { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintBlock", + encode(message: IndexerTendermintBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== 0) { + writer.uint32(8).uint32(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + for (const v of message.events) { + IndexerTendermintEvent.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.txHashes) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerTendermintBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerTendermintBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint32(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.events.push(IndexerTendermintEvent.decode(reader, reader.uint32())); + break; + case 4: + message.txHashes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerTendermintBlock { + const message = createBaseIndexerTendermintBlock(); + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.events = object.events?.map(e => IndexerTendermintEvent.fromPartial(e)) || []; + message.txHashes = object.txHashes?.map(e => e) || []; + return message; + }, + fromAmino(object: IndexerTendermintBlockAmino): IndexerTendermintBlock { + const message = createBaseIndexerTendermintBlock(); + if (object.height !== undefined && object.height !== null) { + message.height = object.height; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + message.events = object.events?.map(e => IndexerTendermintEvent.fromAmino(e)) || []; + message.txHashes = object.tx_hashes?.map(e => e) || []; + return message; + }, + toAmino(message: IndexerTendermintBlock): IndexerTendermintBlockAmino { + const obj: any = {}; + obj.height = message.height === 0 ? undefined : message.height; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + if (message.events) { + obj.events = message.events.map(e => e ? IndexerTendermintEvent.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + if (message.txHashes) { + obj.tx_hashes = message.txHashes.map(e => e); + } else { + obj.tx_hashes = message.txHashes; + } + return obj; + }, + fromAminoMsg(object: IndexerTendermintBlockAminoMsg): IndexerTendermintBlock { + return IndexerTendermintBlock.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerTendermintBlockProtoMsg): IndexerTendermintBlock { + return IndexerTendermintBlock.decode(message.value); + }, + toProto(message: IndexerTendermintBlock): Uint8Array { + return IndexerTendermintBlock.encode(message).finish(); + }, + toProtoMsg(message: IndexerTendermintBlock): IndexerTendermintBlockProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.indexer_manager.IndexerTendermintBlock", + value: IndexerTendermintBlock.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/off_chain_updates/off_chain_updates.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/off_chain_updates/off_chain_updates.ts new file mode 100644 index 00000000..8b2f0d19 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/off_chain_updates/off_chain_updates.ts @@ -0,0 +1,763 @@ +//@ts-nocheck +import { IndexerOrder, IndexerOrderAmino, IndexerOrderSDKType, IndexerOrderId, IndexerOrderIdAmino, IndexerOrderIdSDKType } from "../protocol/v1/clob"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { OrderRemovalReason } from "../shared/removal_reason"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** + * OrderPlacementStatus is an enum for the resulting status after an order is + * placed. + */ +export enum OrderPlaceV1_OrderPlacementStatus { + /** ORDER_PLACEMENT_STATUS_UNSPECIFIED - Default value, this is invalid and unused. */ + ORDER_PLACEMENT_STATUS_UNSPECIFIED = 0, + /** + * ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED - A best effort opened order is one that has only been confirmed to be + * placed on the dYdX node sending the off-chain update message. + * The cases where this happens includes: + * - The dYdX node places an order in it's in-memory orderbook during the + * CheckTx flow. + * A best effort placed order may not have been placed on other dYdX + * nodes including other dYdX validator nodes and may still be excluded in + * future order matches. + */ + ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED = 1, + /** + * ORDER_PLACEMENT_STATUS_OPENED - An opened order is one that is confirmed to be placed on all dYdX nodes + * (discounting dishonest dYdX nodes) and will be included in any future + * order matches. + * This status is used internally by the indexer and will not be sent + * out by protocol. + */ + ORDER_PLACEMENT_STATUS_OPENED = 2, + UNRECOGNIZED = -1, +} +export const OrderPlaceV1_OrderPlacementStatusSDKType = OrderPlaceV1_OrderPlacementStatus; +export const OrderPlaceV1_OrderPlacementStatusAmino = OrderPlaceV1_OrderPlacementStatus; +export function orderPlaceV1_OrderPlacementStatusFromJSON(object: any): OrderPlaceV1_OrderPlacementStatus { + switch (object) { + case 0: + case "ORDER_PLACEMENT_STATUS_UNSPECIFIED": + return OrderPlaceV1_OrderPlacementStatus.ORDER_PLACEMENT_STATUS_UNSPECIFIED; + case 1: + case "ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED": + return OrderPlaceV1_OrderPlacementStatus.ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED; + case 2: + case "ORDER_PLACEMENT_STATUS_OPENED": + return OrderPlaceV1_OrderPlacementStatus.ORDER_PLACEMENT_STATUS_OPENED; + case -1: + case "UNRECOGNIZED": + default: + return OrderPlaceV1_OrderPlacementStatus.UNRECOGNIZED; + } +} +export function orderPlaceV1_OrderPlacementStatusToJSON(object: OrderPlaceV1_OrderPlacementStatus): string { + switch (object) { + case OrderPlaceV1_OrderPlacementStatus.ORDER_PLACEMENT_STATUS_UNSPECIFIED: + return "ORDER_PLACEMENT_STATUS_UNSPECIFIED"; + case OrderPlaceV1_OrderPlacementStatus.ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED: + return "ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED"; + case OrderPlaceV1_OrderPlacementStatus.ORDER_PLACEMENT_STATUS_OPENED: + return "ORDER_PLACEMENT_STATUS_OPENED"; + case OrderPlaceV1_OrderPlacementStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * OrderRemovalStatus is an enum for the resulting status after an order is + * removed. + */ +export enum OrderRemoveV1_OrderRemovalStatus { + /** ORDER_REMOVAL_STATUS_UNSPECIFIED - Default value, this is invalid and unused. */ + ORDER_REMOVAL_STATUS_UNSPECIFIED = 0, + /** + * ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED - A best effort canceled order is one that has only been confirmed to be + * removed on the dYdX node sending the off-chain update message. + * The cases where this happens includes: + * - the order was removed due to the dYdX node receiving a CancelOrder + * transaction for the order. + * - the order was removed due to being undercollateralized during + * optimistic matching. + * A best effort canceled order may not have been removed on other dYdX + * nodes including other dYdX validator nodes and may still be included in + * future order matches. + */ + ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED = 1, + /** + * ORDER_REMOVAL_STATUS_CANCELED - A canceled order is one that is confirmed to be removed on all dYdX nodes + * (discounting dishonest dYdX nodes) and will not be included in any future + * order matches. + * The cases where this happens includes: + * - the order is expired. + */ + ORDER_REMOVAL_STATUS_CANCELED = 2, + /** ORDER_REMOVAL_STATUS_FILLED - An order was fully-filled. Only sent by the Indexer for stateful orders. */ + ORDER_REMOVAL_STATUS_FILLED = 3, + UNRECOGNIZED = -1, +} +export const OrderRemoveV1_OrderRemovalStatusSDKType = OrderRemoveV1_OrderRemovalStatus; +export const OrderRemoveV1_OrderRemovalStatusAmino = OrderRemoveV1_OrderRemovalStatus; +export function orderRemoveV1_OrderRemovalStatusFromJSON(object: any): OrderRemoveV1_OrderRemovalStatus { + switch (object) { + case 0: + case "ORDER_REMOVAL_STATUS_UNSPECIFIED": + return OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_UNSPECIFIED; + case 1: + case "ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED": + return OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED; + case 2: + case "ORDER_REMOVAL_STATUS_CANCELED": + return OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_CANCELED; + case 3: + case "ORDER_REMOVAL_STATUS_FILLED": + return OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_FILLED; + case -1: + case "UNRECOGNIZED": + default: + return OrderRemoveV1_OrderRemovalStatus.UNRECOGNIZED; + } +} +export function orderRemoveV1_OrderRemovalStatusToJSON(object: OrderRemoveV1_OrderRemovalStatus): string { + switch (object) { + case OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_UNSPECIFIED: + return "ORDER_REMOVAL_STATUS_UNSPECIFIED"; + case OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED: + return "ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED"; + case OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_CANCELED: + return "ORDER_REMOVAL_STATUS_CANCELED"; + case OrderRemoveV1_OrderRemovalStatus.ORDER_REMOVAL_STATUS_FILLED: + return "ORDER_REMOVAL_STATUS_FILLED"; + case OrderRemoveV1_OrderRemovalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** OrderPlace messages contain the order placed/replaced. */ +export interface OrderPlaceV1 { + order?: IndexerOrder; + placementStatus: OrderPlaceV1_OrderPlacementStatus; + /** The timestamp of the order placement. */ + timeStamp?: Date; +} +export interface OrderPlaceV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderPlaceV1"; + value: Uint8Array; +} +/** OrderPlace messages contain the order placed/replaced. */ +export interface OrderPlaceV1Amino { + order?: IndexerOrderAmino; + placement_status?: OrderPlaceV1_OrderPlacementStatus; + /** The timestamp of the order placement. */ + time_stamp?: string; +} +export interface OrderPlaceV1AminoMsg { + type: "/dydxprotocol.indexer.off_chain_updates.OrderPlaceV1"; + value: OrderPlaceV1Amino; +} +/** OrderPlace messages contain the order placed/replaced. */ +export interface OrderPlaceV1SDKType { + order?: IndexerOrderSDKType; + placement_status: OrderPlaceV1_OrderPlacementStatus; + time_stamp?: Date; +} +/** + * OrderRemove messages contain the id of the order removed, the reason for the + * removal and the resulting status from the removal. + */ +export interface OrderRemoveV1 { + removedOrderId?: IndexerOrderId; + reason: OrderRemovalReason; + removalStatus: OrderRemoveV1_OrderRemovalStatus; + /** The timestamp of the order removal. */ + timeStamp?: Date; +} +export interface OrderRemoveV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderRemoveV1"; + value: Uint8Array; +} +/** + * OrderRemove messages contain the id of the order removed, the reason for the + * removal and the resulting status from the removal. + */ +export interface OrderRemoveV1Amino { + removed_order_id?: IndexerOrderIdAmino; + reason?: OrderRemovalReason; + removal_status?: OrderRemoveV1_OrderRemovalStatus; + /** The timestamp of the order removal. */ + time_stamp?: string; +} +export interface OrderRemoveV1AminoMsg { + type: "/dydxprotocol.indexer.off_chain_updates.OrderRemoveV1"; + value: OrderRemoveV1Amino; +} +/** + * OrderRemove messages contain the id of the order removed, the reason for the + * removal and the resulting status from the removal. + */ +export interface OrderRemoveV1SDKType { + removed_order_id?: IndexerOrderIdSDKType; + reason: OrderRemovalReason; + removal_status: OrderRemoveV1_OrderRemovalStatus; + time_stamp?: Date; +} +/** + * OrderUpdate messages contain the id of the order being updated, and the + * updated total filled quantums of the order. + */ +export interface OrderUpdateV1 { + orderId?: IndexerOrderId; + totalFilledQuantums: bigint; +} +export interface OrderUpdateV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderUpdateV1"; + value: Uint8Array; +} +/** + * OrderUpdate messages contain the id of the order being updated, and the + * updated total filled quantums of the order. + */ +export interface OrderUpdateV1Amino { + order_id?: IndexerOrderIdAmino; + total_filled_quantums?: string; +} +export interface OrderUpdateV1AminoMsg { + type: "/dydxprotocol.indexer.off_chain_updates.OrderUpdateV1"; + value: OrderUpdateV1Amino; +} +/** + * OrderUpdate messages contain the id of the order being updated, and the + * updated total filled quantums of the order. + */ +export interface OrderUpdateV1SDKType { + order_id?: IndexerOrderIdSDKType; + total_filled_quantums: bigint; +} +/** OrderReplace messages contain the old order ID and the replacement order. */ +export interface OrderReplaceV1 { + /** vault replaces orders with a different order ID */ + oldOrderId?: IndexerOrderId; + order?: IndexerOrder; + placementStatus: OrderPlaceV1_OrderPlacementStatus; + timeStamp?: Date; +} +export interface OrderReplaceV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderReplaceV1"; + value: Uint8Array; +} +/** OrderReplace messages contain the old order ID and the replacement order. */ +export interface OrderReplaceV1Amino { + /** vault replaces orders with a different order ID */ + old_order_id?: IndexerOrderIdAmino; + order?: IndexerOrderAmino; + placement_status?: OrderPlaceV1_OrderPlacementStatus; + time_stamp?: string; +} +export interface OrderReplaceV1AminoMsg { + type: "/dydxprotocol.indexer.off_chain_updates.OrderReplaceV1"; + value: OrderReplaceV1Amino; +} +/** OrderReplace messages contain the old order ID and the replacement order. */ +export interface OrderReplaceV1SDKType { + old_order_id?: IndexerOrderIdSDKType; + order?: IndexerOrderSDKType; + placement_status: OrderPlaceV1_OrderPlacementStatus; + time_stamp?: Date; +} +/** + * An OffChainUpdate message is the message type which will be sent on Kafka to + * the Indexer. + */ +export interface OffChainUpdateV1 { + orderPlace?: OrderPlaceV1; + orderRemove?: OrderRemoveV1; + orderUpdate?: OrderUpdateV1; + orderReplace?: OrderReplaceV1; +} +export interface OffChainUpdateV1ProtoMsg { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OffChainUpdateV1"; + value: Uint8Array; +} +/** + * An OffChainUpdate message is the message type which will be sent on Kafka to + * the Indexer. + */ +export interface OffChainUpdateV1Amino { + order_place?: OrderPlaceV1Amino; + order_remove?: OrderRemoveV1Amino; + order_update?: OrderUpdateV1Amino; + order_replace?: OrderReplaceV1Amino; +} +export interface OffChainUpdateV1AminoMsg { + type: "/dydxprotocol.indexer.off_chain_updates.OffChainUpdateV1"; + value: OffChainUpdateV1Amino; +} +/** + * An OffChainUpdate message is the message type which will be sent on Kafka to + * the Indexer. + */ +export interface OffChainUpdateV1SDKType { + order_place?: OrderPlaceV1SDKType; + order_remove?: OrderRemoveV1SDKType; + order_update?: OrderUpdateV1SDKType; + order_replace?: OrderReplaceV1SDKType; +} +function createBaseOrderPlaceV1(): OrderPlaceV1 { + return { + order: undefined, + placementStatus: 0, + timeStamp: undefined + }; +} +export const OrderPlaceV1 = { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderPlaceV1", + encode(message: OrderPlaceV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.placementStatus !== 0) { + writer.uint32(16).int32(message.placementStatus); + } + if (message.timeStamp !== undefined) { + Timestamp.encode(toTimestamp(message.timeStamp), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderPlaceV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderPlaceV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + case 2: + message.placementStatus = reader.int32() as any; + break; + case 3: + message.timeStamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderPlaceV1 { + const message = createBaseOrderPlaceV1(); + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + message.placementStatus = object.placementStatus ?? 0; + message.timeStamp = object.timeStamp ?? undefined; + return message; + }, + fromAmino(object: OrderPlaceV1Amino): OrderPlaceV1 { + const message = createBaseOrderPlaceV1(); + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + if (object.placement_status !== undefined && object.placement_status !== null) { + message.placementStatus = object.placement_status; + } + if (object.time_stamp !== undefined && object.time_stamp !== null) { + message.timeStamp = fromTimestamp(Timestamp.fromAmino(object.time_stamp)); + } + return message; + }, + toAmino(message: OrderPlaceV1): OrderPlaceV1Amino { + const obj: any = {}; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + obj.placement_status = message.placementStatus === 0 ? undefined : message.placementStatus; + obj.time_stamp = message.timeStamp ? Timestamp.toAmino(toTimestamp(message.timeStamp)) : undefined; + return obj; + }, + fromAminoMsg(object: OrderPlaceV1AminoMsg): OrderPlaceV1 { + return OrderPlaceV1.fromAmino(object.value); + }, + fromProtoMsg(message: OrderPlaceV1ProtoMsg): OrderPlaceV1 { + return OrderPlaceV1.decode(message.value); + }, + toProto(message: OrderPlaceV1): Uint8Array { + return OrderPlaceV1.encode(message).finish(); + }, + toProtoMsg(message: OrderPlaceV1): OrderPlaceV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderPlaceV1", + value: OrderPlaceV1.encode(message).finish() + }; + } +}; +function createBaseOrderRemoveV1(): OrderRemoveV1 { + return { + removedOrderId: undefined, + reason: 0, + removalStatus: 0, + timeStamp: undefined + }; +} +export const OrderRemoveV1 = { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderRemoveV1", + encode(message: OrderRemoveV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.removedOrderId !== undefined) { + IndexerOrderId.encode(message.removedOrderId, writer.uint32(10).fork()).ldelim(); + } + if (message.reason !== 0) { + writer.uint32(16).int32(message.reason); + } + if (message.removalStatus !== 0) { + writer.uint32(24).int32(message.removalStatus); + } + if (message.timeStamp !== undefined) { + Timestamp.encode(toTimestamp(message.timeStamp), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderRemoveV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderRemoveV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.removedOrderId = IndexerOrderId.decode(reader, reader.uint32()); + break; + case 2: + message.reason = reader.int32() as any; + break; + case 3: + message.removalStatus = reader.int32() as any; + break; + case 4: + message.timeStamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderRemoveV1 { + const message = createBaseOrderRemoveV1(); + message.removedOrderId = object.removedOrderId !== undefined && object.removedOrderId !== null ? IndexerOrderId.fromPartial(object.removedOrderId) : undefined; + message.reason = object.reason ?? 0; + message.removalStatus = object.removalStatus ?? 0; + message.timeStamp = object.timeStamp ?? undefined; + return message; + }, + fromAmino(object: OrderRemoveV1Amino): OrderRemoveV1 { + const message = createBaseOrderRemoveV1(); + if (object.removed_order_id !== undefined && object.removed_order_id !== null) { + message.removedOrderId = IndexerOrderId.fromAmino(object.removed_order_id); + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + if (object.removal_status !== undefined && object.removal_status !== null) { + message.removalStatus = object.removal_status; + } + if (object.time_stamp !== undefined && object.time_stamp !== null) { + message.timeStamp = fromTimestamp(Timestamp.fromAmino(object.time_stamp)); + } + return message; + }, + toAmino(message: OrderRemoveV1): OrderRemoveV1Amino { + const obj: any = {}; + obj.removed_order_id = message.removedOrderId ? IndexerOrderId.toAmino(message.removedOrderId) : undefined; + obj.reason = message.reason === 0 ? undefined : message.reason; + obj.removal_status = message.removalStatus === 0 ? undefined : message.removalStatus; + obj.time_stamp = message.timeStamp ? Timestamp.toAmino(toTimestamp(message.timeStamp)) : undefined; + return obj; + }, + fromAminoMsg(object: OrderRemoveV1AminoMsg): OrderRemoveV1 { + return OrderRemoveV1.fromAmino(object.value); + }, + fromProtoMsg(message: OrderRemoveV1ProtoMsg): OrderRemoveV1 { + return OrderRemoveV1.decode(message.value); + }, + toProto(message: OrderRemoveV1): Uint8Array { + return OrderRemoveV1.encode(message).finish(); + }, + toProtoMsg(message: OrderRemoveV1): OrderRemoveV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderRemoveV1", + value: OrderRemoveV1.encode(message).finish() + }; + } +}; +function createBaseOrderUpdateV1(): OrderUpdateV1 { + return { + orderId: undefined, + totalFilledQuantums: BigInt(0) + }; +} +export const OrderUpdateV1 = { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderUpdateV1", + encode(message: OrderUpdateV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderId !== undefined) { + IndexerOrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.totalFilledQuantums !== BigInt(0)) { + writer.uint32(16).uint64(message.totalFilledQuantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderUpdateV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderUpdateV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = IndexerOrderId.decode(reader, reader.uint32()); + break; + case 2: + message.totalFilledQuantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderUpdateV1 { + const message = createBaseOrderUpdateV1(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? IndexerOrderId.fromPartial(object.orderId) : undefined; + message.totalFilledQuantums = object.totalFilledQuantums !== undefined && object.totalFilledQuantums !== null ? BigInt(object.totalFilledQuantums.toString()) : BigInt(0); + return message; + }, + fromAmino(object: OrderUpdateV1Amino): OrderUpdateV1 { + const message = createBaseOrderUpdateV1(); + if (object.order_id !== undefined && object.order_id !== null) { + message.orderId = IndexerOrderId.fromAmino(object.order_id); + } + if (object.total_filled_quantums !== undefined && object.total_filled_quantums !== null) { + message.totalFilledQuantums = BigInt(object.total_filled_quantums); + } + return message; + }, + toAmino(message: OrderUpdateV1): OrderUpdateV1Amino { + const obj: any = {}; + obj.order_id = message.orderId ? IndexerOrderId.toAmino(message.orderId) : undefined; + obj.total_filled_quantums = message.totalFilledQuantums !== BigInt(0) ? message.totalFilledQuantums.toString() : undefined; + return obj; + }, + fromAminoMsg(object: OrderUpdateV1AminoMsg): OrderUpdateV1 { + return OrderUpdateV1.fromAmino(object.value); + }, + fromProtoMsg(message: OrderUpdateV1ProtoMsg): OrderUpdateV1 { + return OrderUpdateV1.decode(message.value); + }, + toProto(message: OrderUpdateV1): Uint8Array { + return OrderUpdateV1.encode(message).finish(); + }, + toProtoMsg(message: OrderUpdateV1): OrderUpdateV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderUpdateV1", + value: OrderUpdateV1.encode(message).finish() + }; + } +}; +function createBaseOrderReplaceV1(): OrderReplaceV1 { + return { + oldOrderId: undefined, + order: undefined, + placementStatus: 0, + timeStamp: undefined + }; +} +export const OrderReplaceV1 = { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderReplaceV1", + encode(message: OrderReplaceV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.oldOrderId !== undefined) { + IndexerOrderId.encode(message.oldOrderId, writer.uint32(10).fork()).ldelim(); + } + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + if (message.placementStatus !== 0) { + writer.uint32(24).int32(message.placementStatus); + } + if (message.timeStamp !== undefined) { + Timestamp.encode(toTimestamp(message.timeStamp), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderReplaceV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderReplaceV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oldOrderId = IndexerOrderId.decode(reader, reader.uint32()); + break; + case 2: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + case 3: + message.placementStatus = reader.int32() as any; + break; + case 4: + message.timeStamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderReplaceV1 { + const message = createBaseOrderReplaceV1(); + message.oldOrderId = object.oldOrderId !== undefined && object.oldOrderId !== null ? IndexerOrderId.fromPartial(object.oldOrderId) : undefined; + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + message.placementStatus = object.placementStatus ?? 0; + message.timeStamp = object.timeStamp ?? undefined; + return message; + }, + fromAmino(object: OrderReplaceV1Amino): OrderReplaceV1 { + const message = createBaseOrderReplaceV1(); + if (object.old_order_id !== undefined && object.old_order_id !== null) { + message.oldOrderId = IndexerOrderId.fromAmino(object.old_order_id); + } + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + if (object.placement_status !== undefined && object.placement_status !== null) { + message.placementStatus = object.placement_status; + } + if (object.time_stamp !== undefined && object.time_stamp !== null) { + message.timeStamp = fromTimestamp(Timestamp.fromAmino(object.time_stamp)); + } + return message; + }, + toAmino(message: OrderReplaceV1): OrderReplaceV1Amino { + const obj: any = {}; + obj.old_order_id = message.oldOrderId ? IndexerOrderId.toAmino(message.oldOrderId) : undefined; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + obj.placement_status = message.placementStatus === 0 ? undefined : message.placementStatus; + obj.time_stamp = message.timeStamp ? Timestamp.toAmino(toTimestamp(message.timeStamp)) : undefined; + return obj; + }, + fromAminoMsg(object: OrderReplaceV1AminoMsg): OrderReplaceV1 { + return OrderReplaceV1.fromAmino(object.value); + }, + fromProtoMsg(message: OrderReplaceV1ProtoMsg): OrderReplaceV1 { + return OrderReplaceV1.decode(message.value); + }, + toProto(message: OrderReplaceV1): Uint8Array { + return OrderReplaceV1.encode(message).finish(); + }, + toProtoMsg(message: OrderReplaceV1): OrderReplaceV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OrderReplaceV1", + value: OrderReplaceV1.encode(message).finish() + }; + } +}; +function createBaseOffChainUpdateV1(): OffChainUpdateV1 { + return { + orderPlace: undefined, + orderRemove: undefined, + orderUpdate: undefined, + orderReplace: undefined + }; +} +export const OffChainUpdateV1 = { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OffChainUpdateV1", + encode(message: OffChainUpdateV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderPlace !== undefined) { + OrderPlaceV1.encode(message.orderPlace, writer.uint32(10).fork()).ldelim(); + } + if (message.orderRemove !== undefined) { + OrderRemoveV1.encode(message.orderRemove, writer.uint32(18).fork()).ldelim(); + } + if (message.orderUpdate !== undefined) { + OrderUpdateV1.encode(message.orderUpdate, writer.uint32(26).fork()).ldelim(); + } + if (message.orderReplace !== undefined) { + OrderReplaceV1.encode(message.orderReplace, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OffChainUpdateV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOffChainUpdateV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderPlace = OrderPlaceV1.decode(reader, reader.uint32()); + break; + case 2: + message.orderRemove = OrderRemoveV1.decode(reader, reader.uint32()); + break; + case 3: + message.orderUpdate = OrderUpdateV1.decode(reader, reader.uint32()); + break; + case 4: + message.orderReplace = OrderReplaceV1.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OffChainUpdateV1 { + const message = createBaseOffChainUpdateV1(); + message.orderPlace = object.orderPlace !== undefined && object.orderPlace !== null ? OrderPlaceV1.fromPartial(object.orderPlace) : undefined; + message.orderRemove = object.orderRemove !== undefined && object.orderRemove !== null ? OrderRemoveV1.fromPartial(object.orderRemove) : undefined; + message.orderUpdate = object.orderUpdate !== undefined && object.orderUpdate !== null ? OrderUpdateV1.fromPartial(object.orderUpdate) : undefined; + message.orderReplace = object.orderReplace !== undefined && object.orderReplace !== null ? OrderReplaceV1.fromPartial(object.orderReplace) : undefined; + return message; + }, + fromAmino(object: OffChainUpdateV1Amino): OffChainUpdateV1 { + const message = createBaseOffChainUpdateV1(); + if (object.order_place !== undefined && object.order_place !== null) { + message.orderPlace = OrderPlaceV1.fromAmino(object.order_place); + } + if (object.order_remove !== undefined && object.order_remove !== null) { + message.orderRemove = OrderRemoveV1.fromAmino(object.order_remove); + } + if (object.order_update !== undefined && object.order_update !== null) { + message.orderUpdate = OrderUpdateV1.fromAmino(object.order_update); + } + if (object.order_replace !== undefined && object.order_replace !== null) { + message.orderReplace = OrderReplaceV1.fromAmino(object.order_replace); + } + return message; + }, + toAmino(message: OffChainUpdateV1): OffChainUpdateV1Amino { + const obj: any = {}; + obj.order_place = message.orderPlace ? OrderPlaceV1.toAmino(message.orderPlace) : undefined; + obj.order_remove = message.orderRemove ? OrderRemoveV1.toAmino(message.orderRemove) : undefined; + obj.order_update = message.orderUpdate ? OrderUpdateV1.toAmino(message.orderUpdate) : undefined; + obj.order_replace = message.orderReplace ? OrderReplaceV1.toAmino(message.orderReplace) : undefined; + return obj; + }, + fromAminoMsg(object: OffChainUpdateV1AminoMsg): OffChainUpdateV1 { + return OffChainUpdateV1.fromAmino(object.value); + }, + fromProtoMsg(message: OffChainUpdateV1ProtoMsg): OffChainUpdateV1 { + return OffChainUpdateV1.decode(message.value); + }, + toProto(message: OffChainUpdateV1): Uint8Array { + return OffChainUpdateV1.encode(message).finish(); + }, + toProtoMsg(message: OffChainUpdateV1): OffChainUpdateV1ProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.off_chain_updates.OffChainUpdateV1", + value: OffChainUpdateV1.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/clob.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/clob.ts new file mode 100644 index 00000000..3c391155 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/clob.ts @@ -0,0 +1,780 @@ +//@ts-nocheck +import { IndexerSubaccountId, IndexerSubaccountIdAmino, IndexerSubaccountIdSDKType } from "./subaccount"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * Represents the side of the orderbook the order will be placed on. + * Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be + * placed on the orderbook. + */ +export enum IndexerOrder_Side { + /** SIDE_UNSPECIFIED - Default value. This value is invalid and unused. */ + SIDE_UNSPECIFIED = 0, + /** SIDE_BUY - SIDE_BUY is used to represent a BUY order. */ + SIDE_BUY = 1, + /** SIDE_SELL - SIDE_SELL is used to represent a SELL order. */ + SIDE_SELL = 2, + UNRECOGNIZED = -1, +} +export const IndexerOrder_SideSDKType = IndexerOrder_Side; +export const IndexerOrder_SideAmino = IndexerOrder_Side; +export function indexerOrder_SideFromJSON(object: any): IndexerOrder_Side { + switch (object) { + case 0: + case "SIDE_UNSPECIFIED": + return IndexerOrder_Side.SIDE_UNSPECIFIED; + case 1: + case "SIDE_BUY": + return IndexerOrder_Side.SIDE_BUY; + case 2: + case "SIDE_SELL": + return IndexerOrder_Side.SIDE_SELL; + case -1: + case "UNRECOGNIZED": + default: + return IndexerOrder_Side.UNRECOGNIZED; + } +} +export function indexerOrder_SideToJSON(object: IndexerOrder_Side): string { + switch (object) { + case IndexerOrder_Side.SIDE_UNSPECIFIED: + return "SIDE_UNSPECIFIED"; + case IndexerOrder_Side.SIDE_BUY: + return "SIDE_BUY"; + case IndexerOrder_Side.SIDE_SELL: + return "SIDE_SELL"; + case IndexerOrder_Side.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * TimeInForce indicates how long an order will remain active before it + * is executed or expires. + */ +export enum IndexerOrder_TimeInForce { + /** + * TIME_IN_FORCE_UNSPECIFIED - TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an + * order will first match with existing orders on the book, and any + * remaining size will be added to the book as a maker order. + */ + TIME_IN_FORCE_UNSPECIFIED = 0, + /** + * TIME_IN_FORCE_IOC - TIME_IN_FORCE_IOC enforces that an order only be matched with + * maker orders on the book. If the order has remaining size after + * matching with existing orders on the book, the remaining size + * is not placed on the book. + */ + TIME_IN_FORCE_IOC = 1, + /** + * TIME_IN_FORCE_POST_ONLY - TIME_IN_FORCE_POST_ONLY enforces that an order only be placed + * on the book as a maker order. Note this means that validators will cancel + * any newly-placed post only orders that would cross with other maker + * orders. + */ + TIME_IN_FORCE_POST_ONLY = 2, + /** + * TIME_IN_FORCE_FILL_OR_KILL - TIME_IN_FORCE_FILL_OR_KILL enforces that an order will either be filled + * completely and immediately by maker orders on the book or canceled if the + * entire amount can‘t be matched. + */ + TIME_IN_FORCE_FILL_OR_KILL = 3, + UNRECOGNIZED = -1, +} +export const IndexerOrder_TimeInForceSDKType = IndexerOrder_TimeInForce; +export const IndexerOrder_TimeInForceAmino = IndexerOrder_TimeInForce; +export function indexerOrder_TimeInForceFromJSON(object: any): IndexerOrder_TimeInForce { + switch (object) { + case 0: + case "TIME_IN_FORCE_UNSPECIFIED": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_UNSPECIFIED; + case 1: + case "TIME_IN_FORCE_IOC": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_IOC; + case 2: + case "TIME_IN_FORCE_POST_ONLY": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_POST_ONLY; + case 3: + case "TIME_IN_FORCE_FILL_OR_KILL": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL; + case -1: + case "UNRECOGNIZED": + default: + return IndexerOrder_TimeInForce.UNRECOGNIZED; + } +} +export function indexerOrder_TimeInForceToJSON(object: IndexerOrder_TimeInForce): string { + switch (object) { + case IndexerOrder_TimeInForce.TIME_IN_FORCE_UNSPECIFIED: + return "TIME_IN_FORCE_UNSPECIFIED"; + case IndexerOrder_TimeInForce.TIME_IN_FORCE_IOC: + return "TIME_IN_FORCE_IOC"; + case IndexerOrder_TimeInForce.TIME_IN_FORCE_POST_ONLY: + return "TIME_IN_FORCE_POST_ONLY"; + case IndexerOrder_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL: + return "TIME_IN_FORCE_FILL_OR_KILL"; + case IndexerOrder_TimeInForce.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum IndexerOrder_ConditionType { + /** + * CONDITION_TYPE_UNSPECIFIED - CONDITION_TYPE_UNSPECIFIED represents the default behavior where an + * order will be placed immediately on the orderbook. + */ + CONDITION_TYPE_UNSPECIFIED = 0, + /** + * CONDITION_TYPE_STOP_LOSS - CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will + * trigger when the oracle price moves at or above the trigger price for + * buys, and at or below the trigger price for sells. + */ + CONDITION_TYPE_STOP_LOSS = 1, + /** + * CONDITION_TYPE_TAKE_PROFIT - CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit + * order will trigger when the oracle price moves at or below the trigger + * price for buys and at or above the trigger price for sells. + */ + CONDITION_TYPE_TAKE_PROFIT = 2, + UNRECOGNIZED = -1, +} +export const IndexerOrder_ConditionTypeSDKType = IndexerOrder_ConditionType; +export const IndexerOrder_ConditionTypeAmino = IndexerOrder_ConditionType; +export function indexerOrder_ConditionTypeFromJSON(object: any): IndexerOrder_ConditionType { + switch (object) { + case 0: + case "CONDITION_TYPE_UNSPECIFIED": + return IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED; + case 1: + case "CONDITION_TYPE_STOP_LOSS": + return IndexerOrder_ConditionType.CONDITION_TYPE_STOP_LOSS; + case 2: + case "CONDITION_TYPE_TAKE_PROFIT": + return IndexerOrder_ConditionType.CONDITION_TYPE_TAKE_PROFIT; + case -1: + case "UNRECOGNIZED": + default: + return IndexerOrder_ConditionType.UNRECOGNIZED; + } +} +export function indexerOrder_ConditionTypeToJSON(object: IndexerOrder_ConditionType): string { + switch (object) { + case IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED: + return "CONDITION_TYPE_UNSPECIFIED"; + case IndexerOrder_ConditionType.CONDITION_TYPE_STOP_LOSS: + return "CONDITION_TYPE_STOP_LOSS"; + case IndexerOrder_ConditionType.CONDITION_TYPE_TAKE_PROFIT: + return "CONDITION_TYPE_TAKE_PROFIT"; + case IndexerOrder_ConditionType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Status of the CLOB. + * Defined in clob.clob_pair + */ +export enum ClobPairStatus { + /** CLOB_PAIR_STATUS_UNSPECIFIED - Default value. This value is invalid and unused. */ + CLOB_PAIR_STATUS_UNSPECIFIED = 0, + /** + * CLOB_PAIR_STATUS_ACTIVE - CLOB_PAIR_STATUS_ACTIVE behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + CLOB_PAIR_STATUS_ACTIVE = 1, + /** + * CLOB_PAIR_STATUS_PAUSED - CLOB_PAIR_STATUS_PAUSED behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + CLOB_PAIR_STATUS_PAUSED = 2, + /** + * CLOB_PAIR_STATUS_CANCEL_ONLY - CLOB_PAIR_STATUS_CANCEL_ONLY behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + CLOB_PAIR_STATUS_CANCEL_ONLY = 3, + /** + * CLOB_PAIR_STATUS_POST_ONLY - CLOB_PAIR_STATUS_POST_ONLY behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + CLOB_PAIR_STATUS_POST_ONLY = 4, + /** + * CLOB_PAIR_STATUS_INITIALIZING - CLOB_PAIR_STATUS_INITIALIZING represents a newly-added clob pair. + * Clob pairs in this state only accept orders which are + * both short-term and post-only. + */ + CLOB_PAIR_STATUS_INITIALIZING = 5, + /** + * CLOB_PAIR_STATUS_FINAL_SETTLEMENT - CLOB_PAIR_STATUS_FINAL_SETTLEMENT represents a clob pair that has been + * deactivated. Clob pairs in this state do not accept new orders and trading + * is blocked. All open positions are closed and open stateful orders canceled + * by the protocol when the clob pair transitions to this status. All + * short-term orders are left to expire. + */ + CLOB_PAIR_STATUS_FINAL_SETTLEMENT = 6, + UNRECOGNIZED = -1, +} +export const ClobPairStatusSDKType = ClobPairStatus; +export const ClobPairStatusAmino = ClobPairStatus; +export function clobPairStatusFromJSON(object: any): ClobPairStatus { + switch (object) { + case 0: + case "CLOB_PAIR_STATUS_UNSPECIFIED": + return ClobPairStatus.CLOB_PAIR_STATUS_UNSPECIFIED; + case 1: + case "CLOB_PAIR_STATUS_ACTIVE": + return ClobPairStatus.CLOB_PAIR_STATUS_ACTIVE; + case 2: + case "CLOB_PAIR_STATUS_PAUSED": + return ClobPairStatus.CLOB_PAIR_STATUS_PAUSED; + case 3: + case "CLOB_PAIR_STATUS_CANCEL_ONLY": + return ClobPairStatus.CLOB_PAIR_STATUS_CANCEL_ONLY; + case 4: + case "CLOB_PAIR_STATUS_POST_ONLY": + return ClobPairStatus.CLOB_PAIR_STATUS_POST_ONLY; + case 5: + case "CLOB_PAIR_STATUS_INITIALIZING": + return ClobPairStatus.CLOB_PAIR_STATUS_INITIALIZING; + case 6: + case "CLOB_PAIR_STATUS_FINAL_SETTLEMENT": + return ClobPairStatus.CLOB_PAIR_STATUS_FINAL_SETTLEMENT; + case -1: + case "UNRECOGNIZED": + default: + return ClobPairStatus.UNRECOGNIZED; + } +} +export function clobPairStatusToJSON(object: ClobPairStatus): string { + switch (object) { + case ClobPairStatus.CLOB_PAIR_STATUS_UNSPECIFIED: + return "CLOB_PAIR_STATUS_UNSPECIFIED"; + case ClobPairStatus.CLOB_PAIR_STATUS_ACTIVE: + return "CLOB_PAIR_STATUS_ACTIVE"; + case ClobPairStatus.CLOB_PAIR_STATUS_PAUSED: + return "CLOB_PAIR_STATUS_PAUSED"; + case ClobPairStatus.CLOB_PAIR_STATUS_CANCEL_ONLY: + return "CLOB_PAIR_STATUS_CANCEL_ONLY"; + case ClobPairStatus.CLOB_PAIR_STATUS_POST_ONLY: + return "CLOB_PAIR_STATUS_POST_ONLY"; + case ClobPairStatus.CLOB_PAIR_STATUS_INITIALIZING: + return "CLOB_PAIR_STATUS_INITIALIZING"; + case ClobPairStatus.CLOB_PAIR_STATUS_FINAL_SETTLEMENT: + return "CLOB_PAIR_STATUS_FINAL_SETTLEMENT"; + case ClobPairStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** IndexerOrderId refers to a single order belonging to a Subaccount. */ +export interface IndexerOrderId { + /** + * The subaccount ID that opened this order. + * Note that this field has `gogoproto.nullable = false` so that it is + * generated as a value instead of a pointer. This is because the `OrderId` + * proto is used as a key within maps, and map comparisons will compare + * pointers for equality (when the desired behavior is to compare the values). + */ + subaccountId: IndexerSubaccountId; + /** + * The client ID of this order, unique with respect to the specific + * sub account (I.E., the same subaccount can't have two orders with + * the same ClientId). + */ + clientId: number; + /** + * order_flags represent order flags for the order. This field is invalid if + * it's greater than 127 (larger than one byte). Each bit in the first byte + * represents a different flag. Currently only two flags are supported. + * + * Starting from the bit after the most MSB (note that the MSB is used in + * proto varint encoding, and therefore cannot be used): Bit 1 is set if this + * order is a Long-Term order (0x40, or 64 as a uint8). Bit 2 is set if this + * order is a Conditional order (0x20, or 32 as a uint8). + * + * If neither bit is set, the order is assumed to be a Short-Term order. + * + * If both bits are set or bits other than the 2nd and 3rd are set, the order + * ID is invalid. + */ + orderFlags: number; + /** ID of the CLOB the order is created for. */ + clobPairId: number; +} +export interface IndexerOrderIdProtoMsg { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerOrderId"; + value: Uint8Array; +} +/** IndexerOrderId refers to a single order belonging to a Subaccount. */ +export interface IndexerOrderIdAmino { + /** + * The subaccount ID that opened this order. + * Note that this field has `gogoproto.nullable = false` so that it is + * generated as a value instead of a pointer. This is because the `OrderId` + * proto is used as a key within maps, and map comparisons will compare + * pointers for equality (when the desired behavior is to compare the values). + */ + subaccount_id?: IndexerSubaccountIdAmino; + /** + * The client ID of this order, unique with respect to the specific + * sub account (I.E., the same subaccount can't have two orders with + * the same ClientId). + */ + client_id?: number; + /** + * order_flags represent order flags for the order. This field is invalid if + * it's greater than 127 (larger than one byte). Each bit in the first byte + * represents a different flag. Currently only two flags are supported. + * + * Starting from the bit after the most MSB (note that the MSB is used in + * proto varint encoding, and therefore cannot be used): Bit 1 is set if this + * order is a Long-Term order (0x40, or 64 as a uint8). Bit 2 is set if this + * order is a Conditional order (0x20, or 32 as a uint8). + * + * If neither bit is set, the order is assumed to be a Short-Term order. + * + * If both bits are set or bits other than the 2nd and 3rd are set, the order + * ID is invalid. + */ + order_flags?: number; + /** ID of the CLOB the order is created for. */ + clob_pair_id?: number; +} +export interface IndexerOrderIdAminoMsg { + type: "/dydxprotocol.indexer.protocol.v1.IndexerOrderId"; + value: IndexerOrderIdAmino; +} +/** IndexerOrderId refers to a single order belonging to a Subaccount. */ +export interface IndexerOrderIdSDKType { + subaccount_id: IndexerSubaccountIdSDKType; + client_id: number; + order_flags: number; + clob_pair_id: number; +} +/** + * IndexerOrderV1 represents a single order belonging to a `Subaccount` + * for a particular `ClobPair`. + */ +export interface IndexerOrder { + /** The unique ID of this order. Meant to be unique across all orders. */ + orderId: IndexerOrderId; + side: IndexerOrder_Side; + /** + * The size of this order in base quantums. Must be a multiple of + * `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`). + */ + quantums: bigint; + /** + * The price level that this order will be placed at on the orderbook, + * in subticks. Must be a multiple of ClobPair.SubticksPerTick + * (where `ClobPair.Id = orderId.ClobPairId`). + */ + subticks: bigint; + /** + * The last block this order can be executed at (after which it will be + * unfillable). Used only for Short-Term orders. If this value is non-zero + * then the order is assumed to be a Short-Term order. + */ + goodTilBlock?: number; + /** + * good_til_block_time represents the unix timestamp (in seconds) at which a + * stateful order will be considered expired. The + * good_til_block_time is always evaluated against the previous block's + * `BlockTime` instead of the block in which the order is committed. If this + * value is non-zero then the order is assumed to be a stateful or + * conditional order. + */ + goodTilBlockTime?: number; + /** The time in force of this order. */ + timeInForce: IndexerOrder_TimeInForce; + /** + * Enforces that the order can only reduce the size of an existing position. + * If a ReduceOnly order would change the side of the existing position, + * its size is reduced to that of the remaining size of the position. + * If existing orders on the book with ReduceOnly + * would already close the position, the least aggressive (out-of-the-money) + * ReduceOnly orders are resized and canceled first. + */ + reduceOnly: boolean; + /** + * Set of bit flags set arbitrarily by clients and ignored by the protocol. + * Used by indexer to infer information about a placed order. + */ + clientMetadata: number; + conditionType: IndexerOrder_ConditionType; + /** + * conditional_order_trigger_subticks represents the price at which this order + * will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED, + * this value is enforced to be 0. If this value is nonzero, condition_type + * cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks. + * Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id = + * orderId.ClobPairId`). + */ + conditionalOrderTriggerSubticks: bigint; +} +export interface IndexerOrderProtoMsg { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerOrder"; + value: Uint8Array; +} +/** + * IndexerOrderV1 represents a single order belonging to a `Subaccount` + * for a particular `ClobPair`. + */ +export interface IndexerOrderAmino { + /** The unique ID of this order. Meant to be unique across all orders. */ + order_id?: IndexerOrderIdAmino; + side?: IndexerOrder_Side; + /** + * The size of this order in base quantums. Must be a multiple of + * `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`). + */ + quantums?: string; + /** + * The price level that this order will be placed at on the orderbook, + * in subticks. Must be a multiple of ClobPair.SubticksPerTick + * (where `ClobPair.Id = orderId.ClobPairId`). + */ + subticks?: string; + /** + * The last block this order can be executed at (after which it will be + * unfillable). Used only for Short-Term orders. If this value is non-zero + * then the order is assumed to be a Short-Term order. + */ + good_til_block?: number; + /** + * good_til_block_time represents the unix timestamp (in seconds) at which a + * stateful order will be considered expired. The + * good_til_block_time is always evaluated against the previous block's + * `BlockTime` instead of the block in which the order is committed. If this + * value is non-zero then the order is assumed to be a stateful or + * conditional order. + */ + good_til_block_time?: number; + /** The time in force of this order. */ + time_in_force?: IndexerOrder_TimeInForce; + /** + * Enforces that the order can only reduce the size of an existing position. + * If a ReduceOnly order would change the side of the existing position, + * its size is reduced to that of the remaining size of the position. + * If existing orders on the book with ReduceOnly + * would already close the position, the least aggressive (out-of-the-money) + * ReduceOnly orders are resized and canceled first. + */ + reduce_only?: boolean; + /** + * Set of bit flags set arbitrarily by clients and ignored by the protocol. + * Used by indexer to infer information about a placed order. + */ + client_metadata?: number; + condition_type?: IndexerOrder_ConditionType; + /** + * conditional_order_trigger_subticks represents the price at which this order + * will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED, + * this value is enforced to be 0. If this value is nonzero, condition_type + * cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks. + * Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id = + * orderId.ClobPairId`). + */ + conditional_order_trigger_subticks?: string; +} +export interface IndexerOrderAminoMsg { + type: "/dydxprotocol.indexer.protocol.v1.IndexerOrder"; + value: IndexerOrderAmino; +} +/** + * IndexerOrderV1 represents a single order belonging to a `Subaccount` + * for a particular `ClobPair`. + */ +export interface IndexerOrderSDKType { + order_id: IndexerOrderIdSDKType; + side: IndexerOrder_Side; + quantums: bigint; + subticks: bigint; + good_til_block?: number; + good_til_block_time?: number; + time_in_force: IndexerOrder_TimeInForce; + reduce_only: boolean; + client_metadata: number; + condition_type: IndexerOrder_ConditionType; + conditional_order_trigger_subticks: bigint; +} +function createBaseIndexerOrderId(): IndexerOrderId { + return { + subaccountId: IndexerSubaccountId.fromPartial({}), + clientId: 0, + orderFlags: 0, + clobPairId: 0 + }; +} +export const IndexerOrderId = { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerOrderId", + encode(message: IndexerOrderId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + IndexerSubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== 0) { + writer.uint32(21).fixed32(message.clientId); + } + if (message.orderFlags !== 0) { + writer.uint32(24).uint32(message.orderFlags); + } + if (message.clobPairId !== 0) { + writer.uint32(32).uint32(message.clobPairId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerOrderId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerOrderId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.fixed32(); + break; + case 3: + message.orderFlags = reader.uint32(); + break; + case 4: + message.clobPairId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerOrderId { + const message = createBaseIndexerOrderId(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? IndexerSubaccountId.fromPartial(object.subaccountId) : undefined; + message.clientId = object.clientId ?? 0; + message.orderFlags = object.orderFlags ?? 0; + message.clobPairId = object.clobPairId ?? 0; + return message; + }, + fromAmino(object: IndexerOrderIdAmino): IndexerOrderId { + const message = createBaseIndexerOrderId(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = IndexerSubaccountId.fromAmino(object.subaccount_id); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.order_flags !== undefined && object.order_flags !== null) { + message.orderFlags = object.order_flags; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + return message; + }, + toAmino(message: IndexerOrderId): IndexerOrderIdAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? IndexerSubaccountId.toAmino(message.subaccountId) : undefined; + obj.client_id = message.clientId === 0 ? undefined : message.clientId; + obj.order_flags = message.orderFlags === 0 ? undefined : message.orderFlags; + obj.clob_pair_id = message.clobPairId === 0 ? undefined : message.clobPairId; + return obj; + }, + fromAminoMsg(object: IndexerOrderIdAminoMsg): IndexerOrderId { + return IndexerOrderId.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerOrderIdProtoMsg): IndexerOrderId { + return IndexerOrderId.decode(message.value); + }, + toProto(message: IndexerOrderId): Uint8Array { + return IndexerOrderId.encode(message).finish(); + }, + toProtoMsg(message: IndexerOrderId): IndexerOrderIdProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerOrderId", + value: IndexerOrderId.encode(message).finish() + }; + } +}; +function createBaseIndexerOrder(): IndexerOrder { + return { + orderId: IndexerOrderId.fromPartial({}), + side: 0, + quantums: BigInt(0), + subticks: BigInt(0), + goodTilBlock: undefined, + goodTilBlockTime: undefined, + timeInForce: 0, + reduceOnly: false, + clientMetadata: 0, + conditionType: 0, + conditionalOrderTriggerSubticks: BigInt(0) + }; +} +export const IndexerOrder = { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerOrder", + encode(message: IndexerOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.orderId !== undefined) { + IndexerOrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.side !== 0) { + writer.uint32(16).int32(message.side); + } + if (message.quantums !== BigInt(0)) { + writer.uint32(24).uint64(message.quantums); + } + if (message.subticks !== BigInt(0)) { + writer.uint32(32).uint64(message.subticks); + } + if (message.goodTilBlock !== undefined) { + writer.uint32(40).uint32(message.goodTilBlock); + } + if (message.goodTilBlockTime !== undefined) { + writer.uint32(53).fixed32(message.goodTilBlockTime); + } + if (message.timeInForce !== 0) { + writer.uint32(56).int32(message.timeInForce); + } + if (message.reduceOnly === true) { + writer.uint32(64).bool(message.reduceOnly); + } + if (message.clientMetadata !== 0) { + writer.uint32(72).uint32(message.clientMetadata); + } + if (message.conditionType !== 0) { + writer.uint32(80).int32(message.conditionType); + } + if (message.conditionalOrderTriggerSubticks !== BigInt(0)) { + writer.uint32(88).uint64(message.conditionalOrderTriggerSubticks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = IndexerOrderId.decode(reader, reader.uint32()); + break; + case 2: + message.side = reader.int32() as any; + break; + case 3: + message.quantums = reader.uint64(); + break; + case 4: + message.subticks = reader.uint64(); + break; + case 5: + message.goodTilBlock = reader.uint32(); + break; + case 6: + message.goodTilBlockTime = reader.fixed32(); + break; + case 7: + message.timeInForce = reader.int32() as any; + break; + case 8: + message.reduceOnly = reader.bool(); + break; + case 9: + message.clientMetadata = reader.uint32(); + break; + case 10: + message.conditionType = reader.int32() as any; + break; + case 11: + message.conditionalOrderTriggerSubticks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerOrder { + const message = createBaseIndexerOrder(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? IndexerOrderId.fromPartial(object.orderId) : undefined; + message.side = object.side ?? 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? BigInt(object.quantums.toString()) : BigInt(0); + message.subticks = object.subticks !== undefined && object.subticks !== null ? BigInt(object.subticks.toString()) : BigInt(0); + message.goodTilBlock = object.goodTilBlock ?? undefined; + message.goodTilBlockTime = object.goodTilBlockTime ?? undefined; + message.timeInForce = object.timeInForce ?? 0; + message.reduceOnly = object.reduceOnly ?? false; + message.clientMetadata = object.clientMetadata ?? 0; + message.conditionType = object.conditionType ?? 0; + message.conditionalOrderTriggerSubticks = object.conditionalOrderTriggerSubticks !== undefined && object.conditionalOrderTriggerSubticks !== null ? BigInt(object.conditionalOrderTriggerSubticks.toString()) : BigInt(0); + return message; + }, + fromAmino(object: IndexerOrderAmino): IndexerOrder { + const message = createBaseIndexerOrder(); + if (object.order_id !== undefined && object.order_id !== null) { + message.orderId = IndexerOrderId.fromAmino(object.order_id); + } + if (object.side !== undefined && object.side !== null) { + message.side = object.side; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = BigInt(object.quantums); + } + if (object.subticks !== undefined && object.subticks !== null) { + message.subticks = BigInt(object.subticks); + } + if (object.good_til_block !== undefined && object.good_til_block !== null) { + message.goodTilBlock = object.good_til_block; + } + if (object.good_til_block_time !== undefined && object.good_til_block_time !== null) { + message.goodTilBlockTime = object.good_til_block_time; + } + if (object.time_in_force !== undefined && object.time_in_force !== null) { + message.timeInForce = object.time_in_force; + } + if (object.reduce_only !== undefined && object.reduce_only !== null) { + message.reduceOnly = object.reduce_only; + } + if (object.client_metadata !== undefined && object.client_metadata !== null) { + message.clientMetadata = object.client_metadata; + } + if (object.condition_type !== undefined && object.condition_type !== null) { + message.conditionType = object.condition_type; + } + if (object.conditional_order_trigger_subticks !== undefined && object.conditional_order_trigger_subticks !== null) { + message.conditionalOrderTriggerSubticks = BigInt(object.conditional_order_trigger_subticks); + } + return message; + }, + toAmino(message: IndexerOrder): IndexerOrderAmino { + const obj: any = {}; + obj.order_id = message.orderId ? IndexerOrderId.toAmino(message.orderId) : undefined; + obj.side = message.side === 0 ? undefined : message.side; + obj.quantums = message.quantums !== BigInt(0) ? message.quantums.toString() : undefined; + obj.subticks = message.subticks !== BigInt(0) ? message.subticks.toString() : undefined; + obj.good_til_block = message.goodTilBlock === null ? undefined : message.goodTilBlock; + obj.good_til_block_time = message.goodTilBlockTime === null ? undefined : message.goodTilBlockTime; + obj.time_in_force = message.timeInForce === 0 ? undefined : message.timeInForce; + obj.reduce_only = message.reduceOnly === false ? undefined : message.reduceOnly; + obj.client_metadata = message.clientMetadata === 0 ? undefined : message.clientMetadata; + obj.condition_type = message.conditionType === 0 ? undefined : message.conditionType; + obj.conditional_order_trigger_subticks = message.conditionalOrderTriggerSubticks !== BigInt(0) ? message.conditionalOrderTriggerSubticks.toString() : undefined; + return obj; + }, + fromAminoMsg(object: IndexerOrderAminoMsg): IndexerOrder { + return IndexerOrder.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerOrderProtoMsg): IndexerOrder { + return IndexerOrder.decode(message.value); + }, + toProto(message: IndexerOrder): Uint8Array { + return IndexerOrder.encode(message).finish(); + }, + toProtoMsg(message: IndexerOrder): IndexerOrderProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerOrder", + value: IndexerOrder.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/perpetual.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/perpetual.ts new file mode 100644 index 00000000..39f61abf --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/perpetual.ts @@ -0,0 +1,46 @@ +//@ts-nocheck +/** + * Market type of perpetual. + * Defined in perpetual. + */ +export enum PerpetualMarketType { + /** PERPETUAL_MARKET_TYPE_UNSPECIFIED - Unspecified market type. */ + PERPETUAL_MARKET_TYPE_UNSPECIFIED = 0, + /** PERPETUAL_MARKET_TYPE_CROSS - Market type for cross margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_CROSS = 1, + /** PERPETUAL_MARKET_TYPE_ISOLATED - Market type for isolated margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_ISOLATED = 2, + UNRECOGNIZED = -1, +} +export const PerpetualMarketTypeSDKType = PerpetualMarketType; +export const PerpetualMarketTypeAmino = PerpetualMarketType; +export function perpetualMarketTypeFromJSON(object: any): PerpetualMarketType { + switch (object) { + case 0: + case "PERPETUAL_MARKET_TYPE_UNSPECIFIED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED; + case 1: + case "PERPETUAL_MARKET_TYPE_CROSS": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS; + case 2: + case "PERPETUAL_MARKET_TYPE_ISOLATED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED; + case -1: + case "UNRECOGNIZED": + default: + return PerpetualMarketType.UNRECOGNIZED; + } +} +export function perpetualMarketTypeToJSON(object: PerpetualMarketType): string { + switch (object) { + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED: + return "PERPETUAL_MARKET_TYPE_UNSPECIFIED"; + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS: + return "PERPETUAL_MARKET_TYPE_CROSS"; + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED: + return "PERPETUAL_MARKET_TYPE_ISOLATED"; + case PerpetualMarketType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/subaccount.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/subaccount.ts new file mode 100644 index 00000000..008b2081 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/protocol/v1/subaccount.ts @@ -0,0 +1,408 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** IndexerSubaccountId defines a unique identifier for a Subaccount. */ +export interface IndexerSubaccountId { + /** The address of the wallet that owns this subaccount. */ + owner: string; + /** + * < 128 Since 128 should be enough to start and it fits within + * 1 Byte (1 Bit needed to indicate that the first byte is the last). + */ + number: number; +} +export interface IndexerSubaccountIdProtoMsg { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerSubaccountId"; + value: Uint8Array; +} +/** IndexerSubaccountId defines a unique identifier for a Subaccount. */ +export interface IndexerSubaccountIdAmino { + /** The address of the wallet that owns this subaccount. */ + owner?: string; + /** + * < 128 Since 128 should be enough to start and it fits within + * 1 Byte (1 Bit needed to indicate that the first byte is the last). + */ + number?: number; +} +export interface IndexerSubaccountIdAminoMsg { + type: "/dydxprotocol.indexer.protocol.v1.IndexerSubaccountId"; + value: IndexerSubaccountIdAmino; +} +/** IndexerSubaccountId defines a unique identifier for a Subaccount. */ +export interface IndexerSubaccountIdSDKType { + owner: string; + number: number; +} +/** + * IndexerPerpetualPosition are an account’s positions of a `Perpetual`. + * Therefore they hold any information needed to trade perpetuals. + */ +export interface IndexerPerpetualPosition { + /** The `Id` of the `Perpetual`. */ + perpetualId: number; + /** The size of the position in base quantums. */ + quantums: Uint8Array; + /** + * The funding_index of the `Perpetual` the last time this position was + * settled. + */ + fundingIndex: Uint8Array; + /** + * Amount of funding payment (in quote quantums). + * Note: 1. this field is not cumulative. + * 2. a positive value means funding payment was paid out and + * a negative value means funding payment was received. + */ + fundingPayment: Uint8Array; +} +export interface IndexerPerpetualPositionProtoMsg { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerPerpetualPosition"; + value: Uint8Array; +} +/** + * IndexerPerpetualPosition are an account’s positions of a `Perpetual`. + * Therefore they hold any information needed to trade perpetuals. + */ +export interface IndexerPerpetualPositionAmino { + /** The `Id` of the `Perpetual`. */ + perpetual_id?: number; + /** The size of the position in base quantums. */ + quantums?: string; + /** + * The funding_index of the `Perpetual` the last time this position was + * settled. + */ + funding_index?: string; + /** + * Amount of funding payment (in quote quantums). + * Note: 1. this field is not cumulative. + * 2. a positive value means funding payment was paid out and + * a negative value means funding payment was received. + */ + funding_payment?: string; +} +export interface IndexerPerpetualPositionAminoMsg { + type: "/dydxprotocol.indexer.protocol.v1.IndexerPerpetualPosition"; + value: IndexerPerpetualPositionAmino; +} +/** + * IndexerPerpetualPosition are an account’s positions of a `Perpetual`. + * Therefore they hold any information needed to trade perpetuals. + */ +export interface IndexerPerpetualPositionSDKType { + perpetual_id: number; + quantums: Uint8Array; + funding_index: Uint8Array; + funding_payment: Uint8Array; +} +/** + * IndexerAssetPosition define an account’s positions of an `Asset`. + * Therefore they hold any information needed to trade on Spot and Margin. + */ +export interface IndexerAssetPosition { + /** The `Id` of the `Asset`. */ + assetId: number; + /** The absolute size of the position in base quantums. */ + quantums: Uint8Array; + /** + * The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last + * time this position was settled + * TODO(DEC-582): pending margin trading being added. + */ + index: bigint; +} +export interface IndexerAssetPositionProtoMsg { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerAssetPosition"; + value: Uint8Array; +} +/** + * IndexerAssetPosition define an account’s positions of an `Asset`. + * Therefore they hold any information needed to trade on Spot and Margin. + */ +export interface IndexerAssetPositionAmino { + /** The `Id` of the `Asset`. */ + asset_id?: number; + /** The absolute size of the position in base quantums. */ + quantums?: string; + /** + * The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last + * time this position was settled + * TODO(DEC-582): pending margin trading being added. + */ + index?: string; +} +export interface IndexerAssetPositionAminoMsg { + type: "/dydxprotocol.indexer.protocol.v1.IndexerAssetPosition"; + value: IndexerAssetPositionAmino; +} +/** + * IndexerAssetPosition define an account’s positions of an `Asset`. + * Therefore they hold any information needed to trade on Spot and Margin. + */ +export interface IndexerAssetPositionSDKType { + asset_id: number; + quantums: Uint8Array; + index: bigint; +} +function createBaseIndexerSubaccountId(): IndexerSubaccountId { + return { + owner: "", + number: 0 + }; +} +export const IndexerSubaccountId = { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerSubaccountId", + encode(message: IndexerSubaccountId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerSubaccountId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerSubaccountId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.number = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerSubaccountId { + const message = createBaseIndexerSubaccountId(); + message.owner = object.owner ?? ""; + message.number = object.number ?? 0; + return message; + }, + fromAmino(object: IndexerSubaccountIdAmino): IndexerSubaccountId { + const message = createBaseIndexerSubaccountId(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + return message; + }, + toAmino(message: IndexerSubaccountId): IndexerSubaccountIdAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.number = message.number === 0 ? undefined : message.number; + return obj; + }, + fromAminoMsg(object: IndexerSubaccountIdAminoMsg): IndexerSubaccountId { + return IndexerSubaccountId.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerSubaccountIdProtoMsg): IndexerSubaccountId { + return IndexerSubaccountId.decode(message.value); + }, + toProto(message: IndexerSubaccountId): Uint8Array { + return IndexerSubaccountId.encode(message).finish(); + }, + toProtoMsg(message: IndexerSubaccountId): IndexerSubaccountIdProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerSubaccountId", + value: IndexerSubaccountId.encode(message).finish() + }; + } +}; +function createBaseIndexerPerpetualPosition(): IndexerPerpetualPosition { + return { + perpetualId: 0, + quantums: new Uint8Array(), + fundingIndex: new Uint8Array(), + fundingPayment: new Uint8Array() + }; +} +export const IndexerPerpetualPosition = { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerPerpetualPosition", + encode(message: IndexerPerpetualPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (message.quantums.length !== 0) { + writer.uint32(18).bytes(message.quantums); + } + if (message.fundingIndex.length !== 0) { + writer.uint32(26).bytes(message.fundingIndex); + } + if (message.fundingPayment.length !== 0) { + writer.uint32(34).bytes(message.fundingPayment); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerPerpetualPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerPerpetualPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.quantums = reader.bytes(); + break; + case 3: + message.fundingIndex = reader.bytes(); + break; + case 4: + message.fundingPayment = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerPerpetualPosition { + const message = createBaseIndexerPerpetualPosition(); + message.perpetualId = object.perpetualId ?? 0; + message.quantums = object.quantums ?? new Uint8Array(); + message.fundingIndex = object.fundingIndex ?? new Uint8Array(); + message.fundingPayment = object.fundingPayment ?? new Uint8Array(); + return message; + }, + fromAmino(object: IndexerPerpetualPositionAmino): IndexerPerpetualPosition { + const message = createBaseIndexerPerpetualPosition(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = bytesFromBase64(object.quantums); + } + if (object.funding_index !== undefined && object.funding_index !== null) { + message.fundingIndex = bytesFromBase64(object.funding_index); + } + if (object.funding_payment !== undefined && object.funding_payment !== null) { + message.fundingPayment = bytesFromBase64(object.funding_payment); + } + return message; + }, + toAmino(message: IndexerPerpetualPosition): IndexerPerpetualPositionAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.quantums = message.quantums ? base64FromBytes(message.quantums) : undefined; + obj.funding_index = message.fundingIndex ? base64FromBytes(message.fundingIndex) : undefined; + obj.funding_payment = message.fundingPayment ? base64FromBytes(message.fundingPayment) : undefined; + return obj; + }, + fromAminoMsg(object: IndexerPerpetualPositionAminoMsg): IndexerPerpetualPosition { + return IndexerPerpetualPosition.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerPerpetualPositionProtoMsg): IndexerPerpetualPosition { + return IndexerPerpetualPosition.decode(message.value); + }, + toProto(message: IndexerPerpetualPosition): Uint8Array { + return IndexerPerpetualPosition.encode(message).finish(); + }, + toProtoMsg(message: IndexerPerpetualPosition): IndexerPerpetualPositionProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerPerpetualPosition", + value: IndexerPerpetualPosition.encode(message).finish() + }; + } +}; +function createBaseIndexerAssetPosition(): IndexerAssetPosition { + return { + assetId: 0, + quantums: new Uint8Array(), + index: BigInt(0) + }; +} +export const IndexerAssetPosition = { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerAssetPosition", + encode(message: IndexerAssetPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetId !== 0) { + writer.uint32(8).uint32(message.assetId); + } + if (message.quantums.length !== 0) { + writer.uint32(18).bytes(message.quantums); + } + if (message.index !== BigInt(0)) { + writer.uint32(24).uint64(message.index); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexerAssetPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerAssetPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetId = reader.uint32(); + break; + case 2: + message.quantums = reader.bytes(); + break; + case 3: + message.index = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexerAssetPosition { + const message = createBaseIndexerAssetPosition(); + message.assetId = object.assetId ?? 0; + message.quantums = object.quantums ?? new Uint8Array(); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + return message; + }, + fromAmino(object: IndexerAssetPositionAmino): IndexerAssetPosition { + const message = createBaseIndexerAssetPosition(); + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = bytesFromBase64(object.quantums); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + return message; + }, + toAmino(message: IndexerAssetPosition): IndexerAssetPositionAmino { + const obj: any = {}; + obj.asset_id = message.assetId === 0 ? undefined : message.assetId; + obj.quantums = message.quantums ? base64FromBytes(message.quantums) : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + return obj; + }, + fromAminoMsg(object: IndexerAssetPositionAminoMsg): IndexerAssetPosition { + return IndexerAssetPosition.fromAmino(object.value); + }, + fromProtoMsg(message: IndexerAssetPositionProtoMsg): IndexerAssetPosition { + return IndexerAssetPosition.decode(message.value); + }, + toProto(message: IndexerAssetPosition): Uint8Array { + return IndexerAssetPosition.encode(message).finish(); + }, + toProtoMsg(message: IndexerAssetPosition): IndexerAssetPositionProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.protocol.v1.IndexerAssetPosition", + value: IndexerAssetPosition.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/redis/redis_order.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/redis/redis_order.ts new file mode 100644 index 00000000..38f5f4ed --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/redis/redis_order.ts @@ -0,0 +1,230 @@ +//@ts-nocheck +import { IndexerOrder, IndexerOrderAmino, IndexerOrderSDKType } from "../protocol/v1/clob"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Enum for the ticker type, PERPETUAL or SPOT. */ +export enum RedisOrder_TickerType { + /** + * TICKER_TYPE_UNSPECIFIED - Default value for the enum. Should never be used in an initialized + * `RedisOrder`. + */ + TICKER_TYPE_UNSPECIFIED = 0, + /** TICKER_TYPE_PERPETUAL - Ticker is for a perpetual pair. */ + TICKER_TYPE_PERPETUAL = 1, + /** TICKER_TYPE_SPOT - Ticker is for a spot pair. */ + TICKER_TYPE_SPOT = 2, + UNRECOGNIZED = -1, +} +export const RedisOrder_TickerTypeSDKType = RedisOrder_TickerType; +export const RedisOrder_TickerTypeAmino = RedisOrder_TickerType; +export function redisOrder_TickerTypeFromJSON(object: any): RedisOrder_TickerType { + switch (object) { + case 0: + case "TICKER_TYPE_UNSPECIFIED": + return RedisOrder_TickerType.TICKER_TYPE_UNSPECIFIED; + case 1: + case "TICKER_TYPE_PERPETUAL": + return RedisOrder_TickerType.TICKER_TYPE_PERPETUAL; + case 2: + case "TICKER_TYPE_SPOT": + return RedisOrder_TickerType.TICKER_TYPE_SPOT; + case -1: + case "UNRECOGNIZED": + default: + return RedisOrder_TickerType.UNRECOGNIZED; + } +} +export function redisOrder_TickerTypeToJSON(object: RedisOrder_TickerType): string { + switch (object) { + case RedisOrder_TickerType.TICKER_TYPE_UNSPECIFIED: + return "TICKER_TYPE_UNSPECIFIED"; + case RedisOrder_TickerType.TICKER_TYPE_PERPETUAL: + return "TICKER_TYPE_PERPETUAL"; + case RedisOrder_TickerType.TICKER_TYPE_SPOT: + return "TICKER_TYPE_SPOT"; + case RedisOrder_TickerType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * RedisOrder is a proto for orders stored in Redis. This proto holds some + * human-readable values such as price, size and ticker as well as the original + * `Order` proto from the dYdX application. + */ +export interface RedisOrder { + /** uuid of the Order generated by the Indexer based on the `OrderId`. */ + id: string; + /** Order proto from the protocol. */ + order?: IndexerOrder; + /** Ticker for the exchange pair for the order. */ + ticker: string; + /** Type of the ticker, PERPETUAL or SPOT. */ + tickerType: RedisOrder_TickerType; + /** Human-readable price of the order. */ + price: string; + /** Human-readable size of the order. */ + size: string; +} +export interface RedisOrderProtoMsg { + typeUrl: "/dydxprotocol.indexer.redis.RedisOrder"; + value: Uint8Array; +} +/** + * RedisOrder is a proto for orders stored in Redis. This proto holds some + * human-readable values such as price, size and ticker as well as the original + * `Order` proto from the dYdX application. + */ +export interface RedisOrderAmino { + /** uuid of the Order generated by the Indexer based on the `OrderId`. */ + id?: string; + /** Order proto from the protocol. */ + order?: IndexerOrderAmino; + /** Ticker for the exchange pair for the order. */ + ticker?: string; + /** Type of the ticker, PERPETUAL or SPOT. */ + ticker_type?: RedisOrder_TickerType; + /** Human-readable price of the order. */ + price?: string; + /** Human-readable size of the order. */ + size?: string; +} +export interface RedisOrderAminoMsg { + type: "/dydxprotocol.indexer.redis.RedisOrder"; + value: RedisOrderAmino; +} +/** + * RedisOrder is a proto for orders stored in Redis. This proto holds some + * human-readable values such as price, size and ticker as well as the original + * `Order` proto from the dYdX application. + */ +export interface RedisOrderSDKType { + id: string; + order?: IndexerOrderSDKType; + ticker: string; + ticker_type: RedisOrder_TickerType; + price: string; + size: string; +} +function createBaseRedisOrder(): RedisOrder { + return { + id: "", + order: undefined, + ticker: "", + tickerType: 0, + price: "", + size: "" + }; +} +export const RedisOrder = { + typeUrl: "/dydxprotocol.indexer.redis.RedisOrder", + encode(message: RedisOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.order !== undefined) { + IndexerOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); + } + if (message.ticker !== "") { + writer.uint32(26).string(message.ticker); + } + if (message.tickerType !== 0) { + writer.uint32(32).int32(message.tickerType); + } + if (message.price !== "") { + writer.uint32(42).string(message.price); + } + if (message.size !== "") { + writer.uint32(50).string(message.size); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RedisOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedisOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.order = IndexerOrder.decode(reader, reader.uint32()); + break; + case 3: + message.ticker = reader.string(); + break; + case 4: + message.tickerType = reader.int32() as any; + break; + case 5: + message.price = reader.string(); + break; + case 6: + message.size = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RedisOrder { + const message = createBaseRedisOrder(); + message.id = object.id ?? ""; + message.order = object.order !== undefined && object.order !== null ? IndexerOrder.fromPartial(object.order) : undefined; + message.ticker = object.ticker ?? ""; + message.tickerType = object.tickerType ?? 0; + message.price = object.price ?? ""; + message.size = object.size ?? ""; + return message; + }, + fromAmino(object: RedisOrderAmino): RedisOrder { + const message = createBaseRedisOrder(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.order !== undefined && object.order !== null) { + message.order = IndexerOrder.fromAmino(object.order); + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.ticker_type !== undefined && object.ticker_type !== null) { + message.tickerType = object.ticker_type; + } + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.size !== undefined && object.size !== null) { + message.size = object.size; + } + return message; + }, + toAmino(message: RedisOrder): RedisOrderAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + obj.order = message.order ? IndexerOrder.toAmino(message.order) : undefined; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.ticker_type = message.tickerType === 0 ? undefined : message.tickerType; + obj.price = message.price === "" ? undefined : message.price; + obj.size = message.size === "" ? undefined : message.size; + return obj; + }, + fromAminoMsg(object: RedisOrderAminoMsg): RedisOrder { + return RedisOrder.fromAmino(object.value); + }, + fromProtoMsg(message: RedisOrderProtoMsg): RedisOrder { + return RedisOrder.decode(message.value); + }, + toProto(message: RedisOrder): Uint8Array { + return RedisOrder.encode(message).finish(); + }, + toProtoMsg(message: RedisOrder): RedisOrderProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.redis.RedisOrder", + value: RedisOrder.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/shared/removal_reason.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/shared/removal_reason.ts new file mode 100644 index 00000000..794bcbd8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/shared/removal_reason.ts @@ -0,0 +1,171 @@ +//@ts-nocheck +/** OrderRemovalReason is an enum of all the reasons an order was removed. */ +export enum OrderRemovalReason { + /** ORDER_REMOVAL_REASON_UNSPECIFIED - Default value, this is invalid and unused. */ + ORDER_REMOVAL_REASON_UNSPECIFIED = 0, + /** ORDER_REMOVAL_REASON_EXPIRED - The order was removed due to being expired. */ + ORDER_REMOVAL_REASON_EXPIRED = 1, + /** ORDER_REMOVAL_REASON_USER_CANCELED - The order was removed due to being canceled by a user. */ + ORDER_REMOVAL_REASON_USER_CANCELED = 2, + /** ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED - The order was removed due to being undercollateralized. */ + ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED = 3, + /** + * ORDER_REMOVAL_REASON_INTERNAL_ERROR - The order caused an internal error during order placement and was + * removed. + */ + ORDER_REMOVAL_REASON_INTERNAL_ERROR = 4, + /** + * ORDER_REMOVAL_REASON_SELF_TRADE_ERROR - The order would have matched against another order placed by the same + * subaccount and was removed. + */ + ORDER_REMOVAL_REASON_SELF_TRADE_ERROR = 5, + /** + * ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER - The order would have matched against maker orders on the orderbook + * despite being a post-only order and was removed. + */ + ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER = 6, + /** + * ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK - The order was an ICO order and would have been placed on the orderbook as + * resting liquidity and was removed. + */ + ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK = 7, + /** + * ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED - The order was a fill-or-kill order that could not be fully filled and was + * removed. + */ + ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED = 8, + /** + * ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE - The order was a reduce-only order that was removed due to either: + * - being a taker order and fully-filling the order would flip the side of + * the subaccount's position, in this case the remaining size of the + * order is removed + * - being a maker order resting on the book and being removed when either + * the subaccount's position is closed or flipped sides + */ + ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE = 9, + /** + * ORDER_REMOVAL_REASON_INDEXER_EXPIRED - The order should be expired, according to the Indexer's cached data, but + * the Indexer has yet to receive a message to remove the order. In order to + * keep the data cached by the Indexer up-to-date and accurate, clear out + * the data if it's expired by sending an order removal with this reason. + * Protocol should never send this reason to Indexer. + */ + ORDER_REMOVAL_REASON_INDEXER_EXPIRED = 10, + /** ORDER_REMOVAL_REASON_REPLACED - The order has been replaced. */ + ORDER_REMOVAL_REASON_REPLACED = 11, + /** + * ORDER_REMOVAL_REASON_FULLY_FILLED - The order has been fully-filled. Only sent by the Indexer for stateful + * orders. + */ + ORDER_REMOVAL_REASON_FULLY_FILLED = 12, + /** + * ORDER_REMOVAL_REASON_EQUITY_TIER - The order has been removed since the subaccount does not satisfy the + * equity tier requirements. + */ + ORDER_REMOVAL_REASON_EQUITY_TIER = 13, + /** ORDER_REMOVAL_REASON_FINAL_SETTLEMENT - The order has been removed since its ClobPair has entered final settlement. */ + ORDER_REMOVAL_REASON_FINAL_SETTLEMENT = 14, + /** + * ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS - The order has been removed since filling it would lead to the subaccount + * violating isolated subaccount constraints. + */ + ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS = 15, + UNRECOGNIZED = -1, +} +export const OrderRemovalReasonSDKType = OrderRemovalReason; +export const OrderRemovalReasonAmino = OrderRemovalReason; +export function orderRemovalReasonFromJSON(object: any): OrderRemovalReason { + switch (object) { + case 0: + case "ORDER_REMOVAL_REASON_UNSPECIFIED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_UNSPECIFIED; + case 1: + case "ORDER_REMOVAL_REASON_EXPIRED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_EXPIRED; + case 2: + case "ORDER_REMOVAL_REASON_USER_CANCELED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_USER_CANCELED; + case 3: + case "ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED; + case 4: + case "ORDER_REMOVAL_REASON_INTERNAL_ERROR": + return OrderRemovalReason.ORDER_REMOVAL_REASON_INTERNAL_ERROR; + case 5: + case "ORDER_REMOVAL_REASON_SELF_TRADE_ERROR": + return OrderRemovalReason.ORDER_REMOVAL_REASON_SELF_TRADE_ERROR; + case 6: + case "ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER": + return OrderRemovalReason.ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER; + case 7: + case "ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK": + return OrderRemovalReason.ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK; + case 8: + case "ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED; + case 9: + case "ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE": + return OrderRemovalReason.ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE; + case 10: + case "ORDER_REMOVAL_REASON_INDEXER_EXPIRED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_INDEXER_EXPIRED; + case 11: + case "ORDER_REMOVAL_REASON_REPLACED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_REPLACED; + case 12: + case "ORDER_REMOVAL_REASON_FULLY_FILLED": + return OrderRemovalReason.ORDER_REMOVAL_REASON_FULLY_FILLED; + case 13: + case "ORDER_REMOVAL_REASON_EQUITY_TIER": + return OrderRemovalReason.ORDER_REMOVAL_REASON_EQUITY_TIER; + case 14: + case "ORDER_REMOVAL_REASON_FINAL_SETTLEMENT": + return OrderRemovalReason.ORDER_REMOVAL_REASON_FINAL_SETTLEMENT; + case 15: + case "ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS": + return OrderRemovalReason.ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS; + case -1: + case "UNRECOGNIZED": + default: + return OrderRemovalReason.UNRECOGNIZED; + } +} +export function orderRemovalReasonToJSON(object: OrderRemovalReason): string { + switch (object) { + case OrderRemovalReason.ORDER_REMOVAL_REASON_UNSPECIFIED: + return "ORDER_REMOVAL_REASON_UNSPECIFIED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_EXPIRED: + return "ORDER_REMOVAL_REASON_EXPIRED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_USER_CANCELED: + return "ORDER_REMOVAL_REASON_USER_CANCELED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED: + return "ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_INTERNAL_ERROR: + return "ORDER_REMOVAL_REASON_INTERNAL_ERROR"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_SELF_TRADE_ERROR: + return "ORDER_REMOVAL_REASON_SELF_TRADE_ERROR"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER: + return "ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK: + return "ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED: + return "ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE: + return "ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_INDEXER_EXPIRED: + return "ORDER_REMOVAL_REASON_INDEXER_EXPIRED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_REPLACED: + return "ORDER_REMOVAL_REASON_REPLACED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_FULLY_FILLED: + return "ORDER_REMOVAL_REASON_FULLY_FILLED"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_EQUITY_TIER: + return "ORDER_REMOVAL_REASON_EQUITY_TIER"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_FINAL_SETTLEMENT: + return "ORDER_REMOVAL_REASON_FINAL_SETTLEMENT"; + case OrderRemovalReason.ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS: + return "ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS"; + case OrderRemovalReason.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/socks/messages.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/socks/messages.ts new file mode 100644 index 00000000..05723cc0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/indexer/socks/messages.ts @@ -0,0 +1,858 @@ +//@ts-nocheck +import { IndexerSubaccountId, IndexerSubaccountIdAmino, IndexerSubaccountIdSDKType } from "../protocol/v1/subaccount"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** TODO(IND-210): Make this proto conform and update downstream indexer logic */ +export enum CandleMessage_Resolution { + /** + * ONE_MINUTE - buf:lint:ignore ENUM_VALUE_PREFIX + * buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX + */ + ONE_MINUTE = 0, + /** FIVE_MINUTES - buf:lint:ignore ENUM_VALUE_PREFIX */ + FIVE_MINUTES = 1, + /** FIFTEEN_MINUTES - buf:lint:ignore ENUM_VALUE_PREFIX */ + FIFTEEN_MINUTES = 2, + /** THIRTY_MINUTES - buf:lint:ignore ENUM_VALUE_PREFIX */ + THIRTY_MINUTES = 3, + /** ONE_HOUR - buf:lint:ignore ENUM_VALUE_PREFIX */ + ONE_HOUR = 4, + /** FOUR_HOURS - buf:lint:ignore ENUM_VALUE_PREFIX */ + FOUR_HOURS = 5, + /** ONE_DAY - buf:lint:ignore ENUM_VALUE_PREFIX */ + ONE_DAY = 6, + UNRECOGNIZED = -1, +} +export const CandleMessage_ResolutionSDKType = CandleMessage_Resolution; +export const CandleMessage_ResolutionAmino = CandleMessage_Resolution; +export function candleMessage_ResolutionFromJSON(object: any): CandleMessage_Resolution { + switch (object) { + case 0: + case "ONE_MINUTE": + return CandleMessage_Resolution.ONE_MINUTE; + case 1: + case "FIVE_MINUTES": + return CandleMessage_Resolution.FIVE_MINUTES; + case 2: + case "FIFTEEN_MINUTES": + return CandleMessage_Resolution.FIFTEEN_MINUTES; + case 3: + case "THIRTY_MINUTES": + return CandleMessage_Resolution.THIRTY_MINUTES; + case 4: + case "ONE_HOUR": + return CandleMessage_Resolution.ONE_HOUR; + case 5: + case "FOUR_HOURS": + return CandleMessage_Resolution.FOUR_HOURS; + case 6: + case "ONE_DAY": + return CandleMessage_Resolution.ONE_DAY; + case -1: + case "UNRECOGNIZED": + default: + return CandleMessage_Resolution.UNRECOGNIZED; + } +} +export function candleMessage_ResolutionToJSON(object: CandleMessage_Resolution): string { + switch (object) { + case CandleMessage_Resolution.ONE_MINUTE: + return "ONE_MINUTE"; + case CandleMessage_Resolution.FIVE_MINUTES: + return "FIVE_MINUTES"; + case CandleMessage_Resolution.FIFTEEN_MINUTES: + return "FIFTEEN_MINUTES"; + case CandleMessage_Resolution.THIRTY_MINUTES: + return "THIRTY_MINUTES"; + case CandleMessage_Resolution.ONE_HOUR: + return "ONE_HOUR"; + case CandleMessage_Resolution.FOUR_HOURS: + return "FOUR_HOURS"; + case CandleMessage_Resolution.ONE_DAY: + return "ONE_DAY"; + case CandleMessage_Resolution.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Message to be sent through the 'to-websockets-orderbooks` kafka topic. */ +export interface OrderbookMessage { + /** Stringified JSON object of all events to be streamed. */ + contents: string; + /** Clob pair id of the Orderbook message. */ + clobPairId: string; + /** Version of the websocket message. */ + version: string; +} +export interface OrderbookMessageProtoMsg { + typeUrl: "/dydxprotocol.indexer.socks.OrderbookMessage"; + value: Uint8Array; +} +/** Message to be sent through the 'to-websockets-orderbooks` kafka topic. */ +export interface OrderbookMessageAmino { + /** Stringified JSON object of all events to be streamed. */ + contents?: string; + /** Clob pair id of the Orderbook message. */ + clob_pair_id?: string; + /** Version of the websocket message. */ + version?: string; +} +export interface OrderbookMessageAminoMsg { + type: "/dydxprotocol.indexer.socks.OrderbookMessage"; + value: OrderbookMessageAmino; +} +/** Message to be sent through the 'to-websockets-orderbooks` kafka topic. */ +export interface OrderbookMessageSDKType { + contents: string; + clob_pair_id: string; + version: string; +} +/** Message to be sent through the 'to-websockets-subaccounts` kafka topic. */ +export interface SubaccountMessage { + /** Block height where the contents occur. */ + blockHeight: string; + /** Transaction index where the contents occur. */ + transactionIndex: number; + /** Event index where the contents occur. */ + eventIndex: number; + /** Stringified JSON object of all events to be streamed. */ + contents: string; + /** Subaccount id that the content corresponds to. */ + subaccountId?: IndexerSubaccountId; + /** Version of the websocket message. */ + version: string; +} +export interface SubaccountMessageProtoMsg { + typeUrl: "/dydxprotocol.indexer.socks.SubaccountMessage"; + value: Uint8Array; +} +/** Message to be sent through the 'to-websockets-subaccounts` kafka topic. */ +export interface SubaccountMessageAmino { + /** Block height where the contents occur. */ + block_height?: string; + /** Transaction index where the contents occur. */ + transaction_index?: number; + /** Event index where the contents occur. */ + event_index?: number; + /** Stringified JSON object of all events to be streamed. */ + contents?: string; + /** Subaccount id that the content corresponds to. */ + subaccount_id?: IndexerSubaccountIdAmino; + /** Version of the websocket message. */ + version?: string; +} +export interface SubaccountMessageAminoMsg { + type: "/dydxprotocol.indexer.socks.SubaccountMessage"; + value: SubaccountMessageAmino; +} +/** Message to be sent through the 'to-websockets-subaccounts` kafka topic. */ +export interface SubaccountMessageSDKType { + block_height: string; + transaction_index: number; + event_index: number; + contents: string; + subaccount_id?: IndexerSubaccountIdSDKType; + version: string; +} +/** Message to be sent through the 'to-websockets-trades` kafka topic. */ +export interface TradeMessage { + /** Block height where the contents occur. */ + blockHeight: string; + /** Stringified JSON object of all events to be streamed. */ + contents: string; + /** Clob pair id of the Trade message. */ + clobPairId: string; + /** Version of the websocket message. */ + version: string; +} +export interface TradeMessageProtoMsg { + typeUrl: "/dydxprotocol.indexer.socks.TradeMessage"; + value: Uint8Array; +} +/** Message to be sent through the 'to-websockets-trades` kafka topic. */ +export interface TradeMessageAmino { + /** Block height where the contents occur. */ + block_height?: string; + /** Stringified JSON object of all events to be streamed. */ + contents?: string; + /** Clob pair id of the Trade message. */ + clob_pair_id?: string; + /** Version of the websocket message. */ + version?: string; +} +export interface TradeMessageAminoMsg { + type: "/dydxprotocol.indexer.socks.TradeMessage"; + value: TradeMessageAmino; +} +/** Message to be sent through the 'to-websockets-trades` kafka topic. */ +export interface TradeMessageSDKType { + block_height: string; + contents: string; + clob_pair_id: string; + version: string; +} +/** Message to be sent through the 'to-websockets-markets` kafka topic. */ +export interface MarketMessage { + /** Stringified JSON object of all events to be streamed. */ + contents: string; + /** Version of the websocket message. */ + version: string; +} +export interface MarketMessageProtoMsg { + typeUrl: "/dydxprotocol.indexer.socks.MarketMessage"; + value: Uint8Array; +} +/** Message to be sent through the 'to-websockets-markets` kafka topic. */ +export interface MarketMessageAmino { + /** Stringified JSON object of all events to be streamed. */ + contents?: string; + /** Version of the websocket message. */ + version?: string; +} +export interface MarketMessageAminoMsg { + type: "/dydxprotocol.indexer.socks.MarketMessage"; + value: MarketMessageAmino; +} +/** Message to be sent through the 'to-websockets-markets` kafka topic. */ +export interface MarketMessageSDKType { + contents: string; + version: string; +} +/** Message to be sent through the 'to-websockets-candles` kafka topic. */ +export interface CandleMessage { + /** Stringified JSON object of all events to be streamed. */ + contents: string; + /** Clob pair id of the Candle message. */ + clobPairId: string; + /** Resolution of the candle update. */ + resolution: CandleMessage_Resolution; + /** Version of the websocket message. */ + version: string; +} +export interface CandleMessageProtoMsg { + typeUrl: "/dydxprotocol.indexer.socks.CandleMessage"; + value: Uint8Array; +} +/** Message to be sent through the 'to-websockets-candles` kafka topic. */ +export interface CandleMessageAmino { + /** Stringified JSON object of all events to be streamed. */ + contents?: string; + /** Clob pair id of the Candle message. */ + clob_pair_id?: string; + /** Resolution of the candle update. */ + resolution?: CandleMessage_Resolution; + /** Version of the websocket message. */ + version?: string; +} +export interface CandleMessageAminoMsg { + type: "/dydxprotocol.indexer.socks.CandleMessage"; + value: CandleMessageAmino; +} +/** Message to be sent through the 'to-websockets-candles` kafka topic. */ +export interface CandleMessageSDKType { + contents: string; + clob_pair_id: string; + resolution: CandleMessage_Resolution; + version: string; +} +/** Message to be sent through the 'to-websockets-block-height` kafka topic. */ +export interface BlockHeightMessage { + /** Block height where the contents occur. */ + blockHeight: string; + /** ISO formatted time of the block height. */ + time: string; + /** Version of the websocket message. */ + version: string; +} +export interface BlockHeightMessageProtoMsg { + typeUrl: "/dydxprotocol.indexer.socks.BlockHeightMessage"; + value: Uint8Array; +} +/** Message to be sent through the 'to-websockets-block-height` kafka topic. */ +export interface BlockHeightMessageAmino { + /** Block height where the contents occur. */ + block_height?: string; + /** ISO formatted time of the block height. */ + time?: string; + /** Version of the websocket message. */ + version?: string; +} +export interface BlockHeightMessageAminoMsg { + type: "/dydxprotocol.indexer.socks.BlockHeightMessage"; + value: BlockHeightMessageAmino; +} +/** Message to be sent through the 'to-websockets-block-height` kafka topic. */ +export interface BlockHeightMessageSDKType { + block_height: string; + time: string; + version: string; +} +function createBaseOrderbookMessage(): OrderbookMessage { + return { + contents: "", + clobPairId: "", + version: "" + }; +} +export const OrderbookMessage = { + typeUrl: "/dydxprotocol.indexer.socks.OrderbookMessage", + encode(message: OrderbookMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contents !== "") { + writer.uint32(10).string(message.contents); + } + if (message.clobPairId !== "") { + writer.uint32(18).string(message.clobPairId); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OrderbookMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderbookMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contents = reader.string(); + break; + case 2: + message.clobPairId = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OrderbookMessage { + const message = createBaseOrderbookMessage(); + message.contents = object.contents ?? ""; + message.clobPairId = object.clobPairId ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: OrderbookMessageAmino): OrderbookMessage { + const message = createBaseOrderbookMessage(); + if (object.contents !== undefined && object.contents !== null) { + message.contents = object.contents; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: OrderbookMessage): OrderbookMessageAmino { + const obj: any = {}; + obj.contents = message.contents === "" ? undefined : message.contents; + obj.clob_pair_id = message.clobPairId === "" ? undefined : message.clobPairId; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: OrderbookMessageAminoMsg): OrderbookMessage { + return OrderbookMessage.fromAmino(object.value); + }, + fromProtoMsg(message: OrderbookMessageProtoMsg): OrderbookMessage { + return OrderbookMessage.decode(message.value); + }, + toProto(message: OrderbookMessage): Uint8Array { + return OrderbookMessage.encode(message).finish(); + }, + toProtoMsg(message: OrderbookMessage): OrderbookMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.socks.OrderbookMessage", + value: OrderbookMessage.encode(message).finish() + }; + } +}; +function createBaseSubaccountMessage(): SubaccountMessage { + return { + blockHeight: "", + transactionIndex: 0, + eventIndex: 0, + contents: "", + subaccountId: undefined, + version: "" + }; +} +export const SubaccountMessage = { + typeUrl: "/dydxprotocol.indexer.socks.SubaccountMessage", + encode(message: SubaccountMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== "") { + writer.uint32(10).string(message.blockHeight); + } + if (message.transactionIndex !== 0) { + writer.uint32(16).int32(message.transactionIndex); + } + if (message.eventIndex !== 0) { + writer.uint32(24).uint32(message.eventIndex); + } + if (message.contents !== "") { + writer.uint32(34).string(message.contents); + } + if (message.subaccountId !== undefined) { + IndexerSubaccountId.encode(message.subaccountId, writer.uint32(42).fork()).ldelim(); + } + if (message.version !== "") { + writer.uint32(50).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.string(); + break; + case 2: + message.transactionIndex = reader.int32(); + break; + case 3: + message.eventIndex = reader.uint32(); + break; + case 4: + message.contents = reader.string(); + break; + case 5: + message.subaccountId = IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 6: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountMessage { + const message = createBaseSubaccountMessage(); + message.blockHeight = object.blockHeight ?? ""; + message.transactionIndex = object.transactionIndex ?? 0; + message.eventIndex = object.eventIndex ?? 0; + message.contents = object.contents ?? ""; + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? IndexerSubaccountId.fromPartial(object.subaccountId) : undefined; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: SubaccountMessageAmino): SubaccountMessage { + const message = createBaseSubaccountMessage(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + if (object.transaction_index !== undefined && object.transaction_index !== null) { + message.transactionIndex = object.transaction_index; + } + if (object.event_index !== undefined && object.event_index !== null) { + message.eventIndex = object.event_index; + } + if (object.contents !== undefined && object.contents !== null) { + message.contents = object.contents; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = IndexerSubaccountId.fromAmino(object.subaccount_id); + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: SubaccountMessage): SubaccountMessageAmino { + const obj: any = {}; + obj.block_height = message.blockHeight === "" ? undefined : message.blockHeight; + obj.transaction_index = message.transactionIndex === 0 ? undefined : message.transactionIndex; + obj.event_index = message.eventIndex === 0 ? undefined : message.eventIndex; + obj.contents = message.contents === "" ? undefined : message.contents; + obj.subaccount_id = message.subaccountId ? IndexerSubaccountId.toAmino(message.subaccountId) : undefined; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: SubaccountMessageAminoMsg): SubaccountMessage { + return SubaccountMessage.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountMessageProtoMsg): SubaccountMessage { + return SubaccountMessage.decode(message.value); + }, + toProto(message: SubaccountMessage): Uint8Array { + return SubaccountMessage.encode(message).finish(); + }, + toProtoMsg(message: SubaccountMessage): SubaccountMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.socks.SubaccountMessage", + value: SubaccountMessage.encode(message).finish() + }; + } +}; +function createBaseTradeMessage(): TradeMessage { + return { + blockHeight: "", + contents: "", + clobPairId: "", + version: "" + }; +} +export const TradeMessage = { + typeUrl: "/dydxprotocol.indexer.socks.TradeMessage", + encode(message: TradeMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== "") { + writer.uint32(10).string(message.blockHeight); + } + if (message.contents !== "") { + writer.uint32(34).string(message.contents); + } + if (message.clobPairId !== "") { + writer.uint32(42).string(message.clobPairId); + } + if (message.version !== "") { + writer.uint32(50).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradeMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradeMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.string(); + break; + case 4: + message.contents = reader.string(); + break; + case 5: + message.clobPairId = reader.string(); + break; + case 6: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TradeMessage { + const message = createBaseTradeMessage(); + message.blockHeight = object.blockHeight ?? ""; + message.contents = object.contents ?? ""; + message.clobPairId = object.clobPairId ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: TradeMessageAmino): TradeMessage { + const message = createBaseTradeMessage(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + if (object.contents !== undefined && object.contents !== null) { + message.contents = object.contents; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: TradeMessage): TradeMessageAmino { + const obj: any = {}; + obj.block_height = message.blockHeight === "" ? undefined : message.blockHeight; + obj.contents = message.contents === "" ? undefined : message.contents; + obj.clob_pair_id = message.clobPairId === "" ? undefined : message.clobPairId; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: TradeMessageAminoMsg): TradeMessage { + return TradeMessage.fromAmino(object.value); + }, + fromProtoMsg(message: TradeMessageProtoMsg): TradeMessage { + return TradeMessage.decode(message.value); + }, + toProto(message: TradeMessage): Uint8Array { + return TradeMessage.encode(message).finish(); + }, + toProtoMsg(message: TradeMessage): TradeMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.socks.TradeMessage", + value: TradeMessage.encode(message).finish() + }; + } +}; +function createBaseMarketMessage(): MarketMessage { + return { + contents: "", + version: "" + }; +} +export const MarketMessage = { + typeUrl: "/dydxprotocol.indexer.socks.MarketMessage", + encode(message: MarketMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contents !== "") { + writer.uint32(10).string(message.contents); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contents = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketMessage { + const message = createBaseMarketMessage(); + message.contents = object.contents ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: MarketMessageAmino): MarketMessage { + const message = createBaseMarketMessage(); + if (object.contents !== undefined && object.contents !== null) { + message.contents = object.contents; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: MarketMessage): MarketMessageAmino { + const obj: any = {}; + obj.contents = message.contents === "" ? undefined : message.contents; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: MarketMessageAminoMsg): MarketMessage { + return MarketMessage.fromAmino(object.value); + }, + fromProtoMsg(message: MarketMessageProtoMsg): MarketMessage { + return MarketMessage.decode(message.value); + }, + toProto(message: MarketMessage): Uint8Array { + return MarketMessage.encode(message).finish(); + }, + toProtoMsg(message: MarketMessage): MarketMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.socks.MarketMessage", + value: MarketMessage.encode(message).finish() + }; + } +}; +function createBaseCandleMessage(): CandleMessage { + return { + contents: "", + clobPairId: "", + resolution: 0, + version: "" + }; +} +export const CandleMessage = { + typeUrl: "/dydxprotocol.indexer.socks.CandleMessage", + encode(message: CandleMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contents !== "") { + writer.uint32(10).string(message.contents); + } + if (message.clobPairId !== "") { + writer.uint32(18).string(message.clobPairId); + } + if (message.resolution !== 0) { + writer.uint32(24).int32(message.resolution); + } + if (message.version !== "") { + writer.uint32(34).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CandleMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCandleMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contents = reader.string(); + break; + case 2: + message.clobPairId = reader.string(); + break; + case 3: + message.resolution = reader.int32() as any; + break; + case 4: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CandleMessage { + const message = createBaseCandleMessage(); + message.contents = object.contents ?? ""; + message.clobPairId = object.clobPairId ?? ""; + message.resolution = object.resolution ?? 0; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: CandleMessageAmino): CandleMessage { + const message = createBaseCandleMessage(); + if (object.contents !== undefined && object.contents !== null) { + message.contents = object.contents; + } + if (object.clob_pair_id !== undefined && object.clob_pair_id !== null) { + message.clobPairId = object.clob_pair_id; + } + if (object.resolution !== undefined && object.resolution !== null) { + message.resolution = object.resolution; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: CandleMessage): CandleMessageAmino { + const obj: any = {}; + obj.contents = message.contents === "" ? undefined : message.contents; + obj.clob_pair_id = message.clobPairId === "" ? undefined : message.clobPairId; + obj.resolution = message.resolution === 0 ? undefined : message.resolution; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: CandleMessageAminoMsg): CandleMessage { + return CandleMessage.fromAmino(object.value); + }, + fromProtoMsg(message: CandleMessageProtoMsg): CandleMessage { + return CandleMessage.decode(message.value); + }, + toProto(message: CandleMessage): Uint8Array { + return CandleMessage.encode(message).finish(); + }, + toProtoMsg(message: CandleMessage): CandleMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.socks.CandleMessage", + value: CandleMessage.encode(message).finish() + }; + } +}; +function createBaseBlockHeightMessage(): BlockHeightMessage { + return { + blockHeight: "", + time: "", + version: "" + }; +} +export const BlockHeightMessage = { + typeUrl: "/dydxprotocol.indexer.socks.BlockHeightMessage", + encode(message: BlockHeightMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== "") { + writer.uint32(10).string(message.blockHeight); + } + if (message.time !== "") { + writer.uint32(18).string(message.time); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockHeightMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockHeightMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.string(); + break; + case 2: + message.time = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockHeightMessage { + const message = createBaseBlockHeightMessage(); + message.blockHeight = object.blockHeight ?? ""; + message.time = object.time ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: BlockHeightMessageAmino): BlockHeightMessage { + const message = createBaseBlockHeightMessage(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = object.block_height; + } + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: BlockHeightMessage): BlockHeightMessageAmino { + const obj: any = {}; + obj.block_height = message.blockHeight === "" ? undefined : message.blockHeight; + obj.time = message.time === "" ? undefined : message.time; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: BlockHeightMessageAminoMsg): BlockHeightMessage { + return BlockHeightMessage.fromAmino(object.value); + }, + fromProtoMsg(message: BlockHeightMessageProtoMsg): BlockHeightMessage { + return BlockHeightMessage.decode(message.value); + }, + toProto(message: BlockHeightMessage): Uint8Array { + return BlockHeightMessage.encode(message).finish(); + }, + toProtoMsg(message: BlockHeightMessage): BlockHeightMessageProtoMsg { + return { + typeUrl: "/dydxprotocol.indexer.socks.BlockHeightMessage", + value: BlockHeightMessage.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/genesis.ts new file mode 100644 index 00000000..3f645f9c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/genesis.ts @@ -0,0 +1,93 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines `x/listing`'s genesis state. */ +export interface GenesisState { + /** + * hard_cap_for_markets is the hard cap for the number of markets that can be + * listed + */ + hardCapForMarkets: number; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.listing.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines `x/listing`'s genesis state. */ +export interface GenesisStateAmino { + /** + * hard_cap_for_markets is the hard cap for the number of markets that can be + * listed + */ + hard_cap_for_markets?: number; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.listing.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines `x/listing`'s genesis state. */ +export interface GenesisStateSDKType { + hard_cap_for_markets: number; +} +function createBaseGenesisState(): GenesisState { + return { + hardCapForMarkets: 0 + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.listing.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hardCapForMarkets !== 0) { + writer.uint32(8).uint32(message.hardCapForMarkets); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hardCapForMarkets = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.hardCapForMarkets = object.hardCapForMarkets ?? 0; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.hard_cap_for_markets !== undefined && object.hard_cap_for_markets !== null) { + message.hardCapForMarkets = object.hard_cap_for_markets; + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.hard_cap_for_markets = message.hardCapForMarkets === 0 ? undefined : message.hardCapForMarkets; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/params.ts new file mode 100644 index 00000000..630960d4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/params.ts @@ -0,0 +1,128 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** ListingVaultDepositParams represents the params for PML megavault deposits */ +export interface ListingVaultDepositParams { + /** Amount that will be deposited into the new market vault exclusively */ + newVaultDepositAmount: Uint8Array; + /** + * Amount deposited into the main vault exclusively. This amount does not + * include the amount deposited into the new vault. + */ + mainVaultDepositAmount: Uint8Array; + /** Lockup period for this deposit */ + numBlocksToLockShares: number; +} +export interface ListingVaultDepositParamsProtoMsg { + typeUrl: "/dydxprotocol.listing.ListingVaultDepositParams"; + value: Uint8Array; +} +/** ListingVaultDepositParams represents the params for PML megavault deposits */ +export interface ListingVaultDepositParamsAmino { + /** Amount that will be deposited into the new market vault exclusively */ + new_vault_deposit_amount?: string; + /** + * Amount deposited into the main vault exclusively. This amount does not + * include the amount deposited into the new vault. + */ + main_vault_deposit_amount?: string; + /** Lockup period for this deposit */ + num_blocks_to_lock_shares?: number; +} +export interface ListingVaultDepositParamsAminoMsg { + type: "/dydxprotocol.listing.ListingVaultDepositParams"; + value: ListingVaultDepositParamsAmino; +} +/** ListingVaultDepositParams represents the params for PML megavault deposits */ +export interface ListingVaultDepositParamsSDKType { + new_vault_deposit_amount: Uint8Array; + main_vault_deposit_amount: Uint8Array; + num_blocks_to_lock_shares: number; +} +function createBaseListingVaultDepositParams(): ListingVaultDepositParams { + return { + newVaultDepositAmount: new Uint8Array(), + mainVaultDepositAmount: new Uint8Array(), + numBlocksToLockShares: 0 + }; +} +export const ListingVaultDepositParams = { + typeUrl: "/dydxprotocol.listing.ListingVaultDepositParams", + encode(message: ListingVaultDepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newVaultDepositAmount.length !== 0) { + writer.uint32(10).bytes(message.newVaultDepositAmount); + } + if (message.mainVaultDepositAmount.length !== 0) { + writer.uint32(18).bytes(message.mainVaultDepositAmount); + } + if (message.numBlocksToLockShares !== 0) { + writer.uint32(24).uint32(message.numBlocksToLockShares); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListingVaultDepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListingVaultDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newVaultDepositAmount = reader.bytes(); + break; + case 2: + message.mainVaultDepositAmount = reader.bytes(); + break; + case 3: + message.numBlocksToLockShares = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListingVaultDepositParams { + const message = createBaseListingVaultDepositParams(); + message.newVaultDepositAmount = object.newVaultDepositAmount ?? new Uint8Array(); + message.mainVaultDepositAmount = object.mainVaultDepositAmount ?? new Uint8Array(); + message.numBlocksToLockShares = object.numBlocksToLockShares ?? 0; + return message; + }, + fromAmino(object: ListingVaultDepositParamsAmino): ListingVaultDepositParams { + const message = createBaseListingVaultDepositParams(); + if (object.new_vault_deposit_amount !== undefined && object.new_vault_deposit_amount !== null) { + message.newVaultDepositAmount = bytesFromBase64(object.new_vault_deposit_amount); + } + if (object.main_vault_deposit_amount !== undefined && object.main_vault_deposit_amount !== null) { + message.mainVaultDepositAmount = bytesFromBase64(object.main_vault_deposit_amount); + } + if (object.num_blocks_to_lock_shares !== undefined && object.num_blocks_to_lock_shares !== null) { + message.numBlocksToLockShares = object.num_blocks_to_lock_shares; + } + return message; + }, + toAmino(message: ListingVaultDepositParams): ListingVaultDepositParamsAmino { + const obj: any = {}; + obj.new_vault_deposit_amount = message.newVaultDepositAmount ? base64FromBytes(message.newVaultDepositAmount) : undefined; + obj.main_vault_deposit_amount = message.mainVaultDepositAmount ? base64FromBytes(message.mainVaultDepositAmount) : undefined; + obj.num_blocks_to_lock_shares = message.numBlocksToLockShares === 0 ? undefined : message.numBlocksToLockShares; + return obj; + }, + fromAminoMsg(object: ListingVaultDepositParamsAminoMsg): ListingVaultDepositParams { + return ListingVaultDepositParams.fromAmino(object.value); + }, + fromProtoMsg(message: ListingVaultDepositParamsProtoMsg): ListingVaultDepositParams { + return ListingVaultDepositParams.decode(message.value); + }, + toProto(message: ListingVaultDepositParams): Uint8Array { + return ListingVaultDepositParams.encode(message).finish(); + }, + toProtoMsg(message: ListingVaultDepositParams): ListingVaultDepositParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.ListingVaultDepositParams", + value: ListingVaultDepositParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/query.rpc.Query.ts new file mode 100644 index 00000000..e755da76 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/query.rpc.Query.ts @@ -0,0 +1,42 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryMarketsHardCap, QueryMarketsHardCapResponse, QueryListingVaultDepositParams, QueryListingVaultDepositParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries for the hard cap number of listed markets */ + marketsHardCap(request?: QueryMarketsHardCap): Promise; + /** Queries the listing vault deposit params */ + listingVaultDepositParams(request?: QueryListingVaultDepositParams): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.marketsHardCap = this.marketsHardCap.bind(this); + this.listingVaultDepositParams = this.listingVaultDepositParams.bind(this); + } + marketsHardCap(request: QueryMarketsHardCap = {}): Promise { + const data = QueryMarketsHardCap.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.listing.Query", "MarketsHardCap", data); + return promise.then(data => QueryMarketsHardCapResponse.decode(new BinaryReader(data))); + } + listingVaultDepositParams(request: QueryListingVaultDepositParams = {}): Promise { + const data = QueryListingVaultDepositParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.listing.Query", "ListingVaultDepositParams", data); + return promise.then(data => QueryListingVaultDepositParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + marketsHardCap(request?: QueryMarketsHardCap): Promise { + return queryService.marketsHardCap(request); + }, + listingVaultDepositParams(request?: QueryListingVaultDepositParams): Promise { + return queryService.listingVaultDepositParams(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/query.ts new file mode 100644 index 00000000..c3dd954e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/query.ts @@ -0,0 +1,297 @@ +//@ts-nocheck +import { ListingVaultDepositParams, ListingVaultDepositParamsAmino, ListingVaultDepositParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Queries for the hard cap on listed markets */ +export interface QueryMarketsHardCap {} +export interface QueryMarketsHardCapProtoMsg { + typeUrl: "/dydxprotocol.listing.QueryMarketsHardCap"; + value: Uint8Array; +} +/** Queries for the hard cap on listed markets */ +export interface QueryMarketsHardCapAmino {} +export interface QueryMarketsHardCapAminoMsg { + type: "/dydxprotocol.listing.QueryMarketsHardCap"; + value: QueryMarketsHardCapAmino; +} +/** Queries for the hard cap on listed markets */ +export interface QueryMarketsHardCapSDKType {} +/** Response type indicating the hard cap on listed markets */ +export interface QueryMarketsHardCapResponse { + hardCap: number; +} +export interface QueryMarketsHardCapResponseProtoMsg { + typeUrl: "/dydxprotocol.listing.QueryMarketsHardCapResponse"; + value: Uint8Array; +} +/** Response type indicating the hard cap on listed markets */ +export interface QueryMarketsHardCapResponseAmino { + hard_cap?: number; +} +export interface QueryMarketsHardCapResponseAminoMsg { + type: "/dydxprotocol.listing.QueryMarketsHardCapResponse"; + value: QueryMarketsHardCapResponseAmino; +} +/** Response type indicating the hard cap on listed markets */ +export interface QueryMarketsHardCapResponseSDKType { + hard_cap: number; +} +/** Queries the listing vault deposit params */ +export interface QueryListingVaultDepositParams {} +export interface QueryListingVaultDepositParamsProtoMsg { + typeUrl: "/dydxprotocol.listing.QueryListingVaultDepositParams"; + value: Uint8Array; +} +/** Queries the listing vault deposit params */ +export interface QueryListingVaultDepositParamsAmino {} +export interface QueryListingVaultDepositParamsAminoMsg { + type: "/dydxprotocol.listing.QueryListingVaultDepositParams"; + value: QueryListingVaultDepositParamsAmino; +} +/** Queries the listing vault deposit params */ +export interface QueryListingVaultDepositParamsSDKType {} +/** Response type for QueryListingVaultDepositParams */ +export interface QueryListingVaultDepositParamsResponse { + params: ListingVaultDepositParams; +} +export interface QueryListingVaultDepositParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.listing.QueryListingVaultDepositParamsResponse"; + value: Uint8Array; +} +/** Response type for QueryListingVaultDepositParams */ +export interface QueryListingVaultDepositParamsResponseAmino { + params?: ListingVaultDepositParamsAmino; +} +export interface QueryListingVaultDepositParamsResponseAminoMsg { + type: "/dydxprotocol.listing.QueryListingVaultDepositParamsResponse"; + value: QueryListingVaultDepositParamsResponseAmino; +} +/** Response type for QueryListingVaultDepositParams */ +export interface QueryListingVaultDepositParamsResponseSDKType { + params: ListingVaultDepositParamsSDKType; +} +function createBaseQueryMarketsHardCap(): QueryMarketsHardCap { + return {}; +} +export const QueryMarketsHardCap = { + typeUrl: "/dydxprotocol.listing.QueryMarketsHardCap", + encode(_: QueryMarketsHardCap, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketsHardCap { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketsHardCap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryMarketsHardCap { + const message = createBaseQueryMarketsHardCap(); + return message; + }, + fromAmino(_: QueryMarketsHardCapAmino): QueryMarketsHardCap { + const message = createBaseQueryMarketsHardCap(); + return message; + }, + toAmino(_: QueryMarketsHardCap): QueryMarketsHardCapAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryMarketsHardCapAminoMsg): QueryMarketsHardCap { + return QueryMarketsHardCap.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketsHardCapProtoMsg): QueryMarketsHardCap { + return QueryMarketsHardCap.decode(message.value); + }, + toProto(message: QueryMarketsHardCap): Uint8Array { + return QueryMarketsHardCap.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketsHardCap): QueryMarketsHardCapProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.QueryMarketsHardCap", + value: QueryMarketsHardCap.encode(message).finish() + }; + } +}; +function createBaseQueryMarketsHardCapResponse(): QueryMarketsHardCapResponse { + return { + hardCap: 0 + }; +} +export const QueryMarketsHardCapResponse = { + typeUrl: "/dydxprotocol.listing.QueryMarketsHardCapResponse", + encode(message: QueryMarketsHardCapResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hardCap !== 0) { + writer.uint32(8).uint32(message.hardCap); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketsHardCapResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketsHardCapResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hardCap = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketsHardCapResponse { + const message = createBaseQueryMarketsHardCapResponse(); + message.hardCap = object.hardCap ?? 0; + return message; + }, + fromAmino(object: QueryMarketsHardCapResponseAmino): QueryMarketsHardCapResponse { + const message = createBaseQueryMarketsHardCapResponse(); + if (object.hard_cap !== undefined && object.hard_cap !== null) { + message.hardCap = object.hard_cap; + } + return message; + }, + toAmino(message: QueryMarketsHardCapResponse): QueryMarketsHardCapResponseAmino { + const obj: any = {}; + obj.hard_cap = message.hardCap === 0 ? undefined : message.hardCap; + return obj; + }, + fromAminoMsg(object: QueryMarketsHardCapResponseAminoMsg): QueryMarketsHardCapResponse { + return QueryMarketsHardCapResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketsHardCapResponseProtoMsg): QueryMarketsHardCapResponse { + return QueryMarketsHardCapResponse.decode(message.value); + }, + toProto(message: QueryMarketsHardCapResponse): Uint8Array { + return QueryMarketsHardCapResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketsHardCapResponse): QueryMarketsHardCapResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.QueryMarketsHardCapResponse", + value: QueryMarketsHardCapResponse.encode(message).finish() + }; + } +}; +function createBaseQueryListingVaultDepositParams(): QueryListingVaultDepositParams { + return {}; +} +export const QueryListingVaultDepositParams = { + typeUrl: "/dydxprotocol.listing.QueryListingVaultDepositParams", + encode(_: QueryListingVaultDepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryListingVaultDepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryListingVaultDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryListingVaultDepositParams { + const message = createBaseQueryListingVaultDepositParams(); + return message; + }, + fromAmino(_: QueryListingVaultDepositParamsAmino): QueryListingVaultDepositParams { + const message = createBaseQueryListingVaultDepositParams(); + return message; + }, + toAmino(_: QueryListingVaultDepositParams): QueryListingVaultDepositParamsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryListingVaultDepositParamsAminoMsg): QueryListingVaultDepositParams { + return QueryListingVaultDepositParams.fromAmino(object.value); + }, + fromProtoMsg(message: QueryListingVaultDepositParamsProtoMsg): QueryListingVaultDepositParams { + return QueryListingVaultDepositParams.decode(message.value); + }, + toProto(message: QueryListingVaultDepositParams): Uint8Array { + return QueryListingVaultDepositParams.encode(message).finish(); + }, + toProtoMsg(message: QueryListingVaultDepositParams): QueryListingVaultDepositParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.QueryListingVaultDepositParams", + value: QueryListingVaultDepositParams.encode(message).finish() + }; + } +}; +function createBaseQueryListingVaultDepositParamsResponse(): QueryListingVaultDepositParamsResponse { + return { + params: ListingVaultDepositParams.fromPartial({}) + }; +} +export const QueryListingVaultDepositParamsResponse = { + typeUrl: "/dydxprotocol.listing.QueryListingVaultDepositParamsResponse", + encode(message: QueryListingVaultDepositParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ListingVaultDepositParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryListingVaultDepositParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryListingVaultDepositParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ListingVaultDepositParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryListingVaultDepositParamsResponse { + const message = createBaseQueryListingVaultDepositParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? ListingVaultDepositParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryListingVaultDepositParamsResponseAmino): QueryListingVaultDepositParamsResponse { + const message = createBaseQueryListingVaultDepositParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = ListingVaultDepositParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryListingVaultDepositParamsResponse): QueryListingVaultDepositParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? ListingVaultDepositParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryListingVaultDepositParamsResponseAminoMsg): QueryListingVaultDepositParamsResponse { + return QueryListingVaultDepositParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryListingVaultDepositParamsResponseProtoMsg): QueryListingVaultDepositParamsResponse { + return QueryListingVaultDepositParamsResponse.decode(message.value); + }, + toProto(message: QueryListingVaultDepositParamsResponse): Uint8Array { + return QueryListingVaultDepositParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryListingVaultDepositParamsResponse): QueryListingVaultDepositParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.QueryListingVaultDepositParamsResponse", + value: QueryListingVaultDepositParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.amino.ts new file mode 100644 index 00000000..75739d67 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgSetMarketsHardCap, MsgCreateMarketPermissionless, MsgSetListingVaultDepositParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.listing.MsgSetMarketsHardCap": { + aminoType: "/dydxprotocol.listing.MsgSetMarketsHardCap", + toAmino: MsgSetMarketsHardCap.toAmino, + fromAmino: MsgSetMarketsHardCap.fromAmino + }, + "/dydxprotocol.listing.MsgCreateMarketPermissionless": { + aminoType: "/dydxprotocol.listing.MsgCreateMarketPermissionless", + toAmino: MsgCreateMarketPermissionless.toAmino, + fromAmino: MsgCreateMarketPermissionless.fromAmino + }, + "/dydxprotocol.listing.MsgSetListingVaultDepositParams": { + aminoType: "/dydxprotocol.listing.MsgSetListingVaultDepositParams", + toAmino: MsgSetListingVaultDepositParams.toAmino, + fromAmino: MsgSetListingVaultDepositParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.registry.ts new file mode 100644 index 00000000..8b5d46d0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSetMarketsHardCap, MsgCreateMarketPermissionless, MsgSetListingVaultDepositParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.listing.MsgSetMarketsHardCap", MsgSetMarketsHardCap], ["/dydxprotocol.listing.MsgCreateMarketPermissionless", MsgCreateMarketPermissionless], ["/dydxprotocol.listing.MsgSetListingVaultDepositParams", MsgSetListingVaultDepositParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setMarketsHardCap(value: MsgSetMarketsHardCap) { + return { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCap", + value: MsgSetMarketsHardCap.encode(value).finish() + }; + }, + createMarketPermissionless(value: MsgCreateMarketPermissionless) { + return { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionless", + value: MsgCreateMarketPermissionless.encode(value).finish() + }; + }, + setListingVaultDepositParams(value: MsgSetListingVaultDepositParams) { + return { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParams", + value: MsgSetListingVaultDepositParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + setMarketsHardCap(value: MsgSetMarketsHardCap) { + return { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCap", + value + }; + }, + createMarketPermissionless(value: MsgCreateMarketPermissionless) { + return { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionless", + value + }; + }, + setListingVaultDepositParams(value: MsgSetListingVaultDepositParams) { + return { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParams", + value + }; + } + }, + fromPartial: { + setMarketsHardCap(value: MsgSetMarketsHardCap) { + return { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCap", + value: MsgSetMarketsHardCap.fromPartial(value) + }; + }, + createMarketPermissionless(value: MsgCreateMarketPermissionless) { + return { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionless", + value: MsgCreateMarketPermissionless.fromPartial(value) + }; + }, + setListingVaultDepositParams(value: MsgSetListingVaultDepositParams) { + return { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParams", + value: MsgSetListingVaultDepositParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.rpc.msg.ts new file mode 100644 index 00000000..5ebad8f0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.rpc.msg.ts @@ -0,0 +1,37 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgSetMarketsHardCap, MsgSetMarketsHardCapResponse, MsgCreateMarketPermissionless, MsgCreateMarketPermissionlessResponse, MsgSetListingVaultDepositParams, MsgSetListingVaultDepositParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** SetMarketsHardCap sets a hard cap on the number of markets listed */ + setMarketsHardCap(request: MsgSetMarketsHardCap): Promise; + /** CreateMarketPermissionless creates a new market without going through x/gov */ + createMarketPermissionless(request: MsgCreateMarketPermissionless): Promise; + /** SetListingVaultDepositParams sets PML megavault deposit params */ + setListingVaultDepositParams(request: MsgSetListingVaultDepositParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setMarketsHardCap = this.setMarketsHardCap.bind(this); + this.createMarketPermissionless = this.createMarketPermissionless.bind(this); + this.setListingVaultDepositParams = this.setListingVaultDepositParams.bind(this); + } + setMarketsHardCap(request: MsgSetMarketsHardCap): Promise { + const data = MsgSetMarketsHardCap.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.listing.Msg", "SetMarketsHardCap", data); + return promise.then(data => MsgSetMarketsHardCapResponse.decode(new BinaryReader(data))); + } + createMarketPermissionless(request: MsgCreateMarketPermissionless): Promise { + const data = MsgCreateMarketPermissionless.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.listing.Msg", "CreateMarketPermissionless", data); + return promise.then(data => MsgCreateMarketPermissionlessResponse.decode(new BinaryReader(data))); + } + setListingVaultDepositParams(request: MsgSetListingVaultDepositParams): Promise { + const data = MsgSetListingVaultDepositParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.listing.Msg", "SetListingVaultDepositParams", data); + return promise.then(data => MsgSetListingVaultDepositParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.ts new file mode 100644 index 00000000..392f0c6e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/listing/tx.ts @@ -0,0 +1,561 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { ListingVaultDepositParams, ListingVaultDepositParamsAmino, ListingVaultDepositParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * MsgSetMarketsHardCap is used to set a hard cap on the number of markets + * listed + */ +export interface MsgSetMarketsHardCap { + authority: string; + /** Hard cap for the total number of markets listed */ + hardCapForMarkets: number; +} +export interface MsgSetMarketsHardCapProtoMsg { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCap"; + value: Uint8Array; +} +/** + * MsgSetMarketsHardCap is used to set a hard cap on the number of markets + * listed + */ +export interface MsgSetMarketsHardCapAmino { + authority?: string; + /** Hard cap for the total number of markets listed */ + hard_cap_for_markets?: number; +} +export interface MsgSetMarketsHardCapAminoMsg { + type: "/dydxprotocol.listing.MsgSetMarketsHardCap"; + value: MsgSetMarketsHardCapAmino; +} +/** + * MsgSetMarketsHardCap is used to set a hard cap on the number of markets + * listed + */ +export interface MsgSetMarketsHardCapSDKType { + authority: string; + hard_cap_for_markets: number; +} +/** MsgSetMarketsHardCapResponse defines the MsgSetMarketsHardCap response */ +export interface MsgSetMarketsHardCapResponse {} +export interface MsgSetMarketsHardCapResponseProtoMsg { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCapResponse"; + value: Uint8Array; +} +/** MsgSetMarketsHardCapResponse defines the MsgSetMarketsHardCap response */ +export interface MsgSetMarketsHardCapResponseAmino {} +export interface MsgSetMarketsHardCapResponseAminoMsg { + type: "/dydxprotocol.listing.MsgSetMarketsHardCapResponse"; + value: MsgSetMarketsHardCapResponseAmino; +} +/** MsgSetMarketsHardCapResponse defines the MsgSetMarketsHardCap response */ +export interface MsgSetMarketsHardCapResponseSDKType {} +/** + * MsgCreateMarketPermissionless is a message used to create new markets without + * going through x/gov + */ +export interface MsgCreateMarketPermissionless { + /** The name of the `Perpetual` (e.g. `BTC-USD`). */ + ticker: string; + /** The subaccount to deposit from. */ + subaccountId?: SubaccountId; + /** Number of quote quantums to deposit. */ + quoteQuantums: Uint8Array; +} +export interface MsgCreateMarketPermissionlessProtoMsg { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionless"; + value: Uint8Array; +} +/** + * MsgCreateMarketPermissionless is a message used to create new markets without + * going through x/gov + */ +export interface MsgCreateMarketPermissionlessAmino { + /** The name of the `Perpetual` (e.g. `BTC-USD`). */ + ticker?: string; + /** The subaccount to deposit from. */ + subaccount_id?: SubaccountIdAmino; + /** Number of quote quantums to deposit. */ + quote_quantums?: string; +} +export interface MsgCreateMarketPermissionlessAminoMsg { + type: "/dydxprotocol.listing.MsgCreateMarketPermissionless"; + value: MsgCreateMarketPermissionlessAmino; +} +/** + * MsgCreateMarketPermissionless is a message used to create new markets without + * going through x/gov + */ +export interface MsgCreateMarketPermissionlessSDKType { + ticker: string; + subaccount_id?: SubaccountIdSDKType; + quote_quantums: Uint8Array; +} +/** + * MsgCreateMarketPermissionlessResponse defines the + * MsgCreateMarketPermissionless response + */ +export interface MsgCreateMarketPermissionlessResponse {} +export interface MsgCreateMarketPermissionlessResponseProtoMsg { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionlessResponse"; + value: Uint8Array; +} +/** + * MsgCreateMarketPermissionlessResponse defines the + * MsgCreateMarketPermissionless response + */ +export interface MsgCreateMarketPermissionlessResponseAmino {} +export interface MsgCreateMarketPermissionlessResponseAminoMsg { + type: "/dydxprotocol.listing.MsgCreateMarketPermissionlessResponse"; + value: MsgCreateMarketPermissionlessResponseAmino; +} +/** + * MsgCreateMarketPermissionlessResponse defines the + * MsgCreateMarketPermissionless response + */ +export interface MsgCreateMarketPermissionlessResponseSDKType {} +/** + * MsgSetListingVaultDepositParams is a message used to set PML megavault + * deposit params + */ +export interface MsgSetListingVaultDepositParams { + authority: string; + /** Params which define the vault deposit for market listing */ + params: ListingVaultDepositParams; +} +export interface MsgSetListingVaultDepositParamsProtoMsg { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParams"; + value: Uint8Array; +} +/** + * MsgSetListingVaultDepositParams is a message used to set PML megavault + * deposit params + */ +export interface MsgSetListingVaultDepositParamsAmino { + authority?: string; + /** Params which define the vault deposit for market listing */ + params?: ListingVaultDepositParamsAmino; +} +export interface MsgSetListingVaultDepositParamsAminoMsg { + type: "/dydxprotocol.listing.MsgSetListingVaultDepositParams"; + value: MsgSetListingVaultDepositParamsAmino; +} +/** + * MsgSetListingVaultDepositParams is a message used to set PML megavault + * deposit params + */ +export interface MsgSetListingVaultDepositParamsSDKType { + authority: string; + params: ListingVaultDepositParamsSDKType; +} +/** + * MsgSetListingVaultDepositParamsResponse defines the + * MsgSetListingVaultDepositParams response + */ +export interface MsgSetListingVaultDepositParamsResponse {} +export interface MsgSetListingVaultDepositParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse"; + value: Uint8Array; +} +/** + * MsgSetListingVaultDepositParamsResponse defines the + * MsgSetListingVaultDepositParams response + */ +export interface MsgSetListingVaultDepositParamsResponseAmino {} +export interface MsgSetListingVaultDepositParamsResponseAminoMsg { + type: "/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse"; + value: MsgSetListingVaultDepositParamsResponseAmino; +} +/** + * MsgSetListingVaultDepositParamsResponse defines the + * MsgSetListingVaultDepositParams response + */ +export interface MsgSetListingVaultDepositParamsResponseSDKType {} +function createBaseMsgSetMarketsHardCap(): MsgSetMarketsHardCap { + return { + authority: "", + hardCapForMarkets: 0 + }; +} +export const MsgSetMarketsHardCap = { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCap", + encode(message: MsgSetMarketsHardCap, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.hardCapForMarkets !== 0) { + writer.uint32(16).uint32(message.hardCapForMarkets); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetMarketsHardCap { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketsHardCap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.hardCapForMarkets = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetMarketsHardCap { + const message = createBaseMsgSetMarketsHardCap(); + message.authority = object.authority ?? ""; + message.hardCapForMarkets = object.hardCapForMarkets ?? 0; + return message; + }, + fromAmino(object: MsgSetMarketsHardCapAmino): MsgSetMarketsHardCap { + const message = createBaseMsgSetMarketsHardCap(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.hard_cap_for_markets !== undefined && object.hard_cap_for_markets !== null) { + message.hardCapForMarkets = object.hard_cap_for_markets; + } + return message; + }, + toAmino(message: MsgSetMarketsHardCap): MsgSetMarketsHardCapAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.hard_cap_for_markets = message.hardCapForMarkets === 0 ? undefined : message.hardCapForMarkets; + return obj; + }, + fromAminoMsg(object: MsgSetMarketsHardCapAminoMsg): MsgSetMarketsHardCap { + return MsgSetMarketsHardCap.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMarketsHardCapProtoMsg): MsgSetMarketsHardCap { + return MsgSetMarketsHardCap.decode(message.value); + }, + toProto(message: MsgSetMarketsHardCap): Uint8Array { + return MsgSetMarketsHardCap.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMarketsHardCap): MsgSetMarketsHardCapProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCap", + value: MsgSetMarketsHardCap.encode(message).finish() + }; + } +}; +function createBaseMsgSetMarketsHardCapResponse(): MsgSetMarketsHardCapResponse { + return {}; +} +export const MsgSetMarketsHardCapResponse = { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCapResponse", + encode(_: MsgSetMarketsHardCapResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetMarketsHardCapResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketsHardCapResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetMarketsHardCapResponse { + const message = createBaseMsgSetMarketsHardCapResponse(); + return message; + }, + fromAmino(_: MsgSetMarketsHardCapResponseAmino): MsgSetMarketsHardCapResponse { + const message = createBaseMsgSetMarketsHardCapResponse(); + return message; + }, + toAmino(_: MsgSetMarketsHardCapResponse): MsgSetMarketsHardCapResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetMarketsHardCapResponseAminoMsg): MsgSetMarketsHardCapResponse { + return MsgSetMarketsHardCapResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMarketsHardCapResponseProtoMsg): MsgSetMarketsHardCapResponse { + return MsgSetMarketsHardCapResponse.decode(message.value); + }, + toProto(message: MsgSetMarketsHardCapResponse): Uint8Array { + return MsgSetMarketsHardCapResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMarketsHardCapResponse): MsgSetMarketsHardCapResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.MsgSetMarketsHardCapResponse", + value: MsgSetMarketsHardCapResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreateMarketPermissionless(): MsgCreateMarketPermissionless { + return { + ticker: "", + subaccountId: undefined, + quoteQuantums: new Uint8Array() + }; +} +export const MsgCreateMarketPermissionless = { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionless", + encode(message: MsgCreateMarketPermissionless, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.subaccountId !== undefined) { + SubaccountId.encode(message.subaccountId, writer.uint32(18).fork()).ldelim(); + } + if (message.quoteQuantums.length !== 0) { + writer.uint32(26).bytes(message.quoteQuantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateMarketPermissionless { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateMarketPermissionless(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.subaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 3: + message.quoteQuantums = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateMarketPermissionless { + const message = createBaseMsgCreateMarketPermissionless(); + message.ticker = object.ticker ?? ""; + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; + message.quoteQuantums = object.quoteQuantums ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgCreateMarketPermissionlessAmino): MsgCreateMarketPermissionless { + const message = createBaseMsgCreateMarketPermissionless(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = SubaccountId.fromAmino(object.subaccount_id); + } + if (object.quote_quantums !== undefined && object.quote_quantums !== null) { + message.quoteQuantums = bytesFromBase64(object.quote_quantums); + } + return message; + }, + toAmino(message: MsgCreateMarketPermissionless): MsgCreateMarketPermissionlessAmino { + const obj: any = {}; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.subaccount_id = message.subaccountId ? SubaccountId.toAmino(message.subaccountId) : undefined; + obj.quote_quantums = message.quoteQuantums ? base64FromBytes(message.quoteQuantums) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateMarketPermissionlessAminoMsg): MsgCreateMarketPermissionless { + return MsgCreateMarketPermissionless.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateMarketPermissionlessProtoMsg): MsgCreateMarketPermissionless { + return MsgCreateMarketPermissionless.decode(message.value); + }, + toProto(message: MsgCreateMarketPermissionless): Uint8Array { + return MsgCreateMarketPermissionless.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateMarketPermissionless): MsgCreateMarketPermissionlessProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionless", + value: MsgCreateMarketPermissionless.encode(message).finish() + }; + } +}; +function createBaseMsgCreateMarketPermissionlessResponse(): MsgCreateMarketPermissionlessResponse { + return {}; +} +export const MsgCreateMarketPermissionlessResponse = { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionlessResponse", + encode(_: MsgCreateMarketPermissionlessResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateMarketPermissionlessResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateMarketPermissionlessResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateMarketPermissionlessResponse { + const message = createBaseMsgCreateMarketPermissionlessResponse(); + return message; + }, + fromAmino(_: MsgCreateMarketPermissionlessResponseAmino): MsgCreateMarketPermissionlessResponse { + const message = createBaseMsgCreateMarketPermissionlessResponse(); + return message; + }, + toAmino(_: MsgCreateMarketPermissionlessResponse): MsgCreateMarketPermissionlessResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateMarketPermissionlessResponseAminoMsg): MsgCreateMarketPermissionlessResponse { + return MsgCreateMarketPermissionlessResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateMarketPermissionlessResponseProtoMsg): MsgCreateMarketPermissionlessResponse { + return MsgCreateMarketPermissionlessResponse.decode(message.value); + }, + toProto(message: MsgCreateMarketPermissionlessResponse): Uint8Array { + return MsgCreateMarketPermissionlessResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateMarketPermissionlessResponse): MsgCreateMarketPermissionlessResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.MsgCreateMarketPermissionlessResponse", + value: MsgCreateMarketPermissionlessResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetListingVaultDepositParams(): MsgSetListingVaultDepositParams { + return { + authority: "", + params: ListingVaultDepositParams.fromPartial({}) + }; +} +export const MsgSetListingVaultDepositParams = { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParams", + encode(message: MsgSetListingVaultDepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + ListingVaultDepositParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetListingVaultDepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetListingVaultDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = ListingVaultDepositParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetListingVaultDepositParams { + const message = createBaseMsgSetListingVaultDepositParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? ListingVaultDepositParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgSetListingVaultDepositParamsAmino): MsgSetListingVaultDepositParams { + const message = createBaseMsgSetListingVaultDepositParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = ListingVaultDepositParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgSetListingVaultDepositParams): MsgSetListingVaultDepositParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? ListingVaultDepositParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetListingVaultDepositParamsAminoMsg): MsgSetListingVaultDepositParams { + return MsgSetListingVaultDepositParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetListingVaultDepositParamsProtoMsg): MsgSetListingVaultDepositParams { + return MsgSetListingVaultDepositParams.decode(message.value); + }, + toProto(message: MsgSetListingVaultDepositParams): Uint8Array { + return MsgSetListingVaultDepositParams.encode(message).finish(); + }, + toProtoMsg(message: MsgSetListingVaultDepositParams): MsgSetListingVaultDepositParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParams", + value: MsgSetListingVaultDepositParams.encode(message).finish() + }; + } +}; +function createBaseMsgSetListingVaultDepositParamsResponse(): MsgSetListingVaultDepositParamsResponse { + return {}; +} +export const MsgSetListingVaultDepositParamsResponse = { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse", + encode(_: MsgSetListingVaultDepositParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetListingVaultDepositParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetListingVaultDepositParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetListingVaultDepositParamsResponse { + const message = createBaseMsgSetListingVaultDepositParamsResponse(); + return message; + }, + fromAmino(_: MsgSetListingVaultDepositParamsResponseAmino): MsgSetListingVaultDepositParamsResponse { + const message = createBaseMsgSetListingVaultDepositParamsResponse(); + return message; + }, + toAmino(_: MsgSetListingVaultDepositParamsResponse): MsgSetListingVaultDepositParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetListingVaultDepositParamsResponseAminoMsg): MsgSetListingVaultDepositParamsResponse { + return MsgSetListingVaultDepositParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetListingVaultDepositParamsResponseProtoMsg): MsgSetListingVaultDepositParamsResponse { + return MsgSetListingVaultDepositParamsResponse.decode(message.value); + }, + toProto(message: MsgSetListingVaultDepositParamsResponse): Uint8Array { + return MsgSetListingVaultDepositParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetListingVaultDepositParamsResponse): MsgSetListingVaultDepositParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse", + value: MsgSetListingVaultDepositParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/genesis.ts new file mode 100644 index 00000000..ba97cbbc --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/genesis.ts @@ -0,0 +1,121 @@ +//@ts-nocheck +import { Perpetual, PerpetualAmino, PerpetualSDKType, LiquidityTier, LiquidityTierAmino, LiquidityTierSDKType } from "./perpetual"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the perpetuals module's genesis state. */ +export interface GenesisState { + perpetuals: Perpetual[]; + liquidityTiers: LiquidityTier[]; + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the perpetuals module's genesis state. */ +export interface GenesisStateAmino { + perpetuals?: PerpetualAmino[]; + liquidity_tiers?: LiquidityTierAmino[]; + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.perpetuals.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the perpetuals module's genesis state. */ +export interface GenesisStateSDKType { + perpetuals: PerpetualSDKType[]; + liquidity_tiers: LiquidityTierSDKType[]; + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + perpetuals: [], + liquidityTiers: [], + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.perpetuals.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.perpetuals) { + Perpetual.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.liquidityTiers) { + LiquidityTier.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetuals.push(Perpetual.decode(reader, reader.uint32())); + break; + case 2: + message.liquidityTiers.push(LiquidityTier.decode(reader, reader.uint32())); + break; + case 3: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.perpetuals = object.perpetuals?.map(e => Perpetual.fromPartial(e)) || []; + message.liquidityTiers = object.liquidityTiers?.map(e => LiquidityTier.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.perpetuals = object.perpetuals?.map(e => Perpetual.fromAmino(e)) || []; + message.liquidityTiers = object.liquidity_tiers?.map(e => LiquidityTier.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.perpetuals) { + obj.perpetuals = message.perpetuals.map(e => e ? Perpetual.toAmino(e) : undefined); + } else { + obj.perpetuals = message.perpetuals; + } + if (message.liquidityTiers) { + obj.liquidity_tiers = message.liquidityTiers.map(e => e ? LiquidityTier.toAmino(e) : undefined); + } else { + obj.liquidity_tiers = message.liquidityTiers; + } + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/params.ts new file mode 100644 index 00000000..ff2f7f82 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/params.ts @@ -0,0 +1,143 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Params defines the parameters for x/perpetuals module. */ +export interface Params { + /** + * Funding rate clamp factor in parts-per-million, used for clamping 8-hour + * funding rates according to equation: |R| <= funding_rate_clamp_factor * + * (initial margin - maintenance margin). + */ + fundingRateClampFactorPpm: number; + /** + * Premium vote clamp factor in parts-per-million, used for clamping premium + * votes according to equation: |V| <= premium_vote_clamp_factor * + * (initial margin - maintenance margin). + */ + premiumVoteClampFactorPpm: number; + /** + * Minimum number of premium votes per premium sample. If number of premium + * votes is smaller than this number, pad with zeros up to this number. + */ + minNumVotesPerSample: number; +} +export interface ParamsProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.Params"; + value: Uint8Array; +} +/** Params defines the parameters for x/perpetuals module. */ +export interface ParamsAmino { + /** + * Funding rate clamp factor in parts-per-million, used for clamping 8-hour + * funding rates according to equation: |R| <= funding_rate_clamp_factor * + * (initial margin - maintenance margin). + */ + funding_rate_clamp_factor_ppm?: number; + /** + * Premium vote clamp factor in parts-per-million, used for clamping premium + * votes according to equation: |V| <= premium_vote_clamp_factor * + * (initial margin - maintenance margin). + */ + premium_vote_clamp_factor_ppm?: number; + /** + * Minimum number of premium votes per premium sample. If number of premium + * votes is smaller than this number, pad with zeros up to this number. + */ + min_num_votes_per_sample?: number; +} +export interface ParamsAminoMsg { + type: "/dydxprotocol.perpetuals.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for x/perpetuals module. */ +export interface ParamsSDKType { + funding_rate_clamp_factor_ppm: number; + premium_vote_clamp_factor_ppm: number; + min_num_votes_per_sample: number; +} +function createBaseParams(): Params { + return { + fundingRateClampFactorPpm: 0, + premiumVoteClampFactorPpm: 0, + minNumVotesPerSample: 0 + }; +} +export const Params = { + typeUrl: "/dydxprotocol.perpetuals.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fundingRateClampFactorPpm !== 0) { + writer.uint32(8).uint32(message.fundingRateClampFactorPpm); + } + if (message.premiumVoteClampFactorPpm !== 0) { + writer.uint32(16).uint32(message.premiumVoteClampFactorPpm); + } + if (message.minNumVotesPerSample !== 0) { + writer.uint32(24).uint32(message.minNumVotesPerSample); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fundingRateClampFactorPpm = reader.uint32(); + break; + case 2: + message.premiumVoteClampFactorPpm = reader.uint32(); + break; + case 3: + message.minNumVotesPerSample = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.fundingRateClampFactorPpm = object.fundingRateClampFactorPpm ?? 0; + message.premiumVoteClampFactorPpm = object.premiumVoteClampFactorPpm ?? 0; + message.minNumVotesPerSample = object.minNumVotesPerSample ?? 0; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.funding_rate_clamp_factor_ppm !== undefined && object.funding_rate_clamp_factor_ppm !== null) { + message.fundingRateClampFactorPpm = object.funding_rate_clamp_factor_ppm; + } + if (object.premium_vote_clamp_factor_ppm !== undefined && object.premium_vote_clamp_factor_ppm !== null) { + message.premiumVoteClampFactorPpm = object.premium_vote_clamp_factor_ppm; + } + if (object.min_num_votes_per_sample !== undefined && object.min_num_votes_per_sample !== null) { + message.minNumVotesPerSample = object.min_num_votes_per_sample; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.funding_rate_clamp_factor_ppm = message.fundingRateClampFactorPpm === 0 ? undefined : message.fundingRateClampFactorPpm; + obj.premium_vote_clamp_factor_ppm = message.premiumVoteClampFactorPpm === 0 ? undefined : message.premiumVoteClampFactorPpm; + obj.min_num_votes_per_sample = message.minNumVotesPerSample === 0 ? undefined : message.minNumVotesPerSample; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/perpetual.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/perpetual.ts new file mode 100644 index 00000000..27db26d5 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/perpetual.ts @@ -0,0 +1,916 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +export enum PerpetualMarketType { + /** PERPETUAL_MARKET_TYPE_UNSPECIFIED - Unspecified market type. */ + PERPETUAL_MARKET_TYPE_UNSPECIFIED = 0, + /** PERPETUAL_MARKET_TYPE_CROSS - Market type for cross margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_CROSS = 1, + /** PERPETUAL_MARKET_TYPE_ISOLATED - Market type for isolated margin perpetual markets. */ + PERPETUAL_MARKET_TYPE_ISOLATED = 2, + UNRECOGNIZED = -1, +} +export const PerpetualMarketTypeSDKType = PerpetualMarketType; +export const PerpetualMarketTypeAmino = PerpetualMarketType; +export function perpetualMarketTypeFromJSON(object: any): PerpetualMarketType { + switch (object) { + case 0: + case "PERPETUAL_MARKET_TYPE_UNSPECIFIED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED; + case 1: + case "PERPETUAL_MARKET_TYPE_CROSS": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS; + case 2: + case "PERPETUAL_MARKET_TYPE_ISOLATED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED; + case -1: + case "UNRECOGNIZED": + default: + return PerpetualMarketType.UNRECOGNIZED; + } +} +export function perpetualMarketTypeToJSON(object: PerpetualMarketType): string { + switch (object) { + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED: + return "PERPETUAL_MARKET_TYPE_UNSPECIFIED"; + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS: + return "PERPETUAL_MARKET_TYPE_CROSS"; + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED: + return "PERPETUAL_MARKET_TYPE_ISOLATED"; + case PerpetualMarketType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Perpetual represents a perpetual on the dYdX exchange. */ +export interface Perpetual { + /** PerpetualParams is the parameters of the perpetual. */ + params: PerpetualParams; + /** + * The current index determined by the cumulative all-time + * history of the funding mechanism. Starts at zero. + */ + fundingIndex: Uint8Array; + /** Total size of open long contracts, measured in base_quantums. */ + openInterest: Uint8Array; +} +export interface PerpetualProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.Perpetual"; + value: Uint8Array; +} +/** Perpetual represents a perpetual on the dYdX exchange. */ +export interface PerpetualAmino { + /** PerpetualParams is the parameters of the perpetual. */ + params?: PerpetualParamsAmino; + /** + * The current index determined by the cumulative all-time + * history of the funding mechanism. Starts at zero. + */ + funding_index?: string; + /** Total size of open long contracts, measured in base_quantums. */ + open_interest?: string; +} +export interface PerpetualAminoMsg { + type: "/dydxprotocol.perpetuals.Perpetual"; + value: PerpetualAmino; +} +/** Perpetual represents a perpetual on the dYdX exchange. */ +export interface PerpetualSDKType { + params: PerpetualParamsSDKType; + funding_index: Uint8Array; + open_interest: Uint8Array; +} +/** + * PerpetualParams represents the parameters of a perpetual on the dYdX + * exchange. + */ +export interface PerpetualParams { + /** Unique, sequentially-generated. */ + id: number; + /** The name of the `Perpetual` (e.g. `BTC-USD`). */ + ticker: string; + /** + * The market associated with this `Perpetual`. It + * acts as the oracle price for the purposes of calculating + * collateral, margin requirements, and funding rates. + */ + marketId: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + */ + atomicResolution: number; + /** + * The default funding payment if there is no price premium. In + * parts-per-million. + */ + defaultFundingPpm: number; + /** The liquidity_tier that this perpetual is associated with. */ + liquidityTier: number; + /** The market type specifying if this perpetual is cross or isolated */ + marketType: PerpetualMarketType; +} +export interface PerpetualParamsProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.PerpetualParams"; + value: Uint8Array; +} +/** + * PerpetualParams represents the parameters of a perpetual on the dYdX + * exchange. + */ +export interface PerpetualParamsAmino { + /** Unique, sequentially-generated. */ + id?: number; + /** The name of the `Perpetual` (e.g. `BTC-USD`). */ + ticker?: string; + /** + * The market associated with this `Perpetual`. It + * acts as the oracle price for the purposes of calculating + * collateral, margin requirements, and funding rates. + */ + market_id?: number; + /** + * The exponent for converting an atomic amount (`size = 1`) + * to a full coin. For example, if `AtomicResolution = -8` + * then a `PerpetualPosition` with `size = 1e8` is equivalent to + * a position size of one full coin. + */ + atomic_resolution?: number; + /** + * The default funding payment if there is no price premium. In + * parts-per-million. + */ + default_funding_ppm?: number; + /** The liquidity_tier that this perpetual is associated with. */ + liquidity_tier?: number; + /** The market type specifying if this perpetual is cross or isolated */ + market_type?: PerpetualMarketType; +} +export interface PerpetualParamsAminoMsg { + type: "/dydxprotocol.perpetuals.PerpetualParams"; + value: PerpetualParamsAmino; +} +/** + * PerpetualParams represents the parameters of a perpetual on the dYdX + * exchange. + */ +export interface PerpetualParamsSDKType { + id: number; + ticker: string; + market_id: number; + atomic_resolution: number; + default_funding_ppm: number; + liquidity_tier: number; + market_type: PerpetualMarketType; +} +/** MarketPremiums stores a list of premiums for a single perpetual market. */ +export interface MarketPremiums { + /** perpetual_id is the Id of the perpetual market. */ + perpetualId: number; + /** + * premiums is a list of premium values for a perpetual market. Since most + * premiums are zeros under "stable" market conditions, only non-zero values + * are stored in this list. + */ + premiums: number[]; +} +export interface MarketPremiumsProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MarketPremiums"; + value: Uint8Array; +} +/** MarketPremiums stores a list of premiums for a single perpetual market. */ +export interface MarketPremiumsAmino { + /** perpetual_id is the Id of the perpetual market. */ + perpetual_id?: number; + /** + * premiums is a list of premium values for a perpetual market. Since most + * premiums are zeros under "stable" market conditions, only non-zero values + * are stored in this list. + */ + premiums?: number[]; +} +export interface MarketPremiumsAminoMsg { + type: "/dydxprotocol.perpetuals.MarketPremiums"; + value: MarketPremiumsAmino; +} +/** MarketPremiums stores a list of premiums for a single perpetual market. */ +export interface MarketPremiumsSDKType { + perpetual_id: number; + premiums: number[]; +} +/** + * PremiumStore is a struct to store a perpetual premiums for all + * perpetual markets. It stores a list of `MarketPremiums`, each of which + * corresponds to a perpetual market and stores a list of non-zero premium + * values for that market. + * This struct can either be used to store `PremiumVotes` or + * `PremiumSamples`. + */ +export interface PremiumStore { + /** + * all_market_premiums a list of `MarketPremiums`, each corresponding to + * a perpetual market. + */ + allMarketPremiums: MarketPremiums[]; + /** + * number of rounds where premium values were added. This value indicates + * the total number of premiums (zeros and non-zeros) for each + * `MarketPremiums` struct. Note that in the edge case a perpetual market was + * added in the middle of a epoch, we don't keep a seperate count for that + * market. This means we treat this market as having zero premiums before it + * was added. + */ + numPremiums: number; +} +export interface PremiumStoreProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.PremiumStore"; + value: Uint8Array; +} +/** + * PremiumStore is a struct to store a perpetual premiums for all + * perpetual markets. It stores a list of `MarketPremiums`, each of which + * corresponds to a perpetual market and stores a list of non-zero premium + * values for that market. + * This struct can either be used to store `PremiumVotes` or + * `PremiumSamples`. + */ +export interface PremiumStoreAmino { + /** + * all_market_premiums a list of `MarketPremiums`, each corresponding to + * a perpetual market. + */ + all_market_premiums?: MarketPremiumsAmino[]; + /** + * number of rounds where premium values were added. This value indicates + * the total number of premiums (zeros and non-zeros) for each + * `MarketPremiums` struct. Note that in the edge case a perpetual market was + * added in the middle of a epoch, we don't keep a seperate count for that + * market. This means we treat this market as having zero premiums before it + * was added. + */ + num_premiums?: number; +} +export interface PremiumStoreAminoMsg { + type: "/dydxprotocol.perpetuals.PremiumStore"; + value: PremiumStoreAmino; +} +/** + * PremiumStore is a struct to store a perpetual premiums for all + * perpetual markets. It stores a list of `MarketPremiums`, each of which + * corresponds to a perpetual market and stores a list of non-zero premium + * values for that market. + * This struct can either be used to store `PremiumVotes` or + * `PremiumSamples`. + */ +export interface PremiumStoreSDKType { + all_market_premiums: MarketPremiumsSDKType[]; + num_premiums: number; +} +/** LiquidityTier stores margin information. */ +export interface LiquidityTier { + /** Unique id. */ + id: number; + /** The name of the tier purely for mnemonic purposes, e.g. "Gold". */ + name: string; + /** + * The margin fraction needed to open a position. + * In parts-per-million. + */ + initialMarginPpm: number; + /** + * The fraction of the initial-margin that the maintenance-margin is, + * e.g. 50%. In parts-per-million. + */ + maintenanceFractionPpm: number; + /** + * The maximum position size at which the margin requirements are + * not increased over the default values. Above this position size, + * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. + */ + /** @deprecated */ + basePositionNotional: bigint; + /** + * The impact notional amount (in quote quantums) is used to determine impact + * bid/ask prices and its recommended value is 500 USDC / initial margin + * fraction. + * - Impact bid price = average execution price for a market sell of the + * impact notional value. + * - Impact ask price = average execution price for a market buy of the + * impact notional value. + */ + impactNotional: bigint; + /** + * Lower cap for Open Interest Margin Fracton (OIMF), in quote quantums. + * IMF is not affected when OI <= open_interest_lower_cap. + */ + openInterestLowerCap: bigint; + /** + * Upper cap for Open Interest Margin Fracton (OIMF), in quote quantums. + * IMF scales linearly to 100% as OI approaches open_interest_upper_cap. + * If zero, then the IMF does not scale with OI. + */ + openInterestUpperCap: bigint; +} +export interface LiquidityTierProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.LiquidityTier"; + value: Uint8Array; +} +/** LiquidityTier stores margin information. */ +export interface LiquidityTierAmino { + /** Unique id. */ + id?: number; + /** The name of the tier purely for mnemonic purposes, e.g. "Gold". */ + name?: string; + /** + * The margin fraction needed to open a position. + * In parts-per-million. + */ + initial_margin_ppm?: number; + /** + * The fraction of the initial-margin that the maintenance-margin is, + * e.g. 50%. In parts-per-million. + */ + maintenance_fraction_ppm?: number; + /** + * The maximum position size at which the margin requirements are + * not increased over the default values. Above this position size, + * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. + */ + /** @deprecated */ + base_position_notional?: string; + /** + * The impact notional amount (in quote quantums) is used to determine impact + * bid/ask prices and its recommended value is 500 USDC / initial margin + * fraction. + * - Impact bid price = average execution price for a market sell of the + * impact notional value. + * - Impact ask price = average execution price for a market buy of the + * impact notional value. + */ + impact_notional?: string; + /** + * Lower cap for Open Interest Margin Fracton (OIMF), in quote quantums. + * IMF is not affected when OI <= open_interest_lower_cap. + */ + open_interest_lower_cap?: string; + /** + * Upper cap for Open Interest Margin Fracton (OIMF), in quote quantums. + * IMF scales linearly to 100% as OI approaches open_interest_upper_cap. + * If zero, then the IMF does not scale with OI. + */ + open_interest_upper_cap?: string; +} +export interface LiquidityTierAminoMsg { + type: "/dydxprotocol.perpetuals.LiquidityTier"; + value: LiquidityTierAmino; +} +/** LiquidityTier stores margin information. */ +export interface LiquidityTierSDKType { + id: number; + name: string; + initial_margin_ppm: number; + maintenance_fraction_ppm: number; + /** @deprecated */ + base_position_notional: bigint; + impact_notional: bigint; + open_interest_lower_cap: bigint; + open_interest_upper_cap: bigint; +} +function createBasePerpetual(): Perpetual { + return { + params: PerpetualParams.fromPartial({}), + fundingIndex: new Uint8Array(), + openInterest: new Uint8Array() + }; +} +export const Perpetual = { + typeUrl: "/dydxprotocol.perpetuals.Perpetual", + encode(message: Perpetual, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + PerpetualParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.fundingIndex.length !== 0) { + writer.uint32(18).bytes(message.fundingIndex); + } + if (message.openInterest.length !== 0) { + writer.uint32(26).bytes(message.openInterest); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Perpetual { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetual(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = PerpetualParams.decode(reader, reader.uint32()); + break; + case 2: + message.fundingIndex = reader.bytes(); + break; + case 3: + message.openInterest = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Perpetual { + const message = createBasePerpetual(); + message.params = object.params !== undefined && object.params !== null ? PerpetualParams.fromPartial(object.params) : undefined; + message.fundingIndex = object.fundingIndex ?? new Uint8Array(); + message.openInterest = object.openInterest ?? new Uint8Array(); + return message; + }, + fromAmino(object: PerpetualAmino): Perpetual { + const message = createBasePerpetual(); + if (object.params !== undefined && object.params !== null) { + message.params = PerpetualParams.fromAmino(object.params); + } + if (object.funding_index !== undefined && object.funding_index !== null) { + message.fundingIndex = bytesFromBase64(object.funding_index); + } + if (object.open_interest !== undefined && object.open_interest !== null) { + message.openInterest = bytesFromBase64(object.open_interest); + } + return message; + }, + toAmino(message: Perpetual): PerpetualAmino { + const obj: any = {}; + obj.params = message.params ? PerpetualParams.toAmino(message.params) : undefined; + obj.funding_index = message.fundingIndex ? base64FromBytes(message.fundingIndex) : undefined; + obj.open_interest = message.openInterest ? base64FromBytes(message.openInterest) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualAminoMsg): Perpetual { + return Perpetual.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualProtoMsg): Perpetual { + return Perpetual.decode(message.value); + }, + toProto(message: Perpetual): Uint8Array { + return Perpetual.encode(message).finish(); + }, + toProtoMsg(message: Perpetual): PerpetualProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.Perpetual", + value: Perpetual.encode(message).finish() + }; + } +}; +function createBasePerpetualParams(): PerpetualParams { + return { + id: 0, + ticker: "", + marketId: 0, + atomicResolution: 0, + defaultFundingPpm: 0, + liquidityTier: 0, + marketType: 0 + }; +} +export const PerpetualParams = { + typeUrl: "/dydxprotocol.perpetuals.PerpetualParams", + encode(message: PerpetualParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.marketId !== 0) { + writer.uint32(24).uint32(message.marketId); + } + if (message.atomicResolution !== 0) { + writer.uint32(32).sint32(message.atomicResolution); + } + if (message.defaultFundingPpm !== 0) { + writer.uint32(40).sint32(message.defaultFundingPpm); + } + if (message.liquidityTier !== 0) { + writer.uint32(48).uint32(message.liquidityTier); + } + if (message.marketType !== 0) { + writer.uint32(56).int32(message.marketType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.marketId = reader.uint32(); + break; + case 4: + message.atomicResolution = reader.sint32(); + break; + case 5: + message.defaultFundingPpm = reader.sint32(); + break; + case 6: + message.liquidityTier = reader.uint32(); + break; + case 7: + message.marketType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualParams { + const message = createBasePerpetualParams(); + message.id = object.id ?? 0; + message.ticker = object.ticker ?? ""; + message.marketId = object.marketId ?? 0; + message.atomicResolution = object.atomicResolution ?? 0; + message.defaultFundingPpm = object.defaultFundingPpm ?? 0; + message.liquidityTier = object.liquidityTier ?? 0; + message.marketType = object.marketType ?? 0; + return message; + }, + fromAmino(object: PerpetualParamsAmino): PerpetualParams { + const message = createBasePerpetualParams(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = object.ticker; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.atomic_resolution !== undefined && object.atomic_resolution !== null) { + message.atomicResolution = object.atomic_resolution; + } + if (object.default_funding_ppm !== undefined && object.default_funding_ppm !== null) { + message.defaultFundingPpm = object.default_funding_ppm; + } + if (object.liquidity_tier !== undefined && object.liquidity_tier !== null) { + message.liquidityTier = object.liquidity_tier; + } + if (object.market_type !== undefined && object.market_type !== null) { + message.marketType = object.market_type; + } + return message; + }, + toAmino(message: PerpetualParams): PerpetualParamsAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.ticker = message.ticker === "" ? undefined : message.ticker; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.atomic_resolution = message.atomicResolution === 0 ? undefined : message.atomicResolution; + obj.default_funding_ppm = message.defaultFundingPpm === 0 ? undefined : message.defaultFundingPpm; + obj.liquidity_tier = message.liquidityTier === 0 ? undefined : message.liquidityTier; + obj.market_type = message.marketType === 0 ? undefined : message.marketType; + return obj; + }, + fromAminoMsg(object: PerpetualParamsAminoMsg): PerpetualParams { + return PerpetualParams.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualParamsProtoMsg): PerpetualParams { + return PerpetualParams.decode(message.value); + }, + toProto(message: PerpetualParams): Uint8Array { + return PerpetualParams.encode(message).finish(); + }, + toProtoMsg(message: PerpetualParams): PerpetualParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.PerpetualParams", + value: PerpetualParams.encode(message).finish() + }; + } +}; +function createBaseMarketPremiums(): MarketPremiums { + return { + perpetualId: 0, + premiums: [] + }; +} +export const MarketPremiums = { + typeUrl: "/dydxprotocol.perpetuals.MarketPremiums", + encode(message: MarketPremiums, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + writer.uint32(18).fork(); + for (const v of message.premiums) { + writer.sint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketPremiums { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketPremiums(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.premiums.push(reader.sint32()); + } + } else { + message.premiums.push(reader.sint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketPremiums { + const message = createBaseMarketPremiums(); + message.perpetualId = object.perpetualId ?? 0; + message.premiums = object.premiums?.map(e => e) || []; + return message; + }, + fromAmino(object: MarketPremiumsAmino): MarketPremiums { + const message = createBaseMarketPremiums(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + message.premiums = object.premiums?.map(e => e) || []; + return message; + }, + toAmino(message: MarketPremiums): MarketPremiumsAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + if (message.premiums) { + obj.premiums = message.premiums.map(e => e); + } else { + obj.premiums = message.premiums; + } + return obj; + }, + fromAminoMsg(object: MarketPremiumsAminoMsg): MarketPremiums { + return MarketPremiums.fromAmino(object.value); + }, + fromProtoMsg(message: MarketPremiumsProtoMsg): MarketPremiums { + return MarketPremiums.decode(message.value); + }, + toProto(message: MarketPremiums): Uint8Array { + return MarketPremiums.encode(message).finish(); + }, + toProtoMsg(message: MarketPremiums): MarketPremiumsProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MarketPremiums", + value: MarketPremiums.encode(message).finish() + }; + } +}; +function createBasePremiumStore(): PremiumStore { + return { + allMarketPremiums: [], + numPremiums: 0 + }; +} +export const PremiumStore = { + typeUrl: "/dydxprotocol.perpetuals.PremiumStore", + encode(message: PremiumStore, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allMarketPremiums) { + MarketPremiums.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.numPremiums !== 0) { + writer.uint32(16).uint32(message.numPremiums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PremiumStore { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePremiumStore(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allMarketPremiums.push(MarketPremiums.decode(reader, reader.uint32())); + break; + case 2: + message.numPremiums = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PremiumStore { + const message = createBasePremiumStore(); + message.allMarketPremiums = object.allMarketPremiums?.map(e => MarketPremiums.fromPartial(e)) || []; + message.numPremiums = object.numPremiums ?? 0; + return message; + }, + fromAmino(object: PremiumStoreAmino): PremiumStore { + const message = createBasePremiumStore(); + message.allMarketPremiums = object.all_market_premiums?.map(e => MarketPremiums.fromAmino(e)) || []; + if (object.num_premiums !== undefined && object.num_premiums !== null) { + message.numPremiums = object.num_premiums; + } + return message; + }, + toAmino(message: PremiumStore): PremiumStoreAmino { + const obj: any = {}; + if (message.allMarketPremiums) { + obj.all_market_premiums = message.allMarketPremiums.map(e => e ? MarketPremiums.toAmino(e) : undefined); + } else { + obj.all_market_premiums = message.allMarketPremiums; + } + obj.num_premiums = message.numPremiums === 0 ? undefined : message.numPremiums; + return obj; + }, + fromAminoMsg(object: PremiumStoreAminoMsg): PremiumStore { + return PremiumStore.fromAmino(object.value); + }, + fromProtoMsg(message: PremiumStoreProtoMsg): PremiumStore { + return PremiumStore.decode(message.value); + }, + toProto(message: PremiumStore): Uint8Array { + return PremiumStore.encode(message).finish(); + }, + toProtoMsg(message: PremiumStore): PremiumStoreProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.PremiumStore", + value: PremiumStore.encode(message).finish() + }; + } +}; +function createBaseLiquidityTier(): LiquidityTier { + return { + id: 0, + name: "", + initialMarginPpm: 0, + maintenanceFractionPpm: 0, + basePositionNotional: BigInt(0), + impactNotional: BigInt(0), + openInterestLowerCap: BigInt(0), + openInterestUpperCap: BigInt(0) + }; +} +export const LiquidityTier = { + typeUrl: "/dydxprotocol.perpetuals.LiquidityTier", + encode(message: LiquidityTier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.initialMarginPpm !== 0) { + writer.uint32(24).uint32(message.initialMarginPpm); + } + if (message.maintenanceFractionPpm !== 0) { + writer.uint32(32).uint32(message.maintenanceFractionPpm); + } + if (message.basePositionNotional !== BigInt(0)) { + writer.uint32(40).uint64(message.basePositionNotional); + } + if (message.impactNotional !== BigInt(0)) { + writer.uint32(48).uint64(message.impactNotional); + } + if (message.openInterestLowerCap !== BigInt(0)) { + writer.uint32(56).uint64(message.openInterestLowerCap); + } + if (message.openInterestUpperCap !== BigInt(0)) { + writer.uint32(64).uint64(message.openInterestUpperCap); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidityTier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidityTier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.initialMarginPpm = reader.uint32(); + break; + case 4: + message.maintenanceFractionPpm = reader.uint32(); + break; + case 5: + message.basePositionNotional = reader.uint64(); + break; + case 6: + message.impactNotional = reader.uint64(); + break; + case 7: + message.openInterestLowerCap = reader.uint64(); + break; + case 8: + message.openInterestUpperCap = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidityTier { + const message = createBaseLiquidityTier(); + message.id = object.id ?? 0; + message.name = object.name ?? ""; + message.initialMarginPpm = object.initialMarginPpm ?? 0; + message.maintenanceFractionPpm = object.maintenanceFractionPpm ?? 0; + message.basePositionNotional = object.basePositionNotional !== undefined && object.basePositionNotional !== null ? BigInt(object.basePositionNotional.toString()) : BigInt(0); + message.impactNotional = object.impactNotional !== undefined && object.impactNotional !== null ? BigInt(object.impactNotional.toString()) : BigInt(0); + message.openInterestLowerCap = object.openInterestLowerCap !== undefined && object.openInterestLowerCap !== null ? BigInt(object.openInterestLowerCap.toString()) : BigInt(0); + message.openInterestUpperCap = object.openInterestUpperCap !== undefined && object.openInterestUpperCap !== null ? BigInt(object.openInterestUpperCap.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LiquidityTierAmino): LiquidityTier { + const message = createBaseLiquidityTier(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.initial_margin_ppm !== undefined && object.initial_margin_ppm !== null) { + message.initialMarginPpm = object.initial_margin_ppm; + } + if (object.maintenance_fraction_ppm !== undefined && object.maintenance_fraction_ppm !== null) { + message.maintenanceFractionPpm = object.maintenance_fraction_ppm; + } + if (object.base_position_notional !== undefined && object.base_position_notional !== null) { + message.basePositionNotional = BigInt(object.base_position_notional); + } + if (object.impact_notional !== undefined && object.impact_notional !== null) { + message.impactNotional = BigInt(object.impact_notional); + } + if (object.open_interest_lower_cap !== undefined && object.open_interest_lower_cap !== null) { + message.openInterestLowerCap = BigInt(object.open_interest_lower_cap); + } + if (object.open_interest_upper_cap !== undefined && object.open_interest_upper_cap !== null) { + message.openInterestUpperCap = BigInt(object.open_interest_upper_cap); + } + return message; + }, + toAmino(message: LiquidityTier): LiquidityTierAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.name = message.name === "" ? undefined : message.name; + obj.initial_margin_ppm = message.initialMarginPpm === 0 ? undefined : message.initialMarginPpm; + obj.maintenance_fraction_ppm = message.maintenanceFractionPpm === 0 ? undefined : message.maintenanceFractionPpm; + obj.base_position_notional = message.basePositionNotional !== BigInt(0) ? message.basePositionNotional.toString() : undefined; + obj.impact_notional = message.impactNotional !== BigInt(0) ? message.impactNotional.toString() : undefined; + obj.open_interest_lower_cap = message.openInterestLowerCap !== BigInt(0) ? message.openInterestLowerCap.toString() : undefined; + obj.open_interest_upper_cap = message.openInterestUpperCap !== BigInt(0) ? message.openInterestUpperCap.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LiquidityTierAminoMsg): LiquidityTier { + return LiquidityTier.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidityTierProtoMsg): LiquidityTier { + return LiquidityTier.decode(message.value); + }, + toProto(message: LiquidityTier): Uint8Array { + return LiquidityTier.encode(message).finish(); + }, + toProtoMsg(message: LiquidityTier): LiquidityTierProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.LiquidityTier", + value: LiquidityTier.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/query.rpc.Query.ts new file mode 100644 index 00000000..12669624 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/query.rpc.Query.ts @@ -0,0 +1,90 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryPerpetualRequest, QueryPerpetualResponse, QueryAllPerpetualsRequest, QueryAllPerpetualsResponse, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponse, QueryPremiumVotesRequest, QueryPremiumVotesResponse, QueryPremiumSamplesRequest, QueryPremiumSamplesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a Perpetual by id. */ + perpetual(request: QueryPerpetualRequest): Promise; + /** Queries a list of Perpetual items. */ + allPerpetuals(request?: QueryAllPerpetualsRequest): Promise; + /** Queries a list of LiquidityTiers. */ + allLiquidityTiers(request?: QueryAllLiquidityTiersRequest): Promise; + /** Queries a list of premium votes. */ + premiumVotes(request?: QueryPremiumVotesRequest): Promise; + /** Queries a list of premium samples. */ + premiumSamples(request?: QueryPremiumSamplesRequest): Promise; + /** Queries the perpetual params. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.perpetual = this.perpetual.bind(this); + this.allPerpetuals = this.allPerpetuals.bind(this); + this.allLiquidityTiers = this.allLiquidityTiers.bind(this); + this.premiumVotes = this.premiumVotes.bind(this); + this.premiumSamples = this.premiumSamples.bind(this); + this.params = this.params.bind(this); + } + perpetual(request: QueryPerpetualRequest): Promise { + const data = QueryPerpetualRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "Perpetual", data); + return promise.then(data => QueryPerpetualResponse.decode(new BinaryReader(data))); + } + allPerpetuals(request: QueryAllPerpetualsRequest = { + pagination: undefined + }): Promise { + const data = QueryAllPerpetualsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "AllPerpetuals", data); + return promise.then(data => QueryAllPerpetualsResponse.decode(new BinaryReader(data))); + } + allLiquidityTiers(request: QueryAllLiquidityTiersRequest = { + pagination: undefined + }): Promise { + const data = QueryAllLiquidityTiersRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "AllLiquidityTiers", data); + return promise.then(data => QueryAllLiquidityTiersResponse.decode(new BinaryReader(data))); + } + premiumVotes(request: QueryPremiumVotesRequest = {}): Promise { + const data = QueryPremiumVotesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "PremiumVotes", data); + return promise.then(data => QueryPremiumVotesResponse.decode(new BinaryReader(data))); + } + premiumSamples(request: QueryPremiumSamplesRequest = {}): Promise { + const data = QueryPremiumSamplesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "PremiumSamples", data); + return promise.then(data => QueryPremiumSamplesResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + perpetual(request: QueryPerpetualRequest): Promise { + return queryService.perpetual(request); + }, + allPerpetuals(request?: QueryAllPerpetualsRequest): Promise { + return queryService.allPerpetuals(request); + }, + allLiquidityTiers(request?: QueryAllLiquidityTiersRequest): Promise { + return queryService.allLiquidityTiers(request); + }, + premiumVotes(request?: QueryPremiumVotesRequest): Promise { + return queryService.premiumVotes(request); + }, + premiumSamples(request?: QueryPremiumSamplesRequest): Promise { + return queryService.premiumSamples(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/query.ts new file mode 100644 index 00000000..6b699fa7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/query.ts @@ -0,0 +1,1014 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { Perpetual, PerpetualAmino, PerpetualSDKType, LiquidityTier, LiquidityTierAmino, LiquidityTierSDKType, PremiumStore, PremiumStoreAmino, PremiumStoreSDKType } from "./perpetual"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Queries a Perpetual by id. */ +export interface QueryPerpetualRequest { + id: number; +} +export interface QueryPerpetualRequestProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryPerpetualRequest"; + value: Uint8Array; +} +/** Queries a Perpetual by id. */ +export interface QueryPerpetualRequestAmino { + id?: number; +} +export interface QueryPerpetualRequestAminoMsg { + type: "/dydxprotocol.perpetuals.QueryPerpetualRequest"; + value: QueryPerpetualRequestAmino; +} +/** Queries a Perpetual by id. */ +export interface QueryPerpetualRequestSDKType { + id: number; +} +/** QueryPerpetualResponse is response type for the Perpetual RPC method. */ +export interface QueryPerpetualResponse { + perpetual: Perpetual; +} +export interface QueryPerpetualResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryPerpetualResponse"; + value: Uint8Array; +} +/** QueryPerpetualResponse is response type for the Perpetual RPC method. */ +export interface QueryPerpetualResponseAmino { + perpetual?: PerpetualAmino; +} +export interface QueryPerpetualResponseAminoMsg { + type: "/dydxprotocol.perpetuals.QueryPerpetualResponse"; + value: QueryPerpetualResponseAmino; +} +/** QueryPerpetualResponse is response type for the Perpetual RPC method. */ +export interface QueryPerpetualResponseSDKType { + perpetual: PerpetualSDKType; +} +/** Queries a list of Perpetual items. */ +export interface QueryAllPerpetualsRequest { + pagination?: PageRequest; +} +export interface QueryAllPerpetualsRequestProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryAllPerpetualsRequest"; + value: Uint8Array; +} +/** Queries a list of Perpetual items. */ +export interface QueryAllPerpetualsRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllPerpetualsRequestAminoMsg { + type: "/dydxprotocol.perpetuals.QueryAllPerpetualsRequest"; + value: QueryAllPerpetualsRequestAmino; +} +/** Queries a list of Perpetual items. */ +export interface QueryAllPerpetualsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryAllPerpetualsResponse is response type for the AllPerpetuals RPC method. */ +export interface QueryAllPerpetualsResponse { + perpetual: Perpetual[]; + pagination?: PageResponse; +} +export interface QueryAllPerpetualsResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryAllPerpetualsResponse"; + value: Uint8Array; +} +/** QueryAllPerpetualsResponse is response type for the AllPerpetuals RPC method. */ +export interface QueryAllPerpetualsResponseAmino { + perpetual?: PerpetualAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryAllPerpetualsResponseAminoMsg { + type: "/dydxprotocol.perpetuals.QueryAllPerpetualsResponse"; + value: QueryAllPerpetualsResponseAmino; +} +/** QueryAllPerpetualsResponse is response type for the AllPerpetuals RPC method. */ +export interface QueryAllPerpetualsResponseSDKType { + perpetual: PerpetualSDKType[]; + pagination?: PageResponseSDKType; +} +/** Queries a list of LiquidityTier items. */ +export interface QueryAllLiquidityTiersRequest { + pagination?: PageRequest; +} +export interface QueryAllLiquidityTiersRequestProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersRequest"; + value: Uint8Array; +} +/** Queries a list of LiquidityTier items. */ +export interface QueryAllLiquidityTiersRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllLiquidityTiersRequestAminoMsg { + type: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersRequest"; + value: QueryAllLiquidityTiersRequestAmino; +} +/** Queries a list of LiquidityTier items. */ +export interface QueryAllLiquidityTiersRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC + * method. + */ +export interface QueryAllLiquidityTiersResponse { + liquidityTiers: LiquidityTier[]; + pagination?: PageResponse; +} +export interface QueryAllLiquidityTiersResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersResponse"; + value: Uint8Array; +} +/** + * QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC + * method. + */ +export interface QueryAllLiquidityTiersResponseAmino { + liquidity_tiers?: LiquidityTierAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryAllLiquidityTiersResponseAminoMsg { + type: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersResponse"; + value: QueryAllLiquidityTiersResponseAmino; +} +/** + * QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC + * method. + */ +export interface QueryAllLiquidityTiersResponseSDKType { + liquidity_tiers: LiquidityTierSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. */ +export interface QueryPremiumVotesRequest {} +export interface QueryPremiumVotesRequestProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumVotesRequest"; + value: Uint8Array; +} +/** QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. */ +export interface QueryPremiumVotesRequestAmino {} +export interface QueryPremiumVotesRequestAminoMsg { + type: "/dydxprotocol.perpetuals.QueryPremiumVotesRequest"; + value: QueryPremiumVotesRequestAmino; +} +/** QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. */ +export interface QueryPremiumVotesRequestSDKType {} +/** + * QueryPremiumVotesResponse is the response type for the PremiumVotes RPC + * method. + */ +export interface QueryPremiumVotesResponse { + premiumVotes: PremiumStore; +} +export interface QueryPremiumVotesResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumVotesResponse"; + value: Uint8Array; +} +/** + * QueryPremiumVotesResponse is the response type for the PremiumVotes RPC + * method. + */ +export interface QueryPremiumVotesResponseAmino { + premium_votes?: PremiumStoreAmino; +} +export interface QueryPremiumVotesResponseAminoMsg { + type: "/dydxprotocol.perpetuals.QueryPremiumVotesResponse"; + value: QueryPremiumVotesResponseAmino; +} +/** + * QueryPremiumVotesResponse is the response type for the PremiumVotes RPC + * method. + */ +export interface QueryPremiumVotesResponseSDKType { + premium_votes: PremiumStoreSDKType; +} +/** + * QueryPremiumSamplesRequest is the request type for the PremiumSamples RPC + * method. + */ +export interface QueryPremiumSamplesRequest {} +export interface QueryPremiumSamplesRequestProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumSamplesRequest"; + value: Uint8Array; +} +/** + * QueryPremiumSamplesRequest is the request type for the PremiumSamples RPC + * method. + */ +export interface QueryPremiumSamplesRequestAmino {} +export interface QueryPremiumSamplesRequestAminoMsg { + type: "/dydxprotocol.perpetuals.QueryPremiumSamplesRequest"; + value: QueryPremiumSamplesRequestAmino; +} +/** + * QueryPremiumSamplesRequest is the request type for the PremiumSamples RPC + * method. + */ +export interface QueryPremiumSamplesRequestSDKType {} +/** + * QueryPremiumSamplesResponse is the response type for the PremiumSamples RPC + * method. + */ +export interface QueryPremiumSamplesResponse { + premiumSamples: PremiumStore; +} +export interface QueryPremiumSamplesResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumSamplesResponse"; + value: Uint8Array; +} +/** + * QueryPremiumSamplesResponse is the response type for the PremiumSamples RPC + * method. + */ +export interface QueryPremiumSamplesResponseAmino { + premium_samples?: PremiumStoreAmino; +} +export interface QueryPremiumSamplesResponseAminoMsg { + type: "/dydxprotocol.perpetuals.QueryPremiumSamplesResponse"; + value: QueryPremiumSamplesResponseAmino; +} +/** + * QueryPremiumSamplesResponse is the response type for the PremiumSamples RPC + * method. + */ +export interface QueryPremiumSamplesResponseSDKType { + premium_samples: PremiumStoreSDKType; +} +/** QueryParamsResponse is the response type for the Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/dydxprotocol.perpetuals.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is the response type for the Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Params RPC method. */ +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Params RPC method. */ +export interface QueryParamsResponseAmino { + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/dydxprotocol.perpetuals.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +function createBaseQueryPerpetualRequest(): QueryPerpetualRequest { + return { + id: 0 + }; +} +export const QueryPerpetualRequest = { + typeUrl: "/dydxprotocol.perpetuals.QueryPerpetualRequest", + encode(message: QueryPerpetualRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPerpetualRequest { + const message = createBaseQueryPerpetualRequest(); + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: QueryPerpetualRequestAmino): QueryPerpetualRequest { + const message = createBaseQueryPerpetualRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryPerpetualRequest): QueryPerpetualRequestAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryPerpetualRequestAminoMsg): QueryPerpetualRequest { + return QueryPerpetualRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualRequestProtoMsg): QueryPerpetualRequest { + return QueryPerpetualRequest.decode(message.value); + }, + toProto(message: QueryPerpetualRequest): Uint8Array { + return QueryPerpetualRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualRequest): QueryPerpetualRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryPerpetualRequest", + value: QueryPerpetualRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPerpetualResponse(): QueryPerpetualResponse { + return { + perpetual: Perpetual.fromPartial({}) + }; +} +export const QueryPerpetualResponse = { + typeUrl: "/dydxprotocol.perpetuals.QueryPerpetualResponse", + encode(message: QueryPerpetualResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetual !== undefined) { + Perpetual.encode(message.perpetual, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPerpetualResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetual = Perpetual.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPerpetualResponse { + const message = createBaseQueryPerpetualResponse(); + message.perpetual = object.perpetual !== undefined && object.perpetual !== null ? Perpetual.fromPartial(object.perpetual) : undefined; + return message; + }, + fromAmino(object: QueryPerpetualResponseAmino): QueryPerpetualResponse { + const message = createBaseQueryPerpetualResponse(); + if (object.perpetual !== undefined && object.perpetual !== null) { + message.perpetual = Perpetual.fromAmino(object.perpetual); + } + return message; + }, + toAmino(message: QueryPerpetualResponse): QueryPerpetualResponseAmino { + const obj: any = {}; + obj.perpetual = message.perpetual ? Perpetual.toAmino(message.perpetual) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPerpetualResponseAminoMsg): QueryPerpetualResponse { + return QueryPerpetualResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPerpetualResponseProtoMsg): QueryPerpetualResponse { + return QueryPerpetualResponse.decode(message.value); + }, + toProto(message: QueryPerpetualResponse): Uint8Array { + return QueryPerpetualResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPerpetualResponse): QueryPerpetualResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryPerpetualResponse", + value: QueryPerpetualResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllPerpetualsRequest(): QueryAllPerpetualsRequest { + return { + pagination: undefined + }; +} +export const QueryAllPerpetualsRequest = { + typeUrl: "/dydxprotocol.perpetuals.QueryAllPerpetualsRequest", + encode(message: QueryAllPerpetualsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllPerpetualsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPerpetualsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllPerpetualsRequest { + const message = createBaseQueryAllPerpetualsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllPerpetualsRequestAmino): QueryAllPerpetualsRequest { + const message = createBaseQueryAllPerpetualsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllPerpetualsRequest): QueryAllPerpetualsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllPerpetualsRequestAminoMsg): QueryAllPerpetualsRequest { + return QueryAllPerpetualsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllPerpetualsRequestProtoMsg): QueryAllPerpetualsRequest { + return QueryAllPerpetualsRequest.decode(message.value); + }, + toProto(message: QueryAllPerpetualsRequest): Uint8Array { + return QueryAllPerpetualsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllPerpetualsRequest): QueryAllPerpetualsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryAllPerpetualsRequest", + value: QueryAllPerpetualsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllPerpetualsResponse(): QueryAllPerpetualsResponse { + return { + perpetual: [], + pagination: undefined + }; +} +export const QueryAllPerpetualsResponse = { + typeUrl: "/dydxprotocol.perpetuals.QueryAllPerpetualsResponse", + encode(message: QueryAllPerpetualsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.perpetual) { + Perpetual.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllPerpetualsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPerpetualsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetual.push(Perpetual.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllPerpetualsResponse { + const message = createBaseQueryAllPerpetualsResponse(); + message.perpetual = object.perpetual?.map(e => Perpetual.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllPerpetualsResponseAmino): QueryAllPerpetualsResponse { + const message = createBaseQueryAllPerpetualsResponse(); + message.perpetual = object.perpetual?.map(e => Perpetual.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllPerpetualsResponse): QueryAllPerpetualsResponseAmino { + const obj: any = {}; + if (message.perpetual) { + obj.perpetual = message.perpetual.map(e => e ? Perpetual.toAmino(e) : undefined); + } else { + obj.perpetual = message.perpetual; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllPerpetualsResponseAminoMsg): QueryAllPerpetualsResponse { + return QueryAllPerpetualsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllPerpetualsResponseProtoMsg): QueryAllPerpetualsResponse { + return QueryAllPerpetualsResponse.decode(message.value); + }, + toProto(message: QueryAllPerpetualsResponse): Uint8Array { + return QueryAllPerpetualsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllPerpetualsResponse): QueryAllPerpetualsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryAllPerpetualsResponse", + value: QueryAllPerpetualsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllLiquidityTiersRequest(): QueryAllLiquidityTiersRequest { + return { + pagination: undefined + }; +} +export const QueryAllLiquidityTiersRequest = { + typeUrl: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersRequest", + encode(message: QueryAllLiquidityTiersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllLiquidityTiersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllLiquidityTiersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllLiquidityTiersRequest { + const message = createBaseQueryAllLiquidityTiersRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllLiquidityTiersRequestAmino): QueryAllLiquidityTiersRequest { + const message = createBaseQueryAllLiquidityTiersRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllLiquidityTiersRequest): QueryAllLiquidityTiersRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllLiquidityTiersRequestAminoMsg): QueryAllLiquidityTiersRequest { + return QueryAllLiquidityTiersRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllLiquidityTiersRequestProtoMsg): QueryAllLiquidityTiersRequest { + return QueryAllLiquidityTiersRequest.decode(message.value); + }, + toProto(message: QueryAllLiquidityTiersRequest): Uint8Array { + return QueryAllLiquidityTiersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllLiquidityTiersRequest): QueryAllLiquidityTiersRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersRequest", + value: QueryAllLiquidityTiersRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllLiquidityTiersResponse(): QueryAllLiquidityTiersResponse { + return { + liquidityTiers: [], + pagination: undefined + }; +} +export const QueryAllLiquidityTiersResponse = { + typeUrl: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersResponse", + encode(message: QueryAllLiquidityTiersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.liquidityTiers) { + LiquidityTier.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllLiquidityTiersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllLiquidityTiersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidityTiers.push(LiquidityTier.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllLiquidityTiersResponse { + const message = createBaseQueryAllLiquidityTiersResponse(); + message.liquidityTiers = object.liquidityTiers?.map(e => LiquidityTier.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllLiquidityTiersResponseAmino): QueryAllLiquidityTiersResponse { + const message = createBaseQueryAllLiquidityTiersResponse(); + message.liquidityTiers = object.liquidity_tiers?.map(e => LiquidityTier.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllLiquidityTiersResponse): QueryAllLiquidityTiersResponseAmino { + const obj: any = {}; + if (message.liquidityTiers) { + obj.liquidity_tiers = message.liquidityTiers.map(e => e ? LiquidityTier.toAmino(e) : undefined); + } else { + obj.liquidity_tiers = message.liquidityTiers; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllLiquidityTiersResponseAminoMsg): QueryAllLiquidityTiersResponse { + return QueryAllLiquidityTiersResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllLiquidityTiersResponseProtoMsg): QueryAllLiquidityTiersResponse { + return QueryAllLiquidityTiersResponse.decode(message.value); + }, + toProto(message: QueryAllLiquidityTiersResponse): Uint8Array { + return QueryAllLiquidityTiersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllLiquidityTiersResponse): QueryAllLiquidityTiersResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryAllLiquidityTiersResponse", + value: QueryAllLiquidityTiersResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPremiumVotesRequest(): QueryPremiumVotesRequest { + return {}; +} +export const QueryPremiumVotesRequest = { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumVotesRequest", + encode(_: QueryPremiumVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPremiumVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumVotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryPremiumVotesRequest { + const message = createBaseQueryPremiumVotesRequest(); + return message; + }, + fromAmino(_: QueryPremiumVotesRequestAmino): QueryPremiumVotesRequest { + const message = createBaseQueryPremiumVotesRequest(); + return message; + }, + toAmino(_: QueryPremiumVotesRequest): QueryPremiumVotesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPremiumVotesRequestAminoMsg): QueryPremiumVotesRequest { + return QueryPremiumVotesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPremiumVotesRequestProtoMsg): QueryPremiumVotesRequest { + return QueryPremiumVotesRequest.decode(message.value); + }, + toProto(message: QueryPremiumVotesRequest): Uint8Array { + return QueryPremiumVotesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPremiumVotesRequest): QueryPremiumVotesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumVotesRequest", + value: QueryPremiumVotesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPremiumVotesResponse(): QueryPremiumVotesResponse { + return { + premiumVotes: PremiumStore.fromPartial({}) + }; +} +export const QueryPremiumVotesResponse = { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumVotesResponse", + encode(message: QueryPremiumVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.premiumVotes !== undefined) { + PremiumStore.encode(message.premiumVotes, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPremiumVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.premiumVotes = PremiumStore.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPremiumVotesResponse { + const message = createBaseQueryPremiumVotesResponse(); + message.premiumVotes = object.premiumVotes !== undefined && object.premiumVotes !== null ? PremiumStore.fromPartial(object.premiumVotes) : undefined; + return message; + }, + fromAmino(object: QueryPremiumVotesResponseAmino): QueryPremiumVotesResponse { + const message = createBaseQueryPremiumVotesResponse(); + if (object.premium_votes !== undefined && object.premium_votes !== null) { + message.premiumVotes = PremiumStore.fromAmino(object.premium_votes); + } + return message; + }, + toAmino(message: QueryPremiumVotesResponse): QueryPremiumVotesResponseAmino { + const obj: any = {}; + obj.premium_votes = message.premiumVotes ? PremiumStore.toAmino(message.premiumVotes) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPremiumVotesResponseAminoMsg): QueryPremiumVotesResponse { + return QueryPremiumVotesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPremiumVotesResponseProtoMsg): QueryPremiumVotesResponse { + return QueryPremiumVotesResponse.decode(message.value); + }, + toProto(message: QueryPremiumVotesResponse): Uint8Array { + return QueryPremiumVotesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPremiumVotesResponse): QueryPremiumVotesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumVotesResponse", + value: QueryPremiumVotesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPremiumSamplesRequest(): QueryPremiumSamplesRequest { + return {}; +} +export const QueryPremiumSamplesRequest = { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumSamplesRequest", + encode(_: QueryPremiumSamplesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPremiumSamplesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumSamplesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryPremiumSamplesRequest { + const message = createBaseQueryPremiumSamplesRequest(); + return message; + }, + fromAmino(_: QueryPremiumSamplesRequestAmino): QueryPremiumSamplesRequest { + const message = createBaseQueryPremiumSamplesRequest(); + return message; + }, + toAmino(_: QueryPremiumSamplesRequest): QueryPremiumSamplesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPremiumSamplesRequestAminoMsg): QueryPremiumSamplesRequest { + return QueryPremiumSamplesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPremiumSamplesRequestProtoMsg): QueryPremiumSamplesRequest { + return QueryPremiumSamplesRequest.decode(message.value); + }, + toProto(message: QueryPremiumSamplesRequest): Uint8Array { + return QueryPremiumSamplesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPremiumSamplesRequest): QueryPremiumSamplesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumSamplesRequest", + value: QueryPremiumSamplesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPremiumSamplesResponse(): QueryPremiumSamplesResponse { + return { + premiumSamples: PremiumStore.fromPartial({}) + }; +} +export const QueryPremiumSamplesResponse = { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumSamplesResponse", + encode(message: QueryPremiumSamplesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.premiumSamples !== undefined) { + PremiumStore.encode(message.premiumSamples, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPremiumSamplesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumSamplesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.premiumSamples = PremiumStore.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPremiumSamplesResponse { + const message = createBaseQueryPremiumSamplesResponse(); + message.premiumSamples = object.premiumSamples !== undefined && object.premiumSamples !== null ? PremiumStore.fromPartial(object.premiumSamples) : undefined; + return message; + }, + fromAmino(object: QueryPremiumSamplesResponseAmino): QueryPremiumSamplesResponse { + const message = createBaseQueryPremiumSamplesResponse(); + if (object.premium_samples !== undefined && object.premium_samples !== null) { + message.premiumSamples = PremiumStore.fromAmino(object.premium_samples); + } + return message; + }, + toAmino(message: QueryPremiumSamplesResponse): QueryPremiumSamplesResponseAmino { + const obj: any = {}; + obj.premium_samples = message.premiumSamples ? PremiumStore.toAmino(message.premiumSamples) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPremiumSamplesResponseAminoMsg): QueryPremiumSamplesResponse { + return QueryPremiumSamplesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPremiumSamplesResponseProtoMsg): QueryPremiumSamplesResponse { + return QueryPremiumSamplesResponse.decode(message.value); + }, + toProto(message: QueryPremiumSamplesResponse): Uint8Array { + return QueryPremiumSamplesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPremiumSamplesResponse): QueryPremiumSamplesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryPremiumSamplesResponse", + value: QueryPremiumSamplesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/dydxprotocol.perpetuals.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/dydxprotocol.perpetuals.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.amino.ts new file mode 100644 index 00000000..4fa5da30 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.amino.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { MsgAddPremiumVotes, MsgCreatePerpetual, MsgSetLiquidityTier, MsgUpdatePerpetualParams, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.perpetuals.MsgAddPremiumVotes": { + aminoType: "/dydxprotocol.perpetuals.MsgAddPremiumVotes", + toAmino: MsgAddPremiumVotes.toAmino, + fromAmino: MsgAddPremiumVotes.fromAmino + }, + "/dydxprotocol.perpetuals.MsgCreatePerpetual": { + aminoType: "/dydxprotocol.perpetuals.MsgCreatePerpetual", + toAmino: MsgCreatePerpetual.toAmino, + fromAmino: MsgCreatePerpetual.fromAmino + }, + "/dydxprotocol.perpetuals.MsgSetLiquidityTier": { + aminoType: "/dydxprotocol.perpetuals.MsgSetLiquidityTier", + toAmino: MsgSetLiquidityTier.toAmino, + fromAmino: MsgSetLiquidityTier.fromAmino + }, + "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams": { + aminoType: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams", + toAmino: MsgUpdatePerpetualParams.toAmino, + fromAmino: MsgUpdatePerpetualParams.fromAmino + }, + "/dydxprotocol.perpetuals.MsgUpdateParams": { + aminoType: "/dydxprotocol.perpetuals.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.registry.ts new file mode 100644 index 00000000..982c4823 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.registry.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAddPremiumVotes, MsgCreatePerpetual, MsgSetLiquidityTier, MsgUpdatePerpetualParams, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.perpetuals.MsgAddPremiumVotes", MsgAddPremiumVotes], ["/dydxprotocol.perpetuals.MsgCreatePerpetual", MsgCreatePerpetual], ["/dydxprotocol.perpetuals.MsgSetLiquidityTier", MsgSetLiquidityTier], ["/dydxprotocol.perpetuals.MsgUpdatePerpetualParams", MsgUpdatePerpetualParams], ["/dydxprotocol.perpetuals.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + addPremiumVotes(value: MsgAddPremiumVotes) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotes", + value: MsgAddPremiumVotes.encode(value).finish() + }; + }, + createPerpetual(value: MsgCreatePerpetual) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetual", + value: MsgCreatePerpetual.encode(value).finish() + }; + }, + setLiquidityTier(value: MsgSetLiquidityTier) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTier", + value: MsgSetLiquidityTier.encode(value).finish() + }; + }, + updatePerpetualParams(value: MsgUpdatePerpetualParams) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams", + value: MsgUpdatePerpetualParams.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + addPremiumVotes(value: MsgAddPremiumVotes) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotes", + value + }; + }, + createPerpetual(value: MsgCreatePerpetual) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetual", + value + }; + }, + setLiquidityTier(value: MsgSetLiquidityTier) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTier", + value + }; + }, + updatePerpetualParams(value: MsgUpdatePerpetualParams) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + addPremiumVotes(value: MsgAddPremiumVotes) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotes", + value: MsgAddPremiumVotes.fromPartial(value) + }; + }, + createPerpetual(value: MsgCreatePerpetual) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetual", + value: MsgCreatePerpetual.fromPartial(value) + }; + }, + setLiquidityTier(value: MsgSetLiquidityTier) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTier", + value: MsgSetLiquidityTier.fromPartial(value) + }; + }, + updatePerpetualParams(value: MsgUpdatePerpetualParams) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams", + value: MsgUpdatePerpetualParams.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.rpc.msg.ts new file mode 100644 index 00000000..8ed7c864 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.rpc.msg.ts @@ -0,0 +1,59 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgAddPremiumVotes, MsgAddPremiumVotesResponse, MsgCreatePerpetual, MsgCreatePerpetualResponse, MsgSetLiquidityTier, MsgSetLiquidityTierResponse, MsgUpdatePerpetualParams, MsgUpdatePerpetualParamsResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * AddPremiumVotes add new samples of the funding premiums to the + * application. + */ + addPremiumVotes(request: MsgAddPremiumVotes): Promise; + /** CreatePerpetual creates a new perpetual object. */ + createPerpetual(request: MsgCreatePerpetual): Promise; + /** + * SetLiquidityTier creates an liquidity tier if the ID doesn't exist, and + * updates the existing liquidity tier otherwise. + */ + setLiquidityTier(request: MsgSetLiquidityTier): Promise; + /** UpdatePerpetualParams updates the parameters of a perpetual market. */ + updatePerpetualParams(request: MsgUpdatePerpetualParams): Promise; + /** UpdateParams updates the parameters of perpetuals module. */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.addPremiumVotes = this.addPremiumVotes.bind(this); + this.createPerpetual = this.createPerpetual.bind(this); + this.setLiquidityTier = this.setLiquidityTier.bind(this); + this.updatePerpetualParams = this.updatePerpetualParams.bind(this); + this.updateParams = this.updateParams.bind(this); + } + addPremiumVotes(request: MsgAddPremiumVotes): Promise { + const data = MsgAddPremiumVotes.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Msg", "AddPremiumVotes", data); + return promise.then(data => MsgAddPremiumVotesResponse.decode(new BinaryReader(data))); + } + createPerpetual(request: MsgCreatePerpetual): Promise { + const data = MsgCreatePerpetual.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Msg", "CreatePerpetual", data); + return promise.then(data => MsgCreatePerpetualResponse.decode(new BinaryReader(data))); + } + setLiquidityTier(request: MsgSetLiquidityTier): Promise { + const data = MsgSetLiquidityTier.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Msg", "SetLiquidityTier", data); + return promise.then(data => MsgSetLiquidityTierResponse.decode(new BinaryReader(data))); + } + updatePerpetualParams(request: MsgUpdatePerpetualParams): Promise { + const data = MsgUpdatePerpetualParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Msg", "UpdatePerpetualParams", data); + return promise.then(data => MsgUpdatePerpetualParamsResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.ts new file mode 100644 index 00000000..08f1c282 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/perpetuals/tx.ts @@ -0,0 +1,978 @@ +//@ts-nocheck +import { PerpetualParams, PerpetualParamsAmino, PerpetualParamsSDKType, LiquidityTier, LiquidityTierAmino, LiquidityTierSDKType } from "./perpetual"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgCreatePerpetual is a message used by x/gov to create a new perpetual. */ +export interface MsgCreatePerpetual { + /** The address that controls the module. */ + authority: string; + /** `params` defines parameters for the new perpetual market. */ + params: PerpetualParams; +} +export interface MsgCreatePerpetualProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetual"; + value: Uint8Array; +} +/** MsgCreatePerpetual is a message used by x/gov to create a new perpetual. */ +export interface MsgCreatePerpetualAmino { + /** The address that controls the module. */ + authority?: string; + /** `params` defines parameters for the new perpetual market. */ + params?: PerpetualParamsAmino; +} +export interface MsgCreatePerpetualAminoMsg { + type: "/dydxprotocol.perpetuals.MsgCreatePerpetual"; + value: MsgCreatePerpetualAmino; +} +/** MsgCreatePerpetual is a message used by x/gov to create a new perpetual. */ +export interface MsgCreatePerpetualSDKType { + authority: string; + params: PerpetualParamsSDKType; +} +/** + * MsgCreatePerpetualResponse defines the CreatePerpetual + * response type. + */ +export interface MsgCreatePerpetualResponse {} +export interface MsgCreatePerpetualResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetualResponse"; + value: Uint8Array; +} +/** + * MsgCreatePerpetualResponse defines the CreatePerpetual + * response type. + */ +export interface MsgCreatePerpetualResponseAmino {} +export interface MsgCreatePerpetualResponseAminoMsg { + type: "/dydxprotocol.perpetuals.MsgCreatePerpetualResponse"; + value: MsgCreatePerpetualResponseAmino; +} +/** + * MsgCreatePerpetualResponse defines the CreatePerpetual + * response type. + */ +export interface MsgCreatePerpetualResponseSDKType {} +/** + * MsgSetLiquidityTier is a message used by x/gov to create or update a + * liquidity tier. + */ +export interface MsgSetLiquidityTier { + /** The address that controls the module. */ + authority: string; + /** The liquidity tier to create or update. */ + liquidityTier: LiquidityTier; +} +export interface MsgSetLiquidityTierProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTier"; + value: Uint8Array; +} +/** + * MsgSetLiquidityTier is a message used by x/gov to create or update a + * liquidity tier. + */ +export interface MsgSetLiquidityTierAmino { + /** The address that controls the module. */ + authority?: string; + /** The liquidity tier to create or update. */ + liquidity_tier?: LiquidityTierAmino; +} +export interface MsgSetLiquidityTierAminoMsg { + type: "/dydxprotocol.perpetuals.MsgSetLiquidityTier"; + value: MsgSetLiquidityTierAmino; +} +/** + * MsgSetLiquidityTier is a message used by x/gov to create or update a + * liquidity tier. + */ +export interface MsgSetLiquidityTierSDKType { + authority: string; + liquidity_tier: LiquidityTierSDKType; +} +/** MsgSetLiquidityTierResponse defines the SetLiquidityTier response type. */ +export interface MsgSetLiquidityTierResponse {} +export interface MsgSetLiquidityTierResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTierResponse"; + value: Uint8Array; +} +/** MsgSetLiquidityTierResponse defines the SetLiquidityTier response type. */ +export interface MsgSetLiquidityTierResponseAmino {} +export interface MsgSetLiquidityTierResponseAminoMsg { + type: "/dydxprotocol.perpetuals.MsgSetLiquidityTierResponse"; + value: MsgSetLiquidityTierResponseAmino; +} +/** MsgSetLiquidityTierResponse defines the SetLiquidityTier response type. */ +export interface MsgSetLiquidityTierResponseSDKType {} +/** + * MsgUpdatePerpetualParams is a message used by x/gov to update the parameters + * of a perpetual. + */ +export interface MsgUpdatePerpetualParams { + authority: string; + /** The perpetual to update. Each field must be set. */ + perpetualParams: PerpetualParams; +} +export interface MsgUpdatePerpetualParamsProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams"; + value: Uint8Array; +} +/** + * MsgUpdatePerpetualParams is a message used by x/gov to update the parameters + * of a perpetual. + */ +export interface MsgUpdatePerpetualParamsAmino { + authority?: string; + /** The perpetual to update. Each field must be set. */ + perpetual_params?: PerpetualParamsAmino; +} +export interface MsgUpdatePerpetualParamsAminoMsg { + type: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams"; + value: MsgUpdatePerpetualParamsAmino; +} +/** + * MsgUpdatePerpetualParams is a message used by x/gov to update the parameters + * of a perpetual. + */ +export interface MsgUpdatePerpetualParamsSDKType { + authority: string; + perpetual_params: PerpetualParamsSDKType; +} +/** + * MsgUpdatePerpetualParamsResponse defines the UpdatePerpetualParams + * response type. + */ +export interface MsgUpdatePerpetualParamsResponse {} +export interface MsgUpdatePerpetualParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdatePerpetualParamsResponse defines the UpdatePerpetualParams + * response type. + */ +export interface MsgUpdatePerpetualParamsResponseAmino {} +export interface MsgUpdatePerpetualParamsResponseAminoMsg { + type: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParamsResponse"; + value: MsgUpdatePerpetualParamsResponseAmino; +} +/** + * MsgUpdatePerpetualParamsResponse defines the UpdatePerpetualParams + * response type. + */ +export interface MsgUpdatePerpetualParamsResponseSDKType {} +/** + * FundingPremium represents a funding premium value for a perpetual + * market. Can be used to represent a premium vote or a premium sample. + */ +export interface FundingPremium { + /** The id of the perpetual market. */ + perpetualId: number; + /** The sampled premium rate. In parts-per-million. */ + premiumPpm: number; +} +export interface FundingPremiumProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.FundingPremium"; + value: Uint8Array; +} +/** + * FundingPremium represents a funding premium value for a perpetual + * market. Can be used to represent a premium vote or a premium sample. + */ +export interface FundingPremiumAmino { + /** The id of the perpetual market. */ + perpetual_id?: number; + /** The sampled premium rate. In parts-per-million. */ + premium_ppm?: number; +} +export interface FundingPremiumAminoMsg { + type: "/dydxprotocol.perpetuals.FundingPremium"; + value: FundingPremiumAmino; +} +/** + * FundingPremium represents a funding premium value for a perpetual + * market. Can be used to represent a premium vote or a premium sample. + */ +export interface FundingPremiumSDKType { + perpetual_id: number; + premium_ppm: number; +} +/** MsgAddPremiumVotes is a request type for the AddPremiumVotes method. */ +export interface MsgAddPremiumVotes { + votes: FundingPremium[]; +} +export interface MsgAddPremiumVotesProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotes"; + value: Uint8Array; +} +/** MsgAddPremiumVotes is a request type for the AddPremiumVotes method. */ +export interface MsgAddPremiumVotesAmino { + votes?: FundingPremiumAmino[]; +} +export interface MsgAddPremiumVotesAminoMsg { + type: "/dydxprotocol.perpetuals.MsgAddPremiumVotes"; + value: MsgAddPremiumVotesAmino; +} +/** MsgAddPremiumVotes is a request type for the AddPremiumVotes method. */ +export interface MsgAddPremiumVotesSDKType { + votes: FundingPremiumSDKType[]; +} +/** + * MsgAddPremiumVotesResponse defines the AddPremiumVotes + * response type. + */ +export interface MsgAddPremiumVotesResponse {} +export interface MsgAddPremiumVotesResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotesResponse"; + value: Uint8Array; +} +/** + * MsgAddPremiumVotesResponse defines the AddPremiumVotes + * response type. + */ +export interface MsgAddPremiumVotesResponseAmino {} +export interface MsgAddPremiumVotesResponseAminoMsg { + type: "/dydxprotocol.perpetuals.MsgAddPremiumVotesResponse"; + value: MsgAddPremiumVotesResponseAmino; +} +/** + * MsgAddPremiumVotesResponse defines the AddPremiumVotes + * response type. + */ +export interface MsgAddPremiumVotesResponseSDKType {} +/** + * MsgUpdateParams is a message used by x/gov to update the parameters of the + * perpetuals module. + */ +export interface MsgUpdateParams { + authority: string; + /** The parameters to update. Each field must be set. */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is a message used by x/gov to update the parameters of the + * perpetuals module. + */ +export interface MsgUpdateParamsAmino { + authority?: string; + /** The parameters to update. Each field must be set. */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "/dydxprotocol.perpetuals.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is a message used by x/gov to update the parameters of the + * perpetuals module. + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the UpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the UpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/dydxprotocol.perpetuals.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the UpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgCreatePerpetual(): MsgCreatePerpetual { + return { + authority: "", + params: PerpetualParams.fromPartial({}) + }; +} +export const MsgCreatePerpetual = { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetual", + encode(message: MsgCreatePerpetual, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + PerpetualParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePerpetual { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePerpetual(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = PerpetualParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreatePerpetual { + const message = createBaseMsgCreatePerpetual(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? PerpetualParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgCreatePerpetualAmino): MsgCreatePerpetual { + const message = createBaseMsgCreatePerpetual(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = PerpetualParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgCreatePerpetual): MsgCreatePerpetualAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? PerpetualParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreatePerpetualAminoMsg): MsgCreatePerpetual { + return MsgCreatePerpetual.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreatePerpetualProtoMsg): MsgCreatePerpetual { + return MsgCreatePerpetual.decode(message.value); + }, + toProto(message: MsgCreatePerpetual): Uint8Array { + return MsgCreatePerpetual.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePerpetual): MsgCreatePerpetualProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetual", + value: MsgCreatePerpetual.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePerpetualResponse(): MsgCreatePerpetualResponse { + return {}; +} +export const MsgCreatePerpetualResponse = { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetualResponse", + encode(_: MsgCreatePerpetualResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePerpetualResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePerpetualResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreatePerpetualResponse { + const message = createBaseMsgCreatePerpetualResponse(); + return message; + }, + fromAmino(_: MsgCreatePerpetualResponseAmino): MsgCreatePerpetualResponse { + const message = createBaseMsgCreatePerpetualResponse(); + return message; + }, + toAmino(_: MsgCreatePerpetualResponse): MsgCreatePerpetualResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreatePerpetualResponseAminoMsg): MsgCreatePerpetualResponse { + return MsgCreatePerpetualResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreatePerpetualResponseProtoMsg): MsgCreatePerpetualResponse { + return MsgCreatePerpetualResponse.decode(message.value); + }, + toProto(message: MsgCreatePerpetualResponse): Uint8Array { + return MsgCreatePerpetualResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePerpetualResponse): MsgCreatePerpetualResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgCreatePerpetualResponse", + value: MsgCreatePerpetualResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetLiquidityTier(): MsgSetLiquidityTier { + return { + authority: "", + liquidityTier: LiquidityTier.fromPartial({}) + }; +} +export const MsgSetLiquidityTier = { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTier", + encode(message: MsgSetLiquidityTier, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.liquidityTier !== undefined) { + LiquidityTier.encode(message.liquidityTier, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetLiquidityTier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLiquidityTier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.liquidityTier = LiquidityTier.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetLiquidityTier { + const message = createBaseMsgSetLiquidityTier(); + message.authority = object.authority ?? ""; + message.liquidityTier = object.liquidityTier !== undefined && object.liquidityTier !== null ? LiquidityTier.fromPartial(object.liquidityTier) : undefined; + return message; + }, + fromAmino(object: MsgSetLiquidityTierAmino): MsgSetLiquidityTier { + const message = createBaseMsgSetLiquidityTier(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.liquidity_tier !== undefined && object.liquidity_tier !== null) { + message.liquidityTier = LiquidityTier.fromAmino(object.liquidity_tier); + } + return message; + }, + toAmino(message: MsgSetLiquidityTier): MsgSetLiquidityTierAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.liquidity_tier = message.liquidityTier ? LiquidityTier.toAmino(message.liquidityTier) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetLiquidityTierAminoMsg): MsgSetLiquidityTier { + return MsgSetLiquidityTier.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetLiquidityTierProtoMsg): MsgSetLiquidityTier { + return MsgSetLiquidityTier.decode(message.value); + }, + toProto(message: MsgSetLiquidityTier): Uint8Array { + return MsgSetLiquidityTier.encode(message).finish(); + }, + toProtoMsg(message: MsgSetLiquidityTier): MsgSetLiquidityTierProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTier", + value: MsgSetLiquidityTier.encode(message).finish() + }; + } +}; +function createBaseMsgSetLiquidityTierResponse(): MsgSetLiquidityTierResponse { + return {}; +} +export const MsgSetLiquidityTierResponse = { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTierResponse", + encode(_: MsgSetLiquidityTierResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetLiquidityTierResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLiquidityTierResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetLiquidityTierResponse { + const message = createBaseMsgSetLiquidityTierResponse(); + return message; + }, + fromAmino(_: MsgSetLiquidityTierResponseAmino): MsgSetLiquidityTierResponse { + const message = createBaseMsgSetLiquidityTierResponse(); + return message; + }, + toAmino(_: MsgSetLiquidityTierResponse): MsgSetLiquidityTierResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetLiquidityTierResponseAminoMsg): MsgSetLiquidityTierResponse { + return MsgSetLiquidityTierResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetLiquidityTierResponseProtoMsg): MsgSetLiquidityTierResponse { + return MsgSetLiquidityTierResponse.decode(message.value); + }, + toProto(message: MsgSetLiquidityTierResponse): Uint8Array { + return MsgSetLiquidityTierResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetLiquidityTierResponse): MsgSetLiquidityTierResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgSetLiquidityTierResponse", + value: MsgSetLiquidityTierResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdatePerpetualParams(): MsgUpdatePerpetualParams { + return { + authority: "", + perpetualParams: PerpetualParams.fromPartial({}) + }; +} +export const MsgUpdatePerpetualParams = { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams", + encode(message: MsgUpdatePerpetualParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.perpetualParams !== undefined) { + PerpetualParams.encode(message.perpetualParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdatePerpetualParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePerpetualParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.perpetualParams = PerpetualParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdatePerpetualParams { + const message = createBaseMsgUpdatePerpetualParams(); + message.authority = object.authority ?? ""; + message.perpetualParams = object.perpetualParams !== undefined && object.perpetualParams !== null ? PerpetualParams.fromPartial(object.perpetualParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdatePerpetualParamsAmino): MsgUpdatePerpetualParams { + const message = createBaseMsgUpdatePerpetualParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.perpetual_params !== undefined && object.perpetual_params !== null) { + message.perpetualParams = PerpetualParams.fromAmino(object.perpetual_params); + } + return message; + }, + toAmino(message: MsgUpdatePerpetualParams): MsgUpdatePerpetualParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.perpetual_params = message.perpetualParams ? PerpetualParams.toAmino(message.perpetualParams) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdatePerpetualParamsAminoMsg): MsgUpdatePerpetualParams { + return MsgUpdatePerpetualParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdatePerpetualParamsProtoMsg): MsgUpdatePerpetualParams { + return MsgUpdatePerpetualParams.decode(message.value); + }, + toProto(message: MsgUpdatePerpetualParams): Uint8Array { + return MsgUpdatePerpetualParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdatePerpetualParams): MsgUpdatePerpetualParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParams", + value: MsgUpdatePerpetualParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdatePerpetualParamsResponse(): MsgUpdatePerpetualParamsResponse { + return {}; +} +export const MsgUpdatePerpetualParamsResponse = { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParamsResponse", + encode(_: MsgUpdatePerpetualParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdatePerpetualParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePerpetualParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdatePerpetualParamsResponse { + const message = createBaseMsgUpdatePerpetualParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdatePerpetualParamsResponseAmino): MsgUpdatePerpetualParamsResponse { + const message = createBaseMsgUpdatePerpetualParamsResponse(); + return message; + }, + toAmino(_: MsgUpdatePerpetualParamsResponse): MsgUpdatePerpetualParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdatePerpetualParamsResponseAminoMsg): MsgUpdatePerpetualParamsResponse { + return MsgUpdatePerpetualParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdatePerpetualParamsResponseProtoMsg): MsgUpdatePerpetualParamsResponse { + return MsgUpdatePerpetualParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdatePerpetualParamsResponse): Uint8Array { + return MsgUpdatePerpetualParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdatePerpetualParamsResponse): MsgUpdatePerpetualParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdatePerpetualParamsResponse", + value: MsgUpdatePerpetualParamsResponse.encode(message).finish() + }; + } +}; +function createBaseFundingPremium(): FundingPremium { + return { + perpetualId: 0, + premiumPpm: 0 + }; +} +export const FundingPremium = { + typeUrl: "/dydxprotocol.perpetuals.FundingPremium", + encode(message: FundingPremium, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (message.premiumPpm !== 0) { + writer.uint32(16).int32(message.premiumPpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FundingPremium { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFundingPremium(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.premiumPpm = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FundingPremium { + const message = createBaseFundingPremium(); + message.perpetualId = object.perpetualId ?? 0; + message.premiumPpm = object.premiumPpm ?? 0; + return message; + }, + fromAmino(object: FundingPremiumAmino): FundingPremium { + const message = createBaseFundingPremium(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.premium_ppm !== undefined && object.premium_ppm !== null) { + message.premiumPpm = object.premium_ppm; + } + return message; + }, + toAmino(message: FundingPremium): FundingPremiumAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.premium_ppm = message.premiumPpm === 0 ? undefined : message.premiumPpm; + return obj; + }, + fromAminoMsg(object: FundingPremiumAminoMsg): FundingPremium { + return FundingPremium.fromAmino(object.value); + }, + fromProtoMsg(message: FundingPremiumProtoMsg): FundingPremium { + return FundingPremium.decode(message.value); + }, + toProto(message: FundingPremium): Uint8Array { + return FundingPremium.encode(message).finish(); + }, + toProtoMsg(message: FundingPremium): FundingPremiumProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.FundingPremium", + value: FundingPremium.encode(message).finish() + }; + } +}; +function createBaseMsgAddPremiumVotes(): MsgAddPremiumVotes { + return { + votes: [] + }; +} +export const MsgAddPremiumVotes = { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotes", + encode(message: MsgAddPremiumVotes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + FundingPremium.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddPremiumVotes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddPremiumVotes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(FundingPremium.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddPremiumVotes { + const message = createBaseMsgAddPremiumVotes(); + message.votes = object.votes?.map(e => FundingPremium.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgAddPremiumVotesAmino): MsgAddPremiumVotes { + const message = createBaseMsgAddPremiumVotes(); + message.votes = object.votes?.map(e => FundingPremium.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgAddPremiumVotes): MsgAddPremiumVotesAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? FundingPremium.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: MsgAddPremiumVotesAminoMsg): MsgAddPremiumVotes { + return MsgAddPremiumVotes.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddPremiumVotesProtoMsg): MsgAddPremiumVotes { + return MsgAddPremiumVotes.decode(message.value); + }, + toProto(message: MsgAddPremiumVotes): Uint8Array { + return MsgAddPremiumVotes.encode(message).finish(); + }, + toProtoMsg(message: MsgAddPremiumVotes): MsgAddPremiumVotesProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotes", + value: MsgAddPremiumVotes.encode(message).finish() + }; + } +}; +function createBaseMsgAddPremiumVotesResponse(): MsgAddPremiumVotesResponse { + return {}; +} +export const MsgAddPremiumVotesResponse = { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotesResponse", + encode(_: MsgAddPremiumVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddPremiumVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddPremiumVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAddPremiumVotesResponse { + const message = createBaseMsgAddPremiumVotesResponse(); + return message; + }, + fromAmino(_: MsgAddPremiumVotesResponseAmino): MsgAddPremiumVotesResponse { + const message = createBaseMsgAddPremiumVotesResponse(); + return message; + }, + toAmino(_: MsgAddPremiumVotesResponse): MsgAddPremiumVotesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddPremiumVotesResponseAminoMsg): MsgAddPremiumVotesResponse { + return MsgAddPremiumVotesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddPremiumVotesResponseProtoMsg): MsgAddPremiumVotesResponse { + return MsgAddPremiumVotesResponse.decode(message.value); + }, + toProto(message: MsgAddPremiumVotesResponse): Uint8Array { + return MsgAddPremiumVotesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddPremiumVotesResponse): MsgAddPremiumVotesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgAddPremiumVotesResponse", + value: MsgAddPremiumVotesResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.perpetuals.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/genesis.ts new file mode 100644 index 00000000..158e27f8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/genesis.ts @@ -0,0 +1,106 @@ +//@ts-nocheck +import { MarketParam, MarketParamAmino, MarketParamSDKType } from "./market_param"; +import { MarketPrice, MarketPriceAmino, MarketPriceSDKType } from "./market_price"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the prices module's genesis state. */ +export interface GenesisState { + marketParams: MarketParam[]; + marketPrices: MarketPrice[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.prices.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the prices module's genesis state. */ +export interface GenesisStateAmino { + market_params?: MarketParamAmino[]; + market_prices?: MarketPriceAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.prices.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the prices module's genesis state. */ +export interface GenesisStateSDKType { + market_params: MarketParamSDKType[]; + market_prices: MarketPriceSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + marketParams: [], + marketPrices: [] + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.prices.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketParams) { + MarketParam.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.marketPrices) { + MarketPrice.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketParams.push(MarketParam.decode(reader, reader.uint32())); + break; + case 2: + message.marketPrices.push(MarketPrice.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.marketParams = object.marketParams?.map(e => MarketParam.fromPartial(e)) || []; + message.marketPrices = object.marketPrices?.map(e => MarketPrice.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.marketParams = object.market_params?.map(e => MarketParam.fromAmino(e)) || []; + message.marketPrices = object.market_prices?.map(e => MarketPrice.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.marketParams) { + obj.market_params = message.marketParams.map(e => e ? MarketParam.toAmino(e) : undefined); + } else { + obj.market_params = message.marketParams; + } + if (message.marketPrices) { + obj.market_prices = message.marketPrices.map(e => e ? MarketPrice.toAmino(e) : undefined); + } else { + obj.market_prices = message.marketPrices; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/market_param.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/market_param.ts new file mode 100644 index 00000000..7b939bad --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/market_param.ts @@ -0,0 +1,215 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * MarketParam represents the x/prices configuration for markets, including + * representing price values, resolving markets on individual exchanges, and + * generating price updates. This configuration is specific to the quote + * currency. + */ +export interface MarketParam { + /** Unique, sequentially-generated value. */ + id: number; + /** The human-readable name of the market pair (e.g. `BTC-USD`). */ + pair: string; + /** + * Static value. The exponent of the price. + * For example if `Exponent == -5` then a `Value` of `1,000,000,000` + * represents ``$10,000`. Therefore `10 ^ Exponent` represents the smallest + * price step (in dollars) that can be recorded. + */ + exponent: number; + /** + * The minimum number of exchanges that should be reporting a live price for + * a price update to be considered valid. + */ + minExchanges: number; + /** + * The minimum allowable change in `price` value that would cause a price + * update on the network. Measured as `1e-6` (parts per million). + */ + minPriceChangePpm: number; + /** + * A string of json that encodes the configuration for resolving the price + * of this market on various exchanges. + */ + exchangeConfigJson: string; +} +export interface MarketParamProtoMsg { + typeUrl: "/dydxprotocol.prices.MarketParam"; + value: Uint8Array; +} +/** + * MarketParam represents the x/prices configuration for markets, including + * representing price values, resolving markets on individual exchanges, and + * generating price updates. This configuration is specific to the quote + * currency. + */ +export interface MarketParamAmino { + /** Unique, sequentially-generated value. */ + id?: number; + /** The human-readable name of the market pair (e.g. `BTC-USD`). */ + pair?: string; + /** + * Static value. The exponent of the price. + * For example if `Exponent == -5` then a `Value` of `1,000,000,000` + * represents ``$10,000`. Therefore `10 ^ Exponent` represents the smallest + * price step (in dollars) that can be recorded. + */ + exponent?: number; + /** + * The minimum number of exchanges that should be reporting a live price for + * a price update to be considered valid. + */ + min_exchanges?: number; + /** + * The minimum allowable change in `price` value that would cause a price + * update on the network. Measured as `1e-6` (parts per million). + */ + min_price_change_ppm?: number; + /** + * A string of json that encodes the configuration for resolving the price + * of this market on various exchanges. + */ + exchange_config_json?: string; +} +export interface MarketParamAminoMsg { + type: "/dydxprotocol.prices.MarketParam"; + value: MarketParamAmino; +} +/** + * MarketParam represents the x/prices configuration for markets, including + * representing price values, resolving markets on individual exchanges, and + * generating price updates. This configuration is specific to the quote + * currency. + */ +export interface MarketParamSDKType { + id: number; + pair: string; + exponent: number; + min_exchanges: number; + min_price_change_ppm: number; + exchange_config_json: string; +} +function createBaseMarketParam(): MarketParam { + return { + id: 0, + pair: "", + exponent: 0, + minExchanges: 0, + minPriceChangePpm: 0, + exchangeConfigJson: "" + }; +} +export const MarketParam = { + typeUrl: "/dydxprotocol.prices.MarketParam", + encode(message: MarketParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.pair !== "") { + writer.uint32(18).string(message.pair); + } + if (message.exponent !== 0) { + writer.uint32(24).sint32(message.exponent); + } + if (message.minExchanges !== 0) { + writer.uint32(32).uint32(message.minExchanges); + } + if (message.minPriceChangePpm !== 0) { + writer.uint32(40).uint32(message.minPriceChangePpm); + } + if (message.exchangeConfigJson !== "") { + writer.uint32(50).string(message.exchangeConfigJson); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketParam { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.pair = reader.string(); + break; + case 3: + message.exponent = reader.sint32(); + break; + case 4: + message.minExchanges = reader.uint32(); + break; + case 5: + message.minPriceChangePpm = reader.uint32(); + break; + case 6: + message.exchangeConfigJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketParam { + const message = createBaseMarketParam(); + message.id = object.id ?? 0; + message.pair = object.pair ?? ""; + message.exponent = object.exponent ?? 0; + message.minExchanges = object.minExchanges ?? 0; + message.minPriceChangePpm = object.minPriceChangePpm ?? 0; + message.exchangeConfigJson = object.exchangeConfigJson ?? ""; + return message; + }, + fromAmino(object: MarketParamAmino): MarketParam { + const message = createBaseMarketParam(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.pair !== undefined && object.pair !== null) { + message.pair = object.pair; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + if (object.min_exchanges !== undefined && object.min_exchanges !== null) { + message.minExchanges = object.min_exchanges; + } + if (object.min_price_change_ppm !== undefined && object.min_price_change_ppm !== null) { + message.minPriceChangePpm = object.min_price_change_ppm; + } + if (object.exchange_config_json !== undefined && object.exchange_config_json !== null) { + message.exchangeConfigJson = object.exchange_config_json; + } + return message; + }, + toAmino(message: MarketParam): MarketParamAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.pair = message.pair === "" ? undefined : message.pair; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + obj.min_exchanges = message.minExchanges === 0 ? undefined : message.minExchanges; + obj.min_price_change_ppm = message.minPriceChangePpm === 0 ? undefined : message.minPriceChangePpm; + obj.exchange_config_json = message.exchangeConfigJson === "" ? undefined : message.exchangeConfigJson; + return obj; + }, + fromAminoMsg(object: MarketParamAminoMsg): MarketParam { + return MarketParam.fromAmino(object.value); + }, + fromProtoMsg(message: MarketParamProtoMsg): MarketParam { + return MarketParam.decode(message.value); + }, + toProto(message: MarketParam): Uint8Array { + return MarketParam.encode(message).finish(); + }, + toProtoMsg(message: MarketParam): MarketParamProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MarketParam", + value: MarketParam.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/market_price.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/market_price.ts new file mode 100644 index 00000000..94c7c2f0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/market_price.ts @@ -0,0 +1,133 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MarketPrice is used by the application to store/retrieve oracle price. */ +export interface MarketPrice { + /** Unique, sequentially-generated value that matches `MarketParam`. */ + id: number; + /** + * Static value. The exponent of the price. See the comment on the duplicate + * MarketParam field for more information. + */ + exponent: number; + /** + * The variable value that is updated by oracle price updates. `0` if it has + * never been updated, `>0` otherwise. + */ + price: bigint; +} +export interface MarketPriceProtoMsg { + typeUrl: "/dydxprotocol.prices.MarketPrice"; + value: Uint8Array; +} +/** MarketPrice is used by the application to store/retrieve oracle price. */ +export interface MarketPriceAmino { + /** Unique, sequentially-generated value that matches `MarketParam`. */ + id?: number; + /** + * Static value. The exponent of the price. See the comment on the duplicate + * MarketParam field for more information. + */ + exponent?: number; + /** + * The variable value that is updated by oracle price updates. `0` if it has + * never been updated, `>0` otherwise. + */ + price?: string; +} +export interface MarketPriceAminoMsg { + type: "/dydxprotocol.prices.MarketPrice"; + value: MarketPriceAmino; +} +/** MarketPrice is used by the application to store/retrieve oracle price. */ +export interface MarketPriceSDKType { + id: number; + exponent: number; + price: bigint; +} +function createBaseMarketPrice(): MarketPrice { + return { + id: 0, + exponent: 0, + price: BigInt(0) + }; +} +export const MarketPrice = { + typeUrl: "/dydxprotocol.prices.MarketPrice", + encode(message: MarketPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.exponent !== 0) { + writer.uint32(16).sint32(message.exponent); + } + if (message.price !== BigInt(0)) { + writer.uint32(24).uint64(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.exponent = reader.sint32(); + break; + case 3: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketPrice { + const message = createBaseMarketPrice(); + message.id = object.id ?? 0; + message.exponent = object.exponent ?? 0; + message.price = object.price !== undefined && object.price !== null ? BigInt(object.price.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MarketPriceAmino): MarketPrice { + const message = createBaseMarketPrice(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + if (object.price !== undefined && object.price !== null) { + message.price = BigInt(object.price); + } + return message; + }, + toAmino(message: MarketPrice): MarketPriceAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + obj.price = message.price !== BigInt(0) ? message.price.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MarketPriceAminoMsg): MarketPrice { + return MarketPrice.fromAmino(object.value); + }, + fromProtoMsg(message: MarketPriceProtoMsg): MarketPrice { + return MarketPrice.decode(message.value); + }, + toProto(message: MarketPrice): Uint8Array { + return MarketPrice.encode(message).finish(); + }, + toProtoMsg(message: MarketPrice): MarketPriceProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MarketPrice", + value: MarketPrice.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/query.rpc.Query.ts new file mode 100644 index 00000000..9bd257fd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/query.rpc.Query.ts @@ -0,0 +1,68 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryMarketPriceRequest, QueryMarketPriceResponse, QueryAllMarketPricesRequest, QueryAllMarketPricesResponse, QueryMarketParamRequest, QueryMarketParamResponse, QueryAllMarketParamsRequest, QueryAllMarketParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a MarketPrice by id. */ + marketPrice(request: QueryMarketPriceRequest): Promise; + /** Queries a list of MarketPrice items. */ + allMarketPrices(request?: QueryAllMarketPricesRequest): Promise; + /** Queries a MarketParam by id. */ + marketParam(request: QueryMarketParamRequest): Promise; + /** Queries a list of MarketParam items. */ + allMarketParams(request?: QueryAllMarketParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.marketPrice = this.marketPrice.bind(this); + this.allMarketPrices = this.allMarketPrices.bind(this); + this.marketParam = this.marketParam.bind(this); + this.allMarketParams = this.allMarketParams.bind(this); + } + marketPrice(request: QueryMarketPriceRequest): Promise { + const data = QueryMarketPriceRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Query", "MarketPrice", data); + return promise.then(data => QueryMarketPriceResponse.decode(new BinaryReader(data))); + } + allMarketPrices(request: QueryAllMarketPricesRequest = { + pagination: undefined + }): Promise { + const data = QueryAllMarketPricesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Query", "AllMarketPrices", data); + return promise.then(data => QueryAllMarketPricesResponse.decode(new BinaryReader(data))); + } + marketParam(request: QueryMarketParamRequest): Promise { + const data = QueryMarketParamRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Query", "MarketParam", data); + return promise.then(data => QueryMarketParamResponse.decode(new BinaryReader(data))); + } + allMarketParams(request: QueryAllMarketParamsRequest = { + pagination: undefined + }): Promise { + const data = QueryAllMarketParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Query", "AllMarketParams", data); + return promise.then(data => QueryAllMarketParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + marketPrice(request: QueryMarketPriceRequest): Promise { + return queryService.marketPrice(request); + }, + allMarketPrices(request?: QueryAllMarketPricesRequest): Promise { + return queryService.allMarketPrices(request); + }, + marketParam(request: QueryMarketParamRequest): Promise { + return queryService.marketParam(request); + }, + allMarketParams(request?: QueryAllMarketParamsRequest): Promise { + return queryService.allMarketParams(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/query.ts new file mode 100644 index 00000000..d3699ba6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/query.ts @@ -0,0 +1,775 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { MarketPrice, MarketPriceAmino, MarketPriceSDKType } from "./market_price"; +import { MarketParam, MarketParamAmino, MarketParamSDKType } from "./market_param"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * QueryMarketPriceRequest is request type for the Query/Params `MarketPrice` + * RPC method. + */ +export interface QueryMarketPriceRequest { + id: number; +} +export interface QueryMarketPriceRequestProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryMarketPriceRequest"; + value: Uint8Array; +} +/** + * QueryMarketPriceRequest is request type for the Query/Params `MarketPrice` + * RPC method. + */ +export interface QueryMarketPriceRequestAmino { + id?: number; +} +export interface QueryMarketPriceRequestAminoMsg { + type: "/dydxprotocol.prices.QueryMarketPriceRequest"; + value: QueryMarketPriceRequestAmino; +} +/** + * QueryMarketPriceRequest is request type for the Query/Params `MarketPrice` + * RPC method. + */ +export interface QueryMarketPriceRequestSDKType { + id: number; +} +/** + * QueryMarketPriceResponse is response type for the Query/Params `MarketPrice` + * RPC method. + */ +export interface QueryMarketPriceResponse { + marketPrice: MarketPrice; +} +export interface QueryMarketPriceResponseProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryMarketPriceResponse"; + value: Uint8Array; +} +/** + * QueryMarketPriceResponse is response type for the Query/Params `MarketPrice` + * RPC method. + */ +export interface QueryMarketPriceResponseAmino { + market_price?: MarketPriceAmino; +} +export interface QueryMarketPriceResponseAminoMsg { + type: "/dydxprotocol.prices.QueryMarketPriceResponse"; + value: QueryMarketPriceResponseAmino; +} +/** + * QueryMarketPriceResponse is response type for the Query/Params `MarketPrice` + * RPC method. + */ +export interface QueryMarketPriceResponseSDKType { + market_price: MarketPriceSDKType; +} +/** + * QueryAllMarketPricesRequest is request type for the Query/Params + * `AllMarketPrices` RPC method. + */ +export interface QueryAllMarketPricesRequest { + pagination?: PageRequest; +} +export interface QueryAllMarketPricesRequestProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryAllMarketPricesRequest"; + value: Uint8Array; +} +/** + * QueryAllMarketPricesRequest is request type for the Query/Params + * `AllMarketPrices` RPC method. + */ +export interface QueryAllMarketPricesRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllMarketPricesRequestAminoMsg { + type: "/dydxprotocol.prices.QueryAllMarketPricesRequest"; + value: QueryAllMarketPricesRequestAmino; +} +/** + * QueryAllMarketPricesRequest is request type for the Query/Params + * `AllMarketPrices` RPC method. + */ +export interface QueryAllMarketPricesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryAllMarketPricesResponse is response type for the Query/Params + * `AllMarketPrices` RPC method. + */ +export interface QueryAllMarketPricesResponse { + marketPrices: MarketPrice[]; + pagination?: PageResponse; +} +export interface QueryAllMarketPricesResponseProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryAllMarketPricesResponse"; + value: Uint8Array; +} +/** + * QueryAllMarketPricesResponse is response type for the Query/Params + * `AllMarketPrices` RPC method. + */ +export interface QueryAllMarketPricesResponseAmino { + market_prices?: MarketPriceAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryAllMarketPricesResponseAminoMsg { + type: "/dydxprotocol.prices.QueryAllMarketPricesResponse"; + value: QueryAllMarketPricesResponseAmino; +} +/** + * QueryAllMarketPricesResponse is response type for the Query/Params + * `AllMarketPrices` RPC method. + */ +export interface QueryAllMarketPricesResponseSDKType { + market_prices: MarketPriceSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryMarketParamsRequest is request type for the Query/Params `MarketParams` + * RPC method. + */ +export interface QueryMarketParamRequest { + id: number; +} +export interface QueryMarketParamRequestProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryMarketParamRequest"; + value: Uint8Array; +} +/** + * QueryMarketParamsRequest is request type for the Query/Params `MarketParams` + * RPC method. + */ +export interface QueryMarketParamRequestAmino { + id?: number; +} +export interface QueryMarketParamRequestAminoMsg { + type: "/dydxprotocol.prices.QueryMarketParamRequest"; + value: QueryMarketParamRequestAmino; +} +/** + * QueryMarketParamsRequest is request type for the Query/Params `MarketParams` + * RPC method. + */ +export interface QueryMarketParamRequestSDKType { + id: number; +} +/** + * QueryMarketParamResponse is response type for the Query/Params `MarketParams` + * RPC method. + */ +export interface QueryMarketParamResponse { + marketParam: MarketParam; +} +export interface QueryMarketParamResponseProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryMarketParamResponse"; + value: Uint8Array; +} +/** + * QueryMarketParamResponse is response type for the Query/Params `MarketParams` + * RPC method. + */ +export interface QueryMarketParamResponseAmino { + market_param?: MarketParamAmino; +} +export interface QueryMarketParamResponseAminoMsg { + type: "/dydxprotocol.prices.QueryMarketParamResponse"; + value: QueryMarketParamResponseAmino; +} +/** + * QueryMarketParamResponse is response type for the Query/Params `MarketParams` + * RPC method. + */ +export interface QueryMarketParamResponseSDKType { + market_param: MarketParamSDKType; +} +/** + * QueryAllMarketParamsRequest is request type for the Query/Params + * `AllMarketParams` RPC method. + */ +export interface QueryAllMarketParamsRequest { + pagination?: PageRequest; +} +export interface QueryAllMarketParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryAllMarketParamsRequest"; + value: Uint8Array; +} +/** + * QueryAllMarketParamsRequest is request type for the Query/Params + * `AllMarketParams` RPC method. + */ +export interface QueryAllMarketParamsRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllMarketParamsRequestAminoMsg { + type: "/dydxprotocol.prices.QueryAllMarketParamsRequest"; + value: QueryAllMarketParamsRequestAmino; +} +/** + * QueryAllMarketParamsRequest is request type for the Query/Params + * `AllMarketParams` RPC method. + */ +export interface QueryAllMarketParamsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryAllMarketParamsResponse is response type for the Query/Params + * `AllMarketParams` RPC method. + */ +export interface QueryAllMarketParamsResponse { + marketParams: MarketParam[]; + pagination?: PageResponse; +} +export interface QueryAllMarketParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.prices.QueryAllMarketParamsResponse"; + value: Uint8Array; +} +/** + * QueryAllMarketParamsResponse is response type for the Query/Params + * `AllMarketParams` RPC method. + */ +export interface QueryAllMarketParamsResponseAmino { + market_params?: MarketParamAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryAllMarketParamsResponseAminoMsg { + type: "/dydxprotocol.prices.QueryAllMarketParamsResponse"; + value: QueryAllMarketParamsResponseAmino; +} +/** + * QueryAllMarketParamsResponse is response type for the Query/Params + * `AllMarketParams` RPC method. + */ +export interface QueryAllMarketParamsResponseSDKType { + market_params: MarketParamSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryMarketPriceRequest(): QueryMarketPriceRequest { + return { + id: 0 + }; +} +export const QueryMarketPriceRequest = { + typeUrl: "/dydxprotocol.prices.QueryMarketPriceRequest", + encode(message: QueryMarketPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketPriceRequest { + const message = createBaseQueryMarketPriceRequest(); + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: QueryMarketPriceRequestAmino): QueryMarketPriceRequest { + const message = createBaseQueryMarketPriceRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryMarketPriceRequest): QueryMarketPriceRequestAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryMarketPriceRequestAminoMsg): QueryMarketPriceRequest { + return QueryMarketPriceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketPriceRequestProtoMsg): QueryMarketPriceRequest { + return QueryMarketPriceRequest.decode(message.value); + }, + toProto(message: QueryMarketPriceRequest): Uint8Array { + return QueryMarketPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketPriceRequest): QueryMarketPriceRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryMarketPriceRequest", + value: QueryMarketPriceRequest.encode(message).finish() + }; + } +}; +function createBaseQueryMarketPriceResponse(): QueryMarketPriceResponse { + return { + marketPrice: MarketPrice.fromPartial({}) + }; +} +export const QueryMarketPriceResponse = { + typeUrl: "/dydxprotocol.prices.QueryMarketPriceResponse", + encode(message: QueryMarketPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketPrice !== undefined) { + MarketPrice.encode(message.marketPrice, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketPrice = MarketPrice.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketPriceResponse { + const message = createBaseQueryMarketPriceResponse(); + message.marketPrice = object.marketPrice !== undefined && object.marketPrice !== null ? MarketPrice.fromPartial(object.marketPrice) : undefined; + return message; + }, + fromAmino(object: QueryMarketPriceResponseAmino): QueryMarketPriceResponse { + const message = createBaseQueryMarketPriceResponse(); + if (object.market_price !== undefined && object.market_price !== null) { + message.marketPrice = MarketPrice.fromAmino(object.market_price); + } + return message; + }, + toAmino(message: QueryMarketPriceResponse): QueryMarketPriceResponseAmino { + const obj: any = {}; + obj.market_price = message.marketPrice ? MarketPrice.toAmino(message.marketPrice) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMarketPriceResponseAminoMsg): QueryMarketPriceResponse { + return QueryMarketPriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketPriceResponseProtoMsg): QueryMarketPriceResponse { + return QueryMarketPriceResponse.decode(message.value); + }, + toProto(message: QueryMarketPriceResponse): Uint8Array { + return QueryMarketPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketPriceResponse): QueryMarketPriceResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryMarketPriceResponse", + value: QueryMarketPriceResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllMarketPricesRequest(): QueryAllMarketPricesRequest { + return { + pagination: undefined + }; +} +export const QueryAllMarketPricesRequest = { + typeUrl: "/dydxprotocol.prices.QueryAllMarketPricesRequest", + encode(message: QueryAllMarketPricesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllMarketPricesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllMarketPricesRequest { + const message = createBaseQueryAllMarketPricesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllMarketPricesRequestAmino): QueryAllMarketPricesRequest { + const message = createBaseQueryAllMarketPricesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllMarketPricesRequest): QueryAllMarketPricesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllMarketPricesRequestAminoMsg): QueryAllMarketPricesRequest { + return QueryAllMarketPricesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllMarketPricesRequestProtoMsg): QueryAllMarketPricesRequest { + return QueryAllMarketPricesRequest.decode(message.value); + }, + toProto(message: QueryAllMarketPricesRequest): Uint8Array { + return QueryAllMarketPricesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllMarketPricesRequest): QueryAllMarketPricesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryAllMarketPricesRequest", + value: QueryAllMarketPricesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllMarketPricesResponse(): QueryAllMarketPricesResponse { + return { + marketPrices: [], + pagination: undefined + }; +} +export const QueryAllMarketPricesResponse = { + typeUrl: "/dydxprotocol.prices.QueryAllMarketPricesResponse", + encode(message: QueryAllMarketPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketPrices) { + MarketPrice.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllMarketPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketPrices.push(MarketPrice.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllMarketPricesResponse { + const message = createBaseQueryAllMarketPricesResponse(); + message.marketPrices = object.marketPrices?.map(e => MarketPrice.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllMarketPricesResponseAmino): QueryAllMarketPricesResponse { + const message = createBaseQueryAllMarketPricesResponse(); + message.marketPrices = object.market_prices?.map(e => MarketPrice.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllMarketPricesResponse): QueryAllMarketPricesResponseAmino { + const obj: any = {}; + if (message.marketPrices) { + obj.market_prices = message.marketPrices.map(e => e ? MarketPrice.toAmino(e) : undefined); + } else { + obj.market_prices = message.marketPrices; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllMarketPricesResponseAminoMsg): QueryAllMarketPricesResponse { + return QueryAllMarketPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllMarketPricesResponseProtoMsg): QueryAllMarketPricesResponse { + return QueryAllMarketPricesResponse.decode(message.value); + }, + toProto(message: QueryAllMarketPricesResponse): Uint8Array { + return QueryAllMarketPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllMarketPricesResponse): QueryAllMarketPricesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryAllMarketPricesResponse", + value: QueryAllMarketPricesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryMarketParamRequest(): QueryMarketParamRequest { + return { + id: 0 + }; +} +export const QueryMarketParamRequest = { + typeUrl: "/dydxprotocol.prices.QueryMarketParamRequest", + encode(message: QueryMarketParamRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketParamRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketParamRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketParamRequest { + const message = createBaseQueryMarketParamRequest(); + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: QueryMarketParamRequestAmino): QueryMarketParamRequest { + const message = createBaseQueryMarketParamRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryMarketParamRequest): QueryMarketParamRequestAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryMarketParamRequestAminoMsg): QueryMarketParamRequest { + return QueryMarketParamRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketParamRequestProtoMsg): QueryMarketParamRequest { + return QueryMarketParamRequest.decode(message.value); + }, + toProto(message: QueryMarketParamRequest): Uint8Array { + return QueryMarketParamRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketParamRequest): QueryMarketParamRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryMarketParamRequest", + value: QueryMarketParamRequest.encode(message).finish() + }; + } +}; +function createBaseQueryMarketParamResponse(): QueryMarketParamResponse { + return { + marketParam: MarketParam.fromPartial({}) + }; +} +export const QueryMarketParamResponse = { + typeUrl: "/dydxprotocol.prices.QueryMarketParamResponse", + encode(message: QueryMarketParamResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketParam !== undefined) { + MarketParam.encode(message.marketParam, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketParamResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketParamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketParam = MarketParam.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketParamResponse { + const message = createBaseQueryMarketParamResponse(); + message.marketParam = object.marketParam !== undefined && object.marketParam !== null ? MarketParam.fromPartial(object.marketParam) : undefined; + return message; + }, + fromAmino(object: QueryMarketParamResponseAmino): QueryMarketParamResponse { + const message = createBaseQueryMarketParamResponse(); + if (object.market_param !== undefined && object.market_param !== null) { + message.marketParam = MarketParam.fromAmino(object.market_param); + } + return message; + }, + toAmino(message: QueryMarketParamResponse): QueryMarketParamResponseAmino { + const obj: any = {}; + obj.market_param = message.marketParam ? MarketParam.toAmino(message.marketParam) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMarketParamResponseAminoMsg): QueryMarketParamResponse { + return QueryMarketParamResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketParamResponseProtoMsg): QueryMarketParamResponse { + return QueryMarketParamResponse.decode(message.value); + }, + toProto(message: QueryMarketParamResponse): Uint8Array { + return QueryMarketParamResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketParamResponse): QueryMarketParamResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryMarketParamResponse", + value: QueryMarketParamResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllMarketParamsRequest(): QueryAllMarketParamsRequest { + return { + pagination: undefined + }; +} +export const QueryAllMarketParamsRequest = { + typeUrl: "/dydxprotocol.prices.QueryAllMarketParamsRequest", + encode(message: QueryAllMarketParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllMarketParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllMarketParamsRequest { + const message = createBaseQueryAllMarketParamsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllMarketParamsRequestAmino): QueryAllMarketParamsRequest { + const message = createBaseQueryAllMarketParamsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllMarketParamsRequest): QueryAllMarketParamsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllMarketParamsRequestAminoMsg): QueryAllMarketParamsRequest { + return QueryAllMarketParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllMarketParamsRequestProtoMsg): QueryAllMarketParamsRequest { + return QueryAllMarketParamsRequest.decode(message.value); + }, + toProto(message: QueryAllMarketParamsRequest): Uint8Array { + return QueryAllMarketParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllMarketParamsRequest): QueryAllMarketParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryAllMarketParamsRequest", + value: QueryAllMarketParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllMarketParamsResponse(): QueryAllMarketParamsResponse { + return { + marketParams: [], + pagination: undefined + }; +} +export const QueryAllMarketParamsResponse = { + typeUrl: "/dydxprotocol.prices.QueryAllMarketParamsResponse", + encode(message: QueryAllMarketParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketParams) { + MarketParam.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllMarketParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketParams.push(MarketParam.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllMarketParamsResponse { + const message = createBaseQueryAllMarketParamsResponse(); + message.marketParams = object.marketParams?.map(e => MarketParam.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllMarketParamsResponseAmino): QueryAllMarketParamsResponse { + const message = createBaseQueryAllMarketParamsResponse(); + message.marketParams = object.market_params?.map(e => MarketParam.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllMarketParamsResponse): QueryAllMarketParamsResponseAmino { + const obj: any = {}; + if (message.marketParams) { + obj.market_params = message.marketParams.map(e => e ? MarketParam.toAmino(e) : undefined); + } else { + obj.market_params = message.marketParams; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllMarketParamsResponseAminoMsg): QueryAllMarketParamsResponse { + return QueryAllMarketParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllMarketParamsResponseProtoMsg): QueryAllMarketParamsResponse { + return QueryAllMarketParamsResponse.decode(message.value); + }, + toProto(message: QueryAllMarketParamsResponse): Uint8Array { + return QueryAllMarketParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllMarketParamsResponse): QueryAllMarketParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.QueryAllMarketParamsResponse", + value: QueryAllMarketParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.amino.ts new file mode 100644 index 00000000..8995a5de --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgUpdateMarketPrices, MsgCreateOracleMarket, MsgUpdateMarketParam } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.prices.MsgUpdateMarketPrices": { + aminoType: "/dydxprotocol.prices.MsgUpdateMarketPrices", + toAmino: MsgUpdateMarketPrices.toAmino, + fromAmino: MsgUpdateMarketPrices.fromAmino + }, + "/dydxprotocol.prices.MsgCreateOracleMarket": { + aminoType: "/dydxprotocol.prices.MsgCreateOracleMarket", + toAmino: MsgCreateOracleMarket.toAmino, + fromAmino: MsgCreateOracleMarket.fromAmino + }, + "/dydxprotocol.prices.MsgUpdateMarketParam": { + aminoType: "/dydxprotocol.prices.MsgUpdateMarketParam", + toAmino: MsgUpdateMarketParam.toAmino, + fromAmino: MsgUpdateMarketParam.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.registry.ts new file mode 100644 index 00000000..32c57aae --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateMarketPrices, MsgCreateOracleMarket, MsgUpdateMarketParam } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.prices.MsgUpdateMarketPrices", MsgUpdateMarketPrices], ["/dydxprotocol.prices.MsgCreateOracleMarket", MsgCreateOracleMarket], ["/dydxprotocol.prices.MsgUpdateMarketParam", MsgUpdateMarketParam]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateMarketPrices(value: MsgUpdateMarketPrices) { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPrices", + value: MsgUpdateMarketPrices.encode(value).finish() + }; + }, + createOracleMarket(value: MsgCreateOracleMarket) { + return { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarket", + value: MsgCreateOracleMarket.encode(value).finish() + }; + }, + updateMarketParam(value: MsgUpdateMarketParam) { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParam", + value: MsgUpdateMarketParam.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateMarketPrices(value: MsgUpdateMarketPrices) { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPrices", + value + }; + }, + createOracleMarket(value: MsgCreateOracleMarket) { + return { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarket", + value + }; + }, + updateMarketParam(value: MsgUpdateMarketParam) { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParam", + value + }; + } + }, + fromPartial: { + updateMarketPrices(value: MsgUpdateMarketPrices) { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPrices", + value: MsgUpdateMarketPrices.fromPartial(value) + }; + }, + createOracleMarket(value: MsgCreateOracleMarket) { + return { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarket", + value: MsgCreateOracleMarket.fromPartial(value) + }; + }, + updateMarketParam(value: MsgUpdateMarketParam) { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParam", + value: MsgUpdateMarketParam.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.rpc.msg.ts new file mode 100644 index 00000000..8bd81591 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.rpc.msg.ts @@ -0,0 +1,43 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgUpdateMarketPrices, MsgUpdateMarketPricesResponse, MsgCreateOracleMarket, MsgCreateOracleMarketResponse, MsgUpdateMarketParam, MsgUpdateMarketParamResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * UpdateMarketPrices updates the oracle price of a market relative to + * quoteCurrency. + */ + updateMarketPrices(request: MsgUpdateMarketPrices): Promise; + /** CreateOracleMarket creates a new oracle market. */ + createOracleMarket(request: MsgCreateOracleMarket): Promise; + /** + * UpdateMarketParams allows governance to update the parameters of an + * oracle market. + */ + updateMarketParam(request: MsgUpdateMarketParam): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateMarketPrices = this.updateMarketPrices.bind(this); + this.createOracleMarket = this.createOracleMarket.bind(this); + this.updateMarketParam = this.updateMarketParam.bind(this); + } + updateMarketPrices(request: MsgUpdateMarketPrices): Promise { + const data = MsgUpdateMarketPrices.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Msg", "UpdateMarketPrices", data); + return promise.then(data => MsgUpdateMarketPricesResponse.decode(new BinaryReader(data))); + } + createOracleMarket(request: MsgCreateOracleMarket): Promise { + const data = MsgCreateOracleMarket.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Msg", "CreateOracleMarket", data); + return promise.then(data => MsgCreateOracleMarketResponse.decode(new BinaryReader(data))); + } + updateMarketParam(request: MsgUpdateMarketParam): Promise { + const data = MsgUpdateMarketParam.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Msg", "UpdateMarketParam", data); + return promise.then(data => MsgUpdateMarketParamResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.ts new file mode 100644 index 00000000..e2e7e32e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/prices/tx.ts @@ -0,0 +1,611 @@ +//@ts-nocheck +import { MarketParam, MarketParamAmino, MarketParamSDKType } from "./market_param"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * MsgCreateOracleMarket is a message used by x/gov for creating a new oracle + * market. + */ +export interface MsgCreateOracleMarket { + /** The address that controls the module. */ + authority: string; + /** `params` defines parameters for the new oracle market. */ + params: MarketParam; +} +export interface MsgCreateOracleMarketProtoMsg { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarket"; + value: Uint8Array; +} +/** + * MsgCreateOracleMarket is a message used by x/gov for creating a new oracle + * market. + */ +export interface MsgCreateOracleMarketAmino { + /** The address that controls the module. */ + authority?: string; + /** `params` defines parameters for the new oracle market. */ + params?: MarketParamAmino; +} +export interface MsgCreateOracleMarketAminoMsg { + type: "/dydxprotocol.prices.MsgCreateOracleMarket"; + value: MsgCreateOracleMarketAmino; +} +/** + * MsgCreateOracleMarket is a message used by x/gov for creating a new oracle + * market. + */ +export interface MsgCreateOracleMarketSDKType { + authority: string; + params: MarketParamSDKType; +} +/** MsgCreateOracleMarketResponse defines the CreateOracleMarket response type. */ +export interface MsgCreateOracleMarketResponse {} +export interface MsgCreateOracleMarketResponseProtoMsg { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarketResponse"; + value: Uint8Array; +} +/** MsgCreateOracleMarketResponse defines the CreateOracleMarket response type. */ +export interface MsgCreateOracleMarketResponseAmino {} +export interface MsgCreateOracleMarketResponseAminoMsg { + type: "/dydxprotocol.prices.MsgCreateOracleMarketResponse"; + value: MsgCreateOracleMarketResponseAmino; +} +/** MsgCreateOracleMarketResponse defines the CreateOracleMarket response type. */ +export interface MsgCreateOracleMarketResponseSDKType {} +/** MsgUpdateMarketPrices is a request type for the UpdateMarketPrices method. */ +export interface MsgUpdateMarketPrices { + marketPriceUpdates: MsgUpdateMarketPrices_MarketPrice[]; +} +export interface MsgUpdateMarketPricesProtoMsg { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPrices"; + value: Uint8Array; +} +/** MsgUpdateMarketPrices is a request type for the UpdateMarketPrices method. */ +export interface MsgUpdateMarketPricesAmino { + market_price_updates?: MsgUpdateMarketPrices_MarketPriceAmino[]; +} +export interface MsgUpdateMarketPricesAminoMsg { + type: "/dydxprotocol.prices.MsgUpdateMarketPrices"; + value: MsgUpdateMarketPricesAmino; +} +/** MsgUpdateMarketPrices is a request type for the UpdateMarketPrices method. */ +export interface MsgUpdateMarketPricesSDKType { + market_price_updates: MsgUpdateMarketPrices_MarketPriceSDKType[]; +} +/** MarketPrice represents a price update for a single market */ +export interface MsgUpdateMarketPrices_MarketPrice { + /** The id of market to update */ + marketId: number; + /** The updated price */ + price: bigint; +} +export interface MsgUpdateMarketPrices_MarketPriceProtoMsg { + typeUrl: "/dydxprotocol.prices.MarketPrice"; + value: Uint8Array; +} +/** MarketPrice represents a price update for a single market */ +export interface MsgUpdateMarketPrices_MarketPriceAmino { + /** The id of market to update */ + market_id?: number; + /** The updated price */ + price?: string; +} +export interface MsgUpdateMarketPrices_MarketPriceAminoMsg { + type: "/dydxprotocol.prices.MarketPrice"; + value: MsgUpdateMarketPrices_MarketPriceAmino; +} +/** MarketPrice represents a price update for a single market */ +export interface MsgUpdateMarketPrices_MarketPriceSDKType { + market_id: number; + price: bigint; +} +/** + * MsgUpdateMarketPricesResponse defines the MsgUpdateMarketPrices response + * type. + */ +export interface MsgUpdateMarketPricesResponse {} +export interface MsgUpdateMarketPricesResponseProtoMsg { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPricesResponse"; + value: Uint8Array; +} +/** + * MsgUpdateMarketPricesResponse defines the MsgUpdateMarketPrices response + * type. + */ +export interface MsgUpdateMarketPricesResponseAmino {} +export interface MsgUpdateMarketPricesResponseAminoMsg { + type: "/dydxprotocol.prices.MsgUpdateMarketPricesResponse"; + value: MsgUpdateMarketPricesResponseAmino; +} +/** + * MsgUpdateMarketPricesResponse defines the MsgUpdateMarketPrices response + * type. + */ +export interface MsgUpdateMarketPricesResponseSDKType {} +/** + * MsgUpdateMarketParam is a message used by x/gov for updating the parameters + * of an oracle market. + */ +export interface MsgUpdateMarketParam { + authority: string; + /** The market param to update. Each field must be set. */ + marketParam: MarketParam; +} +export interface MsgUpdateMarketParamProtoMsg { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParam"; + value: Uint8Array; +} +/** + * MsgUpdateMarketParam is a message used by x/gov for updating the parameters + * of an oracle market. + */ +export interface MsgUpdateMarketParamAmino { + authority?: string; + /** The market param to update. Each field must be set. */ + market_param?: MarketParamAmino; +} +export interface MsgUpdateMarketParamAminoMsg { + type: "/dydxprotocol.prices.MsgUpdateMarketParam"; + value: MsgUpdateMarketParamAmino; +} +/** + * MsgUpdateMarketParam is a message used by x/gov for updating the parameters + * of an oracle market. + */ +export interface MsgUpdateMarketParamSDKType { + authority: string; + market_param: MarketParamSDKType; +} +/** MsgUpdateMarketParamResponse defines the UpdateMarketParam response type. */ +export interface MsgUpdateMarketParamResponse {} +export interface MsgUpdateMarketParamResponseProtoMsg { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParamResponse"; + value: Uint8Array; +} +/** MsgUpdateMarketParamResponse defines the UpdateMarketParam response type. */ +export interface MsgUpdateMarketParamResponseAmino {} +export interface MsgUpdateMarketParamResponseAminoMsg { + type: "/dydxprotocol.prices.MsgUpdateMarketParamResponse"; + value: MsgUpdateMarketParamResponseAmino; +} +/** MsgUpdateMarketParamResponse defines the UpdateMarketParam response type. */ +export interface MsgUpdateMarketParamResponseSDKType {} +function createBaseMsgCreateOracleMarket(): MsgCreateOracleMarket { + return { + authority: "", + params: MarketParam.fromPartial({}) + }; +} +export const MsgCreateOracleMarket = { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarket", + encode(message: MsgCreateOracleMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + MarketParam.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateOracleMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateOracleMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = MarketParam.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateOracleMarket { + const message = createBaseMsgCreateOracleMarket(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? MarketParam.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgCreateOracleMarketAmino): MsgCreateOracleMarket { + const message = createBaseMsgCreateOracleMarket(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = MarketParam.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgCreateOracleMarket): MsgCreateOracleMarketAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? MarketParam.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateOracleMarketAminoMsg): MsgCreateOracleMarket { + return MsgCreateOracleMarket.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateOracleMarketProtoMsg): MsgCreateOracleMarket { + return MsgCreateOracleMarket.decode(message.value); + }, + toProto(message: MsgCreateOracleMarket): Uint8Array { + return MsgCreateOracleMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateOracleMarket): MsgCreateOracleMarketProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarket", + value: MsgCreateOracleMarket.encode(message).finish() + }; + } +}; +function createBaseMsgCreateOracleMarketResponse(): MsgCreateOracleMarketResponse { + return {}; +} +export const MsgCreateOracleMarketResponse = { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarketResponse", + encode(_: MsgCreateOracleMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateOracleMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateOracleMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateOracleMarketResponse { + const message = createBaseMsgCreateOracleMarketResponse(); + return message; + }, + fromAmino(_: MsgCreateOracleMarketResponseAmino): MsgCreateOracleMarketResponse { + const message = createBaseMsgCreateOracleMarketResponse(); + return message; + }, + toAmino(_: MsgCreateOracleMarketResponse): MsgCreateOracleMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateOracleMarketResponseAminoMsg): MsgCreateOracleMarketResponse { + return MsgCreateOracleMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateOracleMarketResponseProtoMsg): MsgCreateOracleMarketResponse { + return MsgCreateOracleMarketResponse.decode(message.value); + }, + toProto(message: MsgCreateOracleMarketResponse): Uint8Array { + return MsgCreateOracleMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateOracleMarketResponse): MsgCreateOracleMarketResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MsgCreateOracleMarketResponse", + value: MsgCreateOracleMarketResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateMarketPrices(): MsgUpdateMarketPrices { + return { + marketPriceUpdates: [] + }; +} +export const MsgUpdateMarketPrices = { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPrices", + encode(message: MsgUpdateMarketPrices, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketPriceUpdates) { + MsgUpdateMarketPrices_MarketPrice.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarketPrices { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketPriceUpdates.push(MsgUpdateMarketPrices_MarketPrice.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateMarketPrices { + const message = createBaseMsgUpdateMarketPrices(); + message.marketPriceUpdates = object.marketPriceUpdates?.map(e => MsgUpdateMarketPrices_MarketPrice.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateMarketPricesAmino): MsgUpdateMarketPrices { + const message = createBaseMsgUpdateMarketPrices(); + message.marketPriceUpdates = object.market_price_updates?.map(e => MsgUpdateMarketPrices_MarketPrice.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateMarketPrices): MsgUpdateMarketPricesAmino { + const obj: any = {}; + if (message.marketPriceUpdates) { + obj.market_price_updates = message.marketPriceUpdates.map(e => e ? MsgUpdateMarketPrices_MarketPrice.toAmino(e) : undefined); + } else { + obj.market_price_updates = message.marketPriceUpdates; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateMarketPricesAminoMsg): MsgUpdateMarketPrices { + return MsgUpdateMarketPrices.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateMarketPricesProtoMsg): MsgUpdateMarketPrices { + return MsgUpdateMarketPrices.decode(message.value); + }, + toProto(message: MsgUpdateMarketPrices): Uint8Array { + return MsgUpdateMarketPrices.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateMarketPrices): MsgUpdateMarketPricesProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPrices", + value: MsgUpdateMarketPrices.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateMarketPrices_MarketPrice(): MsgUpdateMarketPrices_MarketPrice { + return { + marketId: 0, + price: BigInt(0) + }; +} +export const MsgUpdateMarketPrices_MarketPrice = { + typeUrl: "/dydxprotocol.prices.MarketPrice", + encode(message: MsgUpdateMarketPrices_MarketPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== 0) { + writer.uint32(8).uint32(message.marketId); + } + if (message.price !== BigInt(0)) { + writer.uint32(16).uint64(message.price); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarketPrices_MarketPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketPrices_MarketPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.uint32(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateMarketPrices_MarketPrice { + const message = createBaseMsgUpdateMarketPrices_MarketPrice(); + message.marketId = object.marketId ?? 0; + message.price = object.price !== undefined && object.price !== null ? BigInt(object.price.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgUpdateMarketPrices_MarketPriceAmino): MsgUpdateMarketPrices_MarketPrice { + const message = createBaseMsgUpdateMarketPrices_MarketPrice(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.price !== undefined && object.price !== null) { + message.price = BigInt(object.price); + } + return message; + }, + toAmino(message: MsgUpdateMarketPrices_MarketPrice): MsgUpdateMarketPrices_MarketPriceAmino { + const obj: any = {}; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.price = message.price !== BigInt(0) ? message.price.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateMarketPrices_MarketPriceAminoMsg): MsgUpdateMarketPrices_MarketPrice { + return MsgUpdateMarketPrices_MarketPrice.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateMarketPrices_MarketPriceProtoMsg): MsgUpdateMarketPrices_MarketPrice { + return MsgUpdateMarketPrices_MarketPrice.decode(message.value); + }, + toProto(message: MsgUpdateMarketPrices_MarketPrice): Uint8Array { + return MsgUpdateMarketPrices_MarketPrice.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateMarketPrices_MarketPrice): MsgUpdateMarketPrices_MarketPriceProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MarketPrice", + value: MsgUpdateMarketPrices_MarketPrice.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateMarketPricesResponse(): MsgUpdateMarketPricesResponse { + return {}; +} +export const MsgUpdateMarketPricesResponse = { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPricesResponse", + encode(_: MsgUpdateMarketPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarketPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateMarketPricesResponse { + const message = createBaseMsgUpdateMarketPricesResponse(); + return message; + }, + fromAmino(_: MsgUpdateMarketPricesResponseAmino): MsgUpdateMarketPricesResponse { + const message = createBaseMsgUpdateMarketPricesResponse(); + return message; + }, + toAmino(_: MsgUpdateMarketPricesResponse): MsgUpdateMarketPricesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateMarketPricesResponseAminoMsg): MsgUpdateMarketPricesResponse { + return MsgUpdateMarketPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateMarketPricesResponseProtoMsg): MsgUpdateMarketPricesResponse { + return MsgUpdateMarketPricesResponse.decode(message.value); + }, + toProto(message: MsgUpdateMarketPricesResponse): Uint8Array { + return MsgUpdateMarketPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateMarketPricesResponse): MsgUpdateMarketPricesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketPricesResponse", + value: MsgUpdateMarketPricesResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateMarketParam(): MsgUpdateMarketParam { + return { + authority: "", + marketParam: MarketParam.fromPartial({}) + }; +} +export const MsgUpdateMarketParam = { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParam", + encode(message: MsgUpdateMarketParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.marketParam !== undefined) { + MarketParam.encode(message.marketParam, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarketParam { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.marketParam = MarketParam.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateMarketParam { + const message = createBaseMsgUpdateMarketParam(); + message.authority = object.authority ?? ""; + message.marketParam = object.marketParam !== undefined && object.marketParam !== null ? MarketParam.fromPartial(object.marketParam) : undefined; + return message; + }, + fromAmino(object: MsgUpdateMarketParamAmino): MsgUpdateMarketParam { + const message = createBaseMsgUpdateMarketParam(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.market_param !== undefined && object.market_param !== null) { + message.marketParam = MarketParam.fromAmino(object.market_param); + } + return message; + }, + toAmino(message: MsgUpdateMarketParam): MsgUpdateMarketParamAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.market_param = message.marketParam ? MarketParam.toAmino(message.marketParam) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateMarketParamAminoMsg): MsgUpdateMarketParam { + return MsgUpdateMarketParam.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateMarketParamProtoMsg): MsgUpdateMarketParam { + return MsgUpdateMarketParam.decode(message.value); + }, + toProto(message: MsgUpdateMarketParam): Uint8Array { + return MsgUpdateMarketParam.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateMarketParam): MsgUpdateMarketParamProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParam", + value: MsgUpdateMarketParam.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateMarketParamResponse(): MsgUpdateMarketParamResponse { + return {}; +} +export const MsgUpdateMarketParamResponse = { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParamResponse", + encode(_: MsgUpdateMarketParamResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarketParamResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketParamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateMarketParamResponse { + const message = createBaseMsgUpdateMarketParamResponse(); + return message; + }, + fromAmino(_: MsgUpdateMarketParamResponseAmino): MsgUpdateMarketParamResponse { + const message = createBaseMsgUpdateMarketParamResponse(); + return message; + }, + toAmino(_: MsgUpdateMarketParamResponse): MsgUpdateMarketParamResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateMarketParamResponseAminoMsg): MsgUpdateMarketParamResponse { + return MsgUpdateMarketParamResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateMarketParamResponseProtoMsg): MsgUpdateMarketParamResponse { + return MsgUpdateMarketParamResponse.decode(message.value); + }, + toProto(message: MsgUpdateMarketParamResponse): Uint8Array { + return MsgUpdateMarketParamResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateMarketParamResponse): MsgUpdateMarketParamResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.prices.MsgUpdateMarketParamResponse", + value: MsgUpdateMarketParamResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/capacity.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/capacity.ts new file mode 100644 index 00000000..4f24493a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/capacity.ts @@ -0,0 +1,220 @@ +//@ts-nocheck +import { Limiter, LimiterAmino, LimiterSDKType } from "./limit_params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** DenomCapacity stores a list of rate limit capacity for a denom. */ +export interface DenomCapacity { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom: string; + /** + * capacity_list is a list of capacity amount tracked for each `Limiter` + * on the denom. This list has a 1:1 mapping to `limiter` list under + * `LimitParams`. + */ + capacityList: Uint8Array[]; +} +export interface DenomCapacityProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.DenomCapacity"; + value: Uint8Array; +} +/** DenomCapacity stores a list of rate limit capacity for a denom. */ +export interface DenomCapacityAmino { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom?: string; + /** + * capacity_list is a list of capacity amount tracked for each `Limiter` + * on the denom. This list has a 1:1 mapping to `limiter` list under + * `LimitParams`. + */ + capacity_list?: string[]; +} +export interface DenomCapacityAminoMsg { + type: "/dydxprotocol.ratelimit.DenomCapacity"; + value: DenomCapacityAmino; +} +/** DenomCapacity stores a list of rate limit capacity for a denom. */ +export interface DenomCapacitySDKType { + denom: string; + capacity_list: Uint8Array[]; +} +/** LimiterCapacity contains a pair of limiter and its corresponding capacity. */ +export interface LimiterCapacity { + limiter: Limiter; + capacity: Uint8Array; +} +export interface LimiterCapacityProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.LimiterCapacity"; + value: Uint8Array; +} +/** LimiterCapacity contains a pair of limiter and its corresponding capacity. */ +export interface LimiterCapacityAmino { + limiter?: LimiterAmino; + capacity?: string; +} +export interface LimiterCapacityAminoMsg { + type: "/dydxprotocol.ratelimit.LimiterCapacity"; + value: LimiterCapacityAmino; +} +/** LimiterCapacity contains a pair of limiter and its corresponding capacity. */ +export interface LimiterCapacitySDKType { + limiter: LimiterSDKType; + capacity: Uint8Array; +} +function createBaseDenomCapacity(): DenomCapacity { + return { + denom: "", + capacityList: [] + }; +} +export const DenomCapacity = { + typeUrl: "/dydxprotocol.ratelimit.DenomCapacity", + encode(message: DenomCapacity, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + for (const v of message.capacityList) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomCapacity { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomCapacity(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.capacityList.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomCapacity { + const message = createBaseDenomCapacity(); + message.denom = object.denom ?? ""; + message.capacityList = object.capacityList?.map(e => e) || []; + return message; + }, + fromAmino(object: DenomCapacityAmino): DenomCapacity { + const message = createBaseDenomCapacity(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + message.capacityList = object.capacity_list?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: DenomCapacity): DenomCapacityAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + if (message.capacityList) { + obj.capacity_list = message.capacityList.map(e => base64FromBytes(e)); + } else { + obj.capacity_list = message.capacityList; + } + return obj; + }, + fromAminoMsg(object: DenomCapacityAminoMsg): DenomCapacity { + return DenomCapacity.fromAmino(object.value); + }, + fromProtoMsg(message: DenomCapacityProtoMsg): DenomCapacity { + return DenomCapacity.decode(message.value); + }, + toProto(message: DenomCapacity): Uint8Array { + return DenomCapacity.encode(message).finish(); + }, + toProtoMsg(message: DenomCapacity): DenomCapacityProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.DenomCapacity", + value: DenomCapacity.encode(message).finish() + }; + } +}; +function createBaseLimiterCapacity(): LimiterCapacity { + return { + limiter: Limiter.fromPartial({}), + capacity: new Uint8Array() + }; +} +export const LimiterCapacity = { + typeUrl: "/dydxprotocol.ratelimit.LimiterCapacity", + encode(message: LimiterCapacity, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.limiter !== undefined) { + Limiter.encode(message.limiter, writer.uint32(10).fork()).ldelim(); + } + if (message.capacity.length !== 0) { + writer.uint32(18).bytes(message.capacity); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LimiterCapacity { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimiterCapacity(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limiter = Limiter.decode(reader, reader.uint32()); + break; + case 2: + message.capacity = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LimiterCapacity { + const message = createBaseLimiterCapacity(); + message.limiter = object.limiter !== undefined && object.limiter !== null ? Limiter.fromPartial(object.limiter) : undefined; + message.capacity = object.capacity ?? new Uint8Array(); + return message; + }, + fromAmino(object: LimiterCapacityAmino): LimiterCapacity { + const message = createBaseLimiterCapacity(); + if (object.limiter !== undefined && object.limiter !== null) { + message.limiter = Limiter.fromAmino(object.limiter); + } + if (object.capacity !== undefined && object.capacity !== null) { + message.capacity = bytesFromBase64(object.capacity); + } + return message; + }, + toAmino(message: LimiterCapacity): LimiterCapacityAmino { + const obj: any = {}; + obj.limiter = message.limiter ? Limiter.toAmino(message.limiter) : undefined; + obj.capacity = message.capacity ? base64FromBytes(message.capacity) : undefined; + return obj; + }, + fromAminoMsg(object: LimiterCapacityAminoMsg): LimiterCapacity { + return LimiterCapacity.fromAmino(object.value); + }, + fromProtoMsg(message: LimiterCapacityProtoMsg): LimiterCapacity { + return LimiterCapacity.decode(message.value); + }, + toProto(message: LimiterCapacity): Uint8Array { + return LimiterCapacity.encode(message).finish(); + }, + toProtoMsg(message: LimiterCapacity): LimiterCapacityProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.LimiterCapacity", + value: LimiterCapacity.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/genesis.ts new file mode 100644 index 00000000..042316a4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/genesis.ts @@ -0,0 +1,90 @@ +//@ts-nocheck +import { LimitParams, LimitParamsAmino, LimitParamsSDKType } from "./limit_params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the ratelimit module's genesis state. */ +export interface GenesisState { + /** limit_params_list defines the list of `LimitParams` at genesis. */ + limitParamsList: LimitParams[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ratelimit module's genesis state. */ +export interface GenesisStateAmino { + /** limit_params_list defines the list of `LimitParams` at genesis. */ + limit_params_list?: LimitParamsAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.ratelimit.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ratelimit module's genesis state. */ +export interface GenesisStateSDKType { + limit_params_list: LimitParamsSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + limitParamsList: [] + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.ratelimit.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.limitParamsList) { + LimitParams.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limitParamsList.push(LimitParams.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.limitParamsList = object.limitParamsList?.map(e => LimitParams.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.limitParamsList = object.limit_params_list?.map(e => LimitParams.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.limitParamsList) { + obj.limit_params_list = message.limitParamsList.map(e => e ? LimitParams.toAmino(e) : undefined); + } else { + obj.limit_params_list = message.limitParamsList; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/limit_params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/limit_params.ts new file mode 100644 index 00000000..79d7116d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/limit_params.ts @@ -0,0 +1,261 @@ +//@ts-nocheck +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** LimitParams defines rate limit params on a denom. */ +export interface LimitParams { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom: string; + /** + * limiters is a list of rate-limiters on this denom. All limiters + * must be satified for a withdrawal to proceed. + */ + limiters: Limiter[]; +} +export interface LimitParamsProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.LimitParams"; + value: Uint8Array; +} +/** LimitParams defines rate limit params on a denom. */ +export interface LimitParamsAmino { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom?: string; + /** + * limiters is a list of rate-limiters on this denom. All limiters + * must be satified for a withdrawal to proceed. + */ + limiters?: LimiterAmino[]; +} +export interface LimitParamsAminoMsg { + type: "/dydxprotocol.ratelimit.LimitParams"; + value: LimitParamsAmino; +} +/** LimitParams defines rate limit params on a denom. */ +export interface LimitParamsSDKType { + denom: string; + limiters: LimiterSDKType[]; +} +/** Limiter defines one rate-limiter on a specfic denom. */ +export interface Limiter { + /** + * period is the rolling time period for which the limit applies + * e.g. 3600 (an hour) + */ + period: Duration; + /** + * baseline_minimum is the minimum maximum withdrawal coin amount within the + * time period. + * e.g. 100_000_000_000 uusdc for 100k USDC; 5e22 adv4tnt for 50k DV4TNT + */ + baselineMinimum: Uint8Array; + /** + * baseline_tvl_ppm is the maximum ratio of TVL withdrawable in + * the time period, in part-per-million. + * e.g. 100_000 (10%) + */ + baselineTvlPpm: number; +} +export interface LimiterProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.Limiter"; + value: Uint8Array; +} +/** Limiter defines one rate-limiter on a specfic denom. */ +export interface LimiterAmino { + /** + * period is the rolling time period for which the limit applies + * e.g. 3600 (an hour) + */ + period?: DurationAmino; + /** + * baseline_minimum is the minimum maximum withdrawal coin amount within the + * time period. + * e.g. 100_000_000_000 uusdc for 100k USDC; 5e22 adv4tnt for 50k DV4TNT + */ + baseline_minimum?: string; + /** + * baseline_tvl_ppm is the maximum ratio of TVL withdrawable in + * the time period, in part-per-million. + * e.g. 100_000 (10%) + */ + baseline_tvl_ppm?: number; +} +export interface LimiterAminoMsg { + type: "/dydxprotocol.ratelimit.Limiter"; + value: LimiterAmino; +} +/** Limiter defines one rate-limiter on a specfic denom. */ +export interface LimiterSDKType { + period: DurationSDKType; + baseline_minimum: Uint8Array; + baseline_tvl_ppm: number; +} +function createBaseLimitParams(): LimitParams { + return { + denom: "", + limiters: [] + }; +} +export const LimitParams = { + typeUrl: "/dydxprotocol.ratelimit.LimitParams", + encode(message: LimitParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + for (const v of message.limiters) { + Limiter.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LimitParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimitParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.limiters.push(Limiter.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LimitParams { + const message = createBaseLimitParams(); + message.denom = object.denom ?? ""; + message.limiters = object.limiters?.map(e => Limiter.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LimitParamsAmino): LimitParams { + const message = createBaseLimitParams(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + message.limiters = object.limiters?.map(e => Limiter.fromAmino(e)) || []; + return message; + }, + toAmino(message: LimitParams): LimitParamsAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + if (message.limiters) { + obj.limiters = message.limiters.map(e => e ? Limiter.toAmino(e) : undefined); + } else { + obj.limiters = message.limiters; + } + return obj; + }, + fromAminoMsg(object: LimitParamsAminoMsg): LimitParams { + return LimitParams.fromAmino(object.value); + }, + fromProtoMsg(message: LimitParamsProtoMsg): LimitParams { + return LimitParams.decode(message.value); + }, + toProto(message: LimitParams): Uint8Array { + return LimitParams.encode(message).finish(); + }, + toProtoMsg(message: LimitParams): LimitParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.LimitParams", + value: LimitParams.encode(message).finish() + }; + } +}; +function createBaseLimiter(): Limiter { + return { + period: Duration.fromPartial({}), + baselineMinimum: new Uint8Array(), + baselineTvlPpm: 0 + }; +} +export const Limiter = { + typeUrl: "/dydxprotocol.ratelimit.Limiter", + encode(message: Limiter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.period !== undefined) { + Duration.encode(message.period, writer.uint32(10).fork()).ldelim(); + } + if (message.baselineMinimum.length !== 0) { + writer.uint32(26).bytes(message.baselineMinimum); + } + if (message.baselineTvlPpm !== 0) { + writer.uint32(32).uint32(message.baselineTvlPpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Limiter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimiter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.period = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.baselineMinimum = reader.bytes(); + break; + case 4: + message.baselineTvlPpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Limiter { + const message = createBaseLimiter(); + message.period = object.period !== undefined && object.period !== null ? Duration.fromPartial(object.period) : undefined; + message.baselineMinimum = object.baselineMinimum ?? new Uint8Array(); + message.baselineTvlPpm = object.baselineTvlPpm ?? 0; + return message; + }, + fromAmino(object: LimiterAmino): Limiter { + const message = createBaseLimiter(); + if (object.period !== undefined && object.period !== null) { + message.period = Duration.fromAmino(object.period); + } + if (object.baseline_minimum !== undefined && object.baseline_minimum !== null) { + message.baselineMinimum = bytesFromBase64(object.baseline_minimum); + } + if (object.baseline_tvl_ppm !== undefined && object.baseline_tvl_ppm !== null) { + message.baselineTvlPpm = object.baseline_tvl_ppm; + } + return message; + }, + toAmino(message: Limiter): LimiterAmino { + const obj: any = {}; + obj.period = message.period ? Duration.toAmino(message.period) : undefined; + obj.baseline_minimum = message.baselineMinimum ? base64FromBytes(message.baselineMinimum) : undefined; + obj.baseline_tvl_ppm = message.baselineTvlPpm === 0 ? undefined : message.baselineTvlPpm; + return obj; + }, + fromAminoMsg(object: LimiterAminoMsg): Limiter { + return Limiter.fromAmino(object.value); + }, + fromProtoMsg(message: LimiterProtoMsg): Limiter { + return Limiter.decode(message.value); + }, + toProto(message: Limiter): Uint8Array { + return Limiter.encode(message).finish(); + }, + toProtoMsg(message: Limiter): LimiterProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.Limiter", + value: Limiter.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/pending_send_packet.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/pending_send_packet.ts new file mode 100644 index 00000000..d1728d18 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/pending_send_packet.ts @@ -0,0 +1,109 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * PendingSendPacket contains the channel_id and sequence pair to identify a + * pending packet + */ +export interface PendingSendPacket { + channelId: string; + sequence: bigint; +} +export interface PendingSendPacketProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.PendingSendPacket"; + value: Uint8Array; +} +/** + * PendingSendPacket contains the channel_id and sequence pair to identify a + * pending packet + */ +export interface PendingSendPacketAmino { + channel_id?: string; + sequence?: string; +} +export interface PendingSendPacketAminoMsg { + type: "/dydxprotocol.ratelimit.PendingSendPacket"; + value: PendingSendPacketAmino; +} +/** + * PendingSendPacket contains the channel_id and sequence pair to identify a + * pending packet + */ +export interface PendingSendPacketSDKType { + channel_id: string; + sequence: bigint; +} +function createBasePendingSendPacket(): PendingSendPacket { + return { + channelId: "", + sequence: BigInt(0) + }; +} +export const PendingSendPacket = { + typeUrl: "/dydxprotocol.ratelimit.PendingSendPacket", + encode(message: PendingSendPacket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(16).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PendingSendPacket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePendingSendPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PendingSendPacket { + const message = createBasePendingSendPacket(); + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PendingSendPacketAmino): PendingSendPacket { + const message = createBasePendingSendPacket(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: PendingSendPacket): PendingSendPacketAmino { + const obj: any = {}; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PendingSendPacketAminoMsg): PendingSendPacket { + return PendingSendPacket.fromAmino(object.value); + }, + fromProtoMsg(message: PendingSendPacketProtoMsg): PendingSendPacket { + return PendingSendPacket.decode(message.value); + }, + toProto(message: PendingSendPacket): Uint8Array { + return PendingSendPacket.encode(message).finish(); + }, + toProtoMsg(message: PendingSendPacket): PendingSendPacketProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.PendingSendPacket", + value: PendingSendPacket.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/query.rpc.Query.ts new file mode 100644 index 00000000..7b71eb6b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/query.rpc.Query.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { ListLimitParamsRequest, ListLimitParamsResponse, QueryCapacityByDenomRequest, QueryCapacityByDenomResponse, QueryAllPendingSendPacketsRequest, QueryAllPendingSendPacketsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** List all limit params. */ + listLimitParams(request?: ListLimitParamsRequest): Promise; + /** Query capacity by denom. */ + capacityByDenom(request: QueryCapacityByDenomRequest): Promise; + /** Get all pending send packets */ + allPendingSendPackets(request?: QueryAllPendingSendPacketsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.listLimitParams = this.listLimitParams.bind(this); + this.capacityByDenom = this.capacityByDenom.bind(this); + this.allPendingSendPackets = this.allPendingSendPackets.bind(this); + } + listLimitParams(request: ListLimitParamsRequest = {}): Promise { + const data = ListLimitParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ratelimit.Query", "ListLimitParams", data); + return promise.then(data => ListLimitParamsResponse.decode(new BinaryReader(data))); + } + capacityByDenom(request: QueryCapacityByDenomRequest): Promise { + const data = QueryCapacityByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ratelimit.Query", "CapacityByDenom", data); + return promise.then(data => QueryCapacityByDenomResponse.decode(new BinaryReader(data))); + } + allPendingSendPackets(request: QueryAllPendingSendPacketsRequest = {}): Promise { + const data = QueryAllPendingSendPacketsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ratelimit.Query", "AllPendingSendPackets", data); + return promise.then(data => QueryAllPendingSendPacketsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + listLimitParams(request?: ListLimitParamsRequest): Promise { + return queryService.listLimitParams(request); + }, + capacityByDenom(request: QueryCapacityByDenomRequest): Promise { + return queryService.capacityByDenom(request); + }, + allPendingSendPackets(request?: QueryAllPendingSendPacketsRequest): Promise { + return queryService.allPendingSendPackets(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/query.ts new file mode 100644 index 00000000..83145f2b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/query.ts @@ -0,0 +1,507 @@ +//@ts-nocheck +import { LimitParams, LimitParamsAmino, LimitParamsSDKType } from "./limit_params"; +import { LimiterCapacity, LimiterCapacityAmino, LimiterCapacitySDKType } from "./capacity"; +import { PendingSendPacket, PendingSendPacketAmino, PendingSendPacketSDKType } from "./pending_send_packet"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** ListLimitParamsRequest is a request type of the ListLimitParams RPC method. */ +export interface ListLimitParamsRequest {} +export interface ListLimitParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.ListLimitParamsRequest"; + value: Uint8Array; +} +/** ListLimitParamsRequest is a request type of the ListLimitParams RPC method. */ +export interface ListLimitParamsRequestAmino {} +export interface ListLimitParamsRequestAminoMsg { + type: "/dydxprotocol.ratelimit.ListLimitParamsRequest"; + value: ListLimitParamsRequestAmino; +} +/** ListLimitParamsRequest is a request type of the ListLimitParams RPC method. */ +export interface ListLimitParamsRequestSDKType {} +/** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ +export interface ListLimitParamsResponse { + limitParamsList: LimitParams[]; +} +export interface ListLimitParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.ListLimitParamsResponse"; + value: Uint8Array; +} +/** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ +export interface ListLimitParamsResponseAmino { + limit_params_list?: LimitParamsAmino[]; +} +export interface ListLimitParamsResponseAminoMsg { + type: "/dydxprotocol.ratelimit.ListLimitParamsResponse"; + value: ListLimitParamsResponseAmino; +} +/** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ +export interface ListLimitParamsResponseSDKType { + limit_params_list: LimitParamsSDKType[]; +} +/** + * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC + * method. + */ +export interface QueryCapacityByDenomRequest { + denom: string; +} +export interface QueryCapacityByDenomRequestProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.QueryCapacityByDenomRequest"; + value: Uint8Array; +} +/** + * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC + * method. + */ +export interface QueryCapacityByDenomRequestAmino { + denom?: string; +} +export interface QueryCapacityByDenomRequestAminoMsg { + type: "/dydxprotocol.ratelimit.QueryCapacityByDenomRequest"; + value: QueryCapacityByDenomRequestAmino; +} +/** + * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC + * method. + */ +export interface QueryCapacityByDenomRequestSDKType { + denom: string; +} +/** + * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC + * method. + */ +export interface QueryCapacityByDenomResponse { + limiterCapacityList: LimiterCapacity[]; +} +export interface QueryCapacityByDenomResponseProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.QueryCapacityByDenomResponse"; + value: Uint8Array; +} +/** + * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC + * method. + */ +export interface QueryCapacityByDenomResponseAmino { + limiter_capacity_list?: LimiterCapacityAmino[]; +} +export interface QueryCapacityByDenomResponseAminoMsg { + type: "/dydxprotocol.ratelimit.QueryCapacityByDenomResponse"; + value: QueryCapacityByDenomResponseAmino; +} +/** + * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC + * method. + */ +export interface QueryCapacityByDenomResponseSDKType { + limiter_capacity_list: LimiterCapacitySDKType[]; +} +/** + * QueryAllPendingSendPacketsRequest is a request type for the + * AllPendingSendPackets RPC + */ +export interface QueryAllPendingSendPacketsRequest {} +export interface QueryAllPendingSendPacketsRequestProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsRequest"; + value: Uint8Array; +} +/** + * QueryAllPendingSendPacketsRequest is a request type for the + * AllPendingSendPackets RPC + */ +export interface QueryAllPendingSendPacketsRequestAmino {} +export interface QueryAllPendingSendPacketsRequestAminoMsg { + type: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsRequest"; + value: QueryAllPendingSendPacketsRequestAmino; +} +/** + * QueryAllPendingSendPacketsRequest is a request type for the + * AllPendingSendPackets RPC + */ +export interface QueryAllPendingSendPacketsRequestSDKType {} +/** + * QueryAllPendingSendPacketsResponse is a response type of the + * AllPendingSendPackets RPC + */ +export interface QueryAllPendingSendPacketsResponse { + pendingSendPackets: PendingSendPacket[]; +} +export interface QueryAllPendingSendPacketsResponseProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsResponse"; + value: Uint8Array; +} +/** + * QueryAllPendingSendPacketsResponse is a response type of the + * AllPendingSendPackets RPC + */ +export interface QueryAllPendingSendPacketsResponseAmino { + pending_send_packets?: PendingSendPacketAmino[]; +} +export interface QueryAllPendingSendPacketsResponseAminoMsg { + type: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsResponse"; + value: QueryAllPendingSendPacketsResponseAmino; +} +/** + * QueryAllPendingSendPacketsResponse is a response type of the + * AllPendingSendPackets RPC + */ +export interface QueryAllPendingSendPacketsResponseSDKType { + pending_send_packets: PendingSendPacketSDKType[]; +} +function createBaseListLimitParamsRequest(): ListLimitParamsRequest { + return {}; +} +export const ListLimitParamsRequest = { + typeUrl: "/dydxprotocol.ratelimit.ListLimitParamsRequest", + encode(_: ListLimitParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListLimitParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListLimitParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ListLimitParamsRequest { + const message = createBaseListLimitParamsRequest(); + return message; + }, + fromAmino(_: ListLimitParamsRequestAmino): ListLimitParamsRequest { + const message = createBaseListLimitParamsRequest(); + return message; + }, + toAmino(_: ListLimitParamsRequest): ListLimitParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ListLimitParamsRequestAminoMsg): ListLimitParamsRequest { + return ListLimitParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ListLimitParamsRequestProtoMsg): ListLimitParamsRequest { + return ListLimitParamsRequest.decode(message.value); + }, + toProto(message: ListLimitParamsRequest): Uint8Array { + return ListLimitParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: ListLimitParamsRequest): ListLimitParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.ListLimitParamsRequest", + value: ListLimitParamsRequest.encode(message).finish() + }; + } +}; +function createBaseListLimitParamsResponse(): ListLimitParamsResponse { + return { + limitParamsList: [] + }; +} +export const ListLimitParamsResponse = { + typeUrl: "/dydxprotocol.ratelimit.ListLimitParamsResponse", + encode(message: ListLimitParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.limitParamsList) { + LimitParams.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListLimitParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListLimitParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limitParamsList.push(LimitParams.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListLimitParamsResponse { + const message = createBaseListLimitParamsResponse(); + message.limitParamsList = object.limitParamsList?.map(e => LimitParams.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListLimitParamsResponseAmino): ListLimitParamsResponse { + const message = createBaseListLimitParamsResponse(); + message.limitParamsList = object.limit_params_list?.map(e => LimitParams.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListLimitParamsResponse): ListLimitParamsResponseAmino { + const obj: any = {}; + if (message.limitParamsList) { + obj.limit_params_list = message.limitParamsList.map(e => e ? LimitParams.toAmino(e) : undefined); + } else { + obj.limit_params_list = message.limitParamsList; + } + return obj; + }, + fromAminoMsg(object: ListLimitParamsResponseAminoMsg): ListLimitParamsResponse { + return ListLimitParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: ListLimitParamsResponseProtoMsg): ListLimitParamsResponse { + return ListLimitParamsResponse.decode(message.value); + }, + toProto(message: ListLimitParamsResponse): Uint8Array { + return ListLimitParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: ListLimitParamsResponse): ListLimitParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.ListLimitParamsResponse", + value: ListLimitParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCapacityByDenomRequest(): QueryCapacityByDenomRequest { + return { + denom: "" + }; +} +export const QueryCapacityByDenomRequest = { + typeUrl: "/dydxprotocol.ratelimit.QueryCapacityByDenomRequest", + encode(message: QueryCapacityByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCapacityByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCapacityByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCapacityByDenomRequest { + const message = createBaseQueryCapacityByDenomRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryCapacityByDenomRequestAmino): QueryCapacityByDenomRequest { + const message = createBaseQueryCapacityByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryCapacityByDenomRequest): QueryCapacityByDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryCapacityByDenomRequestAminoMsg): QueryCapacityByDenomRequest { + return QueryCapacityByDenomRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCapacityByDenomRequestProtoMsg): QueryCapacityByDenomRequest { + return QueryCapacityByDenomRequest.decode(message.value); + }, + toProto(message: QueryCapacityByDenomRequest): Uint8Array { + return QueryCapacityByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCapacityByDenomRequest): QueryCapacityByDenomRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.QueryCapacityByDenomRequest", + value: QueryCapacityByDenomRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCapacityByDenomResponse(): QueryCapacityByDenomResponse { + return { + limiterCapacityList: [] + }; +} +export const QueryCapacityByDenomResponse = { + typeUrl: "/dydxprotocol.ratelimit.QueryCapacityByDenomResponse", + encode(message: QueryCapacityByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.limiterCapacityList) { + LimiterCapacity.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCapacityByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCapacityByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limiterCapacityList.push(LimiterCapacity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCapacityByDenomResponse { + const message = createBaseQueryCapacityByDenomResponse(); + message.limiterCapacityList = object.limiterCapacityList?.map(e => LimiterCapacity.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCapacityByDenomResponseAmino): QueryCapacityByDenomResponse { + const message = createBaseQueryCapacityByDenomResponse(); + message.limiterCapacityList = object.limiter_capacity_list?.map(e => LimiterCapacity.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCapacityByDenomResponse): QueryCapacityByDenomResponseAmino { + const obj: any = {}; + if (message.limiterCapacityList) { + obj.limiter_capacity_list = message.limiterCapacityList.map(e => e ? LimiterCapacity.toAmino(e) : undefined); + } else { + obj.limiter_capacity_list = message.limiterCapacityList; + } + return obj; + }, + fromAminoMsg(object: QueryCapacityByDenomResponseAminoMsg): QueryCapacityByDenomResponse { + return QueryCapacityByDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCapacityByDenomResponseProtoMsg): QueryCapacityByDenomResponse { + return QueryCapacityByDenomResponse.decode(message.value); + }, + toProto(message: QueryCapacityByDenomResponse): Uint8Array { + return QueryCapacityByDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCapacityByDenomResponse): QueryCapacityByDenomResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.QueryCapacityByDenomResponse", + value: QueryCapacityByDenomResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllPendingSendPacketsRequest(): QueryAllPendingSendPacketsRequest { + return {}; +} +export const QueryAllPendingSendPacketsRequest = { + typeUrl: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsRequest", + encode(_: QueryAllPendingSendPacketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllPendingSendPacketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPendingSendPacketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAllPendingSendPacketsRequest { + const message = createBaseQueryAllPendingSendPacketsRequest(); + return message; + }, + fromAmino(_: QueryAllPendingSendPacketsRequestAmino): QueryAllPendingSendPacketsRequest { + const message = createBaseQueryAllPendingSendPacketsRequest(); + return message; + }, + toAmino(_: QueryAllPendingSendPacketsRequest): QueryAllPendingSendPacketsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllPendingSendPacketsRequestAminoMsg): QueryAllPendingSendPacketsRequest { + return QueryAllPendingSendPacketsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllPendingSendPacketsRequestProtoMsg): QueryAllPendingSendPacketsRequest { + return QueryAllPendingSendPacketsRequest.decode(message.value); + }, + toProto(message: QueryAllPendingSendPacketsRequest): Uint8Array { + return QueryAllPendingSendPacketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllPendingSendPacketsRequest): QueryAllPendingSendPacketsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsRequest", + value: QueryAllPendingSendPacketsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllPendingSendPacketsResponse(): QueryAllPendingSendPacketsResponse { + return { + pendingSendPackets: [] + }; +} +export const QueryAllPendingSendPacketsResponse = { + typeUrl: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsResponse", + encode(message: QueryAllPendingSendPacketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pendingSendPackets) { + PendingSendPacket.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllPendingSendPacketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPendingSendPacketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pendingSendPackets.push(PendingSendPacket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllPendingSendPacketsResponse { + const message = createBaseQueryAllPendingSendPacketsResponse(); + message.pendingSendPackets = object.pendingSendPackets?.map(e => PendingSendPacket.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllPendingSendPacketsResponseAmino): QueryAllPendingSendPacketsResponse { + const message = createBaseQueryAllPendingSendPacketsResponse(); + message.pendingSendPackets = object.pending_send_packets?.map(e => PendingSendPacket.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllPendingSendPacketsResponse): QueryAllPendingSendPacketsResponseAmino { + const obj: any = {}; + if (message.pendingSendPackets) { + obj.pending_send_packets = message.pendingSendPackets.map(e => e ? PendingSendPacket.toAmino(e) : undefined); + } else { + obj.pending_send_packets = message.pendingSendPackets; + } + return obj; + }, + fromAminoMsg(object: QueryAllPendingSendPacketsResponseAminoMsg): QueryAllPendingSendPacketsResponse { + return QueryAllPendingSendPacketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllPendingSendPacketsResponseProtoMsg): QueryAllPendingSendPacketsResponse { + return QueryAllPendingSendPacketsResponse.decode(message.value); + }, + toProto(message: QueryAllPendingSendPacketsResponse): Uint8Array { + return QueryAllPendingSendPacketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllPendingSendPacketsResponse): QueryAllPendingSendPacketsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.QueryAllPendingSendPacketsResponse", + value: QueryAllPendingSendPacketsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.amino.ts new file mode 100644 index 00000000..6a5364aa --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgSetLimitParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.ratelimit.MsgSetLimitParams": { + aminoType: "/dydxprotocol.ratelimit.MsgSetLimitParams", + toAmino: MsgSetLimitParams.toAmino, + fromAmino: MsgSetLimitParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.registry.ts new file mode 100644 index 00000000..f7d9108e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSetLimitParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.ratelimit.MsgSetLimitParams", MsgSetLimitParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setLimitParams(value: MsgSetLimitParams) { + return { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParams", + value: MsgSetLimitParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + setLimitParams(value: MsgSetLimitParams) { + return { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParams", + value + }; + } + }, + fromPartial: { + setLimitParams(value: MsgSetLimitParams) { + return { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParams", + value: MsgSetLimitParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.rpc.msg.ts new file mode 100644 index 00000000..f004b4d1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.rpc.msg.ts @@ -0,0 +1,21 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgSetLimitParams, MsgSetLimitParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** SetLimitParams sets a `LimitParams` object in state. */ + setLimitParams(request: MsgSetLimitParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setLimitParams = this.setLimitParams.bind(this); + } + setLimitParams(request: MsgSetLimitParams): Promise { + const data = MsgSetLimitParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ratelimit.Msg", "SetLimitParams", data); + return promise.then(data => MsgSetLimitParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.ts new file mode 100644 index 00000000..8f98bb97 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/ratelimit/tx.ts @@ -0,0 +1,167 @@ +//@ts-nocheck +import { LimitParams, LimitParamsAmino, LimitParamsSDKType } from "./limit_params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgSetLimitParams is the Msg/SetLimitParams request type. */ +export interface MsgSetLimitParams { + authority: string; + /** Defines the parameters to set. All parameters must be supplied. */ + limitParams: LimitParams; +} +export interface MsgSetLimitParamsProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParams"; + value: Uint8Array; +} +/** MsgSetLimitParams is the Msg/SetLimitParams request type. */ +export interface MsgSetLimitParamsAmino { + authority?: string; + /** Defines the parameters to set. All parameters must be supplied. */ + limit_params?: LimitParamsAmino; +} +export interface MsgSetLimitParamsAminoMsg { + type: "/dydxprotocol.ratelimit.MsgSetLimitParams"; + value: MsgSetLimitParamsAmino; +} +/** MsgSetLimitParams is the Msg/SetLimitParams request type. */ +export interface MsgSetLimitParamsSDKType { + authority: string; + limit_params: LimitParamsSDKType; +} +/** MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. */ +export interface MsgSetLimitParamsResponse {} +export interface MsgSetLimitParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParamsResponse"; + value: Uint8Array; +} +/** MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. */ +export interface MsgSetLimitParamsResponseAmino {} +export interface MsgSetLimitParamsResponseAminoMsg { + type: "/dydxprotocol.ratelimit.MsgSetLimitParamsResponse"; + value: MsgSetLimitParamsResponseAmino; +} +/** MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. */ +export interface MsgSetLimitParamsResponseSDKType {} +function createBaseMsgSetLimitParams(): MsgSetLimitParams { + return { + authority: "", + limitParams: LimitParams.fromPartial({}) + }; +} +export const MsgSetLimitParams = { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParams", + encode(message: MsgSetLimitParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.limitParams !== undefined) { + LimitParams.encode(message.limitParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetLimitParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLimitParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.limitParams = LimitParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetLimitParams { + const message = createBaseMsgSetLimitParams(); + message.authority = object.authority ?? ""; + message.limitParams = object.limitParams !== undefined && object.limitParams !== null ? LimitParams.fromPartial(object.limitParams) : undefined; + return message; + }, + fromAmino(object: MsgSetLimitParamsAmino): MsgSetLimitParams { + const message = createBaseMsgSetLimitParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.limit_params !== undefined && object.limit_params !== null) { + message.limitParams = LimitParams.fromAmino(object.limit_params); + } + return message; + }, + toAmino(message: MsgSetLimitParams): MsgSetLimitParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.limit_params = message.limitParams ? LimitParams.toAmino(message.limitParams) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetLimitParamsAminoMsg): MsgSetLimitParams { + return MsgSetLimitParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetLimitParamsProtoMsg): MsgSetLimitParams { + return MsgSetLimitParams.decode(message.value); + }, + toProto(message: MsgSetLimitParams): Uint8Array { + return MsgSetLimitParams.encode(message).finish(); + }, + toProtoMsg(message: MsgSetLimitParams): MsgSetLimitParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParams", + value: MsgSetLimitParams.encode(message).finish() + }; + } +}; +function createBaseMsgSetLimitParamsResponse(): MsgSetLimitParamsResponse { + return {}; +} +export const MsgSetLimitParamsResponse = { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParamsResponse", + encode(_: MsgSetLimitParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetLimitParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLimitParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetLimitParamsResponse { + const message = createBaseMsgSetLimitParamsResponse(); + return message; + }, + fromAmino(_: MsgSetLimitParamsResponseAmino): MsgSetLimitParamsResponse { + const message = createBaseMsgSetLimitParamsResponse(); + return message; + }, + toAmino(_: MsgSetLimitParamsResponse): MsgSetLimitParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetLimitParamsResponseAminoMsg): MsgSetLimitParamsResponse { + return MsgSetLimitParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetLimitParamsResponseProtoMsg): MsgSetLimitParamsResponse { + return MsgSetLimitParamsResponse.decode(message.value); + }, + toProto(message: MsgSetLimitParamsResponse): Uint8Array { + return MsgSetLimitParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetLimitParamsResponse): MsgSetLimitParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.ratelimit.MsgSetLimitParamsResponse", + value: MsgSetLimitParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/genesis.ts new file mode 100644 index 00000000..3a77aa11 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/genesis.ts @@ -0,0 +1,86 @@ +//@ts-nocheck +import { MarketMapperRevenueShareParams, MarketMapperRevenueShareParamsAmino, MarketMapperRevenueShareParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines `x/revshare`'s genesis state. */ +export interface GenesisState { + params: MarketMapperRevenueShareParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.revshare.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines `x/revshare`'s genesis state. */ +export interface GenesisStateAmino { + params?: MarketMapperRevenueShareParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.revshare.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines `x/revshare`'s genesis state. */ +export interface GenesisStateSDKType { + params: MarketMapperRevenueShareParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: MarketMapperRevenueShareParams.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.revshare.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + MarketMapperRevenueShareParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = MarketMapperRevenueShareParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? MarketMapperRevenueShareParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = MarketMapperRevenueShareParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? MarketMapperRevenueShareParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/params.ts new file mode 100644 index 00000000..888328d1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/params.ts @@ -0,0 +1,135 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MarketMappeRevenueShareParams represents params for the above message */ +export interface MarketMapperRevenueShareParams { + /** The address which will receive the revenue share payouts */ + address: string; + /** + * The fraction of the fees which will go to the above mentioned address. + * In parts-per-million + */ + revenueSharePpm: number; + /** + * This parameter defines how many days post market initiation will the + * revenue share be applied for. After valid_days from market initiation + * the revenue share goes down to 0 + */ + validDays: number; +} +export interface MarketMapperRevenueShareParamsProtoMsg { + typeUrl: "/dydxprotocol.revshare.MarketMapperRevenueShareParams"; + value: Uint8Array; +} +/** MarketMappeRevenueShareParams represents params for the above message */ +export interface MarketMapperRevenueShareParamsAmino { + /** The address which will receive the revenue share payouts */ + address?: string; + /** + * The fraction of the fees which will go to the above mentioned address. + * In parts-per-million + */ + revenue_share_ppm?: number; + /** + * This parameter defines how many days post market initiation will the + * revenue share be applied for. After valid_days from market initiation + * the revenue share goes down to 0 + */ + valid_days?: number; +} +export interface MarketMapperRevenueShareParamsAminoMsg { + type: "/dydxprotocol.revshare.MarketMapperRevenueShareParams"; + value: MarketMapperRevenueShareParamsAmino; +} +/** MarketMappeRevenueShareParams represents params for the above message */ +export interface MarketMapperRevenueShareParamsSDKType { + address: string; + revenue_share_ppm: number; + valid_days: number; +} +function createBaseMarketMapperRevenueShareParams(): MarketMapperRevenueShareParams { + return { + address: "", + revenueSharePpm: 0, + validDays: 0 + }; +} +export const MarketMapperRevenueShareParams = { + typeUrl: "/dydxprotocol.revshare.MarketMapperRevenueShareParams", + encode(message: MarketMapperRevenueShareParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.revenueSharePpm !== 0) { + writer.uint32(16).uint32(message.revenueSharePpm); + } + if (message.validDays !== 0) { + writer.uint32(24).uint32(message.validDays); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketMapperRevenueShareParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketMapperRevenueShareParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.revenueSharePpm = reader.uint32(); + break; + case 3: + message.validDays = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketMapperRevenueShareParams { + const message = createBaseMarketMapperRevenueShareParams(); + message.address = object.address ?? ""; + message.revenueSharePpm = object.revenueSharePpm ?? 0; + message.validDays = object.validDays ?? 0; + return message; + }, + fromAmino(object: MarketMapperRevenueShareParamsAmino): MarketMapperRevenueShareParams { + const message = createBaseMarketMapperRevenueShareParams(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.revenue_share_ppm !== undefined && object.revenue_share_ppm !== null) { + message.revenueSharePpm = object.revenue_share_ppm; + } + if (object.valid_days !== undefined && object.valid_days !== null) { + message.validDays = object.valid_days; + } + return message; + }, + toAmino(message: MarketMapperRevenueShareParams): MarketMapperRevenueShareParamsAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.revenue_share_ppm = message.revenueSharePpm === 0 ? undefined : message.revenueSharePpm; + obj.valid_days = message.validDays === 0 ? undefined : message.validDays; + return obj; + }, + fromAminoMsg(object: MarketMapperRevenueShareParamsAminoMsg): MarketMapperRevenueShareParams { + return MarketMapperRevenueShareParams.fromAmino(object.value); + }, + fromProtoMsg(message: MarketMapperRevenueShareParamsProtoMsg): MarketMapperRevenueShareParams { + return MarketMapperRevenueShareParams.decode(message.value); + }, + toProto(message: MarketMapperRevenueShareParams): Uint8Array { + return MarketMapperRevenueShareParams.encode(message).finish(); + }, + toProtoMsg(message: MarketMapperRevenueShareParams): MarketMapperRevenueShareParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.MarketMapperRevenueShareParams", + value: MarketMapperRevenueShareParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/query.rpc.Query.ts new file mode 100644 index 00000000..b0ac1756 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/query.rpc.Query.ts @@ -0,0 +1,45 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryMarketMapperRevenueShareParams, QueryMarketMapperRevenueShareParamsResponse, QueryMarketMapperRevShareDetails, QueryMarketMapperRevShareDetailsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * MarketMapperRevenueShareParams queries the revenue share params for the + * market mapper + */ + marketMapperRevenueShareParams(request?: QueryMarketMapperRevenueShareParams): Promise; + /** Queries market mapper revenue share details for a specific market */ + marketMapperRevShareDetails(request: QueryMarketMapperRevShareDetails): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.marketMapperRevenueShareParams = this.marketMapperRevenueShareParams.bind(this); + this.marketMapperRevShareDetails = this.marketMapperRevShareDetails.bind(this); + } + marketMapperRevenueShareParams(request: QueryMarketMapperRevenueShareParams = {}): Promise { + const data = QueryMarketMapperRevenueShareParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.revshare.Query", "MarketMapperRevenueShareParams", data); + return promise.then(data => QueryMarketMapperRevenueShareParamsResponse.decode(new BinaryReader(data))); + } + marketMapperRevShareDetails(request: QueryMarketMapperRevShareDetails): Promise { + const data = QueryMarketMapperRevShareDetails.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.revshare.Query", "MarketMapperRevShareDetails", data); + return promise.then(data => QueryMarketMapperRevShareDetailsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + marketMapperRevenueShareParams(request?: QueryMarketMapperRevenueShareParams): Promise { + return queryService.marketMapperRevenueShareParams(request); + }, + marketMapperRevShareDetails(request: QueryMarketMapperRevShareDetails): Promise { + return queryService.marketMapperRevShareDetails(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/query.ts new file mode 100644 index 00000000..d14762d4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/query.ts @@ -0,0 +1,317 @@ +//@ts-nocheck +import { MarketMapperRevenueShareParams, MarketMapperRevenueShareParamsAmino, MarketMapperRevenueShareParamsSDKType } from "./params"; +import { MarketMapperRevShareDetails, MarketMapperRevShareDetailsAmino, MarketMapperRevShareDetailsSDKType } from "./revshare"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Queries for the default market mapper revenue share params */ +export interface QueryMarketMapperRevenueShareParams {} +export interface QueryMarketMapperRevenueShareParamsProtoMsg { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParams"; + value: Uint8Array; +} +/** Queries for the default market mapper revenue share params */ +export interface QueryMarketMapperRevenueShareParamsAmino {} +export interface QueryMarketMapperRevenueShareParamsAminoMsg { + type: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParams"; + value: QueryMarketMapperRevenueShareParamsAmino; +} +/** Queries for the default market mapper revenue share params */ +export interface QueryMarketMapperRevenueShareParamsSDKType {} +/** Response type for QueryMarketMapperRevenueShareParams */ +export interface QueryMarketMapperRevenueShareParamsResponse { + params: MarketMapperRevenueShareParams; +} +export interface QueryMarketMapperRevenueShareParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParamsResponse"; + value: Uint8Array; +} +/** Response type for QueryMarketMapperRevenueShareParams */ +export interface QueryMarketMapperRevenueShareParamsResponseAmino { + params?: MarketMapperRevenueShareParamsAmino; +} +export interface QueryMarketMapperRevenueShareParamsResponseAminoMsg { + type: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParamsResponse"; + value: QueryMarketMapperRevenueShareParamsResponseAmino; +} +/** Response type for QueryMarketMapperRevenueShareParams */ +export interface QueryMarketMapperRevenueShareParamsResponseSDKType { + params: MarketMapperRevenueShareParamsSDKType; +} +/** Queries market mapper revenue share details for a specific market */ +export interface QueryMarketMapperRevShareDetails { + marketId: number; +} +export interface QueryMarketMapperRevShareDetailsProtoMsg { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetails"; + value: Uint8Array; +} +/** Queries market mapper revenue share details for a specific market */ +export interface QueryMarketMapperRevShareDetailsAmino { + market_id?: number; +} +export interface QueryMarketMapperRevShareDetailsAminoMsg { + type: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetails"; + value: QueryMarketMapperRevShareDetailsAmino; +} +/** Queries market mapper revenue share details for a specific market */ +export interface QueryMarketMapperRevShareDetailsSDKType { + market_id: number; +} +/** Response type for QueryMarketMapperRevShareDetails */ +export interface QueryMarketMapperRevShareDetailsResponse { + details: MarketMapperRevShareDetails; +} +export interface QueryMarketMapperRevShareDetailsResponseProtoMsg { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetailsResponse"; + value: Uint8Array; +} +/** Response type for QueryMarketMapperRevShareDetails */ +export interface QueryMarketMapperRevShareDetailsResponseAmino { + details?: MarketMapperRevShareDetailsAmino; +} +export interface QueryMarketMapperRevShareDetailsResponseAminoMsg { + type: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetailsResponse"; + value: QueryMarketMapperRevShareDetailsResponseAmino; +} +/** Response type for QueryMarketMapperRevShareDetails */ +export interface QueryMarketMapperRevShareDetailsResponseSDKType { + details: MarketMapperRevShareDetailsSDKType; +} +function createBaseQueryMarketMapperRevenueShareParams(): QueryMarketMapperRevenueShareParams { + return {}; +} +export const QueryMarketMapperRevenueShareParams = { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParams", + encode(_: QueryMarketMapperRevenueShareParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketMapperRevenueShareParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketMapperRevenueShareParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryMarketMapperRevenueShareParams { + const message = createBaseQueryMarketMapperRevenueShareParams(); + return message; + }, + fromAmino(_: QueryMarketMapperRevenueShareParamsAmino): QueryMarketMapperRevenueShareParams { + const message = createBaseQueryMarketMapperRevenueShareParams(); + return message; + }, + toAmino(_: QueryMarketMapperRevenueShareParams): QueryMarketMapperRevenueShareParamsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryMarketMapperRevenueShareParamsAminoMsg): QueryMarketMapperRevenueShareParams { + return QueryMarketMapperRevenueShareParams.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketMapperRevenueShareParamsProtoMsg): QueryMarketMapperRevenueShareParams { + return QueryMarketMapperRevenueShareParams.decode(message.value); + }, + toProto(message: QueryMarketMapperRevenueShareParams): Uint8Array { + return QueryMarketMapperRevenueShareParams.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketMapperRevenueShareParams): QueryMarketMapperRevenueShareParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParams", + value: QueryMarketMapperRevenueShareParams.encode(message).finish() + }; + } +}; +function createBaseQueryMarketMapperRevenueShareParamsResponse(): QueryMarketMapperRevenueShareParamsResponse { + return { + params: MarketMapperRevenueShareParams.fromPartial({}) + }; +} +export const QueryMarketMapperRevenueShareParamsResponse = { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParamsResponse", + encode(message: QueryMarketMapperRevenueShareParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + MarketMapperRevenueShareParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketMapperRevenueShareParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketMapperRevenueShareParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = MarketMapperRevenueShareParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketMapperRevenueShareParamsResponse { + const message = createBaseQueryMarketMapperRevenueShareParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? MarketMapperRevenueShareParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryMarketMapperRevenueShareParamsResponseAmino): QueryMarketMapperRevenueShareParamsResponse { + const message = createBaseQueryMarketMapperRevenueShareParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = MarketMapperRevenueShareParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryMarketMapperRevenueShareParamsResponse): QueryMarketMapperRevenueShareParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? MarketMapperRevenueShareParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMarketMapperRevenueShareParamsResponseAminoMsg): QueryMarketMapperRevenueShareParamsResponse { + return QueryMarketMapperRevenueShareParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketMapperRevenueShareParamsResponseProtoMsg): QueryMarketMapperRevenueShareParamsResponse { + return QueryMarketMapperRevenueShareParamsResponse.decode(message.value); + }, + toProto(message: QueryMarketMapperRevenueShareParamsResponse): Uint8Array { + return QueryMarketMapperRevenueShareParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketMapperRevenueShareParamsResponse): QueryMarketMapperRevenueShareParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParamsResponse", + value: QueryMarketMapperRevenueShareParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryMarketMapperRevShareDetails(): QueryMarketMapperRevShareDetails { + return { + marketId: 0 + }; +} +export const QueryMarketMapperRevShareDetails = { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetails", + encode(message: QueryMarketMapperRevShareDetails, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== 0) { + writer.uint32(8).uint32(message.marketId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketMapperRevShareDetails { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketMapperRevShareDetails(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketMapperRevShareDetails { + const message = createBaseQueryMarketMapperRevShareDetails(); + message.marketId = object.marketId ?? 0; + return message; + }, + fromAmino(object: QueryMarketMapperRevShareDetailsAmino): QueryMarketMapperRevShareDetails { + const message = createBaseQueryMarketMapperRevShareDetails(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + return message; + }, + toAmino(message: QueryMarketMapperRevShareDetails): QueryMarketMapperRevShareDetailsAmino { + const obj: any = {}; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + return obj; + }, + fromAminoMsg(object: QueryMarketMapperRevShareDetailsAminoMsg): QueryMarketMapperRevShareDetails { + return QueryMarketMapperRevShareDetails.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketMapperRevShareDetailsProtoMsg): QueryMarketMapperRevShareDetails { + return QueryMarketMapperRevShareDetails.decode(message.value); + }, + toProto(message: QueryMarketMapperRevShareDetails): Uint8Array { + return QueryMarketMapperRevShareDetails.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketMapperRevShareDetails): QueryMarketMapperRevShareDetailsProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetails", + value: QueryMarketMapperRevShareDetails.encode(message).finish() + }; + } +}; +function createBaseQueryMarketMapperRevShareDetailsResponse(): QueryMarketMapperRevShareDetailsResponse { + return { + details: MarketMapperRevShareDetails.fromPartial({}) + }; +} +export const QueryMarketMapperRevShareDetailsResponse = { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetailsResponse", + encode(message: QueryMarketMapperRevShareDetailsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.details !== undefined) { + MarketMapperRevShareDetails.encode(message.details, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketMapperRevShareDetailsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketMapperRevShareDetailsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.details = MarketMapperRevShareDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketMapperRevShareDetailsResponse { + const message = createBaseQueryMarketMapperRevShareDetailsResponse(); + message.details = object.details !== undefined && object.details !== null ? MarketMapperRevShareDetails.fromPartial(object.details) : undefined; + return message; + }, + fromAmino(object: QueryMarketMapperRevShareDetailsResponseAmino): QueryMarketMapperRevShareDetailsResponse { + const message = createBaseQueryMarketMapperRevShareDetailsResponse(); + if (object.details !== undefined && object.details !== null) { + message.details = MarketMapperRevShareDetails.fromAmino(object.details); + } + return message; + }, + toAmino(message: QueryMarketMapperRevShareDetailsResponse): QueryMarketMapperRevShareDetailsResponseAmino { + const obj: any = {}; + obj.details = message.details ? MarketMapperRevShareDetails.toAmino(message.details) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMarketMapperRevShareDetailsResponseAminoMsg): QueryMarketMapperRevShareDetailsResponse { + return QueryMarketMapperRevShareDetailsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketMapperRevShareDetailsResponseProtoMsg): QueryMarketMapperRevShareDetailsResponse { + return QueryMarketMapperRevShareDetailsResponse.decode(message.value); + }, + toProto(message: QueryMarketMapperRevShareDetailsResponse): Uint8Array { + return QueryMarketMapperRevShareDetailsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketMapperRevShareDetailsResponse): QueryMarketMapperRevShareDetailsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.QueryMarketMapperRevShareDetailsResponse", + value: QueryMarketMapperRevShareDetailsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/revshare.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/revshare.ts new file mode 100644 index 00000000..ba724141 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/revshare.ts @@ -0,0 +1,96 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * MarketMapperRevShareDetails specifies any details associated with the market + * mapper revenue share + */ +export interface MarketMapperRevShareDetails { + /** Unix timestamp recorded when the market revenue share expires */ + expirationTs: bigint; +} +export interface MarketMapperRevShareDetailsProtoMsg { + typeUrl: "/dydxprotocol.revshare.MarketMapperRevShareDetails"; + value: Uint8Array; +} +/** + * MarketMapperRevShareDetails specifies any details associated with the market + * mapper revenue share + */ +export interface MarketMapperRevShareDetailsAmino { + /** Unix timestamp recorded when the market revenue share expires */ + expiration_ts?: string; +} +export interface MarketMapperRevShareDetailsAminoMsg { + type: "/dydxprotocol.revshare.MarketMapperRevShareDetails"; + value: MarketMapperRevShareDetailsAmino; +} +/** + * MarketMapperRevShareDetails specifies any details associated with the market + * mapper revenue share + */ +export interface MarketMapperRevShareDetailsSDKType { + expiration_ts: bigint; +} +function createBaseMarketMapperRevShareDetails(): MarketMapperRevShareDetails { + return { + expirationTs: BigInt(0) + }; +} +export const MarketMapperRevShareDetails = { + typeUrl: "/dydxprotocol.revshare.MarketMapperRevShareDetails", + encode(message: MarketMapperRevShareDetails, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.expirationTs !== BigInt(0)) { + writer.uint32(8).uint64(message.expirationTs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketMapperRevShareDetails { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketMapperRevShareDetails(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expirationTs = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketMapperRevShareDetails { + const message = createBaseMarketMapperRevShareDetails(); + message.expirationTs = object.expirationTs !== undefined && object.expirationTs !== null ? BigInt(object.expirationTs.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MarketMapperRevShareDetailsAmino): MarketMapperRevShareDetails { + const message = createBaseMarketMapperRevShareDetails(); + if (object.expiration_ts !== undefined && object.expiration_ts !== null) { + message.expirationTs = BigInt(object.expiration_ts); + } + return message; + }, + toAmino(message: MarketMapperRevShareDetails): MarketMapperRevShareDetailsAmino { + const obj: any = {}; + obj.expiration_ts = message.expirationTs !== BigInt(0) ? message.expirationTs.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MarketMapperRevShareDetailsAminoMsg): MarketMapperRevShareDetails { + return MarketMapperRevShareDetails.fromAmino(object.value); + }, + fromProtoMsg(message: MarketMapperRevShareDetailsProtoMsg): MarketMapperRevShareDetails { + return MarketMapperRevShareDetails.decode(message.value); + }, + toProto(message: MarketMapperRevShareDetails): Uint8Array { + return MarketMapperRevShareDetails.encode(message).finish(); + }, + toProtoMsg(message: MarketMapperRevShareDetails): MarketMapperRevShareDetailsProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.MarketMapperRevShareDetails", + value: MarketMapperRevShareDetails.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.amino.ts new file mode 100644 index 00000000..b2f423b7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgSetMarketMapperRevenueShare, MsgSetMarketMapperRevShareDetailsForMarket } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare": { + aminoType: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare", + toAmino: MsgSetMarketMapperRevenueShare.toAmino, + fromAmino: MsgSetMarketMapperRevenueShare.fromAmino + }, + "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket": { + aminoType: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket", + toAmino: MsgSetMarketMapperRevShareDetailsForMarket.toAmino, + fromAmino: MsgSetMarketMapperRevShareDetailsForMarket.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.registry.ts new file mode 100644 index 00000000..f680e1c2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSetMarketMapperRevenueShare, MsgSetMarketMapperRevShareDetailsForMarket } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare", MsgSetMarketMapperRevenueShare], ["/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket", MsgSetMarketMapperRevShareDetailsForMarket]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setMarketMapperRevenueShare(value: MsgSetMarketMapperRevenueShare) { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare", + value: MsgSetMarketMapperRevenueShare.encode(value).finish() + }; + }, + setMarketMapperRevShareDetailsForMarket(value: MsgSetMarketMapperRevShareDetailsForMarket) { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket", + value: MsgSetMarketMapperRevShareDetailsForMarket.encode(value).finish() + }; + } + }, + withTypeUrl: { + setMarketMapperRevenueShare(value: MsgSetMarketMapperRevenueShare) { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare", + value + }; + }, + setMarketMapperRevShareDetailsForMarket(value: MsgSetMarketMapperRevShareDetailsForMarket) { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket", + value + }; + } + }, + fromPartial: { + setMarketMapperRevenueShare(value: MsgSetMarketMapperRevenueShare) { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare", + value: MsgSetMarketMapperRevenueShare.fromPartial(value) + }; + }, + setMarketMapperRevShareDetailsForMarket(value: MsgSetMarketMapperRevShareDetailsForMarket) { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket", + value: MsgSetMarketMapperRevShareDetailsForMarket.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.rpc.msg.ts new file mode 100644 index 00000000..5bf144a9 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.rpc.msg.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgSetMarketMapperRevenueShare, MsgSetMarketMapperRevenueShareResponse, MsgSetMarketMapperRevShareDetailsForMarket, MsgSetMarketMapperRevShareDetailsForMarketResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * SetMarketMapperRevenueShare sets the revenue share for a market + * mapper. + */ + setMarketMapperRevenueShare(request: MsgSetMarketMapperRevenueShare): Promise; + /** + * SetMarketMapperRevenueShareDetails sets the revenue share details for a + * market mapper. + */ + setMarketMapperRevShareDetailsForMarket(request: MsgSetMarketMapperRevShareDetailsForMarket): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setMarketMapperRevenueShare = this.setMarketMapperRevenueShare.bind(this); + this.setMarketMapperRevShareDetailsForMarket = this.setMarketMapperRevShareDetailsForMarket.bind(this); + } + setMarketMapperRevenueShare(request: MsgSetMarketMapperRevenueShare): Promise { + const data = MsgSetMarketMapperRevenueShare.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.revshare.Msg", "SetMarketMapperRevenueShare", data); + return promise.then(data => MsgSetMarketMapperRevenueShareResponse.decode(new BinaryReader(data))); + } + setMarketMapperRevShareDetailsForMarket(request: MsgSetMarketMapperRevShareDetailsForMarket): Promise { + const data = MsgSetMarketMapperRevShareDetailsForMarket.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.revshare.Msg", "SetMarketMapperRevShareDetailsForMarket", data); + return promise.then(data => MsgSetMarketMapperRevShareDetailsForMarketResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.ts new file mode 100644 index 00000000..bae72f4f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/revshare/tx.ts @@ -0,0 +1,361 @@ +//@ts-nocheck +import { MarketMapperRevenueShareParams, MarketMapperRevenueShareParamsAmino, MarketMapperRevenueShareParamsSDKType } from "./params"; +import { MarketMapperRevShareDetails, MarketMapperRevShareDetailsAmino, MarketMapperRevShareDetailsSDKType } from "./revshare"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Message to set the market mapper revenue share */ +export interface MsgSetMarketMapperRevenueShare { + authority: string; + /** Parameters for the revenue share */ + params: MarketMapperRevenueShareParams; +} +export interface MsgSetMarketMapperRevenueShareProtoMsg { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare"; + value: Uint8Array; +} +/** Message to set the market mapper revenue share */ +export interface MsgSetMarketMapperRevenueShareAmino { + authority?: string; + /** Parameters for the revenue share */ + params?: MarketMapperRevenueShareParamsAmino; +} +export interface MsgSetMarketMapperRevenueShareAminoMsg { + type: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare"; + value: MsgSetMarketMapperRevenueShareAmino; +} +/** Message to set the market mapper revenue share */ +export interface MsgSetMarketMapperRevenueShareSDKType { + authority: string; + params: MarketMapperRevenueShareParamsSDKType; +} +/** Response to a MsgSetMarketMapperRevenueShare */ +export interface MsgSetMarketMapperRevenueShareResponse {} +export interface MsgSetMarketMapperRevenueShareResponseProtoMsg { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShareResponse"; + value: Uint8Array; +} +/** Response to a MsgSetMarketMapperRevenueShare */ +export interface MsgSetMarketMapperRevenueShareResponseAmino {} +export interface MsgSetMarketMapperRevenueShareResponseAminoMsg { + type: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShareResponse"; + value: MsgSetMarketMapperRevenueShareResponseAmino; +} +/** Response to a MsgSetMarketMapperRevenueShare */ +export interface MsgSetMarketMapperRevenueShareResponseSDKType {} +/** + * Msg to set market mapper revenue share details (e.g. expiration timestamp) + * for a specific market. To be used as an override for existing revenue share + * settings set by the MsgSetMarketMapperRevenueShare msg + */ +export interface MsgSetMarketMapperRevShareDetailsForMarket { + authority: string; + /** The market ID for which to set the revenue share details */ + marketId: number; + /** Parameters for the revenue share details */ + params: MarketMapperRevShareDetails; +} +export interface MsgSetMarketMapperRevShareDetailsForMarketProtoMsg { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket"; + value: Uint8Array; +} +/** + * Msg to set market mapper revenue share details (e.g. expiration timestamp) + * for a specific market. To be used as an override for existing revenue share + * settings set by the MsgSetMarketMapperRevenueShare msg + */ +export interface MsgSetMarketMapperRevShareDetailsForMarketAmino { + authority?: string; + /** The market ID for which to set the revenue share details */ + market_id?: number; + /** Parameters for the revenue share details */ + params?: MarketMapperRevShareDetailsAmino; +} +export interface MsgSetMarketMapperRevShareDetailsForMarketAminoMsg { + type: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket"; + value: MsgSetMarketMapperRevShareDetailsForMarketAmino; +} +/** + * Msg to set market mapper revenue share details (e.g. expiration timestamp) + * for a specific market. To be used as an override for existing revenue share + * settings set by the MsgSetMarketMapperRevenueShare msg + */ +export interface MsgSetMarketMapperRevShareDetailsForMarketSDKType { + authority: string; + market_id: number; + params: MarketMapperRevShareDetailsSDKType; +} +/** Response to a MsgSetMarketMapperRevShareDetailsForMarket */ +export interface MsgSetMarketMapperRevShareDetailsForMarketResponse {} +export interface MsgSetMarketMapperRevShareDetailsForMarketResponseProtoMsg { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarketResponse"; + value: Uint8Array; +} +/** Response to a MsgSetMarketMapperRevShareDetailsForMarket */ +export interface MsgSetMarketMapperRevShareDetailsForMarketResponseAmino {} +export interface MsgSetMarketMapperRevShareDetailsForMarketResponseAminoMsg { + type: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarketResponse"; + value: MsgSetMarketMapperRevShareDetailsForMarketResponseAmino; +} +/** Response to a MsgSetMarketMapperRevShareDetailsForMarket */ +export interface MsgSetMarketMapperRevShareDetailsForMarketResponseSDKType {} +function createBaseMsgSetMarketMapperRevenueShare(): MsgSetMarketMapperRevenueShare { + return { + authority: "", + params: MarketMapperRevenueShareParams.fromPartial({}) + }; +} +export const MsgSetMarketMapperRevenueShare = { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare", + encode(message: MsgSetMarketMapperRevenueShare, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + MarketMapperRevenueShareParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetMarketMapperRevenueShare { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketMapperRevenueShare(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = MarketMapperRevenueShareParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetMarketMapperRevenueShare { + const message = createBaseMsgSetMarketMapperRevenueShare(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? MarketMapperRevenueShareParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgSetMarketMapperRevenueShareAmino): MsgSetMarketMapperRevenueShare { + const message = createBaseMsgSetMarketMapperRevenueShare(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = MarketMapperRevenueShareParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgSetMarketMapperRevenueShare): MsgSetMarketMapperRevenueShareAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? MarketMapperRevenueShareParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetMarketMapperRevenueShareAminoMsg): MsgSetMarketMapperRevenueShare { + return MsgSetMarketMapperRevenueShare.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMarketMapperRevenueShareProtoMsg): MsgSetMarketMapperRevenueShare { + return MsgSetMarketMapperRevenueShare.decode(message.value); + }, + toProto(message: MsgSetMarketMapperRevenueShare): Uint8Array { + return MsgSetMarketMapperRevenueShare.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMarketMapperRevenueShare): MsgSetMarketMapperRevenueShareProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare", + value: MsgSetMarketMapperRevenueShare.encode(message).finish() + }; + } +}; +function createBaseMsgSetMarketMapperRevenueShareResponse(): MsgSetMarketMapperRevenueShareResponse { + return {}; +} +export const MsgSetMarketMapperRevenueShareResponse = { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShareResponse", + encode(_: MsgSetMarketMapperRevenueShareResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetMarketMapperRevenueShareResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketMapperRevenueShareResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetMarketMapperRevenueShareResponse { + const message = createBaseMsgSetMarketMapperRevenueShareResponse(); + return message; + }, + fromAmino(_: MsgSetMarketMapperRevenueShareResponseAmino): MsgSetMarketMapperRevenueShareResponse { + const message = createBaseMsgSetMarketMapperRevenueShareResponse(); + return message; + }, + toAmino(_: MsgSetMarketMapperRevenueShareResponse): MsgSetMarketMapperRevenueShareResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetMarketMapperRevenueShareResponseAminoMsg): MsgSetMarketMapperRevenueShareResponse { + return MsgSetMarketMapperRevenueShareResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMarketMapperRevenueShareResponseProtoMsg): MsgSetMarketMapperRevenueShareResponse { + return MsgSetMarketMapperRevenueShareResponse.decode(message.value); + }, + toProto(message: MsgSetMarketMapperRevenueShareResponse): Uint8Array { + return MsgSetMarketMapperRevenueShareResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMarketMapperRevenueShareResponse): MsgSetMarketMapperRevenueShareResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShareResponse", + value: MsgSetMarketMapperRevenueShareResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetMarketMapperRevShareDetailsForMarket(): MsgSetMarketMapperRevShareDetailsForMarket { + return { + authority: "", + marketId: 0, + params: MarketMapperRevShareDetails.fromPartial({}) + }; +} +export const MsgSetMarketMapperRevShareDetailsForMarket = { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket", + encode(message: MsgSetMarketMapperRevShareDetailsForMarket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.marketId !== 0) { + writer.uint32(16).uint32(message.marketId); + } + if (message.params !== undefined) { + MarketMapperRevShareDetails.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetMarketMapperRevShareDetailsForMarket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketMapperRevShareDetailsForMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.marketId = reader.uint32(); + break; + case 3: + message.params = MarketMapperRevShareDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetMarketMapperRevShareDetailsForMarket { + const message = createBaseMsgSetMarketMapperRevShareDetailsForMarket(); + message.authority = object.authority ?? ""; + message.marketId = object.marketId ?? 0; + message.params = object.params !== undefined && object.params !== null ? MarketMapperRevShareDetails.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgSetMarketMapperRevShareDetailsForMarketAmino): MsgSetMarketMapperRevShareDetailsForMarket { + const message = createBaseMsgSetMarketMapperRevShareDetailsForMarket(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.params !== undefined && object.params !== null) { + message.params = MarketMapperRevShareDetails.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgSetMarketMapperRevShareDetailsForMarket): MsgSetMarketMapperRevShareDetailsForMarketAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.params = message.params ? MarketMapperRevShareDetails.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetMarketMapperRevShareDetailsForMarketAminoMsg): MsgSetMarketMapperRevShareDetailsForMarket { + return MsgSetMarketMapperRevShareDetailsForMarket.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMarketMapperRevShareDetailsForMarketProtoMsg): MsgSetMarketMapperRevShareDetailsForMarket { + return MsgSetMarketMapperRevShareDetailsForMarket.decode(message.value); + }, + toProto(message: MsgSetMarketMapperRevShareDetailsForMarket): Uint8Array { + return MsgSetMarketMapperRevShareDetailsForMarket.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMarketMapperRevShareDetailsForMarket): MsgSetMarketMapperRevShareDetailsForMarketProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket", + value: MsgSetMarketMapperRevShareDetailsForMarket.encode(message).finish() + }; + } +}; +function createBaseMsgSetMarketMapperRevShareDetailsForMarketResponse(): MsgSetMarketMapperRevShareDetailsForMarketResponse { + return {}; +} +export const MsgSetMarketMapperRevShareDetailsForMarketResponse = { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarketResponse", + encode(_: MsgSetMarketMapperRevShareDetailsForMarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetMarketMapperRevShareDetailsForMarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketMapperRevShareDetailsForMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetMarketMapperRevShareDetailsForMarketResponse { + const message = createBaseMsgSetMarketMapperRevShareDetailsForMarketResponse(); + return message; + }, + fromAmino(_: MsgSetMarketMapperRevShareDetailsForMarketResponseAmino): MsgSetMarketMapperRevShareDetailsForMarketResponse { + const message = createBaseMsgSetMarketMapperRevShareDetailsForMarketResponse(); + return message; + }, + toAmino(_: MsgSetMarketMapperRevShareDetailsForMarketResponse): MsgSetMarketMapperRevShareDetailsForMarketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetMarketMapperRevShareDetailsForMarketResponseAminoMsg): MsgSetMarketMapperRevShareDetailsForMarketResponse { + return MsgSetMarketMapperRevShareDetailsForMarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMarketMapperRevShareDetailsForMarketResponseProtoMsg): MsgSetMarketMapperRevShareDetailsForMarketResponse { + return MsgSetMarketMapperRevShareDetailsForMarketResponse.decode(message.value); + }, + toProto(message: MsgSetMarketMapperRevShareDetailsForMarketResponse): Uint8Array { + return MsgSetMarketMapperRevShareDetailsForMarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMarketMapperRevShareDetailsForMarketResponse): MsgSetMarketMapperRevShareDetailsForMarketResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarketResponse", + value: MsgSetMarketMapperRevShareDetailsForMarketResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/genesis.ts new file mode 100644 index 00000000..5cab48d6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/genesis.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the rewards module's genesis state. */ +export interface GenesisState { + /** The parameters of the module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.rewards.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the rewards module's genesis state. */ +export interface GenesisStateAmino { + /** The parameters of the module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.rewards.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the rewards module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.rewards.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.rewards.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/params.ts new file mode 100644 index 00000000..a102aaa3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/params.ts @@ -0,0 +1,171 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Params defines the parameters for x/rewards module. */ +export interface Params { + /** The module account to distribute rewards from. */ + treasuryAccount: string; + /** The denom of the rewards token. */ + denom: string; + /** + * The exponent of converting one unit of `denom` to a full coin. + * For example, `denom=uatom, denom_exponent=-6` defines that + * `1 uatom = 10^(-6) ATOM`. This conversion is needed since the + * `market_id` retrieves the price of a full coin of the reward token. + */ + denomExponent: number; + /** The id of the market that has the price of the rewards token. */ + marketId: number; + /** + * The amount (in ppm) that fees are multiplied by to get + * the maximum rewards amount. + */ + feeMultiplierPpm: number; +} +export interface ParamsProtoMsg { + typeUrl: "/dydxprotocol.rewards.Params"; + value: Uint8Array; +} +/** Params defines the parameters for x/rewards module. */ +export interface ParamsAmino { + /** The module account to distribute rewards from. */ + treasury_account?: string; + /** The denom of the rewards token. */ + denom?: string; + /** + * The exponent of converting one unit of `denom` to a full coin. + * For example, `denom=uatom, denom_exponent=-6` defines that + * `1 uatom = 10^(-6) ATOM`. This conversion is needed since the + * `market_id` retrieves the price of a full coin of the reward token. + */ + denom_exponent?: number; + /** The id of the market that has the price of the rewards token. */ + market_id?: number; + /** + * The amount (in ppm) that fees are multiplied by to get + * the maximum rewards amount. + */ + fee_multiplier_ppm?: number; +} +export interface ParamsAminoMsg { + type: "/dydxprotocol.rewards.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for x/rewards module. */ +export interface ParamsSDKType { + treasury_account: string; + denom: string; + denom_exponent: number; + market_id: number; + fee_multiplier_ppm: number; +} +function createBaseParams(): Params { + return { + treasuryAccount: "", + denom: "", + denomExponent: 0, + marketId: 0, + feeMultiplierPpm: 0 + }; +} +export const Params = { + typeUrl: "/dydxprotocol.rewards.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.treasuryAccount !== "") { + writer.uint32(10).string(message.treasuryAccount); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.denomExponent !== 0) { + writer.uint32(24).sint32(message.denomExponent); + } + if (message.marketId !== 0) { + writer.uint32(32).uint32(message.marketId); + } + if (message.feeMultiplierPpm !== 0) { + writer.uint32(40).uint32(message.feeMultiplierPpm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.treasuryAccount = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.denomExponent = reader.sint32(); + break; + case 4: + message.marketId = reader.uint32(); + break; + case 5: + message.feeMultiplierPpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.treasuryAccount = object.treasuryAccount ?? ""; + message.denom = object.denom ?? ""; + message.denomExponent = object.denomExponent ?? 0; + message.marketId = object.marketId ?? 0; + message.feeMultiplierPpm = object.feeMultiplierPpm ?? 0; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.treasury_account !== undefined && object.treasury_account !== null) { + message.treasuryAccount = object.treasury_account; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.denom_exponent !== undefined && object.denom_exponent !== null) { + message.denomExponent = object.denom_exponent; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = object.market_id; + } + if (object.fee_multiplier_ppm !== undefined && object.fee_multiplier_ppm !== null) { + message.feeMultiplierPpm = object.fee_multiplier_ppm; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.treasury_account = message.treasuryAccount === "" ? undefined : message.treasuryAccount; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.denom_exponent = message.denomExponent === 0 ? undefined : message.denomExponent; + obj.market_id = message.marketId === 0 ? undefined : message.marketId; + obj.fee_multiplier_ppm = message.feeMultiplierPpm === 0 ? undefined : message.feeMultiplierPpm; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.rewards.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/query.rpc.Query.ts new file mode 100644 index 00000000..a5b012bb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/query.rpc.Query.ts @@ -0,0 +1,31 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the Params. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.rewards.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/query.ts new file mode 100644 index 00000000..d5c16cfd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/query.ts @@ -0,0 +1,150 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.rewards.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/dydxprotocol.rewards.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.rewards.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponseAmino { + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/dydxprotocol.rewards.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/dydxprotocol.rewards.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.rewards.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/dydxprotocol.rewards.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.rewards.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/reward_share.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/reward_share.ts new file mode 100644 index 00000000..71bb92d1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/reward_share.ts @@ -0,0 +1,110 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * RewardShare stores the relative weight of rewards that each address is + * entitled to. + */ +export interface RewardShare { + address: string; + weight: Uint8Array; +} +export interface RewardShareProtoMsg { + typeUrl: "/dydxprotocol.rewards.RewardShare"; + value: Uint8Array; +} +/** + * RewardShare stores the relative weight of rewards that each address is + * entitled to. + */ +export interface RewardShareAmino { + address?: string; + weight?: string; +} +export interface RewardShareAminoMsg { + type: "/dydxprotocol.rewards.RewardShare"; + value: RewardShareAmino; +} +/** + * RewardShare stores the relative weight of rewards that each address is + * entitled to. + */ +export interface RewardShareSDKType { + address: string; + weight: Uint8Array; +} +function createBaseRewardShare(): RewardShare { + return { + address: "", + weight: new Uint8Array() + }; +} +export const RewardShare = { + typeUrl: "/dydxprotocol.rewards.RewardShare", + encode(message: RewardShare, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.weight.length !== 0) { + writer.uint32(18).bytes(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RewardShare { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardShare(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.weight = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RewardShare { + const message = createBaseRewardShare(); + message.address = object.address ?? ""; + message.weight = object.weight ?? new Uint8Array(); + return message; + }, + fromAmino(object: RewardShareAmino): RewardShare { + const message = createBaseRewardShare(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = bytesFromBase64(object.weight); + } + return message; + }, + toAmino(message: RewardShare): RewardShareAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.weight = message.weight ? base64FromBytes(message.weight) : undefined; + return obj; + }, + fromAminoMsg(object: RewardShareAminoMsg): RewardShare { + return RewardShare.fromAmino(object.value); + }, + fromProtoMsg(message: RewardShareProtoMsg): RewardShare { + return RewardShare.decode(message.value); + }, + toProto(message: RewardShare): Uint8Array { + return RewardShare.encode(message).finish(); + }, + toProtoMsg(message: RewardShare): RewardShareProtoMsg { + return { + typeUrl: "/dydxprotocol.rewards.RewardShare", + value: RewardShare.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.amino.ts new file mode 100644 index 00000000..9c3fbb20 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.rewards.MsgUpdateParams": { + aminoType: "/dydxprotocol.rewards.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.registry.ts new file mode 100644 index 00000000..3193a097 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.rewards.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.rpc.msg.ts new file mode 100644 index 00000000..dad63e53 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.rpc.msg.ts @@ -0,0 +1,21 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** UpdateParams updates the Params in state. */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.rewards.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.ts new file mode 100644 index 00000000..17032b90 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rewards/tx.ts @@ -0,0 +1,167 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + authority: string; + /** The parameters to update. Each field must be set. */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + authority?: string; + /** The parameters to update. Each field must be set. */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "/dydxprotocol.rewards.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse is the Msg/UpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse is the Msg/UpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/dydxprotocol.rewards.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse is the Msg/UpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.rewards.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rpc.query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rpc.query.ts new file mode 100644 index 00000000..00649cb2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rpc.query.ts @@ -0,0 +1,74 @@ +//@ts-nocheck +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + group: { + v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + dydxprotocol: { + affiliates: (await import("./affiliates/query.rpc.Query")).createRpcQueryExtension(client), + assets: (await import("./assets/query.rpc.Query")).createRpcQueryExtension(client), + blocktime: (await import("./blocktime/query.rpc.Query")).createRpcQueryExtension(client), + bridge: (await import("./bridge/query.rpc.Query")).createRpcQueryExtension(client), + clob: (await import("./clob/query.rpc.Query")).createRpcQueryExtension(client), + delaymsg: (await import("./delaymsg/query.rpc.Query")).createRpcQueryExtension(client), + epochs: (await import("./epochs/query.rpc.Query")).createRpcQueryExtension(client), + feetiers: (await import("./feetiers/query.rpc.Query")).createRpcQueryExtension(client), + govplus: (await import("./govplus/query.rpc.Query")).createRpcQueryExtension(client), + listing: (await import("./listing/query.rpc.Query")).createRpcQueryExtension(client), + perpetuals: (await import("./perpetuals/query.rpc.Query")).createRpcQueryExtension(client), + prices: (await import("./prices/query.rpc.Query")).createRpcQueryExtension(client), + ratelimit: (await import("./ratelimit/query.rpc.Query")).createRpcQueryExtension(client), + revshare: (await import("./revshare/query.rpc.Query")).createRpcQueryExtension(client), + rewards: (await import("./rewards/query.rpc.Query")).createRpcQueryExtension(client), + sending: (await import("./sending/query.rpc.Query")).createRpcQueryExtension(client), + stats: (await import("./stats/query.rpc.Query")).createRpcQueryExtension(client), + subaccounts: (await import("./subaccounts/query.rpc.Query")).createRpcQueryExtension(client), + vault: (await import("./vault/query.rpc.Query")).createRpcQueryExtension(client), + vest: (await import("./vest/query.rpc.Query")).createRpcQueryExtension(client) + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/rpc.tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/rpc.tx.ts new file mode 100644 index 00000000..d7c2fc61 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/rpc.tx.ts @@ -0,0 +1,57 @@ +//@ts-nocheck +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + group: { + v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + vesting: { + v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + dydxprotocol: { + affiliates: new (await import("./affiliates/tx.rpc.msg")).MsgClientImpl(rpc), + blocktime: new (await import("./blocktime/tx.rpc.msg")).MsgClientImpl(rpc), + bridge: new (await import("./bridge/tx.rpc.msg")).MsgClientImpl(rpc), + clob: new (await import("./clob/tx.rpc.msg")).MsgClientImpl(rpc), + delaymsg: new (await import("./delaymsg/tx.rpc.msg")).MsgClientImpl(rpc), + feetiers: new (await import("./feetiers/tx.rpc.msg")).MsgClientImpl(rpc), + govplus: new (await import("./govplus/tx.rpc.msg")).MsgClientImpl(rpc), + listing: new (await import("./listing/tx.rpc.msg")).MsgClientImpl(rpc), + perpetuals: new (await import("./perpetuals/tx.rpc.msg")).MsgClientImpl(rpc), + prices: new (await import("./prices/tx.rpc.msg")).MsgClientImpl(rpc), + ratelimit: new (await import("./ratelimit/tx.rpc.msg")).MsgClientImpl(rpc), + revshare: new (await import("./revshare/tx.rpc.msg")).MsgClientImpl(rpc), + rewards: new (await import("./rewards/tx.rpc.msg")).MsgClientImpl(rpc), + sending: new (await import("./sending/tx.rpc.msg")).MsgClientImpl(rpc), + stats: new (await import("./stats/tx.rpc.msg")).MsgClientImpl(rpc), + vault: new (await import("./vault/tx.rpc.msg")).MsgClientImpl(rpc), + vest: new (await import("./vest/tx.rpc.msg")).MsgClientImpl(rpc) + } +}); \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/genesis.ts new file mode 100644 index 00000000..c1b562f6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/genesis.ts @@ -0,0 +1,66 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the sending module's genesis state. */ +export interface GenesisState {} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.sending.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the sending module's genesis state. */ +export interface GenesisStateAmino {} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.sending.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the sending module's genesis state. */ +export interface GenesisStateSDKType {} +function createBaseGenesisState(): GenesisState { + return {}; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.sending.GenesisState", + encode(_: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GenesisState { + const message = createBaseGenesisState(); + return message; + }, + fromAmino(_: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + return message; + }, + toAmino(_: GenesisState): GenesisStateAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/query.rpc.Query.ts new file mode 100644 index 00000000..2d4519c3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/query.rpc.Query.ts @@ -0,0 +1,16 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +/** Query defines the gRPC querier service. */ +export interface Query {} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return {}; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/query.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/query.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/transfer.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/transfer.ts new file mode 100644 index 00000000..d02e972e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/transfer.ts @@ -0,0 +1,585 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Transfer represents a single transfer between two subaccounts. */ +export interface Transfer { + /** The sender subaccount ID. */ + sender: SubaccountId; + /** The recipient subaccount ID. */ + recipient: SubaccountId; + /** Id of the asset to transfer. */ + assetId: number; + /** The amount of asset to transfer */ + amount: bigint; +} +export interface TransferProtoMsg { + typeUrl: "/dydxprotocol.sending.Transfer"; + value: Uint8Array; +} +/** Transfer represents a single transfer between two subaccounts. */ +export interface TransferAmino { + /** The sender subaccount ID. */ + sender?: SubaccountIdAmino; + /** The recipient subaccount ID. */ + recipient?: SubaccountIdAmino; + /** Id of the asset to transfer. */ + asset_id?: number; + /** The amount of asset to transfer */ + amount?: string; +} +export interface TransferAminoMsg { + type: "/dydxprotocol.sending.Transfer"; + value: TransferAmino; +} +/** Transfer represents a single transfer between two subaccounts. */ +export interface TransferSDKType { + sender: SubaccountIdSDKType; + recipient: SubaccountIdSDKType; + asset_id: number; + amount: bigint; +} +/** + * MsgDepositToSubaccount represents a single transfer from an `x/bank` + * account to an `x/subaccounts` subaccount. + */ +export interface MsgDepositToSubaccount { + /** The sender wallet address. */ + sender: string; + /** The recipient subaccount ID. */ + recipient: SubaccountId; + /** Id of the asset to transfer. */ + assetId: number; + /** The number of quantums of asset to transfer. */ + quantums: bigint; +} +export interface MsgDepositToSubaccountProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccount"; + value: Uint8Array; +} +/** + * MsgDepositToSubaccount represents a single transfer from an `x/bank` + * account to an `x/subaccounts` subaccount. + */ +export interface MsgDepositToSubaccountAmino { + /** The sender wallet address. */ + sender?: string; + /** The recipient subaccount ID. */ + recipient?: SubaccountIdAmino; + /** Id of the asset to transfer. */ + asset_id?: number; + /** The number of quantums of asset to transfer. */ + quantums?: string; +} +export interface MsgDepositToSubaccountAminoMsg { + type: "/dydxprotocol.sending.MsgDepositToSubaccount"; + value: MsgDepositToSubaccountAmino; +} +/** + * MsgDepositToSubaccount represents a single transfer from an `x/bank` + * account to an `x/subaccounts` subaccount. + */ +export interface MsgDepositToSubaccountSDKType { + sender: string; + recipient: SubaccountIdSDKType; + asset_id: number; + quantums: bigint; +} +/** + * MsgWithdrawFromSubaccount represents a single transfer from an + * `x/subaccounts` subaccount to an `x/bank` account. + */ +export interface MsgWithdrawFromSubaccount { + /** The sender subaccount ID. */ + sender: SubaccountId; + /** The recipient wallet address. */ + recipient: string; + /** Id of the asset to transfer. */ + assetId: number; + /** The number of quantums of asset to transfer. */ + quantums: bigint; +} +export interface MsgWithdrawFromSubaccountProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccount"; + value: Uint8Array; +} +/** + * MsgWithdrawFromSubaccount represents a single transfer from an + * `x/subaccounts` subaccount to an `x/bank` account. + */ +export interface MsgWithdrawFromSubaccountAmino { + /** The sender subaccount ID. */ + sender?: SubaccountIdAmino; + /** The recipient wallet address. */ + recipient?: string; + /** Id of the asset to transfer. */ + asset_id?: number; + /** The number of quantums of asset to transfer. */ + quantums?: string; +} +export interface MsgWithdrawFromSubaccountAminoMsg { + type: "/dydxprotocol.sending.MsgWithdrawFromSubaccount"; + value: MsgWithdrawFromSubaccountAmino; +} +/** + * MsgWithdrawFromSubaccount represents a single transfer from an + * `x/subaccounts` subaccount to an `x/bank` account. + */ +export interface MsgWithdrawFromSubaccountSDKType { + sender: SubaccountIdSDKType; + recipient: string; + asset_id: number; + quantums: bigint; +} +/** + * MsgSendFromModuleToAccount represents a single transfer from a module + * to an `x/bank` account (can be either a module account address or a user + * account address). + * Should only be executed by governance. + */ +export interface MsgSendFromModuleToAccount { + authority: string; + /** The sender module name. */ + senderModuleName: string; + /** + * The recipient account address (can be either a module account address + * or a user account address). + */ + recipient: string; + /** The coin to transfer, which specifies both denom and amount. */ + coin: Coin; +} +export interface MsgSendFromModuleToAccountProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccount"; + value: Uint8Array; +} +/** + * MsgSendFromModuleToAccount represents a single transfer from a module + * to an `x/bank` account (can be either a module account address or a user + * account address). + * Should only be executed by governance. + */ +export interface MsgSendFromModuleToAccountAmino { + authority?: string; + /** The sender module name. */ + sender_module_name?: string; + /** + * The recipient account address (can be either a module account address + * or a user account address). + */ + recipient?: string; + /** The coin to transfer, which specifies both denom and amount. */ + coin?: CoinAmino; +} +export interface MsgSendFromModuleToAccountAminoMsg { + type: "/dydxprotocol.sending.MsgSendFromModuleToAccount"; + value: MsgSendFromModuleToAccountAmino; +} +/** + * MsgSendFromModuleToAccount represents a single transfer from a module + * to an `x/bank` account (can be either a module account address or a user + * account address). + * Should only be executed by governance. + */ +export interface MsgSendFromModuleToAccountSDKType { + authority: string; + sender_module_name: string; + recipient: string; + coin: CoinSDKType; +} +function createBaseTransfer(): Transfer { + return { + sender: SubaccountId.fromPartial({}), + recipient: SubaccountId.fromPartial({}), + assetId: 0, + amount: BigInt(0) + }; +} +export const Transfer = { + typeUrl: "/dydxprotocol.sending.Transfer", + encode(message: Transfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== undefined) { + SubaccountId.encode(message.sender, writer.uint32(10).fork()).ldelim(); + } + if (message.recipient !== undefined) { + SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim(); + } + if (message.assetId !== 0) { + writer.uint32(24).uint32(message.assetId); + } + if (message.amount !== BigInt(0)) { + writer.uint32(32).uint64(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Transfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.recipient = SubaccountId.decode(reader, reader.uint32()); + break; + case 3: + message.assetId = reader.uint32(); + break; + case 4: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Transfer { + const message = createBaseTransfer(); + message.sender = object.sender !== undefined && object.sender !== null ? SubaccountId.fromPartial(object.sender) : undefined; + message.recipient = object.recipient !== undefined && object.recipient !== null ? SubaccountId.fromPartial(object.recipient) : undefined; + message.assetId = object.assetId ?? 0; + message.amount = object.amount !== undefined && object.amount !== null ? BigInt(object.amount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TransferAmino): Transfer { + const message = createBaseTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = SubaccountId.fromAmino(object.sender); + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = SubaccountId.fromAmino(object.recipient); + } + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = BigInt(object.amount); + } + return message; + }, + toAmino(message: Transfer): TransferAmino { + const obj: any = {}; + obj.sender = message.sender ? SubaccountId.toAmino(message.sender) : undefined; + obj.recipient = message.recipient ? SubaccountId.toAmino(message.recipient) : undefined; + obj.asset_id = message.assetId === 0 ? undefined : message.assetId; + obj.amount = message.amount !== BigInt(0) ? message.amount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TransferAminoMsg): Transfer { + return Transfer.fromAmino(object.value); + }, + fromProtoMsg(message: TransferProtoMsg): Transfer { + return Transfer.decode(message.value); + }, + toProto(message: Transfer): Uint8Array { + return Transfer.encode(message).finish(); + }, + toProtoMsg(message: Transfer): TransferProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.Transfer", + value: Transfer.encode(message).finish() + }; + } +}; +function createBaseMsgDepositToSubaccount(): MsgDepositToSubaccount { + return { + sender: "", + recipient: SubaccountId.fromPartial({}), + assetId: 0, + quantums: BigInt(0) + }; +} +export const MsgDepositToSubaccount = { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccount", + encode(message: MsgDepositToSubaccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.recipient !== undefined) { + SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim(); + } + if (message.assetId !== 0) { + writer.uint32(24).uint32(message.assetId); + } + if (message.quantums !== BigInt(0)) { + writer.uint32(32).uint64(message.quantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositToSubaccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositToSubaccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.recipient = SubaccountId.decode(reader, reader.uint32()); + break; + case 3: + message.assetId = reader.uint32(); + break; + case 4: + message.quantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDepositToSubaccount { + const message = createBaseMsgDepositToSubaccount(); + message.sender = object.sender ?? ""; + message.recipient = object.recipient !== undefined && object.recipient !== null ? SubaccountId.fromPartial(object.recipient) : undefined; + message.assetId = object.assetId ?? 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? BigInt(object.quantums.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgDepositToSubaccountAmino): MsgDepositToSubaccount { + const message = createBaseMsgDepositToSubaccount(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = SubaccountId.fromAmino(object.recipient); + } + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = BigInt(object.quantums); + } + return message; + }, + toAmino(message: MsgDepositToSubaccount): MsgDepositToSubaccountAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.recipient = message.recipient ? SubaccountId.toAmino(message.recipient) : undefined; + obj.asset_id = message.assetId === 0 ? undefined : message.assetId; + obj.quantums = message.quantums !== BigInt(0) ? message.quantums.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgDepositToSubaccountAminoMsg): MsgDepositToSubaccount { + return MsgDepositToSubaccount.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDepositToSubaccountProtoMsg): MsgDepositToSubaccount { + return MsgDepositToSubaccount.decode(message.value); + }, + toProto(message: MsgDepositToSubaccount): Uint8Array { + return MsgDepositToSubaccount.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositToSubaccount): MsgDepositToSubaccountProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccount", + value: MsgDepositToSubaccount.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawFromSubaccount(): MsgWithdrawFromSubaccount { + return { + sender: SubaccountId.fromPartial({}), + recipient: "", + assetId: 0, + quantums: BigInt(0) + }; +} +export const MsgWithdrawFromSubaccount = { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccount", + encode(message: MsgWithdrawFromSubaccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== undefined) { + SubaccountId.encode(message.sender, writer.uint32(18).fork()).ldelim(); + } + if (message.recipient !== "") { + writer.uint32(10).string(message.recipient); + } + if (message.assetId !== 0) { + writer.uint32(24).uint32(message.assetId); + } + if (message.quantums !== BigInt(0)) { + writer.uint32(32).uint64(message.quantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawFromSubaccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawFromSubaccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.sender = SubaccountId.decode(reader, reader.uint32()); + break; + case 1: + message.recipient = reader.string(); + break; + case 3: + message.assetId = reader.uint32(); + break; + case 4: + message.quantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawFromSubaccount { + const message = createBaseMsgWithdrawFromSubaccount(); + message.sender = object.sender !== undefined && object.sender !== null ? SubaccountId.fromPartial(object.sender) : undefined; + message.recipient = object.recipient ?? ""; + message.assetId = object.assetId ?? 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? BigInt(object.quantums.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgWithdrawFromSubaccountAmino): MsgWithdrawFromSubaccount { + const message = createBaseMsgWithdrawFromSubaccount(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = SubaccountId.fromAmino(object.sender); + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = BigInt(object.quantums); + } + return message; + }, + toAmino(message: MsgWithdrawFromSubaccount): MsgWithdrawFromSubaccountAmino { + const obj: any = {}; + obj.sender = message.sender ? SubaccountId.toAmino(message.sender) : undefined; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.asset_id = message.assetId === 0 ? undefined : message.assetId; + obj.quantums = message.quantums !== BigInt(0) ? message.quantums.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgWithdrawFromSubaccountAminoMsg): MsgWithdrawFromSubaccount { + return MsgWithdrawFromSubaccount.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawFromSubaccountProtoMsg): MsgWithdrawFromSubaccount { + return MsgWithdrawFromSubaccount.decode(message.value); + }, + toProto(message: MsgWithdrawFromSubaccount): Uint8Array { + return MsgWithdrawFromSubaccount.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawFromSubaccount): MsgWithdrawFromSubaccountProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccount", + value: MsgWithdrawFromSubaccount.encode(message).finish() + }; + } +}; +function createBaseMsgSendFromModuleToAccount(): MsgSendFromModuleToAccount { + return { + authority: "", + senderModuleName: "", + recipient: "", + coin: Coin.fromPartial({}) + }; +} +export const MsgSendFromModuleToAccount = { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccount", + encode(message: MsgSendFromModuleToAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.senderModuleName !== "") { + writer.uint32(18).string(message.senderModuleName); + } + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendFromModuleToAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendFromModuleToAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.senderModuleName = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + case 4: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSendFromModuleToAccount { + const message = createBaseMsgSendFromModuleToAccount(); + message.authority = object.authority ?? ""; + message.senderModuleName = object.senderModuleName ?? ""; + message.recipient = object.recipient ?? ""; + message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; + return message; + }, + fromAmino(object: MsgSendFromModuleToAccountAmino): MsgSendFromModuleToAccount { + const message = createBaseMsgSendFromModuleToAccount(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.sender_module_name !== undefined && object.sender_module_name !== null) { + message.senderModuleName = object.sender_module_name; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino(message: MsgSendFromModuleToAccount): MsgSendFromModuleToAccountAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.sender_module_name = message.senderModuleName === "" ? undefined : message.senderModuleName; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSendFromModuleToAccountAminoMsg): MsgSendFromModuleToAccount { + return MsgSendFromModuleToAccount.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSendFromModuleToAccountProtoMsg): MsgSendFromModuleToAccount { + return MsgSendFromModuleToAccount.decode(message.value); + }, + toProto(message: MsgSendFromModuleToAccount): Uint8Array { + return MsgSendFromModuleToAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgSendFromModuleToAccount): MsgSendFromModuleToAccountProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccount", + value: MsgSendFromModuleToAccount.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.amino.ts new file mode 100644 index 00000000..d9b323ba --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.amino.ts @@ -0,0 +1,25 @@ +//@ts-nocheck +import { MsgDepositToSubaccount, MsgWithdrawFromSubaccount, MsgSendFromModuleToAccount } from "./transfer"; +import { MsgCreateTransfer } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.sending.MsgCreateTransfer": { + aminoType: "/dydxprotocol.sending.MsgCreateTransfer", + toAmino: MsgCreateTransfer.toAmino, + fromAmino: MsgCreateTransfer.fromAmino + }, + "/dydxprotocol.sending.MsgDepositToSubaccount": { + aminoType: "/dydxprotocol.sending.MsgDepositToSubaccount", + toAmino: MsgDepositToSubaccount.toAmino, + fromAmino: MsgDepositToSubaccount.fromAmino + }, + "/dydxprotocol.sending.MsgWithdrawFromSubaccount": { + aminoType: "/dydxprotocol.sending.MsgWithdrawFromSubaccount", + toAmino: MsgWithdrawFromSubaccount.toAmino, + fromAmino: MsgWithdrawFromSubaccount.fromAmino + }, + "/dydxprotocol.sending.MsgSendFromModuleToAccount": { + aminoType: "/dydxprotocol.sending.MsgSendFromModuleToAccount", + toAmino: MsgSendFromModuleToAccount.toAmino, + fromAmino: MsgSendFromModuleToAccount.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.registry.ts new file mode 100644 index 00000000..47202962 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.registry.ts @@ -0,0 +1,90 @@ +//@ts-nocheck +import { MsgDepositToSubaccount, MsgWithdrawFromSubaccount, MsgSendFromModuleToAccount } from "./transfer"; +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateTransfer } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.sending.MsgCreateTransfer", MsgCreateTransfer], ["/dydxprotocol.sending.MsgDepositToSubaccount", MsgDepositToSubaccount], ["/dydxprotocol.sending.MsgWithdrawFromSubaccount", MsgWithdrawFromSubaccount], ["/dydxprotocol.sending.MsgSendFromModuleToAccount", MsgSendFromModuleToAccount]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createTransfer(value: MsgCreateTransfer) { + return { + typeUrl: "/dydxprotocol.sending.MsgCreateTransfer", + value: MsgCreateTransfer.encode(value).finish() + }; + }, + depositToSubaccount(value: MsgDepositToSubaccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccount", + value: MsgDepositToSubaccount.encode(value).finish() + }; + }, + withdrawFromSubaccount(value: MsgWithdrawFromSubaccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccount", + value: MsgWithdrawFromSubaccount.encode(value).finish() + }; + }, + sendFromModuleToAccount(value: MsgSendFromModuleToAccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccount", + value: MsgSendFromModuleToAccount.encode(value).finish() + }; + } + }, + withTypeUrl: { + createTransfer(value: MsgCreateTransfer) { + return { + typeUrl: "/dydxprotocol.sending.MsgCreateTransfer", + value + }; + }, + depositToSubaccount(value: MsgDepositToSubaccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccount", + value + }; + }, + withdrawFromSubaccount(value: MsgWithdrawFromSubaccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccount", + value + }; + }, + sendFromModuleToAccount(value: MsgSendFromModuleToAccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccount", + value + }; + } + }, + fromPartial: { + createTransfer(value: MsgCreateTransfer) { + return { + typeUrl: "/dydxprotocol.sending.MsgCreateTransfer", + value: MsgCreateTransfer.fromPartial(value) + }; + }, + depositToSubaccount(value: MsgDepositToSubaccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccount", + value: MsgDepositToSubaccount.fromPartial(value) + }; + }, + withdrawFromSubaccount(value: MsgWithdrawFromSubaccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccount", + value: MsgWithdrawFromSubaccount.fromPartial(value) + }; + }, + sendFromModuleToAccount(value: MsgSendFromModuleToAccount) { + return { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccount", + value: MsgSendFromModuleToAccount.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.rpc.msg.ts new file mode 100644 index 00000000..703d8b76 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.rpc.msg.ts @@ -0,0 +1,55 @@ +//@ts-nocheck +import { MsgDepositToSubaccount, MsgWithdrawFromSubaccount, MsgSendFromModuleToAccount } from "./transfer"; +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgCreateTransfer, MsgCreateTransferResponse, MsgDepositToSubaccountResponse, MsgWithdrawFromSubaccountResponse, MsgSendFromModuleToAccountResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** CreateTransfer initiates a new transfer between subaccounts. */ + createTransfer(request: MsgCreateTransfer): Promise; + /** + * DepositToSubaccount initiates a new transfer from an `x/bank` account + * to an `x/subaccounts` subaccount. + */ + depositToSubaccount(request: MsgDepositToSubaccount): Promise; + /** + * WithdrawFromSubaccount initiates a new transfer from an `x/subaccounts` + * subaccount to an `x/bank` account. + */ + withdrawFromSubaccount(request: MsgWithdrawFromSubaccount): Promise; + /** + * SendFromModuleToAccount initiates a new transfer from a module to an + * `x/bank` account (should only be executed by governance). + */ + sendFromModuleToAccount(request: MsgSendFromModuleToAccount): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createTransfer = this.createTransfer.bind(this); + this.depositToSubaccount = this.depositToSubaccount.bind(this); + this.withdrawFromSubaccount = this.withdrawFromSubaccount.bind(this); + this.sendFromModuleToAccount = this.sendFromModuleToAccount.bind(this); + } + createTransfer(request: MsgCreateTransfer): Promise { + const data = MsgCreateTransfer.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.sending.Msg", "CreateTransfer", data); + return promise.then(data => MsgCreateTransferResponse.decode(new BinaryReader(data))); + } + depositToSubaccount(request: MsgDepositToSubaccount): Promise { + const data = MsgDepositToSubaccount.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.sending.Msg", "DepositToSubaccount", data); + return promise.then(data => MsgDepositToSubaccountResponse.decode(new BinaryReader(data))); + } + withdrawFromSubaccount(request: MsgWithdrawFromSubaccount): Promise { + const data = MsgWithdrawFromSubaccount.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.sending.Msg", "WithdrawFromSubaccount", data); + return promise.then(data => MsgWithdrawFromSubaccountResponse.decode(new BinaryReader(data))); + } + sendFromModuleToAccount(request: MsgSendFromModuleToAccount): Promise { + const data = MsgSendFromModuleToAccount.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.sending.Msg", "SendFromModuleToAccount", data); + return promise.then(data => MsgSendFromModuleToAccountResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.ts new file mode 100644 index 00000000..c23f7258 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/sending/tx.ts @@ -0,0 +1,369 @@ +//@ts-nocheck +import { Transfer, TransferAmino, TransferSDKType } from "./transfer"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgCreateTransfer is a request type used for initiating new transfers. */ +export interface MsgCreateTransfer { + transfer?: Transfer; +} +export interface MsgCreateTransferProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgCreateTransfer"; + value: Uint8Array; +} +/** MsgCreateTransfer is a request type used for initiating new transfers. */ +export interface MsgCreateTransferAmino { + transfer?: TransferAmino; +} +export interface MsgCreateTransferAminoMsg { + type: "/dydxprotocol.sending.MsgCreateTransfer"; + value: MsgCreateTransferAmino; +} +/** MsgCreateTransfer is a request type used for initiating new transfers. */ +export interface MsgCreateTransferSDKType { + transfer?: TransferSDKType; +} +/** MsgCreateTransferResponse is a response type used for new transfers. */ +export interface MsgCreateTransferResponse {} +export interface MsgCreateTransferResponseProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgCreateTransferResponse"; + value: Uint8Array; +} +/** MsgCreateTransferResponse is a response type used for new transfers. */ +export interface MsgCreateTransferResponseAmino {} +export interface MsgCreateTransferResponseAminoMsg { + type: "/dydxprotocol.sending.MsgCreateTransferResponse"; + value: MsgCreateTransferResponseAmino; +} +/** MsgCreateTransferResponse is a response type used for new transfers. */ +export interface MsgCreateTransferResponseSDKType {} +/** + * MsgDepositToSubaccountResponse is a response type used for new + * account-to-subaccount transfers. + */ +export interface MsgDepositToSubaccountResponse {} +export interface MsgDepositToSubaccountResponseProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccountResponse"; + value: Uint8Array; +} +/** + * MsgDepositToSubaccountResponse is a response type used for new + * account-to-subaccount transfers. + */ +export interface MsgDepositToSubaccountResponseAmino {} +export interface MsgDepositToSubaccountResponseAminoMsg { + type: "/dydxprotocol.sending.MsgDepositToSubaccountResponse"; + value: MsgDepositToSubaccountResponseAmino; +} +/** + * MsgDepositToSubaccountResponse is a response type used for new + * account-to-subaccount transfers. + */ +export interface MsgDepositToSubaccountResponseSDKType {} +/** + * MsgWithdrawFromSubaccountResponse is a response type used for new + * subaccount-to-account transfers. + */ +export interface MsgWithdrawFromSubaccountResponse {} +export interface MsgWithdrawFromSubaccountResponseProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccountResponse"; + value: Uint8Array; +} +/** + * MsgWithdrawFromSubaccountResponse is a response type used for new + * subaccount-to-account transfers. + */ +export interface MsgWithdrawFromSubaccountResponseAmino {} +export interface MsgWithdrawFromSubaccountResponseAminoMsg { + type: "/dydxprotocol.sending.MsgWithdrawFromSubaccountResponse"; + value: MsgWithdrawFromSubaccountResponseAmino; +} +/** + * MsgWithdrawFromSubaccountResponse is a response type used for new + * subaccount-to-account transfers. + */ +export interface MsgWithdrawFromSubaccountResponseSDKType {} +/** + * MsgSendFromModuleToAccountResponse is a response type used for new + * module-to-account transfers. + */ +export interface MsgSendFromModuleToAccountResponse {} +export interface MsgSendFromModuleToAccountResponseProtoMsg { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccountResponse"; + value: Uint8Array; +} +/** + * MsgSendFromModuleToAccountResponse is a response type used for new + * module-to-account transfers. + */ +export interface MsgSendFromModuleToAccountResponseAmino {} +export interface MsgSendFromModuleToAccountResponseAminoMsg { + type: "/dydxprotocol.sending.MsgSendFromModuleToAccountResponse"; + value: MsgSendFromModuleToAccountResponseAmino; +} +/** + * MsgSendFromModuleToAccountResponse is a response type used for new + * module-to-account transfers. + */ +export interface MsgSendFromModuleToAccountResponseSDKType {} +function createBaseMsgCreateTransfer(): MsgCreateTransfer { + return { + transfer: undefined + }; +} +export const MsgCreateTransfer = { + typeUrl: "/dydxprotocol.sending.MsgCreateTransfer", + encode(message: MsgCreateTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transfer !== undefined) { + Transfer.encode(message.transfer, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transfer = Transfer.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateTransfer { + const message = createBaseMsgCreateTransfer(); + message.transfer = object.transfer !== undefined && object.transfer !== null ? Transfer.fromPartial(object.transfer) : undefined; + return message; + }, + fromAmino(object: MsgCreateTransferAmino): MsgCreateTransfer { + const message = createBaseMsgCreateTransfer(); + if (object.transfer !== undefined && object.transfer !== null) { + message.transfer = Transfer.fromAmino(object.transfer); + } + return message; + }, + toAmino(message: MsgCreateTransfer): MsgCreateTransferAmino { + const obj: any = {}; + obj.transfer = message.transfer ? Transfer.toAmino(message.transfer) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateTransferAminoMsg): MsgCreateTransfer { + return MsgCreateTransfer.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateTransferProtoMsg): MsgCreateTransfer { + return MsgCreateTransfer.decode(message.value); + }, + toProto(message: MsgCreateTransfer): Uint8Array { + return MsgCreateTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateTransfer): MsgCreateTransferProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgCreateTransfer", + value: MsgCreateTransfer.encode(message).finish() + }; + } +}; +function createBaseMsgCreateTransferResponse(): MsgCreateTransferResponse { + return {}; +} +export const MsgCreateTransferResponse = { + typeUrl: "/dydxprotocol.sending.MsgCreateTransferResponse", + encode(_: MsgCreateTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateTransferResponse { + const message = createBaseMsgCreateTransferResponse(); + return message; + }, + fromAmino(_: MsgCreateTransferResponseAmino): MsgCreateTransferResponse { + const message = createBaseMsgCreateTransferResponse(); + return message; + }, + toAmino(_: MsgCreateTransferResponse): MsgCreateTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateTransferResponseAminoMsg): MsgCreateTransferResponse { + return MsgCreateTransferResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateTransferResponseProtoMsg): MsgCreateTransferResponse { + return MsgCreateTransferResponse.decode(message.value); + }, + toProto(message: MsgCreateTransferResponse): Uint8Array { + return MsgCreateTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateTransferResponse): MsgCreateTransferResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgCreateTransferResponse", + value: MsgCreateTransferResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDepositToSubaccountResponse(): MsgDepositToSubaccountResponse { + return {}; +} +export const MsgDepositToSubaccountResponse = { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccountResponse", + encode(_: MsgDepositToSubaccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositToSubaccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositToSubaccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDepositToSubaccountResponse { + const message = createBaseMsgDepositToSubaccountResponse(); + return message; + }, + fromAmino(_: MsgDepositToSubaccountResponseAmino): MsgDepositToSubaccountResponse { + const message = createBaseMsgDepositToSubaccountResponse(); + return message; + }, + toAmino(_: MsgDepositToSubaccountResponse): MsgDepositToSubaccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDepositToSubaccountResponseAminoMsg): MsgDepositToSubaccountResponse { + return MsgDepositToSubaccountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDepositToSubaccountResponseProtoMsg): MsgDepositToSubaccountResponse { + return MsgDepositToSubaccountResponse.decode(message.value); + }, + toProto(message: MsgDepositToSubaccountResponse): Uint8Array { + return MsgDepositToSubaccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositToSubaccountResponse): MsgDepositToSubaccountResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgDepositToSubaccountResponse", + value: MsgDepositToSubaccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawFromSubaccountResponse(): MsgWithdrawFromSubaccountResponse { + return {}; +} +export const MsgWithdrawFromSubaccountResponse = { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccountResponse", + encode(_: MsgWithdrawFromSubaccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawFromSubaccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawFromSubaccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgWithdrawFromSubaccountResponse { + const message = createBaseMsgWithdrawFromSubaccountResponse(); + return message; + }, + fromAmino(_: MsgWithdrawFromSubaccountResponseAmino): MsgWithdrawFromSubaccountResponse { + const message = createBaseMsgWithdrawFromSubaccountResponse(); + return message; + }, + toAmino(_: MsgWithdrawFromSubaccountResponse): MsgWithdrawFromSubaccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawFromSubaccountResponseAminoMsg): MsgWithdrawFromSubaccountResponse { + return MsgWithdrawFromSubaccountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawFromSubaccountResponseProtoMsg): MsgWithdrawFromSubaccountResponse { + return MsgWithdrawFromSubaccountResponse.decode(message.value); + }, + toProto(message: MsgWithdrawFromSubaccountResponse): Uint8Array { + return MsgWithdrawFromSubaccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawFromSubaccountResponse): MsgWithdrawFromSubaccountResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgWithdrawFromSubaccountResponse", + value: MsgWithdrawFromSubaccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSendFromModuleToAccountResponse(): MsgSendFromModuleToAccountResponse { + return {}; +} +export const MsgSendFromModuleToAccountResponse = { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccountResponse", + encode(_: MsgSendFromModuleToAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendFromModuleToAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendFromModuleToAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSendFromModuleToAccountResponse { + const message = createBaseMsgSendFromModuleToAccountResponse(); + return message; + }, + fromAmino(_: MsgSendFromModuleToAccountResponseAmino): MsgSendFromModuleToAccountResponse { + const message = createBaseMsgSendFromModuleToAccountResponse(); + return message; + }, + toAmino(_: MsgSendFromModuleToAccountResponse): MsgSendFromModuleToAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSendFromModuleToAccountResponseAminoMsg): MsgSendFromModuleToAccountResponse { + return MsgSendFromModuleToAccountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSendFromModuleToAccountResponseProtoMsg): MsgSendFromModuleToAccountResponse { + return MsgSendFromModuleToAccountResponse.decode(message.value); + }, + toProto(message: MsgSendFromModuleToAccountResponse): Uint8Array { + return MsgSendFromModuleToAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendFromModuleToAccountResponse): MsgSendFromModuleToAccountResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.sending.MsgSendFromModuleToAccountResponse", + value: MsgSendFromModuleToAccountResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/genesis.ts new file mode 100644 index 00000000..9da726a1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/genesis.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the stats module's genesis state. */ +export interface GenesisState { + /** The parameters of the module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.stats.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the stats module's genesis state. */ +export interface GenesisStateAmino { + /** The parameters of the module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.stats.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the stats module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.stats.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/params.ts new file mode 100644 index 00000000..99697987 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/params.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Params defines the parameters for x/stats module. */ +export interface Params { + /** The desired number of seconds in the look-back window. */ + windowDuration: Duration; +} +export interface ParamsProtoMsg { + typeUrl: "/dydxprotocol.stats.Params"; + value: Uint8Array; +} +/** Params defines the parameters for x/stats module. */ +export interface ParamsAmino { + /** The desired number of seconds in the look-back window. */ + window_duration?: DurationAmino; +} +export interface ParamsAminoMsg { + type: "/dydxprotocol.stats.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for x/stats module. */ +export interface ParamsSDKType { + window_duration: DurationSDKType; +} +function createBaseParams(): Params { + return { + windowDuration: Duration.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/dydxprotocol.stats.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.windowDuration !== undefined) { + Duration.encode(message.windowDuration, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.windowDuration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.windowDuration = object.windowDuration !== undefined && object.windowDuration !== null ? Duration.fromPartial(object.windowDuration) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.window_duration !== undefined && object.window_duration !== null) { + message.windowDuration = Duration.fromAmino(object.window_duration); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.window_duration = message.windowDuration ? Duration.toAmino(message.windowDuration) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/query.rpc.Query.ts new file mode 100644 index 00000000..6edb93ae --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/query.rpc.Query.ts @@ -0,0 +1,64 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryStatsMetadataRequest, QueryStatsMetadataResponse, QueryGlobalStatsRequest, QueryGlobalStatsResponse, QueryUserStatsRequest, QueryUserStatsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the Params. */ + params(request?: QueryParamsRequest): Promise; + /** Queries StatsMetadata. */ + statsMetadata(request?: QueryStatsMetadataRequest): Promise; + /** Queries GlobalStats. */ + globalStats(request?: QueryGlobalStatsRequest): Promise; + /** Queries UserStats. */ + userStats(request: QueryUserStatsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.statsMetadata = this.statsMetadata.bind(this); + this.globalStats = this.globalStats.bind(this); + this.userStats = this.userStats.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.stats.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + statsMetadata(request: QueryStatsMetadataRequest = {}): Promise { + const data = QueryStatsMetadataRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.stats.Query", "StatsMetadata", data); + return promise.then(data => QueryStatsMetadataResponse.decode(new BinaryReader(data))); + } + globalStats(request: QueryGlobalStatsRequest = {}): Promise { + const data = QueryGlobalStatsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.stats.Query", "GlobalStats", data); + return promise.then(data => QueryGlobalStatsResponse.decode(new BinaryReader(data))); + } + userStats(request: QueryUserStatsRequest): Promise { + const data = QueryUserStatsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.stats.Query", "UserStats", data); + return promise.then(data => QueryUserStatsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + statsMetadata(request?: QueryStatsMetadataRequest): Promise { + return queryService.statsMetadata(request); + }, + globalStats(request?: QueryGlobalStatsRequest): Promise { + return queryService.globalStats(request); + }, + userStats(request: QueryUserStatsRequest): Promise { + return queryService.userStats(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/query.ts new file mode 100644 index 00000000..d6bf85f7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/query.ts @@ -0,0 +1,620 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { StatsMetadata, StatsMetadataAmino, StatsMetadataSDKType, GlobalStats, GlobalStatsAmino, GlobalStatsSDKType, UserStats, UserStatsAmino, UserStatsSDKType } from "./stats"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/dydxprotocol.stats.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponseAmino { + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/dydxprotocol.stats.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** QueryStatsMetadataRequest is a request type for the StatsMetadata RPC method. */ +export interface QueryStatsMetadataRequest {} +export interface QueryStatsMetadataRequestProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryStatsMetadataRequest"; + value: Uint8Array; +} +/** QueryStatsMetadataRequest is a request type for the StatsMetadata RPC method. */ +export interface QueryStatsMetadataRequestAmino {} +export interface QueryStatsMetadataRequestAminoMsg { + type: "/dydxprotocol.stats.QueryStatsMetadataRequest"; + value: QueryStatsMetadataRequestAmino; +} +/** QueryStatsMetadataRequest is a request type for the StatsMetadata RPC method. */ +export interface QueryStatsMetadataRequestSDKType {} +/** + * QueryStatsMetadataResponse is a response type for the StatsMetadata RPC + * method. + */ +export interface QueryStatsMetadataResponse { + metadata?: StatsMetadata; +} +export interface QueryStatsMetadataResponseProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryStatsMetadataResponse"; + value: Uint8Array; +} +/** + * QueryStatsMetadataResponse is a response type for the StatsMetadata RPC + * method. + */ +export interface QueryStatsMetadataResponseAmino { + metadata?: StatsMetadataAmino; +} +export interface QueryStatsMetadataResponseAminoMsg { + type: "/dydxprotocol.stats.QueryStatsMetadataResponse"; + value: QueryStatsMetadataResponseAmino; +} +/** + * QueryStatsMetadataResponse is a response type for the StatsMetadata RPC + * method. + */ +export interface QueryStatsMetadataResponseSDKType { + metadata?: StatsMetadataSDKType; +} +/** QueryGlobalStatsRequest is a request type for the GlobalStats RPC method. */ +export interface QueryGlobalStatsRequest {} +export interface QueryGlobalStatsRequestProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryGlobalStatsRequest"; + value: Uint8Array; +} +/** QueryGlobalStatsRequest is a request type for the GlobalStats RPC method. */ +export interface QueryGlobalStatsRequestAmino {} +export interface QueryGlobalStatsRequestAminoMsg { + type: "/dydxprotocol.stats.QueryGlobalStatsRequest"; + value: QueryGlobalStatsRequestAmino; +} +/** QueryGlobalStatsRequest is a request type for the GlobalStats RPC method. */ +export interface QueryGlobalStatsRequestSDKType {} +/** QueryGlobalStatsResponse is a response type for the GlobalStats RPC method. */ +export interface QueryGlobalStatsResponse { + stats?: GlobalStats; +} +export interface QueryGlobalStatsResponseProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryGlobalStatsResponse"; + value: Uint8Array; +} +/** QueryGlobalStatsResponse is a response type for the GlobalStats RPC method. */ +export interface QueryGlobalStatsResponseAmino { + stats?: GlobalStatsAmino; +} +export interface QueryGlobalStatsResponseAminoMsg { + type: "/dydxprotocol.stats.QueryGlobalStatsResponse"; + value: QueryGlobalStatsResponseAmino; +} +/** QueryGlobalStatsResponse is a response type for the GlobalStats RPC method. */ +export interface QueryGlobalStatsResponseSDKType { + stats?: GlobalStatsSDKType; +} +/** QueryUserStatsRequest is a request type for the UserStats RPC method. */ +export interface QueryUserStatsRequest { + user: string; +} +export interface QueryUserStatsRequestProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryUserStatsRequest"; + value: Uint8Array; +} +/** QueryUserStatsRequest is a request type for the UserStats RPC method. */ +export interface QueryUserStatsRequestAmino { + user?: string; +} +export interface QueryUserStatsRequestAminoMsg { + type: "/dydxprotocol.stats.QueryUserStatsRequest"; + value: QueryUserStatsRequestAmino; +} +/** QueryUserStatsRequest is a request type for the UserStats RPC method. */ +export interface QueryUserStatsRequestSDKType { + user: string; +} +/** QueryUserStatsResponse is a request type for the UserStats RPC method. */ +export interface QueryUserStatsResponse { + stats?: UserStats; +} +export interface QueryUserStatsResponseProtoMsg { + typeUrl: "/dydxprotocol.stats.QueryUserStatsResponse"; + value: Uint8Array; +} +/** QueryUserStatsResponse is a request type for the UserStats RPC method. */ +export interface QueryUserStatsResponseAmino { + stats?: UserStatsAmino; +} +export interface QueryUserStatsResponseAminoMsg { + type: "/dydxprotocol.stats.QueryUserStatsResponse"; + value: QueryUserStatsResponseAmino; +} +/** QueryUserStatsResponse is a request type for the UserStats RPC method. */ +export interface QueryUserStatsResponseSDKType { + stats?: UserStatsSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/dydxprotocol.stats.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/dydxprotocol.stats.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryStatsMetadataRequest(): QueryStatsMetadataRequest { + return {}; +} +export const QueryStatsMetadataRequest = { + typeUrl: "/dydxprotocol.stats.QueryStatsMetadataRequest", + encode(_: QueryStatsMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStatsMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatsMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryStatsMetadataRequest { + const message = createBaseQueryStatsMetadataRequest(); + return message; + }, + fromAmino(_: QueryStatsMetadataRequestAmino): QueryStatsMetadataRequest { + const message = createBaseQueryStatsMetadataRequest(); + return message; + }, + toAmino(_: QueryStatsMetadataRequest): QueryStatsMetadataRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStatsMetadataRequestAminoMsg): QueryStatsMetadataRequest { + return QueryStatsMetadataRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStatsMetadataRequestProtoMsg): QueryStatsMetadataRequest { + return QueryStatsMetadataRequest.decode(message.value); + }, + toProto(message: QueryStatsMetadataRequest): Uint8Array { + return QueryStatsMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStatsMetadataRequest): QueryStatsMetadataRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryStatsMetadataRequest", + value: QueryStatsMetadataRequest.encode(message).finish() + }; + } +}; +function createBaseQueryStatsMetadataResponse(): QueryStatsMetadataResponse { + return { + metadata: undefined + }; +} +export const QueryStatsMetadataResponse = { + typeUrl: "/dydxprotocol.stats.QueryStatsMetadataResponse", + encode(message: QueryStatsMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.metadata !== undefined) { + StatsMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryStatsMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatsMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = StatsMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryStatsMetadataResponse { + const message = createBaseQueryStatsMetadataResponse(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? StatsMetadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: QueryStatsMetadataResponseAmino): QueryStatsMetadataResponse { + const message = createBaseQueryStatsMetadataResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = StatsMetadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: QueryStatsMetadataResponse): QueryStatsMetadataResponseAmino { + const obj: any = {}; + obj.metadata = message.metadata ? StatsMetadata.toAmino(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: QueryStatsMetadataResponseAminoMsg): QueryStatsMetadataResponse { + return QueryStatsMetadataResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStatsMetadataResponseProtoMsg): QueryStatsMetadataResponse { + return QueryStatsMetadataResponse.decode(message.value); + }, + toProto(message: QueryStatsMetadataResponse): Uint8Array { + return QueryStatsMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStatsMetadataResponse): QueryStatsMetadataResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryStatsMetadataResponse", + value: QueryStatsMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGlobalStatsRequest(): QueryGlobalStatsRequest { + return {}; +} +export const QueryGlobalStatsRequest = { + typeUrl: "/dydxprotocol.stats.QueryGlobalStatsRequest", + encode(_: QueryGlobalStatsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGlobalStatsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGlobalStatsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryGlobalStatsRequest { + const message = createBaseQueryGlobalStatsRequest(); + return message; + }, + fromAmino(_: QueryGlobalStatsRequestAmino): QueryGlobalStatsRequest { + const message = createBaseQueryGlobalStatsRequest(); + return message; + }, + toAmino(_: QueryGlobalStatsRequest): QueryGlobalStatsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryGlobalStatsRequestAminoMsg): QueryGlobalStatsRequest { + return QueryGlobalStatsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGlobalStatsRequestProtoMsg): QueryGlobalStatsRequest { + return QueryGlobalStatsRequest.decode(message.value); + }, + toProto(message: QueryGlobalStatsRequest): Uint8Array { + return QueryGlobalStatsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGlobalStatsRequest): QueryGlobalStatsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryGlobalStatsRequest", + value: QueryGlobalStatsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGlobalStatsResponse(): QueryGlobalStatsResponse { + return { + stats: undefined + }; +} +export const QueryGlobalStatsResponse = { + typeUrl: "/dydxprotocol.stats.QueryGlobalStatsResponse", + encode(message: QueryGlobalStatsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stats !== undefined) { + GlobalStats.encode(message.stats, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGlobalStatsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGlobalStatsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stats = GlobalStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGlobalStatsResponse { + const message = createBaseQueryGlobalStatsResponse(); + message.stats = object.stats !== undefined && object.stats !== null ? GlobalStats.fromPartial(object.stats) : undefined; + return message; + }, + fromAmino(object: QueryGlobalStatsResponseAmino): QueryGlobalStatsResponse { + const message = createBaseQueryGlobalStatsResponse(); + if (object.stats !== undefined && object.stats !== null) { + message.stats = GlobalStats.fromAmino(object.stats); + } + return message; + }, + toAmino(message: QueryGlobalStatsResponse): QueryGlobalStatsResponseAmino { + const obj: any = {}; + obj.stats = message.stats ? GlobalStats.toAmino(message.stats) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGlobalStatsResponseAminoMsg): QueryGlobalStatsResponse { + return QueryGlobalStatsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGlobalStatsResponseProtoMsg): QueryGlobalStatsResponse { + return QueryGlobalStatsResponse.decode(message.value); + }, + toProto(message: QueryGlobalStatsResponse): Uint8Array { + return QueryGlobalStatsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGlobalStatsResponse): QueryGlobalStatsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryGlobalStatsResponse", + value: QueryGlobalStatsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUserStatsRequest(): QueryUserStatsRequest { + return { + user: "" + }; +} +export const QueryUserStatsRequest = { + typeUrl: "/dydxprotocol.stats.QueryUserStatsRequest", + encode(message: QueryUserStatsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.user !== "") { + writer.uint32(10).string(message.user); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserStatsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserStatsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.user = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserStatsRequest { + const message = createBaseQueryUserStatsRequest(); + message.user = object.user ?? ""; + return message; + }, + fromAmino(object: QueryUserStatsRequestAmino): QueryUserStatsRequest { + const message = createBaseQueryUserStatsRequest(); + if (object.user !== undefined && object.user !== null) { + message.user = object.user; + } + return message; + }, + toAmino(message: QueryUserStatsRequest): QueryUserStatsRequestAmino { + const obj: any = {}; + obj.user = message.user === "" ? undefined : message.user; + return obj; + }, + fromAminoMsg(object: QueryUserStatsRequestAminoMsg): QueryUserStatsRequest { + return QueryUserStatsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUserStatsRequestProtoMsg): QueryUserStatsRequest { + return QueryUserStatsRequest.decode(message.value); + }, + toProto(message: QueryUserStatsRequest): Uint8Array { + return QueryUserStatsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUserStatsRequest): QueryUserStatsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryUserStatsRequest", + value: QueryUserStatsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUserStatsResponse(): QueryUserStatsResponse { + return { + stats: undefined + }; +} +export const QueryUserStatsResponse = { + typeUrl: "/dydxprotocol.stats.QueryUserStatsResponse", + encode(message: QueryUserStatsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stats !== undefined) { + UserStats.encode(message.stats, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserStatsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserStatsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stats = UserStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserStatsResponse { + const message = createBaseQueryUserStatsResponse(); + message.stats = object.stats !== undefined && object.stats !== null ? UserStats.fromPartial(object.stats) : undefined; + return message; + }, + fromAmino(object: QueryUserStatsResponseAmino): QueryUserStatsResponse { + const message = createBaseQueryUserStatsResponse(); + if (object.stats !== undefined && object.stats !== null) { + message.stats = UserStats.fromAmino(object.stats); + } + return message; + }, + toAmino(message: QueryUserStatsResponse): QueryUserStatsResponseAmino { + const obj: any = {}; + obj.stats = message.stats ? UserStats.toAmino(message.stats) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUserStatsResponseAminoMsg): QueryUserStatsResponse { + return QueryUserStatsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUserStatsResponseProtoMsg): QueryUserStatsResponse { + return QueryUserStatsResponse.decode(message.value); + }, + toProto(message: QueryUserStatsResponse): Uint8Array { + return QueryUserStatsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUserStatsResponse): QueryUserStatsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.QueryUserStatsResponse", + value: QueryUserStatsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/stats.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/stats.ts new file mode 100644 index 00000000..ebb9286e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/stats.ts @@ -0,0 +1,690 @@ +//@ts-nocheck +import { Timestamp } from "../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { toTimestamp, fromTimestamp } from "../../helpers"; +/** BlockStats is used to store stats transiently within the scope of a block. */ +export interface BlockStats { + /** The fills that occured on this block. */ + fills: BlockStats_Fill[]; +} +export interface BlockStatsProtoMsg { + typeUrl: "/dydxprotocol.stats.BlockStats"; + value: Uint8Array; +} +/** BlockStats is used to store stats transiently within the scope of a block. */ +export interface BlockStatsAmino { + /** The fills that occured on this block. */ + fills?: BlockStats_FillAmino[]; +} +export interface BlockStatsAminoMsg { + type: "/dydxprotocol.stats.BlockStats"; + value: BlockStatsAmino; +} +/** BlockStats is used to store stats transiently within the scope of a block. */ +export interface BlockStatsSDKType { + fills: BlockStats_FillSDKType[]; +} +/** Fill records data about a fill on this block. */ +export interface BlockStats_Fill { + /** Taker wallet address */ + taker: string; + /** Maker wallet address */ + maker: string; + /** Notional USDC filled in quantums */ + notional: bigint; +} +export interface BlockStats_FillProtoMsg { + typeUrl: "/dydxprotocol.stats.Fill"; + value: Uint8Array; +} +/** Fill records data about a fill on this block. */ +export interface BlockStats_FillAmino { + /** Taker wallet address */ + taker?: string; + /** Maker wallet address */ + maker?: string; + /** Notional USDC filled in quantums */ + notional?: string; +} +export interface BlockStats_FillAminoMsg { + type: "/dydxprotocol.stats.Fill"; + value: BlockStats_FillAmino; +} +/** Fill records data about a fill on this block. */ +export interface BlockStats_FillSDKType { + taker: string; + maker: string; + notional: bigint; +} +/** StatsMetadata stores metadata for the x/stats module */ +export interface StatsMetadata { + /** + * The oldest epoch that is included in the stats. The next epoch to be + * removed from the window. + */ + trailingEpoch: number; +} +export interface StatsMetadataProtoMsg { + typeUrl: "/dydxprotocol.stats.StatsMetadata"; + value: Uint8Array; +} +/** StatsMetadata stores metadata for the x/stats module */ +export interface StatsMetadataAmino { + /** + * The oldest epoch that is included in the stats. The next epoch to be + * removed from the window. + */ + trailing_epoch?: number; +} +export interface StatsMetadataAminoMsg { + type: "/dydxprotocol.stats.StatsMetadata"; + value: StatsMetadataAmino; +} +/** StatsMetadata stores metadata for the x/stats module */ +export interface StatsMetadataSDKType { + trailing_epoch: number; +} +/** EpochStats stores stats for a particular epoch */ +export interface EpochStats { + /** Epoch end time */ + epochEndTime: Date; + /** Stats for each user in this epoch. Sorted by user. */ + stats: EpochStats_UserWithStats[]; +} +export interface EpochStatsProtoMsg { + typeUrl: "/dydxprotocol.stats.EpochStats"; + value: Uint8Array; +} +/** EpochStats stores stats for a particular epoch */ +export interface EpochStatsAmino { + /** Epoch end time */ + epoch_end_time?: string; + /** Stats for each user in this epoch. Sorted by user. */ + stats?: EpochStats_UserWithStatsAmino[]; +} +export interface EpochStatsAminoMsg { + type: "/dydxprotocol.stats.EpochStats"; + value: EpochStatsAmino; +} +/** EpochStats stores stats for a particular epoch */ +export interface EpochStatsSDKType { + epoch_end_time: Date; + stats: EpochStats_UserWithStatsSDKType[]; +} +/** A user and its associated stats */ +export interface EpochStats_UserWithStats { + user: string; + stats?: UserStats; +} +export interface EpochStats_UserWithStatsProtoMsg { + typeUrl: "/dydxprotocol.stats.UserWithStats"; + value: Uint8Array; +} +/** A user and its associated stats */ +export interface EpochStats_UserWithStatsAmino { + user?: string; + stats?: UserStatsAmino; +} +export interface EpochStats_UserWithStatsAminoMsg { + type: "/dydxprotocol.stats.UserWithStats"; + value: EpochStats_UserWithStatsAmino; +} +/** A user and its associated stats */ +export interface EpochStats_UserWithStatsSDKType { + user: string; + stats?: UserStatsSDKType; +} +/** GlobalStats stores global stats */ +export interface GlobalStats { + /** Notional USDC traded in quantums */ + notionalTraded: bigint; +} +export interface GlobalStatsProtoMsg { + typeUrl: "/dydxprotocol.stats.GlobalStats"; + value: Uint8Array; +} +/** GlobalStats stores global stats */ +export interface GlobalStatsAmino { + /** Notional USDC traded in quantums */ + notional_traded?: string; +} +export interface GlobalStatsAminoMsg { + type: "/dydxprotocol.stats.GlobalStats"; + value: GlobalStatsAmino; +} +/** GlobalStats stores global stats */ +export interface GlobalStatsSDKType { + notional_traded: bigint; +} +/** UserStats stores stats for a User */ +export interface UserStats { + /** Taker USDC in quantums */ + takerNotional: bigint; + /** Maker USDC in quantums */ + makerNotional: bigint; +} +export interface UserStatsProtoMsg { + typeUrl: "/dydxprotocol.stats.UserStats"; + value: Uint8Array; +} +/** UserStats stores stats for a User */ +export interface UserStatsAmino { + /** Taker USDC in quantums */ + taker_notional?: string; + /** Maker USDC in quantums */ + maker_notional?: string; +} +export interface UserStatsAminoMsg { + type: "/dydxprotocol.stats.UserStats"; + value: UserStatsAmino; +} +/** UserStats stores stats for a User */ +export interface UserStatsSDKType { + taker_notional: bigint; + maker_notional: bigint; +} +function createBaseBlockStats(): BlockStats { + return { + fills: [] + }; +} +export const BlockStats = { + typeUrl: "/dydxprotocol.stats.BlockStats", + encode(message: BlockStats, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.fills) { + BlockStats_Fill.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockStats { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockStats(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fills.push(BlockStats_Fill.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockStats { + const message = createBaseBlockStats(); + message.fills = object.fills?.map(e => BlockStats_Fill.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BlockStatsAmino): BlockStats { + const message = createBaseBlockStats(); + message.fills = object.fills?.map(e => BlockStats_Fill.fromAmino(e)) || []; + return message; + }, + toAmino(message: BlockStats): BlockStatsAmino { + const obj: any = {}; + if (message.fills) { + obj.fills = message.fills.map(e => e ? BlockStats_Fill.toAmino(e) : undefined); + } else { + obj.fills = message.fills; + } + return obj; + }, + fromAminoMsg(object: BlockStatsAminoMsg): BlockStats { + return BlockStats.fromAmino(object.value); + }, + fromProtoMsg(message: BlockStatsProtoMsg): BlockStats { + return BlockStats.decode(message.value); + }, + toProto(message: BlockStats): Uint8Array { + return BlockStats.encode(message).finish(); + }, + toProtoMsg(message: BlockStats): BlockStatsProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.BlockStats", + value: BlockStats.encode(message).finish() + }; + } +}; +function createBaseBlockStats_Fill(): BlockStats_Fill { + return { + taker: "", + maker: "", + notional: BigInt(0) + }; +} +export const BlockStats_Fill = { + typeUrl: "/dydxprotocol.stats.Fill", + encode(message: BlockStats_Fill, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.taker !== "") { + writer.uint32(10).string(message.taker); + } + if (message.maker !== "") { + writer.uint32(18).string(message.maker); + } + if (message.notional !== BigInt(0)) { + writer.uint32(24).uint64(message.notional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockStats_Fill { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockStats_Fill(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.taker = reader.string(); + break; + case 2: + message.maker = reader.string(); + break; + case 3: + message.notional = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockStats_Fill { + const message = createBaseBlockStats_Fill(); + message.taker = object.taker ?? ""; + message.maker = object.maker ?? ""; + message.notional = object.notional !== undefined && object.notional !== null ? BigInt(object.notional.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BlockStats_FillAmino): BlockStats_Fill { + const message = createBaseBlockStats_Fill(); + if (object.taker !== undefined && object.taker !== null) { + message.taker = object.taker; + } + if (object.maker !== undefined && object.maker !== null) { + message.maker = object.maker; + } + if (object.notional !== undefined && object.notional !== null) { + message.notional = BigInt(object.notional); + } + return message; + }, + toAmino(message: BlockStats_Fill): BlockStats_FillAmino { + const obj: any = {}; + obj.taker = message.taker === "" ? undefined : message.taker; + obj.maker = message.maker === "" ? undefined : message.maker; + obj.notional = message.notional !== BigInt(0) ? message.notional.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BlockStats_FillAminoMsg): BlockStats_Fill { + return BlockStats_Fill.fromAmino(object.value); + }, + fromProtoMsg(message: BlockStats_FillProtoMsg): BlockStats_Fill { + return BlockStats_Fill.decode(message.value); + }, + toProto(message: BlockStats_Fill): Uint8Array { + return BlockStats_Fill.encode(message).finish(); + }, + toProtoMsg(message: BlockStats_Fill): BlockStats_FillProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.Fill", + value: BlockStats_Fill.encode(message).finish() + }; + } +}; +function createBaseStatsMetadata(): StatsMetadata { + return { + trailingEpoch: 0 + }; +} +export const StatsMetadata = { + typeUrl: "/dydxprotocol.stats.StatsMetadata", + encode(message: StatsMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.trailingEpoch !== 0) { + writer.uint32(8).uint32(message.trailingEpoch); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatsMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatsMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailingEpoch = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatsMetadata { + const message = createBaseStatsMetadata(); + message.trailingEpoch = object.trailingEpoch ?? 0; + return message; + }, + fromAmino(object: StatsMetadataAmino): StatsMetadata { + const message = createBaseStatsMetadata(); + if (object.trailing_epoch !== undefined && object.trailing_epoch !== null) { + message.trailingEpoch = object.trailing_epoch; + } + return message; + }, + toAmino(message: StatsMetadata): StatsMetadataAmino { + const obj: any = {}; + obj.trailing_epoch = message.trailingEpoch === 0 ? undefined : message.trailingEpoch; + return obj; + }, + fromAminoMsg(object: StatsMetadataAminoMsg): StatsMetadata { + return StatsMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: StatsMetadataProtoMsg): StatsMetadata { + return StatsMetadata.decode(message.value); + }, + toProto(message: StatsMetadata): Uint8Array { + return StatsMetadata.encode(message).finish(); + }, + toProtoMsg(message: StatsMetadata): StatsMetadataProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.StatsMetadata", + value: StatsMetadata.encode(message).finish() + }; + } +}; +function createBaseEpochStats(): EpochStats { + return { + epochEndTime: new Date(), + stats: [] + }; +} +export const EpochStats = { + typeUrl: "/dydxprotocol.stats.EpochStats", + encode(message: EpochStats, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.epochEndTime), writer.uint32(10).fork()).ldelim(); + } + for (const v of message.stats) { + EpochStats_UserWithStats.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EpochStats { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEpochStats(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.stats.push(EpochStats_UserWithStats.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EpochStats { + const message = createBaseEpochStats(); + message.epochEndTime = object.epochEndTime ?? undefined; + message.stats = object.stats?.map(e => EpochStats_UserWithStats.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EpochStatsAmino): EpochStats { + const message = createBaseEpochStats(); + if (object.epoch_end_time !== undefined && object.epoch_end_time !== null) { + message.epochEndTime = fromTimestamp(Timestamp.fromAmino(object.epoch_end_time)); + } + message.stats = object.stats?.map(e => EpochStats_UserWithStats.fromAmino(e)) || []; + return message; + }, + toAmino(message: EpochStats): EpochStatsAmino { + const obj: any = {}; + obj.epoch_end_time = message.epochEndTime ? Timestamp.toAmino(toTimestamp(message.epochEndTime)) : undefined; + if (message.stats) { + obj.stats = message.stats.map(e => e ? EpochStats_UserWithStats.toAmino(e) : undefined); + } else { + obj.stats = message.stats; + } + return obj; + }, + fromAminoMsg(object: EpochStatsAminoMsg): EpochStats { + return EpochStats.fromAmino(object.value); + }, + fromProtoMsg(message: EpochStatsProtoMsg): EpochStats { + return EpochStats.decode(message.value); + }, + toProto(message: EpochStats): Uint8Array { + return EpochStats.encode(message).finish(); + }, + toProtoMsg(message: EpochStats): EpochStatsProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.EpochStats", + value: EpochStats.encode(message).finish() + }; + } +}; +function createBaseEpochStats_UserWithStats(): EpochStats_UserWithStats { + return { + user: "", + stats: undefined + }; +} +export const EpochStats_UserWithStats = { + typeUrl: "/dydxprotocol.stats.UserWithStats", + encode(message: EpochStats_UserWithStats, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.user !== "") { + writer.uint32(10).string(message.user); + } + if (message.stats !== undefined) { + UserStats.encode(message.stats, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EpochStats_UserWithStats { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEpochStats_UserWithStats(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.user = reader.string(); + break; + case 2: + message.stats = UserStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EpochStats_UserWithStats { + const message = createBaseEpochStats_UserWithStats(); + message.user = object.user ?? ""; + message.stats = object.stats !== undefined && object.stats !== null ? UserStats.fromPartial(object.stats) : undefined; + return message; + }, + fromAmino(object: EpochStats_UserWithStatsAmino): EpochStats_UserWithStats { + const message = createBaseEpochStats_UserWithStats(); + if (object.user !== undefined && object.user !== null) { + message.user = object.user; + } + if (object.stats !== undefined && object.stats !== null) { + message.stats = UserStats.fromAmino(object.stats); + } + return message; + }, + toAmino(message: EpochStats_UserWithStats): EpochStats_UserWithStatsAmino { + const obj: any = {}; + obj.user = message.user === "" ? undefined : message.user; + obj.stats = message.stats ? UserStats.toAmino(message.stats) : undefined; + return obj; + }, + fromAminoMsg(object: EpochStats_UserWithStatsAminoMsg): EpochStats_UserWithStats { + return EpochStats_UserWithStats.fromAmino(object.value); + }, + fromProtoMsg(message: EpochStats_UserWithStatsProtoMsg): EpochStats_UserWithStats { + return EpochStats_UserWithStats.decode(message.value); + }, + toProto(message: EpochStats_UserWithStats): Uint8Array { + return EpochStats_UserWithStats.encode(message).finish(); + }, + toProtoMsg(message: EpochStats_UserWithStats): EpochStats_UserWithStatsProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.UserWithStats", + value: EpochStats_UserWithStats.encode(message).finish() + }; + } +}; +function createBaseGlobalStats(): GlobalStats { + return { + notionalTraded: BigInt(0) + }; +} +export const GlobalStats = { + typeUrl: "/dydxprotocol.stats.GlobalStats", + encode(message: GlobalStats, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.notionalTraded !== BigInt(0)) { + writer.uint32(8).uint64(message.notionalTraded); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GlobalStats { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGlobalStats(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notionalTraded = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GlobalStats { + const message = createBaseGlobalStats(); + message.notionalTraded = object.notionalTraded !== undefined && object.notionalTraded !== null ? BigInt(object.notionalTraded.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GlobalStatsAmino): GlobalStats { + const message = createBaseGlobalStats(); + if (object.notional_traded !== undefined && object.notional_traded !== null) { + message.notionalTraded = BigInt(object.notional_traded); + } + return message; + }, + toAmino(message: GlobalStats): GlobalStatsAmino { + const obj: any = {}; + obj.notional_traded = message.notionalTraded !== BigInt(0) ? message.notionalTraded.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GlobalStatsAminoMsg): GlobalStats { + return GlobalStats.fromAmino(object.value); + }, + fromProtoMsg(message: GlobalStatsProtoMsg): GlobalStats { + return GlobalStats.decode(message.value); + }, + toProto(message: GlobalStats): Uint8Array { + return GlobalStats.encode(message).finish(); + }, + toProtoMsg(message: GlobalStats): GlobalStatsProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.GlobalStats", + value: GlobalStats.encode(message).finish() + }; + } +}; +function createBaseUserStats(): UserStats { + return { + takerNotional: BigInt(0), + makerNotional: BigInt(0) + }; +} +export const UserStats = { + typeUrl: "/dydxprotocol.stats.UserStats", + encode(message: UserStats, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.takerNotional !== BigInt(0)) { + writer.uint32(8).uint64(message.takerNotional); + } + if (message.makerNotional !== BigInt(0)) { + writer.uint32(16).uint64(message.makerNotional); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UserStats { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserStats(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerNotional = reader.uint64(); + break; + case 2: + message.makerNotional = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UserStats { + const message = createBaseUserStats(); + message.takerNotional = object.takerNotional !== undefined && object.takerNotional !== null ? BigInt(object.takerNotional.toString()) : BigInt(0); + message.makerNotional = object.makerNotional !== undefined && object.makerNotional !== null ? BigInt(object.makerNotional.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UserStatsAmino): UserStats { + const message = createBaseUserStats(); + if (object.taker_notional !== undefined && object.taker_notional !== null) { + message.takerNotional = BigInt(object.taker_notional); + } + if (object.maker_notional !== undefined && object.maker_notional !== null) { + message.makerNotional = BigInt(object.maker_notional); + } + return message; + }, + toAmino(message: UserStats): UserStatsAmino { + const obj: any = {}; + obj.taker_notional = message.takerNotional !== BigInt(0) ? message.takerNotional.toString() : undefined; + obj.maker_notional = message.makerNotional !== BigInt(0) ? message.makerNotional.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UserStatsAminoMsg): UserStats { + return UserStats.fromAmino(object.value); + }, + fromProtoMsg(message: UserStatsProtoMsg): UserStats { + return UserStats.decode(message.value); + }, + toProto(message: UserStats): Uint8Array { + return UserStats.encode(message).finish(); + }, + toProtoMsg(message: UserStats): UserStatsProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.UserStats", + value: UserStats.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.amino.ts new file mode 100644 index 00000000..b0caa53e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.stats.MsgUpdateParams": { + aminoType: "/dydxprotocol.stats.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.registry.ts new file mode 100644 index 00000000..18ac1c40 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.stats.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.stats.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.stats.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/dydxprotocol.stats.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.rpc.msg.ts new file mode 100644 index 00000000..e214c650 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.rpc.msg.ts @@ -0,0 +1,21 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** UpdateParams updates the Params in state. */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.stats.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.ts new file mode 100644 index 00000000..544f0197 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/stats/tx.ts @@ -0,0 +1,167 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + authority: string; + /** The parameters to update. Each field must be set. */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/dydxprotocol.stats.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + authority?: string; + /** The parameters to update. Each field must be set. */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "/dydxprotocol.stats.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse is the Msg/UpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.stats.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse is the Msg/UpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/dydxprotocol.stats.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse is the Msg/UpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/dydxprotocol.stats.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/dydxprotocol.stats.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.stats.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/asset_position.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/asset_position.ts new file mode 100644 index 00000000..f8f466ce --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/asset_position.ts @@ -0,0 +1,139 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * AssetPositions define an account’s positions of an `Asset`. + * Therefore they hold any information needed to trade on Spot and Margin. + */ +export interface AssetPosition { + /** The `Id` of the `Asset`. */ + assetId: number; + /** The absolute size of the position in base quantums. */ + quantums: Uint8Array; + /** + * The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last + * time this position was settled + * TODO(DEC-582): pending margin trading being added. + */ + index: bigint; +} +export interface AssetPositionProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.AssetPosition"; + value: Uint8Array; +} +/** + * AssetPositions define an account’s positions of an `Asset`. + * Therefore they hold any information needed to trade on Spot and Margin. + */ +export interface AssetPositionAmino { + /** The `Id` of the `Asset`. */ + asset_id?: number; + /** The absolute size of the position in base quantums. */ + quantums?: string; + /** + * The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last + * time this position was settled + * TODO(DEC-582): pending margin trading being added. + */ + index?: string; +} +export interface AssetPositionAminoMsg { + type: "/dydxprotocol.subaccounts.AssetPosition"; + value: AssetPositionAmino; +} +/** + * AssetPositions define an account’s positions of an `Asset`. + * Therefore they hold any information needed to trade on Spot and Margin. + */ +export interface AssetPositionSDKType { + asset_id: number; + quantums: Uint8Array; + index: bigint; +} +function createBaseAssetPosition(): AssetPosition { + return { + assetId: 0, + quantums: new Uint8Array(), + index: BigInt(0) + }; +} +export const AssetPosition = { + typeUrl: "/dydxprotocol.subaccounts.AssetPosition", + encode(message: AssetPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetId !== 0) { + writer.uint32(8).uint32(message.assetId); + } + if (message.quantums.length !== 0) { + writer.uint32(18).bytes(message.quantums); + } + if (message.index !== BigInt(0)) { + writer.uint32(24).uint64(message.index); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AssetPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAssetPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetId = reader.uint32(); + break; + case 2: + message.quantums = reader.bytes(); + break; + case 3: + message.index = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AssetPosition { + const message = createBaseAssetPosition(); + message.assetId = object.assetId ?? 0; + message.quantums = object.quantums ?? new Uint8Array(); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AssetPositionAmino): AssetPosition { + const message = createBaseAssetPosition(); + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = bytesFromBase64(object.quantums); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + return message; + }, + toAmino(message: AssetPosition): AssetPositionAmino { + const obj: any = {}; + obj.asset_id = message.assetId === 0 ? undefined : message.assetId; + obj.quantums = message.quantums ? base64FromBytes(message.quantums) : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AssetPositionAminoMsg): AssetPosition { + return AssetPosition.fromAmino(object.value); + }, + fromProtoMsg(message: AssetPositionProtoMsg): AssetPosition { + return AssetPosition.decode(message.value); + }, + toProto(message: AssetPosition): Uint8Array { + return AssetPosition.encode(message).finish(); + }, + toProtoMsg(message: AssetPosition): AssetPositionProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.AssetPosition", + value: AssetPosition.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/genesis.ts new file mode 100644 index 00000000..9f603455 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/genesis.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +import { Subaccount, SubaccountAmino, SubaccountSDKType } from "./subaccount"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the subaccounts module's genesis state. */ +export interface GenesisState { + subaccounts: Subaccount[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the subaccounts module's genesis state. */ +export interface GenesisStateAmino { + subaccounts?: SubaccountAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.subaccounts.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the subaccounts module's genesis state. */ +export interface GenesisStateSDKType { + subaccounts: SubaccountSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + subaccounts: [] + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.subaccounts.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccounts) { + Subaccount.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccounts.push(Subaccount.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.subaccounts = object.subaccounts?.map(e => Subaccount.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.subaccounts = object.subaccounts?.map(e => Subaccount.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.subaccounts) { + obj.subaccounts = message.subaccounts.map(e => e ? Subaccount.toAmino(e) : undefined); + } else { + obj.subaccounts = message.subaccounts; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/perpetual_position.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/perpetual_position.ts new file mode 100644 index 00000000..52ec854d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/perpetual_position.ts @@ -0,0 +1,154 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * PerpetualPositions are an account’s positions of a `Perpetual`. + * Therefore they hold any information needed to trade perpetuals. + */ +export interface PerpetualPosition { + /** The `Id` of the `Perpetual`. */ + perpetualId: number; + /** The size of the position in base quantums. */ + quantums: Uint8Array; + /** + * The funding_index of the `Perpetual` the last time this position was + * settled. + */ + fundingIndex: Uint8Array; + /** The quote_balance of the `Perpetual`. */ + quoteBalance: Uint8Array; +} +export interface PerpetualPositionProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.PerpetualPosition"; + value: Uint8Array; +} +/** + * PerpetualPositions are an account’s positions of a `Perpetual`. + * Therefore they hold any information needed to trade perpetuals. + */ +export interface PerpetualPositionAmino { + /** The `Id` of the `Perpetual`. */ + perpetual_id?: number; + /** The size of the position in base quantums. */ + quantums?: string; + /** + * The funding_index of the `Perpetual` the last time this position was + * settled. + */ + funding_index?: string; + /** The quote_balance of the `Perpetual`. */ + quote_balance?: string; +} +export interface PerpetualPositionAminoMsg { + type: "/dydxprotocol.subaccounts.PerpetualPosition"; + value: PerpetualPositionAmino; +} +/** + * PerpetualPositions are an account’s positions of a `Perpetual`. + * Therefore they hold any information needed to trade perpetuals. + */ +export interface PerpetualPositionSDKType { + perpetual_id: number; + quantums: Uint8Array; + funding_index: Uint8Array; + quote_balance: Uint8Array; +} +function createBasePerpetualPosition(): PerpetualPosition { + return { + perpetualId: 0, + quantums: new Uint8Array(), + fundingIndex: new Uint8Array(), + quoteBalance: new Uint8Array() + }; +} +export const PerpetualPosition = { + typeUrl: "/dydxprotocol.subaccounts.PerpetualPosition", + encode(message: PerpetualPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (message.quantums.length !== 0) { + writer.uint32(18).bytes(message.quantums); + } + if (message.fundingIndex.length !== 0) { + writer.uint32(26).bytes(message.fundingIndex); + } + if (message.quoteBalance.length !== 0) { + writer.uint32(34).bytes(message.quoteBalance); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PerpetualPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.quantums = reader.bytes(); + break; + case 3: + message.fundingIndex = reader.bytes(); + break; + case 4: + message.quoteBalance = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PerpetualPosition { + const message = createBasePerpetualPosition(); + message.perpetualId = object.perpetualId ?? 0; + message.quantums = object.quantums ?? new Uint8Array(); + message.fundingIndex = object.fundingIndex ?? new Uint8Array(); + message.quoteBalance = object.quoteBalance ?? new Uint8Array(); + return message; + }, + fromAmino(object: PerpetualPositionAmino): PerpetualPosition { + const message = createBasePerpetualPosition(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = bytesFromBase64(object.quantums); + } + if (object.funding_index !== undefined && object.funding_index !== null) { + message.fundingIndex = bytesFromBase64(object.funding_index); + } + if (object.quote_balance !== undefined && object.quote_balance !== null) { + message.quoteBalance = bytesFromBase64(object.quote_balance); + } + return message; + }, + toAmino(message: PerpetualPosition): PerpetualPositionAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.quantums = message.quantums ? base64FromBytes(message.quantums) : undefined; + obj.funding_index = message.fundingIndex ? base64FromBytes(message.fundingIndex) : undefined; + obj.quote_balance = message.quoteBalance ? base64FromBytes(message.quoteBalance) : undefined; + return obj; + }, + fromAminoMsg(object: PerpetualPositionAminoMsg): PerpetualPosition { + return PerpetualPosition.fromAmino(object.value); + }, + fromProtoMsg(message: PerpetualPositionProtoMsg): PerpetualPosition { + return PerpetualPosition.decode(message.value); + }, + toProto(message: PerpetualPosition): Uint8Array { + return PerpetualPosition.encode(message).finish(); + }, + toProtoMsg(message: PerpetualPosition): PerpetualPositionProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.PerpetualPosition", + value: PerpetualPosition.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/query.rpc.Query.ts new file mode 100644 index 00000000..68eb8b3c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/query.rpc.Query.ts @@ -0,0 +1,69 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryGetSubaccountRequest, QuerySubaccountResponse, QueryAllSubaccountRequest, QuerySubaccountAllResponse, QueryGetWithdrawalAndTransfersBlockedInfoRequest, QueryGetWithdrawalAndTransfersBlockedInfoResponse, QueryCollateralPoolAddressRequest, QueryCollateralPoolAddressResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a Subaccount by id */ + subaccount(request: QueryGetSubaccountRequest): Promise; + /** Queries a list of Subaccount items. */ + subaccountAll(request?: QueryAllSubaccountRequest): Promise; + /** + * Queries information about whether withdrawal and transfers are blocked, and + * if so which block they are re-enabled on. + */ + getWithdrawalAndTransfersBlockedInfo(request: QueryGetWithdrawalAndTransfersBlockedInfoRequest): Promise; + /** Queries the collateral pool account address for a perpetual id. */ + collateralPoolAddress(request: QueryCollateralPoolAddressRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.subaccount = this.subaccount.bind(this); + this.subaccountAll = this.subaccountAll.bind(this); + this.getWithdrawalAndTransfersBlockedInfo = this.getWithdrawalAndTransfersBlockedInfo.bind(this); + this.collateralPoolAddress = this.collateralPoolAddress.bind(this); + } + subaccount(request: QueryGetSubaccountRequest): Promise { + const data = QueryGetSubaccountRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.subaccounts.Query", "Subaccount", data); + return promise.then(data => QuerySubaccountResponse.decode(new BinaryReader(data))); + } + subaccountAll(request: QueryAllSubaccountRequest = { + pagination: undefined + }): Promise { + const data = QueryAllSubaccountRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.subaccounts.Query", "SubaccountAll", data); + return promise.then(data => QuerySubaccountAllResponse.decode(new BinaryReader(data))); + } + getWithdrawalAndTransfersBlockedInfo(request: QueryGetWithdrawalAndTransfersBlockedInfoRequest): Promise { + const data = QueryGetWithdrawalAndTransfersBlockedInfoRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.subaccounts.Query", "GetWithdrawalAndTransfersBlockedInfo", data); + return promise.then(data => QueryGetWithdrawalAndTransfersBlockedInfoResponse.decode(new BinaryReader(data))); + } + collateralPoolAddress(request: QueryCollateralPoolAddressRequest): Promise { + const data = QueryCollateralPoolAddressRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.subaccounts.Query", "CollateralPoolAddress", data); + return promise.then(data => QueryCollateralPoolAddressResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + subaccount(request: QueryGetSubaccountRequest): Promise { + return queryService.subaccount(request); + }, + subaccountAll(request?: QueryAllSubaccountRequest): Promise { + return queryService.subaccountAll(request); + }, + getWithdrawalAndTransfersBlockedInfo(request: QueryGetWithdrawalAndTransfersBlockedInfoRequest): Promise { + return queryService.getWithdrawalAndTransfersBlockedInfo(request); + }, + collateralPoolAddress(request: QueryCollateralPoolAddressRequest): Promise { + return queryService.collateralPoolAddress(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/query.ts new file mode 100644 index 00000000..e909b60a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/query.ts @@ -0,0 +1,775 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { Subaccount, SubaccountAmino, SubaccountSDKType } from "./subaccount"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryGetSubaccountRequest is request type for the Query RPC method. */ +export interface QueryGetSubaccountRequest { + owner: string; + number: number; +} +export interface QueryGetSubaccountRequestProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QueryGetSubaccountRequest"; + value: Uint8Array; +} +/** QueryGetSubaccountRequest is request type for the Query RPC method. */ +export interface QueryGetSubaccountRequestAmino { + owner?: string; + number?: number; +} +export interface QueryGetSubaccountRequestAminoMsg { + type: "/dydxprotocol.subaccounts.QueryGetSubaccountRequest"; + value: QueryGetSubaccountRequestAmino; +} +/** QueryGetSubaccountRequest is request type for the Query RPC method. */ +export interface QueryGetSubaccountRequestSDKType { + owner: string; + number: number; +} +/** QuerySubaccountResponse is response type for the Query RPC method. */ +export interface QuerySubaccountResponse { + subaccount: Subaccount; +} +export interface QuerySubaccountResponseProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QuerySubaccountResponse"; + value: Uint8Array; +} +/** QuerySubaccountResponse is response type for the Query RPC method. */ +export interface QuerySubaccountResponseAmino { + subaccount?: SubaccountAmino; +} +export interface QuerySubaccountResponseAminoMsg { + type: "/dydxprotocol.subaccounts.QuerySubaccountResponse"; + value: QuerySubaccountResponseAmino; +} +/** QuerySubaccountResponse is response type for the Query RPC method. */ +export interface QuerySubaccountResponseSDKType { + subaccount: SubaccountSDKType; +} +/** QueryAllSubaccountRequest is request type for the Query RPC method. */ +export interface QueryAllSubaccountRequest { + pagination?: PageRequest; +} +export interface QueryAllSubaccountRequestProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QueryAllSubaccountRequest"; + value: Uint8Array; +} +/** QueryAllSubaccountRequest is request type for the Query RPC method. */ +export interface QueryAllSubaccountRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllSubaccountRequestAminoMsg { + type: "/dydxprotocol.subaccounts.QueryAllSubaccountRequest"; + value: QueryAllSubaccountRequestAmino; +} +/** QueryAllSubaccountRequest is request type for the Query RPC method. */ +export interface QueryAllSubaccountRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QuerySubaccountAllResponse is response type for the Query RPC method. */ +export interface QuerySubaccountAllResponse { + subaccount: Subaccount[]; + pagination?: PageResponse; +} +export interface QuerySubaccountAllResponseProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QuerySubaccountAllResponse"; + value: Uint8Array; +} +/** QuerySubaccountAllResponse is response type for the Query RPC method. */ +export interface QuerySubaccountAllResponseAmino { + subaccount?: SubaccountAmino[]; + pagination?: PageResponseAmino; +} +export interface QuerySubaccountAllResponseAminoMsg { + type: "/dydxprotocol.subaccounts.QuerySubaccountAllResponse"; + value: QuerySubaccountAllResponseAmino; +} +/** QuerySubaccountAllResponse is response type for the Query RPC method. */ +export interface QuerySubaccountAllResponseSDKType { + subaccount: SubaccountSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryGetWithdrawalAndTransfersBlockedInfoRequest is a request type for + * fetching information about whether withdrawals and transfers are blocked for + * a collateral pool associated with the passed in perpetual id. + */ +export interface QueryGetWithdrawalAndTransfersBlockedInfoRequest { + perpetualId: number; +} +export interface QueryGetWithdrawalAndTransfersBlockedInfoRequestProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoRequest"; + value: Uint8Array; +} +/** + * QueryGetWithdrawalAndTransfersBlockedInfoRequest is a request type for + * fetching information about whether withdrawals and transfers are blocked for + * a collateral pool associated with the passed in perpetual id. + */ +export interface QueryGetWithdrawalAndTransfersBlockedInfoRequestAmino { + perpetual_id?: number; +} +export interface QueryGetWithdrawalAndTransfersBlockedInfoRequestAminoMsg { + type: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoRequest"; + value: QueryGetWithdrawalAndTransfersBlockedInfoRequestAmino; +} +/** + * QueryGetWithdrawalAndTransfersBlockedInfoRequest is a request type for + * fetching information about whether withdrawals and transfers are blocked for + * a collateral pool associated with the passed in perpetual id. + */ +export interface QueryGetWithdrawalAndTransfersBlockedInfoRequestSDKType { + perpetual_id: number; +} +/** + * QueryGetWithdrawalAndTransfersBlockedInfoRequest is a response type for + * fetching information about whether withdrawals and transfers are blocked. + */ +export interface QueryGetWithdrawalAndTransfersBlockedInfoResponse { + negativeTncSubaccountSeenAtBlock: number; + chainOutageSeenAtBlock: number; + withdrawalsAndTransfersUnblockedAtBlock: number; +} +export interface QueryGetWithdrawalAndTransfersBlockedInfoResponseProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoResponse"; + value: Uint8Array; +} +/** + * QueryGetWithdrawalAndTransfersBlockedInfoRequest is a response type for + * fetching information about whether withdrawals and transfers are blocked. + */ +export interface QueryGetWithdrawalAndTransfersBlockedInfoResponseAmino { + negative_tnc_subaccount_seen_at_block?: number; + chain_outage_seen_at_block?: number; + withdrawals_and_transfers_unblocked_at_block?: number; +} +export interface QueryGetWithdrawalAndTransfersBlockedInfoResponseAminoMsg { + type: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoResponse"; + value: QueryGetWithdrawalAndTransfersBlockedInfoResponseAmino; +} +/** + * QueryGetWithdrawalAndTransfersBlockedInfoRequest is a response type for + * fetching information about whether withdrawals and transfers are blocked. + */ +export interface QueryGetWithdrawalAndTransfersBlockedInfoResponseSDKType { + negative_tnc_subaccount_seen_at_block: number; + chain_outage_seen_at_block: number; + withdrawals_and_transfers_unblocked_at_block: number; +} +/** + * QueryCollateralPoolAddressRequest is the request type for fetching the + * account address of the collateral pool associated with the passed in + * perpetual id. + */ +export interface QueryCollateralPoolAddressRequest { + perpetualId: number; +} +export interface QueryCollateralPoolAddressRequestProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressRequest"; + value: Uint8Array; +} +/** + * QueryCollateralPoolAddressRequest is the request type for fetching the + * account address of the collateral pool associated with the passed in + * perpetual id. + */ +export interface QueryCollateralPoolAddressRequestAmino { + perpetual_id?: number; +} +export interface QueryCollateralPoolAddressRequestAminoMsg { + type: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressRequest"; + value: QueryCollateralPoolAddressRequestAmino; +} +/** + * QueryCollateralPoolAddressRequest is the request type for fetching the + * account address of the collateral pool associated with the passed in + * perpetual id. + */ +export interface QueryCollateralPoolAddressRequestSDKType { + perpetual_id: number; +} +/** + * QueryCollateralPoolAddressResponse is a response type for fetching the + * account address of the collateral pool associated with the passed in + * perpetual id. + */ +export interface QueryCollateralPoolAddressResponse { + collateralPoolAddress: string; +} +export interface QueryCollateralPoolAddressResponseProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressResponse"; + value: Uint8Array; +} +/** + * QueryCollateralPoolAddressResponse is a response type for fetching the + * account address of the collateral pool associated with the passed in + * perpetual id. + */ +export interface QueryCollateralPoolAddressResponseAmino { + collateral_pool_address?: string; +} +export interface QueryCollateralPoolAddressResponseAminoMsg { + type: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressResponse"; + value: QueryCollateralPoolAddressResponseAmino; +} +/** + * QueryCollateralPoolAddressResponse is a response type for fetching the + * account address of the collateral pool associated with the passed in + * perpetual id. + */ +export interface QueryCollateralPoolAddressResponseSDKType { + collateral_pool_address: string; +} +function createBaseQueryGetSubaccountRequest(): QueryGetSubaccountRequest { + return { + owner: "", + number: 0 + }; +} +export const QueryGetSubaccountRequest = { + typeUrl: "/dydxprotocol.subaccounts.QueryGetSubaccountRequest", + encode(message: QueryGetSubaccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetSubaccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetSubaccountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.number = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetSubaccountRequest { + const message = createBaseQueryGetSubaccountRequest(); + message.owner = object.owner ?? ""; + message.number = object.number ?? 0; + return message; + }, + fromAmino(object: QueryGetSubaccountRequestAmino): QueryGetSubaccountRequest { + const message = createBaseQueryGetSubaccountRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + return message; + }, + toAmino(message: QueryGetSubaccountRequest): QueryGetSubaccountRequestAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.number = message.number === 0 ? undefined : message.number; + return obj; + }, + fromAminoMsg(object: QueryGetSubaccountRequestAminoMsg): QueryGetSubaccountRequest { + return QueryGetSubaccountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetSubaccountRequestProtoMsg): QueryGetSubaccountRequest { + return QueryGetSubaccountRequest.decode(message.value); + }, + toProto(message: QueryGetSubaccountRequest): Uint8Array { + return QueryGetSubaccountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetSubaccountRequest): QueryGetSubaccountRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QueryGetSubaccountRequest", + value: QueryGetSubaccountRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySubaccountResponse(): QuerySubaccountResponse { + return { + subaccount: Subaccount.fromPartial({}) + }; +} +export const QuerySubaccountResponse = { + typeUrl: "/dydxprotocol.subaccounts.QuerySubaccountResponse", + encode(message: QuerySubaccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccount !== undefined) { + Subaccount.encode(message.subaccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccount = Subaccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySubaccountResponse { + const message = createBaseQuerySubaccountResponse(); + message.subaccount = object.subaccount !== undefined && object.subaccount !== null ? Subaccount.fromPartial(object.subaccount) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountResponseAmino): QuerySubaccountResponse { + const message = createBaseQuerySubaccountResponse(); + if (object.subaccount !== undefined && object.subaccount !== null) { + message.subaccount = Subaccount.fromAmino(object.subaccount); + } + return message; + }, + toAmino(message: QuerySubaccountResponse): QuerySubaccountResponseAmino { + const obj: any = {}; + obj.subaccount = message.subaccount ? Subaccount.toAmino(message.subaccount) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountResponseAminoMsg): QuerySubaccountResponse { + return QuerySubaccountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountResponseProtoMsg): QuerySubaccountResponse { + return QuerySubaccountResponse.decode(message.value); + }, + toProto(message: QuerySubaccountResponse): Uint8Array { + return QuerySubaccountResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountResponse): QuerySubaccountResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QuerySubaccountResponse", + value: QuerySubaccountResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllSubaccountRequest(): QueryAllSubaccountRequest { + return { + pagination: undefined + }; +} +export const QueryAllSubaccountRequest = { + typeUrl: "/dydxprotocol.subaccounts.QueryAllSubaccountRequest", + encode(message: QueryAllSubaccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllSubaccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllSubaccountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllSubaccountRequest { + const message = createBaseQueryAllSubaccountRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllSubaccountRequestAmino): QueryAllSubaccountRequest { + const message = createBaseQueryAllSubaccountRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllSubaccountRequest): QueryAllSubaccountRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllSubaccountRequestAminoMsg): QueryAllSubaccountRequest { + return QueryAllSubaccountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllSubaccountRequestProtoMsg): QueryAllSubaccountRequest { + return QueryAllSubaccountRequest.decode(message.value); + }, + toProto(message: QueryAllSubaccountRequest): Uint8Array { + return QueryAllSubaccountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllSubaccountRequest): QueryAllSubaccountRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QueryAllSubaccountRequest", + value: QueryAllSubaccountRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySubaccountAllResponse(): QuerySubaccountAllResponse { + return { + subaccount: [], + pagination: undefined + }; +} +export const QuerySubaccountAllResponse = { + typeUrl: "/dydxprotocol.subaccounts.QuerySubaccountAllResponse", + encode(message: QuerySubaccountAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subaccount) { + Subaccount.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubaccountAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubaccountAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccount.push(Subaccount.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySubaccountAllResponse { + const message = createBaseQuerySubaccountAllResponse(); + message.subaccount = object.subaccount?.map(e => Subaccount.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySubaccountAllResponseAmino): QuerySubaccountAllResponse { + const message = createBaseQuerySubaccountAllResponse(); + message.subaccount = object.subaccount?.map(e => Subaccount.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySubaccountAllResponse): QuerySubaccountAllResponseAmino { + const obj: any = {}; + if (message.subaccount) { + obj.subaccount = message.subaccount.map(e => e ? Subaccount.toAmino(e) : undefined); + } else { + obj.subaccount = message.subaccount; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySubaccountAllResponseAminoMsg): QuerySubaccountAllResponse { + return QuerySubaccountAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySubaccountAllResponseProtoMsg): QuerySubaccountAllResponse { + return QuerySubaccountAllResponse.decode(message.value); + }, + toProto(message: QuerySubaccountAllResponse): Uint8Array { + return QuerySubaccountAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubaccountAllResponse): QuerySubaccountAllResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QuerySubaccountAllResponse", + value: QuerySubaccountAllResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(): QueryGetWithdrawalAndTransfersBlockedInfoRequest { + return { + perpetualId: 0 + }; +} +export const QueryGetWithdrawalAndTransfersBlockedInfoRequest = { + typeUrl: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoRequest", + encode(message: QueryGetWithdrawalAndTransfersBlockedInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetWithdrawalAndTransfersBlockedInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetWithdrawalAndTransfersBlockedInfoRequest { + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(); + message.perpetualId = object.perpetualId ?? 0; + return message; + }, + fromAmino(object: QueryGetWithdrawalAndTransfersBlockedInfoRequestAmino): QueryGetWithdrawalAndTransfersBlockedInfoRequest { + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + return message; + }, + toAmino(message: QueryGetWithdrawalAndTransfersBlockedInfoRequest): QueryGetWithdrawalAndTransfersBlockedInfoRequestAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + return obj; + }, + fromAminoMsg(object: QueryGetWithdrawalAndTransfersBlockedInfoRequestAminoMsg): QueryGetWithdrawalAndTransfersBlockedInfoRequest { + return QueryGetWithdrawalAndTransfersBlockedInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetWithdrawalAndTransfersBlockedInfoRequestProtoMsg): QueryGetWithdrawalAndTransfersBlockedInfoRequest { + return QueryGetWithdrawalAndTransfersBlockedInfoRequest.decode(message.value); + }, + toProto(message: QueryGetWithdrawalAndTransfersBlockedInfoRequest): Uint8Array { + return QueryGetWithdrawalAndTransfersBlockedInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetWithdrawalAndTransfersBlockedInfoRequest): QueryGetWithdrawalAndTransfersBlockedInfoRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoRequest", + value: QueryGetWithdrawalAndTransfersBlockedInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(): QueryGetWithdrawalAndTransfersBlockedInfoResponse { + return { + negativeTncSubaccountSeenAtBlock: 0, + chainOutageSeenAtBlock: 0, + withdrawalsAndTransfersUnblockedAtBlock: 0 + }; +} +export const QueryGetWithdrawalAndTransfersBlockedInfoResponse = { + typeUrl: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoResponse", + encode(message: QueryGetWithdrawalAndTransfersBlockedInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.negativeTncSubaccountSeenAtBlock !== 0) { + writer.uint32(8).uint32(message.negativeTncSubaccountSeenAtBlock); + } + if (message.chainOutageSeenAtBlock !== 0) { + writer.uint32(16).uint32(message.chainOutageSeenAtBlock); + } + if (message.withdrawalsAndTransfersUnblockedAtBlock !== 0) { + writer.uint32(24).uint32(message.withdrawalsAndTransfersUnblockedAtBlock); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetWithdrawalAndTransfersBlockedInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.negativeTncSubaccountSeenAtBlock = reader.uint32(); + break; + case 2: + message.chainOutageSeenAtBlock = reader.uint32(); + break; + case 3: + message.withdrawalsAndTransfersUnblockedAtBlock = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetWithdrawalAndTransfersBlockedInfoResponse { + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(); + message.negativeTncSubaccountSeenAtBlock = object.negativeTncSubaccountSeenAtBlock ?? 0; + message.chainOutageSeenAtBlock = object.chainOutageSeenAtBlock ?? 0; + message.withdrawalsAndTransfersUnblockedAtBlock = object.withdrawalsAndTransfersUnblockedAtBlock ?? 0; + return message; + }, + fromAmino(object: QueryGetWithdrawalAndTransfersBlockedInfoResponseAmino): QueryGetWithdrawalAndTransfersBlockedInfoResponse { + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(); + if (object.negative_tnc_subaccount_seen_at_block !== undefined && object.negative_tnc_subaccount_seen_at_block !== null) { + message.negativeTncSubaccountSeenAtBlock = object.negative_tnc_subaccount_seen_at_block; + } + if (object.chain_outage_seen_at_block !== undefined && object.chain_outage_seen_at_block !== null) { + message.chainOutageSeenAtBlock = object.chain_outage_seen_at_block; + } + if (object.withdrawals_and_transfers_unblocked_at_block !== undefined && object.withdrawals_and_transfers_unblocked_at_block !== null) { + message.withdrawalsAndTransfersUnblockedAtBlock = object.withdrawals_and_transfers_unblocked_at_block; + } + return message; + }, + toAmino(message: QueryGetWithdrawalAndTransfersBlockedInfoResponse): QueryGetWithdrawalAndTransfersBlockedInfoResponseAmino { + const obj: any = {}; + obj.negative_tnc_subaccount_seen_at_block = message.negativeTncSubaccountSeenAtBlock === 0 ? undefined : message.negativeTncSubaccountSeenAtBlock; + obj.chain_outage_seen_at_block = message.chainOutageSeenAtBlock === 0 ? undefined : message.chainOutageSeenAtBlock; + obj.withdrawals_and_transfers_unblocked_at_block = message.withdrawalsAndTransfersUnblockedAtBlock === 0 ? undefined : message.withdrawalsAndTransfersUnblockedAtBlock; + return obj; + }, + fromAminoMsg(object: QueryGetWithdrawalAndTransfersBlockedInfoResponseAminoMsg): QueryGetWithdrawalAndTransfersBlockedInfoResponse { + return QueryGetWithdrawalAndTransfersBlockedInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetWithdrawalAndTransfersBlockedInfoResponseProtoMsg): QueryGetWithdrawalAndTransfersBlockedInfoResponse { + return QueryGetWithdrawalAndTransfersBlockedInfoResponse.decode(message.value); + }, + toProto(message: QueryGetWithdrawalAndTransfersBlockedInfoResponse): Uint8Array { + return QueryGetWithdrawalAndTransfersBlockedInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGetWithdrawalAndTransfersBlockedInfoResponse): QueryGetWithdrawalAndTransfersBlockedInfoResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QueryGetWithdrawalAndTransfersBlockedInfoResponse", + value: QueryGetWithdrawalAndTransfersBlockedInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCollateralPoolAddressRequest(): QueryCollateralPoolAddressRequest { + return { + perpetualId: 0 + }; +} +export const QueryCollateralPoolAddressRequest = { + typeUrl: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressRequest", + encode(message: QueryCollateralPoolAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCollateralPoolAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCollateralPoolAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCollateralPoolAddressRequest { + const message = createBaseQueryCollateralPoolAddressRequest(); + message.perpetualId = object.perpetualId ?? 0; + return message; + }, + fromAmino(object: QueryCollateralPoolAddressRequestAmino): QueryCollateralPoolAddressRequest { + const message = createBaseQueryCollateralPoolAddressRequest(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + return message; + }, + toAmino(message: QueryCollateralPoolAddressRequest): QueryCollateralPoolAddressRequestAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + return obj; + }, + fromAminoMsg(object: QueryCollateralPoolAddressRequestAminoMsg): QueryCollateralPoolAddressRequest { + return QueryCollateralPoolAddressRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCollateralPoolAddressRequestProtoMsg): QueryCollateralPoolAddressRequest { + return QueryCollateralPoolAddressRequest.decode(message.value); + }, + toProto(message: QueryCollateralPoolAddressRequest): Uint8Array { + return QueryCollateralPoolAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCollateralPoolAddressRequest): QueryCollateralPoolAddressRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressRequest", + value: QueryCollateralPoolAddressRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCollateralPoolAddressResponse(): QueryCollateralPoolAddressResponse { + return { + collateralPoolAddress: "" + }; +} +export const QueryCollateralPoolAddressResponse = { + typeUrl: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressResponse", + encode(message: QueryCollateralPoolAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.collateralPoolAddress !== "") { + writer.uint32(10).string(message.collateralPoolAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCollateralPoolAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCollateralPoolAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.collateralPoolAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCollateralPoolAddressResponse { + const message = createBaseQueryCollateralPoolAddressResponse(); + message.collateralPoolAddress = object.collateralPoolAddress ?? ""; + return message; + }, + fromAmino(object: QueryCollateralPoolAddressResponseAmino): QueryCollateralPoolAddressResponse { + const message = createBaseQueryCollateralPoolAddressResponse(); + if (object.collateral_pool_address !== undefined && object.collateral_pool_address !== null) { + message.collateralPoolAddress = object.collateral_pool_address; + } + return message; + }, + toAmino(message: QueryCollateralPoolAddressResponse): QueryCollateralPoolAddressResponseAmino { + const obj: any = {}; + obj.collateral_pool_address = message.collateralPoolAddress === "" ? undefined : message.collateralPoolAddress; + return obj; + }, + fromAminoMsg(object: QueryCollateralPoolAddressResponseAminoMsg): QueryCollateralPoolAddressResponse { + return QueryCollateralPoolAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCollateralPoolAddressResponseProtoMsg): QueryCollateralPoolAddressResponse { + return QueryCollateralPoolAddressResponse.decode(message.value); + }, + toProto(message: QueryCollateralPoolAddressResponse): Uint8Array { + return QueryCollateralPoolAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCollateralPoolAddressResponse): QueryCollateralPoolAddressResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.QueryCollateralPoolAddressResponse", + value: QueryCollateralPoolAddressResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/streaming.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/streaming.ts new file mode 100644 index 00000000..196223b8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/streaming.ts @@ -0,0 +1,388 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "./subaccount"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * StreamSubaccountUpdate provides information on a subaccount update. Used in + * the full node GRPC stream. + */ +export interface StreamSubaccountUpdate { + subaccountId?: SubaccountId; + /** updated_perpetual_positions will each be for unique perpetuals. */ + updatedPerpetualPositions: SubaccountPerpetualPosition[]; + /** updated_asset_positions will each be for unique assets. */ + updatedAssetPositions: SubaccountAssetPosition[]; + /** + * Snapshot indicates if the response is from a snapshot of the subaccount. + * All updates should be ignored until snapshot is received. + * If the snapshot is true, then all previous entries should be + * discarded and the subaccount should be resynced. + * For a snapshot subaccount update, the `updated_perpetual_positions` and + * `updated_asset_positions` fields will contain the full state of the + * subaccount. + */ + snapshot: boolean; +} +export interface StreamSubaccountUpdateProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.StreamSubaccountUpdate"; + value: Uint8Array; +} +/** + * StreamSubaccountUpdate provides information on a subaccount update. Used in + * the full node GRPC stream. + */ +export interface StreamSubaccountUpdateAmino { + subaccount_id?: SubaccountIdAmino; + /** updated_perpetual_positions will each be for unique perpetuals. */ + updated_perpetual_positions?: SubaccountPerpetualPositionAmino[]; + /** updated_asset_positions will each be for unique assets. */ + updated_asset_positions?: SubaccountAssetPositionAmino[]; + /** + * Snapshot indicates if the response is from a snapshot of the subaccount. + * All updates should be ignored until snapshot is received. + * If the snapshot is true, then all previous entries should be + * discarded and the subaccount should be resynced. + * For a snapshot subaccount update, the `updated_perpetual_positions` and + * `updated_asset_positions` fields will contain the full state of the + * subaccount. + */ + snapshot?: boolean; +} +export interface StreamSubaccountUpdateAminoMsg { + type: "/dydxprotocol.subaccounts.StreamSubaccountUpdate"; + value: StreamSubaccountUpdateAmino; +} +/** + * StreamSubaccountUpdate provides information on a subaccount update. Used in + * the full node GRPC stream. + */ +export interface StreamSubaccountUpdateSDKType { + subaccount_id?: SubaccountIdSDKType; + updated_perpetual_positions: SubaccountPerpetualPositionSDKType[]; + updated_asset_positions: SubaccountAssetPositionSDKType[]; + snapshot: boolean; +} +/** + * SubaccountPerpetualPosition provides information on a subaccount's updated + * perpetual positions. + */ +export interface SubaccountPerpetualPosition { + /** The `Id` of the `Perpetual`. */ + perpetualId: number; + /** The size of the position in base quantums. */ + quantums: bigint; +} +export interface SubaccountPerpetualPositionProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.SubaccountPerpetualPosition"; + value: Uint8Array; +} +/** + * SubaccountPerpetualPosition provides information on a subaccount's updated + * perpetual positions. + */ +export interface SubaccountPerpetualPositionAmino { + /** The `Id` of the `Perpetual`. */ + perpetual_id?: number; + /** The size of the position in base quantums. */ + quantums?: string; +} +export interface SubaccountPerpetualPositionAminoMsg { + type: "/dydxprotocol.subaccounts.SubaccountPerpetualPosition"; + value: SubaccountPerpetualPositionAmino; +} +/** + * SubaccountPerpetualPosition provides information on a subaccount's updated + * perpetual positions. + */ +export interface SubaccountPerpetualPositionSDKType { + perpetual_id: number; + quantums: bigint; +} +/** + * SubaccountAssetPosition provides information on a subaccount's updated asset + * positions. + */ +export interface SubaccountAssetPosition { + /** The `Id` of the `Asset`. */ + assetId: number; + /** The absolute size of the position in base quantums. */ + quantums: bigint; +} +export interface SubaccountAssetPositionProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.SubaccountAssetPosition"; + value: Uint8Array; +} +/** + * SubaccountAssetPosition provides information on a subaccount's updated asset + * positions. + */ +export interface SubaccountAssetPositionAmino { + /** The `Id` of the `Asset`. */ + asset_id?: number; + /** The absolute size of the position in base quantums. */ + quantums?: string; +} +export interface SubaccountAssetPositionAminoMsg { + type: "/dydxprotocol.subaccounts.SubaccountAssetPosition"; + value: SubaccountAssetPositionAmino; +} +/** + * SubaccountAssetPosition provides information on a subaccount's updated asset + * positions. + */ +export interface SubaccountAssetPositionSDKType { + asset_id: number; + quantums: bigint; +} +function createBaseStreamSubaccountUpdate(): StreamSubaccountUpdate { + return { + subaccountId: undefined, + updatedPerpetualPositions: [], + updatedAssetPositions: [], + snapshot: false + }; +} +export const StreamSubaccountUpdate = { + typeUrl: "/dydxprotocol.subaccounts.StreamSubaccountUpdate", + encode(message: StreamSubaccountUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.updatedPerpetualPositions) { + SubaccountPerpetualPosition.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.updatedAssetPositions) { + SubaccountAssetPosition.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.snapshot === true) { + writer.uint32(32).bool(message.snapshot); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StreamSubaccountUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamSubaccountUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.updatedPerpetualPositions.push(SubaccountPerpetualPosition.decode(reader, reader.uint32())); + break; + case 3: + message.updatedAssetPositions.push(SubaccountAssetPosition.decode(reader, reader.uint32())); + break; + case 4: + message.snapshot = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StreamSubaccountUpdate { + const message = createBaseStreamSubaccountUpdate(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; + message.updatedPerpetualPositions = object.updatedPerpetualPositions?.map(e => SubaccountPerpetualPosition.fromPartial(e)) || []; + message.updatedAssetPositions = object.updatedAssetPositions?.map(e => SubaccountAssetPosition.fromPartial(e)) || []; + message.snapshot = object.snapshot ?? false; + return message; + }, + fromAmino(object: StreamSubaccountUpdateAmino): StreamSubaccountUpdate { + const message = createBaseStreamSubaccountUpdate(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = SubaccountId.fromAmino(object.subaccount_id); + } + message.updatedPerpetualPositions = object.updated_perpetual_positions?.map(e => SubaccountPerpetualPosition.fromAmino(e)) || []; + message.updatedAssetPositions = object.updated_asset_positions?.map(e => SubaccountAssetPosition.fromAmino(e)) || []; + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = object.snapshot; + } + return message; + }, + toAmino(message: StreamSubaccountUpdate): StreamSubaccountUpdateAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? SubaccountId.toAmino(message.subaccountId) : undefined; + if (message.updatedPerpetualPositions) { + obj.updated_perpetual_positions = message.updatedPerpetualPositions.map(e => e ? SubaccountPerpetualPosition.toAmino(e) : undefined); + } else { + obj.updated_perpetual_positions = message.updatedPerpetualPositions; + } + if (message.updatedAssetPositions) { + obj.updated_asset_positions = message.updatedAssetPositions.map(e => e ? SubaccountAssetPosition.toAmino(e) : undefined); + } else { + obj.updated_asset_positions = message.updatedAssetPositions; + } + obj.snapshot = message.snapshot === false ? undefined : message.snapshot; + return obj; + }, + fromAminoMsg(object: StreamSubaccountUpdateAminoMsg): StreamSubaccountUpdate { + return StreamSubaccountUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: StreamSubaccountUpdateProtoMsg): StreamSubaccountUpdate { + return StreamSubaccountUpdate.decode(message.value); + }, + toProto(message: StreamSubaccountUpdate): Uint8Array { + return StreamSubaccountUpdate.encode(message).finish(); + }, + toProtoMsg(message: StreamSubaccountUpdate): StreamSubaccountUpdateProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.StreamSubaccountUpdate", + value: StreamSubaccountUpdate.encode(message).finish() + }; + } +}; +function createBaseSubaccountPerpetualPosition(): SubaccountPerpetualPosition { + return { + perpetualId: 0, + quantums: BigInt(0) + }; +} +export const SubaccountPerpetualPosition = { + typeUrl: "/dydxprotocol.subaccounts.SubaccountPerpetualPosition", + encode(message: SubaccountPerpetualPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (message.quantums !== BigInt(0)) { + writer.uint32(16).uint64(message.quantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountPerpetualPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountPerpetualPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.quantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountPerpetualPosition { + const message = createBaseSubaccountPerpetualPosition(); + message.perpetualId = object.perpetualId ?? 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? BigInt(object.quantums.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SubaccountPerpetualPositionAmino): SubaccountPerpetualPosition { + const message = createBaseSubaccountPerpetualPosition(); + if (object.perpetual_id !== undefined && object.perpetual_id !== null) { + message.perpetualId = object.perpetual_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = BigInt(object.quantums); + } + return message; + }, + toAmino(message: SubaccountPerpetualPosition): SubaccountPerpetualPositionAmino { + const obj: any = {}; + obj.perpetual_id = message.perpetualId === 0 ? undefined : message.perpetualId; + obj.quantums = message.quantums !== BigInt(0) ? message.quantums.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountPerpetualPositionAminoMsg): SubaccountPerpetualPosition { + return SubaccountPerpetualPosition.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountPerpetualPositionProtoMsg): SubaccountPerpetualPosition { + return SubaccountPerpetualPosition.decode(message.value); + }, + toProto(message: SubaccountPerpetualPosition): Uint8Array { + return SubaccountPerpetualPosition.encode(message).finish(); + }, + toProtoMsg(message: SubaccountPerpetualPosition): SubaccountPerpetualPositionProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.SubaccountPerpetualPosition", + value: SubaccountPerpetualPosition.encode(message).finish() + }; + } +}; +function createBaseSubaccountAssetPosition(): SubaccountAssetPosition { + return { + assetId: 0, + quantums: BigInt(0) + }; +} +export const SubaccountAssetPosition = { + typeUrl: "/dydxprotocol.subaccounts.SubaccountAssetPosition", + encode(message: SubaccountAssetPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetId !== 0) { + writer.uint32(8).uint32(message.assetId); + } + if (message.quantums !== BigInt(0)) { + writer.uint32(16).uint64(message.quantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountAssetPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountAssetPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetId = reader.uint32(); + break; + case 2: + message.quantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountAssetPosition { + const message = createBaseSubaccountAssetPosition(); + message.assetId = object.assetId ?? 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? BigInt(object.quantums.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SubaccountAssetPositionAmino): SubaccountAssetPosition { + const message = createBaseSubaccountAssetPosition(); + if (object.asset_id !== undefined && object.asset_id !== null) { + message.assetId = object.asset_id; + } + if (object.quantums !== undefined && object.quantums !== null) { + message.quantums = BigInt(object.quantums); + } + return message; + }, + toAmino(message: SubaccountAssetPosition): SubaccountAssetPositionAmino { + const obj: any = {}; + obj.asset_id = message.assetId === 0 ? undefined : message.assetId; + obj.quantums = message.quantums !== BigInt(0) ? message.quantums.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SubaccountAssetPositionAminoMsg): SubaccountAssetPosition { + return SubaccountAssetPosition.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountAssetPositionProtoMsg): SubaccountAssetPosition { + return SubaccountAssetPosition.decode(message.value); + }, + toProto(message: SubaccountAssetPosition): Uint8Array { + return SubaccountAssetPosition.encode(message).finish(); + }, + toProtoMsg(message: SubaccountAssetPosition): SubaccountAssetPositionProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.SubaccountAssetPosition", + value: SubaccountAssetPosition.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/subaccount.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/subaccount.ts new file mode 100644 index 00000000..469606bf --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/subaccounts/subaccount.ts @@ -0,0 +1,279 @@ +//@ts-nocheck +import { AssetPosition, AssetPositionAmino, AssetPositionSDKType } from "./asset_position"; +import { PerpetualPosition, PerpetualPositionAmino, PerpetualPositionSDKType } from "./perpetual_position"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** SubaccountId defines a unique identifier for a Subaccount. */ +export interface SubaccountId { + /** The address of the wallet that owns this subaccount. */ + owner: string; + /** + * The unique number of this subaccount for the owner. + * Currently limited to 128*1000 subaccounts per owner. + */ + number: number; +} +export interface SubaccountIdProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.SubaccountId"; + value: Uint8Array; +} +/** SubaccountId defines a unique identifier for a Subaccount. */ +export interface SubaccountIdAmino { + /** The address of the wallet that owns this subaccount. */ + owner?: string; + /** + * The unique number of this subaccount for the owner. + * Currently limited to 128*1000 subaccounts per owner. + */ + number?: number; +} +export interface SubaccountIdAminoMsg { + type: "/dydxprotocol.subaccounts.SubaccountId"; + value: SubaccountIdAmino; +} +/** SubaccountId defines a unique identifier for a Subaccount. */ +export interface SubaccountIdSDKType { + owner: string; + number: number; +} +/** + * Subaccount defines a single sub-account for a given address. + * Subaccounts are uniquely indexed by a subaccountNumber/owner pair. + */ +export interface Subaccount { + /** The Id of the Subaccount */ + id?: SubaccountId; + /** + * All `AssetPosition`s associated with this subaccount. + * Always sorted ascending by `asset_id`. + */ + assetPositions: AssetPosition[]; + /** + * All `PerpetualPosition`s associated with this subaccount. + * Always sorted ascending by `perpetual_id. + */ + perpetualPositions: PerpetualPosition[]; + /** + * Set by the owner. If true, then margin trades can be made in this + * subaccount. + */ + marginEnabled: boolean; +} +export interface SubaccountProtoMsg { + typeUrl: "/dydxprotocol.subaccounts.Subaccount"; + value: Uint8Array; +} +/** + * Subaccount defines a single sub-account for a given address. + * Subaccounts are uniquely indexed by a subaccountNumber/owner pair. + */ +export interface SubaccountAmino { + /** The Id of the Subaccount */ + id?: SubaccountIdAmino; + /** + * All `AssetPosition`s associated with this subaccount. + * Always sorted ascending by `asset_id`. + */ + asset_positions?: AssetPositionAmino[]; + /** + * All `PerpetualPosition`s associated with this subaccount. + * Always sorted ascending by `perpetual_id. + */ + perpetual_positions?: PerpetualPositionAmino[]; + /** + * Set by the owner. If true, then margin trades can be made in this + * subaccount. + */ + margin_enabled?: boolean; +} +export interface SubaccountAminoMsg { + type: "/dydxprotocol.subaccounts.Subaccount"; + value: SubaccountAmino; +} +/** + * Subaccount defines a single sub-account for a given address. + * Subaccounts are uniquely indexed by a subaccountNumber/owner pair. + */ +export interface SubaccountSDKType { + id?: SubaccountIdSDKType; + asset_positions: AssetPositionSDKType[]; + perpetual_positions: PerpetualPositionSDKType[]; + margin_enabled: boolean; +} +function createBaseSubaccountId(): SubaccountId { + return { + owner: "", + number: 0 + }; +} +export const SubaccountId = { + typeUrl: "/dydxprotocol.subaccounts.SubaccountId", + encode(message: SubaccountId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubaccountId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.number = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SubaccountId { + const message = createBaseSubaccountId(); + message.owner = object.owner ?? ""; + message.number = object.number ?? 0; + return message; + }, + fromAmino(object: SubaccountIdAmino): SubaccountId { + const message = createBaseSubaccountId(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + return message; + }, + toAmino(message: SubaccountId): SubaccountIdAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.number = message.number === 0 ? undefined : message.number; + return obj; + }, + fromAminoMsg(object: SubaccountIdAminoMsg): SubaccountId { + return SubaccountId.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountIdProtoMsg): SubaccountId { + return SubaccountId.decode(message.value); + }, + toProto(message: SubaccountId): Uint8Array { + return SubaccountId.encode(message).finish(); + }, + toProtoMsg(message: SubaccountId): SubaccountIdProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.SubaccountId", + value: SubaccountId.encode(message).finish() + }; + } +}; +function createBaseSubaccount(): Subaccount { + return { + id: undefined, + assetPositions: [], + perpetualPositions: [], + marginEnabled: false + }; +} +export const Subaccount = { + typeUrl: "/dydxprotocol.subaccounts.Subaccount", + encode(message: Subaccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== undefined) { + SubaccountId.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.assetPositions) { + AssetPosition.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.perpetualPositions) { + PerpetualPosition.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.marginEnabled === true) { + writer.uint32(32).bool(message.marginEnabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Subaccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.assetPositions.push(AssetPosition.decode(reader, reader.uint32())); + break; + case 3: + message.perpetualPositions.push(PerpetualPosition.decode(reader, reader.uint32())); + break; + case 4: + message.marginEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Subaccount { + const message = createBaseSubaccount(); + message.id = object.id !== undefined && object.id !== null ? SubaccountId.fromPartial(object.id) : undefined; + message.assetPositions = object.assetPositions?.map(e => AssetPosition.fromPartial(e)) || []; + message.perpetualPositions = object.perpetualPositions?.map(e => PerpetualPosition.fromPartial(e)) || []; + message.marginEnabled = object.marginEnabled ?? false; + return message; + }, + fromAmino(object: SubaccountAmino): Subaccount { + const message = createBaseSubaccount(); + if (object.id !== undefined && object.id !== null) { + message.id = SubaccountId.fromAmino(object.id); + } + message.assetPositions = object.asset_positions?.map(e => AssetPosition.fromAmino(e)) || []; + message.perpetualPositions = object.perpetual_positions?.map(e => PerpetualPosition.fromAmino(e)) || []; + if (object.margin_enabled !== undefined && object.margin_enabled !== null) { + message.marginEnabled = object.margin_enabled; + } + return message; + }, + toAmino(message: Subaccount): SubaccountAmino { + const obj: any = {}; + obj.id = message.id ? SubaccountId.toAmino(message.id) : undefined; + if (message.assetPositions) { + obj.asset_positions = message.assetPositions.map(e => e ? AssetPosition.toAmino(e) : undefined); + } else { + obj.asset_positions = message.assetPositions; + } + if (message.perpetualPositions) { + obj.perpetual_positions = message.perpetualPositions.map(e => e ? PerpetualPosition.toAmino(e) : undefined); + } else { + obj.perpetual_positions = message.perpetualPositions; + } + obj.margin_enabled = message.marginEnabled === false ? undefined : message.marginEnabled; + return obj; + }, + fromAminoMsg(object: SubaccountAminoMsg): Subaccount { + return Subaccount.fromAmino(object.value); + }, + fromProtoMsg(message: SubaccountProtoMsg): Subaccount { + return Subaccount.decode(message.value); + }, + toProto(message: Subaccount): Uint8Array { + return Subaccount.encode(message).finish(); + }, + toProtoMsg(message: Subaccount): SubaccountProtoMsg { + return { + typeUrl: "/dydxprotocol.subaccounts.Subaccount", + value: Subaccount.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/genesis.ts new file mode 100644 index 00000000..3acbb81b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/genesis.ts @@ -0,0 +1,563 @@ +//@ts-nocheck +import { NumShares, NumSharesAmino, NumSharesSDKType, OwnerShare, OwnerShareAmino, OwnerShareSDKType } from "./share"; +import { QuotingParams, QuotingParamsAmino, QuotingParamsSDKType, VaultParams, VaultParamsAmino, VaultParamsSDKType } from "./params"; +import { VaultId, VaultIdAmino, VaultIdSDKType } from "./vault"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines `x/vault`'s genesis state. */ +export interface GenesisState { + /** The total number of shares. */ + totalShares: NumShares; + /** The shares of each owner. */ + ownerShares: OwnerShare[]; + /** The vaults. */ + vaults: Vault[]; + /** The default quoting parameters for all vaults. */ + defaultQuotingParams: QuotingParams; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.vault.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines `x/vault`'s genesis state. */ +export interface GenesisStateAmino { + /** The total number of shares. */ + total_shares?: NumSharesAmino; + /** The shares of each owner. */ + owner_shares?: OwnerShareAmino[]; + /** The vaults. */ + vaults?: VaultAmino[]; + /** The default quoting parameters for all vaults. */ + default_quoting_params?: QuotingParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.vault.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines `x/vault`'s genesis state. */ +export interface GenesisStateSDKType { + total_shares: NumSharesSDKType; + owner_shares: OwnerShareSDKType[]; + vaults: VaultSDKType[]; + default_quoting_params: QuotingParamsSDKType; +} +/** Vault defines the state of a vault. */ +export interface Vault { + /** The ID of the vault. */ + vaultId: VaultId; + /** The parameters of the vault. */ + vaultParams: VaultParams; + /** The client IDs of the most recently placed orders of the vault. */ + mostRecentClientIds: number[]; +} +export interface VaultProtoMsg { + typeUrl: "/dydxprotocol.vault.Vault"; + value: Uint8Array; +} +/** Vault defines the state of a vault. */ +export interface VaultAmino { + /** The ID of the vault. */ + vault_id?: VaultIdAmino; + /** The parameters of the vault. */ + vault_params?: VaultParamsAmino; + /** The client IDs of the most recently placed orders of the vault. */ + most_recent_client_ids?: number[]; +} +export interface VaultAminoMsg { + type: "/dydxprotocol.vault.Vault"; + value: VaultAmino; +} +/** Vault defines the state of a vault. */ +export interface VaultSDKType { + vault_id: VaultIdSDKType; + vault_params: VaultParamsSDKType; + most_recent_client_ids: number[]; +} +/** + * GenesisStateV6 defines `x/vault`'s genesis state in v6.x. + * Deprecated since v7.x in favor of GenesisState. + */ +export interface GenesisStateV6 { + /** The vaults. */ + vaults: Vault[]; + /** The default quoting parameters for all vaults. */ + defaultQuotingParams: QuotingParams; +} +export interface GenesisStateV6ProtoMsg { + typeUrl: "/dydxprotocol.vault.GenesisStateV6"; + value: Uint8Array; +} +/** + * GenesisStateV6 defines `x/vault`'s genesis state in v6.x. + * Deprecated since v7.x in favor of GenesisState. + */ +export interface GenesisStateV6Amino { + /** The vaults. */ + vaults?: VaultAmino[]; + /** The default quoting parameters for all vaults. */ + default_quoting_params?: QuotingParamsAmino; +} +export interface GenesisStateV6AminoMsg { + type: "/dydxprotocol.vault.GenesisStateV6"; + value: GenesisStateV6Amino; +} +/** + * GenesisStateV6 defines `x/vault`'s genesis state in v6.x. + * Deprecated since v7.x in favor of GenesisState. + */ +export interface GenesisStateV6SDKType { + vaults: VaultSDKType[]; + default_quoting_params: QuotingParamsSDKType; +} +/** + * VaultV6 defines the state of a vault. + * Deprecated since v7.x in favor of Vault. + */ +export interface VaultV6 { + /** The ID of the vault. */ + vaultId?: VaultId; + /** The total number of shares in the vault. */ + totalShares?: NumShares; + /** The shares of each owner in the vault. */ + ownerShares: OwnerShare[]; + /** The parameters of the vault. */ + vaultParams: VaultParams; + /** The client IDs of the most recently placed orders of the vault. */ + mostRecentClientIds: number[]; +} +export interface VaultV6ProtoMsg { + typeUrl: "/dydxprotocol.vault.VaultV6"; + value: Uint8Array; +} +/** + * VaultV6 defines the state of a vault. + * Deprecated since v7.x in favor of Vault. + */ +export interface VaultV6Amino { + /** The ID of the vault. */ + vault_id?: VaultIdAmino; + /** The total number of shares in the vault. */ + total_shares?: NumSharesAmino; + /** The shares of each owner in the vault. */ + owner_shares?: OwnerShareAmino[]; + /** The parameters of the vault. */ + vault_params?: VaultParamsAmino; + /** The client IDs of the most recently placed orders of the vault. */ + most_recent_client_ids?: number[]; +} +export interface VaultV6AminoMsg { + type: "/dydxprotocol.vault.VaultV6"; + value: VaultV6Amino; +} +/** + * VaultV6 defines the state of a vault. + * Deprecated since v7.x in favor of Vault. + */ +export interface VaultV6SDKType { + vault_id?: VaultIdSDKType; + total_shares?: NumSharesSDKType; + owner_shares: OwnerShareSDKType[]; + vault_params: VaultParamsSDKType; + most_recent_client_ids: number[]; +} +function createBaseGenesisState(): GenesisState { + return { + totalShares: NumShares.fromPartial({}), + ownerShares: [], + vaults: [], + defaultQuotingParams: QuotingParams.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.vault.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalShares !== undefined) { + NumShares.encode(message.totalShares, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.ownerShares) { + OwnerShare.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.vaults) { + Vault.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.defaultQuotingParams !== undefined) { + QuotingParams.encode(message.defaultQuotingParams, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalShares = NumShares.decode(reader, reader.uint32()); + break; + case 2: + message.ownerShares.push(OwnerShare.decode(reader, reader.uint32())); + break; + case 3: + message.vaults.push(Vault.decode(reader, reader.uint32())); + break; + case 4: + message.defaultQuotingParams = QuotingParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? NumShares.fromPartial(object.totalShares) : undefined; + message.ownerShares = object.ownerShares?.map(e => OwnerShare.fromPartial(e)) || []; + message.vaults = object.vaults?.map(e => Vault.fromPartial(e)) || []; + message.defaultQuotingParams = object.defaultQuotingParams !== undefined && object.defaultQuotingParams !== null ? QuotingParams.fromPartial(object.defaultQuotingParams) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = NumShares.fromAmino(object.total_shares); + } + message.ownerShares = object.owner_shares?.map(e => OwnerShare.fromAmino(e)) || []; + message.vaults = object.vaults?.map(e => Vault.fromAmino(e)) || []; + if (object.default_quoting_params !== undefined && object.default_quoting_params !== null) { + message.defaultQuotingParams = QuotingParams.fromAmino(object.default_quoting_params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.total_shares = message.totalShares ? NumShares.toAmino(message.totalShares) : undefined; + if (message.ownerShares) { + obj.owner_shares = message.ownerShares.map(e => e ? OwnerShare.toAmino(e) : undefined); + } else { + obj.owner_shares = message.ownerShares; + } + if (message.vaults) { + obj.vaults = message.vaults.map(e => e ? Vault.toAmino(e) : undefined); + } else { + obj.vaults = message.vaults; + } + obj.default_quoting_params = message.defaultQuotingParams ? QuotingParams.toAmino(message.defaultQuotingParams) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseVault(): Vault { + return { + vaultId: VaultId.fromPartial({}), + vaultParams: VaultParams.fromPartial({}), + mostRecentClientIds: [] + }; +} +export const Vault = { + typeUrl: "/dydxprotocol.vault.Vault", + encode(message: Vault, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vaultId !== undefined) { + VaultId.encode(message.vaultId, writer.uint32(10).fork()).ldelim(); + } + if (message.vaultParams !== undefined) { + VaultParams.encode(message.vaultParams, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).fork(); + for (const v of message.mostRecentClientIds) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaultId = VaultId.decode(reader, reader.uint32()); + break; + case 2: + message.vaultParams = VaultParams.decode(reader, reader.uint32()); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.mostRecentClientIds.push(reader.uint32()); + } + } else { + message.mostRecentClientIds.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Vault { + const message = createBaseVault(); + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? VaultId.fromPartial(object.vaultId) : undefined; + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? VaultParams.fromPartial(object.vaultParams) : undefined; + message.mostRecentClientIds = object.mostRecentClientIds?.map(e => e) || []; + return message; + }, + fromAmino(object: VaultAmino): Vault { + const message = createBaseVault(); + if (object.vault_id !== undefined && object.vault_id !== null) { + message.vaultId = VaultId.fromAmino(object.vault_id); + } + if (object.vault_params !== undefined && object.vault_params !== null) { + message.vaultParams = VaultParams.fromAmino(object.vault_params); + } + message.mostRecentClientIds = object.most_recent_client_ids?.map(e => e) || []; + return message; + }, + toAmino(message: Vault): VaultAmino { + const obj: any = {}; + obj.vault_id = message.vaultId ? VaultId.toAmino(message.vaultId) : undefined; + obj.vault_params = message.vaultParams ? VaultParams.toAmino(message.vaultParams) : undefined; + if (message.mostRecentClientIds) { + obj.most_recent_client_ids = message.mostRecentClientIds.map(e => e); + } else { + obj.most_recent_client_ids = message.mostRecentClientIds; + } + return obj; + }, + fromAminoMsg(object: VaultAminoMsg): Vault { + return Vault.fromAmino(object.value); + }, + fromProtoMsg(message: VaultProtoMsg): Vault { + return Vault.decode(message.value); + }, + toProto(message: Vault): Uint8Array { + return Vault.encode(message).finish(); + }, + toProtoMsg(message: Vault): VaultProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.Vault", + value: Vault.encode(message).finish() + }; + } +}; +function createBaseGenesisStateV6(): GenesisStateV6 { + return { + vaults: [], + defaultQuotingParams: QuotingParams.fromPartial({}) + }; +} +export const GenesisStateV6 = { + typeUrl: "/dydxprotocol.vault.GenesisStateV6", + encode(message: GenesisStateV6, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.vaults) { + Vault.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.defaultQuotingParams !== undefined) { + QuotingParams.encode(message.defaultQuotingParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisStateV6 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisStateV6(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.vaults.push(Vault.decode(reader, reader.uint32())); + break; + case 3: + message.defaultQuotingParams = QuotingParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisStateV6 { + const message = createBaseGenesisStateV6(); + message.vaults = object.vaults?.map(e => Vault.fromPartial(e)) || []; + message.defaultQuotingParams = object.defaultQuotingParams !== undefined && object.defaultQuotingParams !== null ? QuotingParams.fromPartial(object.defaultQuotingParams) : undefined; + return message; + }, + fromAmino(object: GenesisStateV6Amino): GenesisStateV6 { + const message = createBaseGenesisStateV6(); + message.vaults = object.vaults?.map(e => Vault.fromAmino(e)) || []; + if (object.default_quoting_params !== undefined && object.default_quoting_params !== null) { + message.defaultQuotingParams = QuotingParams.fromAmino(object.default_quoting_params); + } + return message; + }, + toAmino(message: GenesisStateV6): GenesisStateV6Amino { + const obj: any = {}; + if (message.vaults) { + obj.vaults = message.vaults.map(e => e ? Vault.toAmino(e) : undefined); + } else { + obj.vaults = message.vaults; + } + obj.default_quoting_params = message.defaultQuotingParams ? QuotingParams.toAmino(message.defaultQuotingParams) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateV6AminoMsg): GenesisStateV6 { + return GenesisStateV6.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateV6ProtoMsg): GenesisStateV6 { + return GenesisStateV6.decode(message.value); + }, + toProto(message: GenesisStateV6): Uint8Array { + return GenesisStateV6.encode(message).finish(); + }, + toProtoMsg(message: GenesisStateV6): GenesisStateV6ProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.GenesisStateV6", + value: GenesisStateV6.encode(message).finish() + }; + } +}; +function createBaseVaultV6(): VaultV6 { + return { + vaultId: undefined, + totalShares: undefined, + ownerShares: [], + vaultParams: VaultParams.fromPartial({}), + mostRecentClientIds: [] + }; +} +export const VaultV6 = { + typeUrl: "/dydxprotocol.vault.VaultV6", + encode(message: VaultV6, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vaultId !== undefined) { + VaultId.encode(message.vaultId, writer.uint32(10).fork()).ldelim(); + } + if (message.totalShares !== undefined) { + NumShares.encode(message.totalShares, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.ownerShares) { + OwnerShare.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.vaultParams !== undefined) { + VaultParams.encode(message.vaultParams, writer.uint32(34).fork()).ldelim(); + } + writer.uint32(42).fork(); + for (const v of message.mostRecentClientIds) { + writer.uint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VaultV6 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVaultV6(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaultId = VaultId.decode(reader, reader.uint32()); + break; + case 2: + message.totalShares = NumShares.decode(reader, reader.uint32()); + break; + case 3: + message.ownerShares.push(OwnerShare.decode(reader, reader.uint32())); + break; + case 4: + message.vaultParams = VaultParams.decode(reader, reader.uint32()); + break; + case 5: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.mostRecentClientIds.push(reader.uint32()); + } + } else { + message.mostRecentClientIds.push(reader.uint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VaultV6 { + const message = createBaseVaultV6(); + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? VaultId.fromPartial(object.vaultId) : undefined; + message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? NumShares.fromPartial(object.totalShares) : undefined; + message.ownerShares = object.ownerShares?.map(e => OwnerShare.fromPartial(e)) || []; + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? VaultParams.fromPartial(object.vaultParams) : undefined; + message.mostRecentClientIds = object.mostRecentClientIds?.map(e => e) || []; + return message; + }, + fromAmino(object: VaultV6Amino): VaultV6 { + const message = createBaseVaultV6(); + if (object.vault_id !== undefined && object.vault_id !== null) { + message.vaultId = VaultId.fromAmino(object.vault_id); + } + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = NumShares.fromAmino(object.total_shares); + } + message.ownerShares = object.owner_shares?.map(e => OwnerShare.fromAmino(e)) || []; + if (object.vault_params !== undefined && object.vault_params !== null) { + message.vaultParams = VaultParams.fromAmino(object.vault_params); + } + message.mostRecentClientIds = object.most_recent_client_ids?.map(e => e) || []; + return message; + }, + toAmino(message: VaultV6): VaultV6Amino { + const obj: any = {}; + obj.vault_id = message.vaultId ? VaultId.toAmino(message.vaultId) : undefined; + obj.total_shares = message.totalShares ? NumShares.toAmino(message.totalShares) : undefined; + if (message.ownerShares) { + obj.owner_shares = message.ownerShares.map(e => e ? OwnerShare.toAmino(e) : undefined); + } else { + obj.owner_shares = message.ownerShares; + } + obj.vault_params = message.vaultParams ? VaultParams.toAmino(message.vaultParams) : undefined; + if (message.mostRecentClientIds) { + obj.most_recent_client_ids = message.mostRecentClientIds.map(e => e); + } else { + obj.most_recent_client_ids = message.mostRecentClientIds; + } + return obj; + }, + fromAminoMsg(object: VaultV6AminoMsg): VaultV6 { + return VaultV6.fromAmino(object.value); + }, + fromProtoMsg(message: VaultV6ProtoMsg): VaultV6 { + return VaultV6.decode(message.value); + }, + toProto(message: VaultV6): Uint8Array { + return VaultV6.encode(message).finish(); + }, + toProtoMsg(message: VaultV6): VaultV6ProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.VaultV6", + value: VaultV6.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/params.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/params.ts new file mode 100644 index 00000000..e6f4bad2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/params.ts @@ -0,0 +1,537 @@ +//@ts-nocheck +import { VaultStatus } from "./vault"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** QuotingParams stores vault quoting parameters. */ +export interface QuotingParams { + /** + * The number of layers of orders a vault places. For example if + * `layers=2`, a vault places 2 asks and 2 bids. + */ + layers: number; + /** The minimum base spread when a vault quotes around reservation price. */ + spreadMinPpm: number; + /** + * The buffer amount to add to min_price_change_ppm to arrive at `spread` + * according to formula: + * `spread = max(spread_min_ppm, min_price_change_ppm + spread_buffer_ppm)`. + */ + spreadBufferPpm: number; + /** The factor that determines how aggressive a vault skews its orders. */ + skewFactorPpm: number; + /** The percentage of vault equity that each order is sized at. */ + orderSizePctPpm: number; + /** The duration that a vault's orders are valid for. */ + orderExpirationSeconds: number; + /** + * The number of quote quantums in quote asset that a vault with no perpetual + * positions must have to activate, i.e. if a vault has no perpetual positions + * and has strictly less than this amount of quote asset, it will not + * activate. + */ + activationThresholdQuoteQuantums: Uint8Array; +} +export interface QuotingParamsProtoMsg { + typeUrl: "/dydxprotocol.vault.QuotingParams"; + value: Uint8Array; +} +/** QuotingParams stores vault quoting parameters. */ +export interface QuotingParamsAmino { + /** + * The number of layers of orders a vault places. For example if + * `layers=2`, a vault places 2 asks and 2 bids. + */ + layers?: number; + /** The minimum base spread when a vault quotes around reservation price. */ + spread_min_ppm?: number; + /** + * The buffer amount to add to min_price_change_ppm to arrive at `spread` + * according to formula: + * `spread = max(spread_min_ppm, min_price_change_ppm + spread_buffer_ppm)`. + */ + spread_buffer_ppm?: number; + /** The factor that determines how aggressive a vault skews its orders. */ + skew_factor_ppm?: number; + /** The percentage of vault equity that each order is sized at. */ + order_size_pct_ppm?: number; + /** The duration that a vault's orders are valid for. */ + order_expiration_seconds?: number; + /** + * The number of quote quantums in quote asset that a vault with no perpetual + * positions must have to activate, i.e. if a vault has no perpetual positions + * and has strictly less than this amount of quote asset, it will not + * activate. + */ + activation_threshold_quote_quantums?: string; +} +export interface QuotingParamsAminoMsg { + type: "/dydxprotocol.vault.QuotingParams"; + value: QuotingParamsAmino; +} +/** QuotingParams stores vault quoting parameters. */ +export interface QuotingParamsSDKType { + layers: number; + spread_min_ppm: number; + spread_buffer_ppm: number; + skew_factor_ppm: number; + order_size_pct_ppm: number; + order_expiration_seconds: number; + activation_threshold_quote_quantums: Uint8Array; +} +/** VaultParams stores vault parameters. */ +export interface VaultParams { + /** Status of the vault. */ + status: VaultStatus; + /** Quoting parameters of the vault. */ + quotingParams?: QuotingParams; +} +export interface VaultParamsProtoMsg { + typeUrl: "/dydxprotocol.vault.VaultParams"; + value: Uint8Array; +} +/** VaultParams stores vault parameters. */ +export interface VaultParamsAmino { + /** Status of the vault. */ + status?: VaultStatus; + /** Quoting parameters of the vault. */ + quoting_params?: QuotingParamsAmino; +} +export interface VaultParamsAminoMsg { + type: "/dydxprotocol.vault.VaultParams"; + value: VaultParamsAmino; +} +/** VaultParams stores vault parameters. */ +export interface VaultParamsSDKType { + status: VaultStatus; + quoting_params?: QuotingParamsSDKType; +} +/** + * Deprecated: Params stores `x/vault` parameters. + * Deprecated since v6.x as is replaced by QuotingParams. + */ +export interface Params { + /** + * The number of layers of orders a vault places. For example if + * `layers=2`, a vault places 2 asks and 2 bids. + */ + layers: number; + /** The minimum base spread when a vault quotes around reservation price. */ + spreadMinPpm: number; + /** + * The buffer amount to add to min_price_change_ppm to arrive at `spread` + * according to formula: + * `spread = max(spread_min_ppm, min_price_change_ppm + spread_buffer_ppm)`. + */ + spreadBufferPpm: number; + /** The factor that determines how aggressive a vault skews its orders. */ + skewFactorPpm: number; + /** The percentage of vault equity that each order is sized at. */ + orderSizePctPpm: number; + /** The duration that a vault's orders are valid for. */ + orderExpirationSeconds: number; + /** + * The number of quote quantums in quote asset that a vault with no perpetual + * positions must have to activate, i.e. if a vault has no perpetual positions + * and has strictly less than this amount of quote asset, it will not + * activate. + */ + activationThresholdQuoteQuantums: Uint8Array; +} +export interface ParamsProtoMsg { + typeUrl: "/dydxprotocol.vault.Params"; + value: Uint8Array; +} +/** + * Deprecated: Params stores `x/vault` parameters. + * Deprecated since v6.x as is replaced by QuotingParams. + */ +export interface ParamsAmino { + /** + * The number of layers of orders a vault places. For example if + * `layers=2`, a vault places 2 asks and 2 bids. + */ + layers?: number; + /** The minimum base spread when a vault quotes around reservation price. */ + spread_min_ppm?: number; + /** + * The buffer amount to add to min_price_change_ppm to arrive at `spread` + * according to formula: + * `spread = max(spread_min_ppm, min_price_change_ppm + spread_buffer_ppm)`. + */ + spread_buffer_ppm?: number; + /** The factor that determines how aggressive a vault skews its orders. */ + skew_factor_ppm?: number; + /** The percentage of vault equity that each order is sized at. */ + order_size_pct_ppm?: number; + /** The duration that a vault's orders are valid for. */ + order_expiration_seconds?: number; + /** + * The number of quote quantums in quote asset that a vault with no perpetual + * positions must have to activate, i.e. if a vault has no perpetual positions + * and has strictly less than this amount of quote asset, it will not + * activate. + */ + activation_threshold_quote_quantums?: string; +} +export interface ParamsAminoMsg { + type: "/dydxprotocol.vault.Params"; + value: ParamsAmino; +} +/** + * Deprecated: Params stores `x/vault` parameters. + * Deprecated since v6.x as is replaced by QuotingParams. + */ +export interface ParamsSDKType { + layers: number; + spread_min_ppm: number; + spread_buffer_ppm: number; + skew_factor_ppm: number; + order_size_pct_ppm: number; + order_expiration_seconds: number; + activation_threshold_quote_quantums: Uint8Array; +} +function createBaseQuotingParams(): QuotingParams { + return { + layers: 0, + spreadMinPpm: 0, + spreadBufferPpm: 0, + skewFactorPpm: 0, + orderSizePctPpm: 0, + orderExpirationSeconds: 0, + activationThresholdQuoteQuantums: new Uint8Array() + }; +} +export const QuotingParams = { + typeUrl: "/dydxprotocol.vault.QuotingParams", + encode(message: QuotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.layers !== 0) { + writer.uint32(8).uint32(message.layers); + } + if (message.spreadMinPpm !== 0) { + writer.uint32(16).uint32(message.spreadMinPpm); + } + if (message.spreadBufferPpm !== 0) { + writer.uint32(24).uint32(message.spreadBufferPpm); + } + if (message.skewFactorPpm !== 0) { + writer.uint32(32).uint32(message.skewFactorPpm); + } + if (message.orderSizePctPpm !== 0) { + writer.uint32(40).uint32(message.orderSizePctPpm); + } + if (message.orderExpirationSeconds !== 0) { + writer.uint32(48).uint32(message.orderExpirationSeconds); + } + if (message.activationThresholdQuoteQuantums.length !== 0) { + writer.uint32(58).bytes(message.activationThresholdQuoteQuantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuotingParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.layers = reader.uint32(); + break; + case 2: + message.spreadMinPpm = reader.uint32(); + break; + case 3: + message.spreadBufferPpm = reader.uint32(); + break; + case 4: + message.skewFactorPpm = reader.uint32(); + break; + case 5: + message.orderSizePctPpm = reader.uint32(); + break; + case 6: + message.orderExpirationSeconds = reader.uint32(); + break; + case 7: + message.activationThresholdQuoteQuantums = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuotingParams { + const message = createBaseQuotingParams(); + message.layers = object.layers ?? 0; + message.spreadMinPpm = object.spreadMinPpm ?? 0; + message.spreadBufferPpm = object.spreadBufferPpm ?? 0; + message.skewFactorPpm = object.skewFactorPpm ?? 0; + message.orderSizePctPpm = object.orderSizePctPpm ?? 0; + message.orderExpirationSeconds = object.orderExpirationSeconds ?? 0; + message.activationThresholdQuoteQuantums = object.activationThresholdQuoteQuantums ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuotingParamsAmino): QuotingParams { + const message = createBaseQuotingParams(); + if (object.layers !== undefined && object.layers !== null) { + message.layers = object.layers; + } + if (object.spread_min_ppm !== undefined && object.spread_min_ppm !== null) { + message.spreadMinPpm = object.spread_min_ppm; + } + if (object.spread_buffer_ppm !== undefined && object.spread_buffer_ppm !== null) { + message.spreadBufferPpm = object.spread_buffer_ppm; + } + if (object.skew_factor_ppm !== undefined && object.skew_factor_ppm !== null) { + message.skewFactorPpm = object.skew_factor_ppm; + } + if (object.order_size_pct_ppm !== undefined && object.order_size_pct_ppm !== null) { + message.orderSizePctPpm = object.order_size_pct_ppm; + } + if (object.order_expiration_seconds !== undefined && object.order_expiration_seconds !== null) { + message.orderExpirationSeconds = object.order_expiration_seconds; + } + if (object.activation_threshold_quote_quantums !== undefined && object.activation_threshold_quote_quantums !== null) { + message.activationThresholdQuoteQuantums = bytesFromBase64(object.activation_threshold_quote_quantums); + } + return message; + }, + toAmino(message: QuotingParams): QuotingParamsAmino { + const obj: any = {}; + obj.layers = message.layers === 0 ? undefined : message.layers; + obj.spread_min_ppm = message.spreadMinPpm === 0 ? undefined : message.spreadMinPpm; + obj.spread_buffer_ppm = message.spreadBufferPpm === 0 ? undefined : message.spreadBufferPpm; + obj.skew_factor_ppm = message.skewFactorPpm === 0 ? undefined : message.skewFactorPpm; + obj.order_size_pct_ppm = message.orderSizePctPpm === 0 ? undefined : message.orderSizePctPpm; + obj.order_expiration_seconds = message.orderExpirationSeconds === 0 ? undefined : message.orderExpirationSeconds; + obj.activation_threshold_quote_quantums = message.activationThresholdQuoteQuantums ? base64FromBytes(message.activationThresholdQuoteQuantums) : undefined; + return obj; + }, + fromAminoMsg(object: QuotingParamsAminoMsg): QuotingParams { + return QuotingParams.fromAmino(object.value); + }, + fromProtoMsg(message: QuotingParamsProtoMsg): QuotingParams { + return QuotingParams.decode(message.value); + }, + toProto(message: QuotingParams): Uint8Array { + return QuotingParams.encode(message).finish(); + }, + toProtoMsg(message: QuotingParams): QuotingParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QuotingParams", + value: QuotingParams.encode(message).finish() + }; + } +}; +function createBaseVaultParams(): VaultParams { + return { + status: 0, + quotingParams: undefined + }; +} +export const VaultParams = { + typeUrl: "/dydxprotocol.vault.VaultParams", + encode(message: VaultParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.quotingParams !== undefined) { + QuotingParams.encode(message.quotingParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VaultParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVaultParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any; + break; + case 2: + message.quotingParams = QuotingParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VaultParams { + const message = createBaseVaultParams(); + message.status = object.status ?? 0; + message.quotingParams = object.quotingParams !== undefined && object.quotingParams !== null ? QuotingParams.fromPartial(object.quotingParams) : undefined; + return message; + }, + fromAmino(object: VaultParamsAmino): VaultParams { + const message = createBaseVaultParams(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.quoting_params !== undefined && object.quoting_params !== null) { + message.quotingParams = QuotingParams.fromAmino(object.quoting_params); + } + return message; + }, + toAmino(message: VaultParams): VaultParamsAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + obj.quoting_params = message.quotingParams ? QuotingParams.toAmino(message.quotingParams) : undefined; + return obj; + }, + fromAminoMsg(object: VaultParamsAminoMsg): VaultParams { + return VaultParams.fromAmino(object.value); + }, + fromProtoMsg(message: VaultParamsProtoMsg): VaultParams { + return VaultParams.decode(message.value); + }, + toProto(message: VaultParams): Uint8Array { + return VaultParams.encode(message).finish(); + }, + toProtoMsg(message: VaultParams): VaultParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.VaultParams", + value: VaultParams.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + layers: 0, + spreadMinPpm: 0, + spreadBufferPpm: 0, + skewFactorPpm: 0, + orderSizePctPpm: 0, + orderExpirationSeconds: 0, + activationThresholdQuoteQuantums: new Uint8Array() + }; +} +export const Params = { + typeUrl: "/dydxprotocol.vault.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.layers !== 0) { + writer.uint32(8).uint32(message.layers); + } + if (message.spreadMinPpm !== 0) { + writer.uint32(16).uint32(message.spreadMinPpm); + } + if (message.spreadBufferPpm !== 0) { + writer.uint32(24).uint32(message.spreadBufferPpm); + } + if (message.skewFactorPpm !== 0) { + writer.uint32(32).uint32(message.skewFactorPpm); + } + if (message.orderSizePctPpm !== 0) { + writer.uint32(40).uint32(message.orderSizePctPpm); + } + if (message.orderExpirationSeconds !== 0) { + writer.uint32(48).uint32(message.orderExpirationSeconds); + } + if (message.activationThresholdQuoteQuantums.length !== 0) { + writer.uint32(58).bytes(message.activationThresholdQuoteQuantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.layers = reader.uint32(); + break; + case 2: + message.spreadMinPpm = reader.uint32(); + break; + case 3: + message.spreadBufferPpm = reader.uint32(); + break; + case 4: + message.skewFactorPpm = reader.uint32(); + break; + case 5: + message.orderSizePctPpm = reader.uint32(); + break; + case 6: + message.orderExpirationSeconds = reader.uint32(); + break; + case 7: + message.activationThresholdQuoteQuantums = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.layers = object.layers ?? 0; + message.spreadMinPpm = object.spreadMinPpm ?? 0; + message.spreadBufferPpm = object.spreadBufferPpm ?? 0; + message.skewFactorPpm = object.skewFactorPpm ?? 0; + message.orderSizePctPpm = object.orderSizePctPpm ?? 0; + message.orderExpirationSeconds = object.orderExpirationSeconds ?? 0; + message.activationThresholdQuoteQuantums = object.activationThresholdQuoteQuantums ?? new Uint8Array(); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.layers !== undefined && object.layers !== null) { + message.layers = object.layers; + } + if (object.spread_min_ppm !== undefined && object.spread_min_ppm !== null) { + message.spreadMinPpm = object.spread_min_ppm; + } + if (object.spread_buffer_ppm !== undefined && object.spread_buffer_ppm !== null) { + message.spreadBufferPpm = object.spread_buffer_ppm; + } + if (object.skew_factor_ppm !== undefined && object.skew_factor_ppm !== null) { + message.skewFactorPpm = object.skew_factor_ppm; + } + if (object.order_size_pct_ppm !== undefined && object.order_size_pct_ppm !== null) { + message.orderSizePctPpm = object.order_size_pct_ppm; + } + if (object.order_expiration_seconds !== undefined && object.order_expiration_seconds !== null) { + message.orderExpirationSeconds = object.order_expiration_seconds; + } + if (object.activation_threshold_quote_quantums !== undefined && object.activation_threshold_quote_quantums !== null) { + message.activationThresholdQuoteQuantums = bytesFromBase64(object.activation_threshold_quote_quantums); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.layers = message.layers === 0 ? undefined : message.layers; + obj.spread_min_ppm = message.spreadMinPpm === 0 ? undefined : message.spreadMinPpm; + obj.spread_buffer_ppm = message.spreadBufferPpm === 0 ? undefined : message.spreadBufferPpm; + obj.skew_factor_ppm = message.skewFactorPpm === 0 ? undefined : message.skewFactorPpm; + obj.order_size_pct_ppm = message.orderSizePctPpm === 0 ? undefined : message.orderSizePctPpm; + obj.order_expiration_seconds = message.orderExpirationSeconds === 0 ? undefined : message.orderExpirationSeconds; + obj.activation_threshold_quote_quantums = message.activationThresholdQuoteQuantums ? base64FromBytes(message.activationThresholdQuoteQuantums) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/query.rpc.Query.ts new file mode 100644 index 00000000..46edebbb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/query.rpc.Query.ts @@ -0,0 +1,79 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryVaultRequest, QueryVaultResponse, QueryAllVaultsRequest, QueryAllVaultsResponse, QueryMegavaultTotalSharesRequest, QueryMegavaultTotalSharesResponse, QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the Params. */ + params(request?: QueryParamsRequest): Promise; + /** Queries a Vault by type and number. */ + vault(request: QueryVaultRequest): Promise; + /** Queries all vaults. */ + allVaults(request?: QueryAllVaultsRequest): Promise; + /** Queries total shares of megavault. */ + megavaultTotalShares(request?: QueryMegavaultTotalSharesRequest): Promise; + /** Queries owner shares of megavault. */ + megavaultOwnerShares(request?: QueryMegavaultOwnerSharesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.vault = this.vault.bind(this); + this.allVaults = this.allVaults.bind(this); + this.megavaultTotalShares = this.megavaultTotalShares.bind(this); + this.megavaultOwnerShares = this.megavaultOwnerShares.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + vault(request: QueryVaultRequest): Promise { + const data = QueryVaultRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Query", "Vault", data); + return promise.then(data => QueryVaultResponse.decode(new BinaryReader(data))); + } + allVaults(request: QueryAllVaultsRequest = { + pagination: undefined + }): Promise { + const data = QueryAllVaultsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Query", "AllVaults", data); + return promise.then(data => QueryAllVaultsResponse.decode(new BinaryReader(data))); + } + megavaultTotalShares(request: QueryMegavaultTotalSharesRequest = {}): Promise { + const data = QueryMegavaultTotalSharesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Query", "MegavaultTotalShares", data); + return promise.then(data => QueryMegavaultTotalSharesResponse.decode(new BinaryReader(data))); + } + megavaultOwnerShares(request: QueryMegavaultOwnerSharesRequest = { + pagination: undefined + }): Promise { + const data = QueryMegavaultOwnerSharesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Query", "MegavaultOwnerShares", data); + return promise.then(data => QueryMegavaultOwnerSharesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + vault(request: QueryVaultRequest): Promise { + return queryService.vault(request); + }, + allVaults(request?: QueryAllVaultsRequest): Promise { + return queryService.allVaults(request); + }, + megavaultTotalShares(request?: QueryMegavaultTotalSharesRequest): Promise { + return queryService.megavaultTotalShares(request); + }, + megavaultOwnerShares(request?: QueryMegavaultOwnerSharesRequest): Promise { + return queryService.megavaultOwnerShares(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/query.ts new file mode 100644 index 00000000..e7c2afd2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/query.ts @@ -0,0 +1,965 @@ +//@ts-nocheck +import { VaultType, VaultId, VaultIdAmino, VaultIdSDKType } from "./vault"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { Params, ParamsAmino, ParamsSDKType, QuotingParams, QuotingParamsAmino, QuotingParamsSDKType, VaultParams, VaultParamsAmino, VaultParamsSDKType } from "./params"; +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { NumShares, NumSharesAmino, NumSharesSDKType, OwnerShare, OwnerShareAmino, OwnerShareSDKType } from "./share"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/dydxprotocol.vault.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is a request type for the Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponse { + /** Deprecated since v6.x in favor of default_quoting_params. */ + /** @deprecated */ + params: Params; + defaultQuotingParams: QuotingParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponseAmino { + /** Deprecated since v6.x in favor of default_quoting_params. */ + /** @deprecated */ + params?: ParamsAmino; + default_quoting_params?: QuotingParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/dydxprotocol.vault.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is a response type for the Params RPC method. */ +export interface QueryParamsResponseSDKType { + /** @deprecated */ + params: ParamsSDKType; + default_quoting_params: QuotingParamsSDKType; +} +/** QueryVaultRequest is a request type for the Vault RPC method. */ +export interface QueryVaultRequest { + type: VaultType; + number: number; +} +export interface QueryVaultRequestProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryVaultRequest"; + value: Uint8Array; +} +/** QueryVaultRequest is a request type for the Vault RPC method. */ +export interface QueryVaultRequestAmino { + type?: VaultType; + number?: number; +} +export interface QueryVaultRequestAminoMsg { + type: "/dydxprotocol.vault.QueryVaultRequest"; + value: QueryVaultRequestAmino; +} +/** QueryVaultRequest is a request type for the Vault RPC method. */ +export interface QueryVaultRequestSDKType { + type: VaultType; + number: number; +} +/** QueryVaultResponse is a response type for the Vault RPC method. */ +export interface QueryVaultResponse { + vaultId: VaultId; + subaccountId: SubaccountId; + equity: Uint8Array; + inventory: Uint8Array; + vaultParams: VaultParams; +} +export interface QueryVaultResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryVaultResponse"; + value: Uint8Array; +} +/** QueryVaultResponse is a response type for the Vault RPC method. */ +export interface QueryVaultResponseAmino { + vault_id?: VaultIdAmino; + subaccount_id?: SubaccountIdAmino; + equity?: string; + inventory?: string; + vault_params?: VaultParamsAmino; +} +export interface QueryVaultResponseAminoMsg { + type: "/dydxprotocol.vault.QueryVaultResponse"; + value: QueryVaultResponseAmino; +} +/** QueryVaultResponse is a response type for the Vault RPC method. */ +export interface QueryVaultResponseSDKType { + vault_id: VaultIdSDKType; + subaccount_id: SubaccountIdSDKType; + equity: Uint8Array; + inventory: Uint8Array; + vault_params: VaultParamsSDKType; +} +/** QueryAllVaultsRequest is a request type for the AllVaults RPC method. */ +export interface QueryAllVaultsRequest { + pagination?: PageRequest; +} +export interface QueryAllVaultsRequestProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryAllVaultsRequest"; + value: Uint8Array; +} +/** QueryAllVaultsRequest is a request type for the AllVaults RPC method. */ +export interface QueryAllVaultsRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryAllVaultsRequestAminoMsg { + type: "/dydxprotocol.vault.QueryAllVaultsRequest"; + value: QueryAllVaultsRequestAmino; +} +/** QueryAllVaultsRequest is a request type for the AllVaults RPC method. */ +export interface QueryAllVaultsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryAllVaultsResponse is a response type for the AllVaults RPC method. */ +export interface QueryAllVaultsResponse { + vaults: QueryVaultResponse[]; + pagination?: PageResponse; +} +export interface QueryAllVaultsResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryAllVaultsResponse"; + value: Uint8Array; +} +/** QueryAllVaultsResponse is a response type for the AllVaults RPC method. */ +export interface QueryAllVaultsResponseAmino { + vaults?: QueryVaultResponseAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryAllVaultsResponseAminoMsg { + type: "/dydxprotocol.vault.QueryAllVaultsResponse"; + value: QueryAllVaultsResponseAmino; +} +/** QueryAllVaultsResponse is a response type for the AllVaults RPC method. */ +export interface QueryAllVaultsResponseSDKType { + vaults: QueryVaultResponseSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryMegavaultTotalSharesRequest is a request type for the + * MegavaultTotalShares RPC method. + */ +export interface QueryMegavaultTotalSharesRequest {} +export interface QueryMegavaultTotalSharesRequestProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryMegavaultTotalSharesRequest"; + value: Uint8Array; +} +/** + * QueryMegavaultTotalSharesRequest is a request type for the + * MegavaultTotalShares RPC method. + */ +export interface QueryMegavaultTotalSharesRequestAmino {} +export interface QueryMegavaultTotalSharesRequestAminoMsg { + type: "/dydxprotocol.vault.QueryMegavaultTotalSharesRequest"; + value: QueryMegavaultTotalSharesRequestAmino; +} +/** + * QueryMegavaultTotalSharesRequest is a request type for the + * MegavaultTotalShares RPC method. + */ +export interface QueryMegavaultTotalSharesRequestSDKType {} +/** + * QueryMegavaultTotalSharesResponse is a response type for the + * MegavaultTotalShares RPC method. + */ +export interface QueryMegavaultTotalSharesResponse { + totalShares?: NumShares; +} +export interface QueryMegavaultTotalSharesResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryMegavaultTotalSharesResponse"; + value: Uint8Array; +} +/** + * QueryMegavaultTotalSharesResponse is a response type for the + * MegavaultTotalShares RPC method. + */ +export interface QueryMegavaultTotalSharesResponseAmino { + total_shares?: NumSharesAmino; +} +export interface QueryMegavaultTotalSharesResponseAminoMsg { + type: "/dydxprotocol.vault.QueryMegavaultTotalSharesResponse"; + value: QueryMegavaultTotalSharesResponseAmino; +} +/** + * QueryMegavaultTotalSharesResponse is a response type for the + * MegavaultTotalShares RPC method. + */ +export interface QueryMegavaultTotalSharesResponseSDKType { + total_shares?: NumSharesSDKType; +} +/** + * QueryMegavaultOwnerSharesRequest is a request type for the + * MegavaultOwnerShares RPC method. + */ +export interface QueryMegavaultOwnerSharesRequest { + pagination?: PageRequest; +} +export interface QueryMegavaultOwnerSharesRequestProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryMegavaultOwnerSharesRequest"; + value: Uint8Array; +} +/** + * QueryMegavaultOwnerSharesRequest is a request type for the + * MegavaultOwnerShares RPC method. + */ +export interface QueryMegavaultOwnerSharesRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryMegavaultOwnerSharesRequestAminoMsg { + type: "/dydxprotocol.vault.QueryMegavaultOwnerSharesRequest"; + value: QueryMegavaultOwnerSharesRequestAmino; +} +/** + * QueryMegavaultOwnerSharesRequest is a request type for the + * MegavaultOwnerShares RPC method. + */ +export interface QueryMegavaultOwnerSharesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryMegavaultOwnerSharesResponse is a response type for the + * MegavaultOwnerShares RPC method. + */ +export interface QueryMegavaultOwnerSharesResponse { + ownerShares: OwnerShare[]; + pagination?: PageResponse; +} +export interface QueryMegavaultOwnerSharesResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.QueryMegavaultOwnerSharesResponse"; + value: Uint8Array; +} +/** + * QueryMegavaultOwnerSharesResponse is a response type for the + * MegavaultOwnerShares RPC method. + */ +export interface QueryMegavaultOwnerSharesResponseAmino { + owner_shares?: OwnerShareAmino[]; + pagination?: PageResponseAmino; +} +export interface QueryMegavaultOwnerSharesResponseAminoMsg { + type: "/dydxprotocol.vault.QueryMegavaultOwnerSharesResponse"; + value: QueryMegavaultOwnerSharesResponseAmino; +} +/** + * QueryMegavaultOwnerSharesResponse is a response type for the + * MegavaultOwnerShares RPC method. + */ +export interface QueryMegavaultOwnerSharesResponseSDKType { + owner_shares: OwnerShareSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/dydxprotocol.vault.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}), + defaultQuotingParams: QuotingParams.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/dydxprotocol.vault.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultQuotingParams !== undefined) { + QuotingParams.encode(message.defaultQuotingParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.defaultQuotingParams = QuotingParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.defaultQuotingParams = object.defaultQuotingParams !== undefined && object.defaultQuotingParams !== null ? QuotingParams.fromPartial(object.defaultQuotingParams) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.default_quoting_params !== undefined && object.default_quoting_params !== null) { + message.defaultQuotingParams = QuotingParams.fromAmino(object.default_quoting_params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.default_quoting_params = message.defaultQuotingParams ? QuotingParams.toAmino(message.defaultQuotingParams) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVaultRequest(): QueryVaultRequest { + return { + type: 0, + number: 0 + }; +} +export const QueryVaultRequest = { + typeUrl: "/dydxprotocol.vault.QueryVaultRequest", + encode(message: QueryVaultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVaultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVaultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.number = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVaultRequest { + const message = createBaseQueryVaultRequest(); + message.type = object.type ?? 0; + message.number = object.number ?? 0; + return message; + }, + fromAmino(object: QueryVaultRequestAmino): QueryVaultRequest { + const message = createBaseQueryVaultRequest(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + return message; + }, + toAmino(message: QueryVaultRequest): QueryVaultRequestAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.number = message.number === 0 ? undefined : message.number; + return obj; + }, + fromAminoMsg(object: QueryVaultRequestAminoMsg): QueryVaultRequest { + return QueryVaultRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVaultRequestProtoMsg): QueryVaultRequest { + return QueryVaultRequest.decode(message.value); + }, + toProto(message: QueryVaultRequest): Uint8Array { + return QueryVaultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVaultRequest): QueryVaultRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryVaultRequest", + value: QueryVaultRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVaultResponse(): QueryVaultResponse { + return { + vaultId: VaultId.fromPartial({}), + subaccountId: SubaccountId.fromPartial({}), + equity: new Uint8Array(), + inventory: new Uint8Array(), + vaultParams: VaultParams.fromPartial({}) + }; +} +export const QueryVaultResponse = { + typeUrl: "/dydxprotocol.vault.QueryVaultResponse", + encode(message: QueryVaultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vaultId !== undefined) { + VaultId.encode(message.vaultId, writer.uint32(10).fork()).ldelim(); + } + if (message.subaccountId !== undefined) { + SubaccountId.encode(message.subaccountId, writer.uint32(18).fork()).ldelim(); + } + if (message.equity.length !== 0) { + writer.uint32(26).bytes(message.equity); + } + if (message.inventory.length !== 0) { + writer.uint32(34).bytes(message.inventory); + } + if (message.vaultParams !== undefined) { + VaultParams.encode(message.vaultParams, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVaultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVaultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaultId = VaultId.decode(reader, reader.uint32()); + break; + case 2: + message.subaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 3: + message.equity = reader.bytes(); + break; + case 4: + message.inventory = reader.bytes(); + break; + case 5: + message.vaultParams = VaultParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVaultResponse { + const message = createBaseQueryVaultResponse(); + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? VaultId.fromPartial(object.vaultId) : undefined; + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; + message.equity = object.equity ?? new Uint8Array(); + message.inventory = object.inventory ?? new Uint8Array(); + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? VaultParams.fromPartial(object.vaultParams) : undefined; + return message; + }, + fromAmino(object: QueryVaultResponseAmino): QueryVaultResponse { + const message = createBaseQueryVaultResponse(); + if (object.vault_id !== undefined && object.vault_id !== null) { + message.vaultId = VaultId.fromAmino(object.vault_id); + } + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = SubaccountId.fromAmino(object.subaccount_id); + } + if (object.equity !== undefined && object.equity !== null) { + message.equity = bytesFromBase64(object.equity); + } + if (object.inventory !== undefined && object.inventory !== null) { + message.inventory = bytesFromBase64(object.inventory); + } + if (object.vault_params !== undefined && object.vault_params !== null) { + message.vaultParams = VaultParams.fromAmino(object.vault_params); + } + return message; + }, + toAmino(message: QueryVaultResponse): QueryVaultResponseAmino { + const obj: any = {}; + obj.vault_id = message.vaultId ? VaultId.toAmino(message.vaultId) : undefined; + obj.subaccount_id = message.subaccountId ? SubaccountId.toAmino(message.subaccountId) : undefined; + obj.equity = message.equity ? base64FromBytes(message.equity) : undefined; + obj.inventory = message.inventory ? base64FromBytes(message.inventory) : undefined; + obj.vault_params = message.vaultParams ? VaultParams.toAmino(message.vaultParams) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVaultResponseAminoMsg): QueryVaultResponse { + return QueryVaultResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVaultResponseProtoMsg): QueryVaultResponse { + return QueryVaultResponse.decode(message.value); + }, + toProto(message: QueryVaultResponse): Uint8Array { + return QueryVaultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVaultResponse): QueryVaultResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryVaultResponse", + value: QueryVaultResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllVaultsRequest(): QueryAllVaultsRequest { + return { + pagination: undefined + }; +} +export const QueryAllVaultsRequest = { + typeUrl: "/dydxprotocol.vault.QueryAllVaultsRequest", + encode(message: QueryAllVaultsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllVaultsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllVaultsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllVaultsRequest { + const message = createBaseQueryAllVaultsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllVaultsRequestAmino): QueryAllVaultsRequest { + const message = createBaseQueryAllVaultsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllVaultsRequest): QueryAllVaultsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllVaultsRequestAminoMsg): QueryAllVaultsRequest { + return QueryAllVaultsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllVaultsRequestProtoMsg): QueryAllVaultsRequest { + return QueryAllVaultsRequest.decode(message.value); + }, + toProto(message: QueryAllVaultsRequest): Uint8Array { + return QueryAllVaultsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllVaultsRequest): QueryAllVaultsRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryAllVaultsRequest", + value: QueryAllVaultsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllVaultsResponse(): QueryAllVaultsResponse { + return { + vaults: [], + pagination: undefined + }; +} +export const QueryAllVaultsResponse = { + typeUrl: "/dydxprotocol.vault.QueryAllVaultsResponse", + encode(message: QueryAllVaultsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.vaults) { + QueryVaultResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllVaultsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllVaultsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaults.push(QueryVaultResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllVaultsResponse { + const message = createBaseQueryAllVaultsResponse(); + message.vaults = object.vaults?.map(e => QueryVaultResponse.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllVaultsResponseAmino): QueryAllVaultsResponse { + const message = createBaseQueryAllVaultsResponse(); + message.vaults = object.vaults?.map(e => QueryVaultResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllVaultsResponse): QueryAllVaultsResponseAmino { + const obj: any = {}; + if (message.vaults) { + obj.vaults = message.vaults.map(e => e ? QueryVaultResponse.toAmino(e) : undefined); + } else { + obj.vaults = message.vaults; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllVaultsResponseAminoMsg): QueryAllVaultsResponse { + return QueryAllVaultsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllVaultsResponseProtoMsg): QueryAllVaultsResponse { + return QueryAllVaultsResponse.decode(message.value); + }, + toProto(message: QueryAllVaultsResponse): Uint8Array { + return QueryAllVaultsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllVaultsResponse): QueryAllVaultsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryAllVaultsResponse", + value: QueryAllVaultsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryMegavaultTotalSharesRequest(): QueryMegavaultTotalSharesRequest { + return {}; +} +export const QueryMegavaultTotalSharesRequest = { + typeUrl: "/dydxprotocol.vault.QueryMegavaultTotalSharesRequest", + encode(_: QueryMegavaultTotalSharesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMegavaultTotalSharesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMegavaultTotalSharesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryMegavaultTotalSharesRequest { + const message = createBaseQueryMegavaultTotalSharesRequest(); + return message; + }, + fromAmino(_: QueryMegavaultTotalSharesRequestAmino): QueryMegavaultTotalSharesRequest { + const message = createBaseQueryMegavaultTotalSharesRequest(); + return message; + }, + toAmino(_: QueryMegavaultTotalSharesRequest): QueryMegavaultTotalSharesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryMegavaultTotalSharesRequestAminoMsg): QueryMegavaultTotalSharesRequest { + return QueryMegavaultTotalSharesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMegavaultTotalSharesRequestProtoMsg): QueryMegavaultTotalSharesRequest { + return QueryMegavaultTotalSharesRequest.decode(message.value); + }, + toProto(message: QueryMegavaultTotalSharesRequest): Uint8Array { + return QueryMegavaultTotalSharesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMegavaultTotalSharesRequest): QueryMegavaultTotalSharesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryMegavaultTotalSharesRequest", + value: QueryMegavaultTotalSharesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryMegavaultTotalSharesResponse(): QueryMegavaultTotalSharesResponse { + return { + totalShares: undefined + }; +} +export const QueryMegavaultTotalSharesResponse = { + typeUrl: "/dydxprotocol.vault.QueryMegavaultTotalSharesResponse", + encode(message: QueryMegavaultTotalSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalShares !== undefined) { + NumShares.encode(message.totalShares, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMegavaultTotalSharesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMegavaultTotalSharesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalShares = NumShares.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMegavaultTotalSharesResponse { + const message = createBaseQueryMegavaultTotalSharesResponse(); + message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? NumShares.fromPartial(object.totalShares) : undefined; + return message; + }, + fromAmino(object: QueryMegavaultTotalSharesResponseAmino): QueryMegavaultTotalSharesResponse { + const message = createBaseQueryMegavaultTotalSharesResponse(); + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = NumShares.fromAmino(object.total_shares); + } + return message; + }, + toAmino(message: QueryMegavaultTotalSharesResponse): QueryMegavaultTotalSharesResponseAmino { + const obj: any = {}; + obj.total_shares = message.totalShares ? NumShares.toAmino(message.totalShares) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMegavaultTotalSharesResponseAminoMsg): QueryMegavaultTotalSharesResponse { + return QueryMegavaultTotalSharesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMegavaultTotalSharesResponseProtoMsg): QueryMegavaultTotalSharesResponse { + return QueryMegavaultTotalSharesResponse.decode(message.value); + }, + toProto(message: QueryMegavaultTotalSharesResponse): Uint8Array { + return QueryMegavaultTotalSharesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMegavaultTotalSharesResponse): QueryMegavaultTotalSharesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryMegavaultTotalSharesResponse", + value: QueryMegavaultTotalSharesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryMegavaultOwnerSharesRequest(): QueryMegavaultOwnerSharesRequest { + return { + pagination: undefined + }; +} +export const QueryMegavaultOwnerSharesRequest = { + typeUrl: "/dydxprotocol.vault.QueryMegavaultOwnerSharesRequest", + encode(message: QueryMegavaultOwnerSharesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMegavaultOwnerSharesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMegavaultOwnerSharesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMegavaultOwnerSharesRequest { + const message = createBaseQueryMegavaultOwnerSharesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryMegavaultOwnerSharesRequestAmino): QueryMegavaultOwnerSharesRequest { + const message = createBaseQueryMegavaultOwnerSharesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryMegavaultOwnerSharesRequest): QueryMegavaultOwnerSharesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMegavaultOwnerSharesRequestAminoMsg): QueryMegavaultOwnerSharesRequest { + return QueryMegavaultOwnerSharesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMegavaultOwnerSharesRequestProtoMsg): QueryMegavaultOwnerSharesRequest { + return QueryMegavaultOwnerSharesRequest.decode(message.value); + }, + toProto(message: QueryMegavaultOwnerSharesRequest): Uint8Array { + return QueryMegavaultOwnerSharesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMegavaultOwnerSharesRequest): QueryMegavaultOwnerSharesRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryMegavaultOwnerSharesRequest", + value: QueryMegavaultOwnerSharesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryMegavaultOwnerSharesResponse(): QueryMegavaultOwnerSharesResponse { + return { + ownerShares: [], + pagination: undefined + }; +} +export const QueryMegavaultOwnerSharesResponse = { + typeUrl: "/dydxprotocol.vault.QueryMegavaultOwnerSharesResponse", + encode(message: QueryMegavaultOwnerSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.ownerShares) { + OwnerShare.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMegavaultOwnerSharesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMegavaultOwnerSharesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ownerShares.push(OwnerShare.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMegavaultOwnerSharesResponse { + const message = createBaseQueryMegavaultOwnerSharesResponse(); + message.ownerShares = object.ownerShares?.map(e => OwnerShare.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryMegavaultOwnerSharesResponseAmino): QueryMegavaultOwnerSharesResponse { + const message = createBaseQueryMegavaultOwnerSharesResponse(); + message.ownerShares = object.owner_shares?.map(e => OwnerShare.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryMegavaultOwnerSharesResponse): QueryMegavaultOwnerSharesResponseAmino { + const obj: any = {}; + if (message.ownerShares) { + obj.owner_shares = message.ownerShares.map(e => e ? OwnerShare.toAmino(e) : undefined); + } else { + obj.owner_shares = message.ownerShares; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMegavaultOwnerSharesResponseAminoMsg): QueryMegavaultOwnerSharesResponse { + return QueryMegavaultOwnerSharesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMegavaultOwnerSharesResponseProtoMsg): QueryMegavaultOwnerSharesResponse { + return QueryMegavaultOwnerSharesResponse.decode(message.value); + }, + toProto(message: QueryMegavaultOwnerSharesResponse): Uint8Array { + return QueryMegavaultOwnerSharesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMegavaultOwnerSharesResponse): QueryMegavaultOwnerSharesResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.QueryMegavaultOwnerSharesResponse", + value: QueryMegavaultOwnerSharesResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/share.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/share.ts new file mode 100644 index 00000000..42c07767 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/share.ts @@ -0,0 +1,186 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** NumShares represents the number of shares. */ +export interface NumShares { + /** Number of shares. */ + numShares: Uint8Array; +} +export interface NumSharesProtoMsg { + typeUrl: "/dydxprotocol.vault.NumShares"; + value: Uint8Array; +} +/** NumShares represents the number of shares. */ +export interface NumSharesAmino { + /** Number of shares. */ + num_shares?: string; +} +export interface NumSharesAminoMsg { + type: "/dydxprotocol.vault.NumShares"; + value: NumSharesAmino; +} +/** NumShares represents the number of shares. */ +export interface NumSharesSDKType { + num_shares: Uint8Array; +} +/** OwnerShare is a type for owner shares. */ +export interface OwnerShare { + owner: string; + shares: NumShares; +} +export interface OwnerShareProtoMsg { + typeUrl: "/dydxprotocol.vault.OwnerShare"; + value: Uint8Array; +} +/** OwnerShare is a type for owner shares. */ +export interface OwnerShareAmino { + owner?: string; + shares?: NumSharesAmino; +} +export interface OwnerShareAminoMsg { + type: "/dydxprotocol.vault.OwnerShare"; + value: OwnerShareAmino; +} +/** OwnerShare is a type for owner shares. */ +export interface OwnerShareSDKType { + owner: string; + shares: NumSharesSDKType; +} +function createBaseNumShares(): NumShares { + return { + numShares: new Uint8Array() + }; +} +export const NumShares = { + typeUrl: "/dydxprotocol.vault.NumShares", + encode(message: NumShares, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.numShares.length !== 0) { + writer.uint32(18).bytes(message.numShares); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NumShares { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNumShares(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.numShares = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NumShares { + const message = createBaseNumShares(); + message.numShares = object.numShares ?? new Uint8Array(); + return message; + }, + fromAmino(object: NumSharesAmino): NumShares { + const message = createBaseNumShares(); + if (object.num_shares !== undefined && object.num_shares !== null) { + message.numShares = bytesFromBase64(object.num_shares); + } + return message; + }, + toAmino(message: NumShares): NumSharesAmino { + const obj: any = {}; + obj.num_shares = message.numShares ? base64FromBytes(message.numShares) : undefined; + return obj; + }, + fromAminoMsg(object: NumSharesAminoMsg): NumShares { + return NumShares.fromAmino(object.value); + }, + fromProtoMsg(message: NumSharesProtoMsg): NumShares { + return NumShares.decode(message.value); + }, + toProto(message: NumShares): Uint8Array { + return NumShares.encode(message).finish(); + }, + toProtoMsg(message: NumShares): NumSharesProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.NumShares", + value: NumShares.encode(message).finish() + }; + } +}; +function createBaseOwnerShare(): OwnerShare { + return { + owner: "", + shares: NumShares.fromPartial({}) + }; +} +export const OwnerShare = { + typeUrl: "/dydxprotocol.vault.OwnerShare", + encode(message: OwnerShare, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.shares !== undefined) { + NumShares.encode(message.shares, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OwnerShare { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOwnerShare(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.shares = NumShares.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OwnerShare { + const message = createBaseOwnerShare(); + message.owner = object.owner ?? ""; + message.shares = object.shares !== undefined && object.shares !== null ? NumShares.fromPartial(object.shares) : undefined; + return message; + }, + fromAmino(object: OwnerShareAmino): OwnerShare { + const message = createBaseOwnerShare(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = NumShares.fromAmino(object.shares); + } + return message; + }, + toAmino(message: OwnerShare): OwnerShareAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.shares = message.shares ? NumShares.toAmino(message.shares) : undefined; + return obj; + }, + fromAminoMsg(object: OwnerShareAminoMsg): OwnerShare { + return OwnerShare.fromAmino(object.value); + }, + fromProtoMsg(message: OwnerShareProtoMsg): OwnerShare { + return OwnerShare.decode(message.value); + }, + toProto(message: OwnerShare): Uint8Array { + return OwnerShare.encode(message).finish(); + }, + toProtoMsg(message: OwnerShare): OwnerShareProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.OwnerShare", + value: OwnerShare.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.amino.ts new file mode 100644 index 00000000..a803a987 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgDepositToMegavault, MsgUpdateDefaultQuotingParams, MsgSetVaultParams } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.vault.MsgDepositToMegavault": { + aminoType: "/dydxprotocol.vault.MsgDepositToMegavault", + toAmino: MsgDepositToMegavault.toAmino, + fromAmino: MsgDepositToMegavault.fromAmino + }, + "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams": { + aminoType: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams", + toAmino: MsgUpdateDefaultQuotingParams.toAmino, + fromAmino: MsgUpdateDefaultQuotingParams.fromAmino + }, + "/dydxprotocol.vault.MsgSetVaultParams": { + aminoType: "/dydxprotocol.vault.MsgSetVaultParams", + toAmino: MsgSetVaultParams.toAmino, + fromAmino: MsgSetVaultParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.registry.ts new file mode 100644 index 00000000..3630d54b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgDepositToMegavault, MsgUpdateDefaultQuotingParams, MsgSetVaultParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.vault.MsgDepositToMegavault", MsgDepositToMegavault], ["/dydxprotocol.vault.MsgUpdateDefaultQuotingParams", MsgUpdateDefaultQuotingParams], ["/dydxprotocol.vault.MsgSetVaultParams", MsgSetVaultParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + depositToMegavault(value: MsgDepositToMegavault) { + return { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavault", + value: MsgDepositToMegavault.encode(value).finish() + }; + }, + updateDefaultQuotingParams(value: MsgUpdateDefaultQuotingParams) { + return { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams", + value: MsgUpdateDefaultQuotingParams.encode(value).finish() + }; + }, + setVaultParams(value: MsgSetVaultParams) { + return { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParams", + value: MsgSetVaultParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + depositToMegavault(value: MsgDepositToMegavault) { + return { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavault", + value + }; + }, + updateDefaultQuotingParams(value: MsgUpdateDefaultQuotingParams) { + return { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams", + value + }; + }, + setVaultParams(value: MsgSetVaultParams) { + return { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParams", + value + }; + } + }, + fromPartial: { + depositToMegavault(value: MsgDepositToMegavault) { + return { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavault", + value: MsgDepositToMegavault.fromPartial(value) + }; + }, + updateDefaultQuotingParams(value: MsgUpdateDefaultQuotingParams) { + return { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams", + value: MsgUpdateDefaultQuotingParams.fromPartial(value) + }; + }, + setVaultParams(value: MsgSetVaultParams) { + return { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParams", + value: MsgSetVaultParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.rpc.msg.ts new file mode 100644 index 00000000..1162b475 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.rpc.msg.ts @@ -0,0 +1,37 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgDepositToMegavault, MsgDepositToMegavaultResponse, MsgUpdateDefaultQuotingParams, MsgUpdateDefaultQuotingParamsResponse, MsgSetVaultParams, MsgSetVaultParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** DepositToMegavault deposits funds into megavault. */ + depositToMegavault(request: MsgDepositToMegavault): Promise; + /** UpdateDefaultQuotingParams updates the default quoting params in state. */ + updateDefaultQuotingParams(request: MsgUpdateDefaultQuotingParams): Promise; + /** SetVaultParams sets the parameters of a specific vault. */ + setVaultParams(request: MsgSetVaultParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.depositToMegavault = this.depositToMegavault.bind(this); + this.updateDefaultQuotingParams = this.updateDefaultQuotingParams.bind(this); + this.setVaultParams = this.setVaultParams.bind(this); + } + depositToMegavault(request: MsgDepositToMegavault): Promise { + const data = MsgDepositToMegavault.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Msg", "DepositToMegavault", data); + return promise.then(data => MsgDepositToMegavaultResponse.decode(new BinaryReader(data))); + } + updateDefaultQuotingParams(request: MsgUpdateDefaultQuotingParams): Promise { + const data = MsgUpdateDefaultQuotingParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Msg", "UpdateDefaultQuotingParams", data); + return promise.then(data => MsgUpdateDefaultQuotingParamsResponse.decode(new BinaryReader(data))); + } + setVaultParams(request: MsgSetVaultParams): Promise { + const data = MsgSetVaultParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Msg", "SetVaultParams", data); + return promise.then(data => MsgSetVaultParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.ts new file mode 100644 index 00000000..2ac475a3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/tx.ts @@ -0,0 +1,566 @@ +//@ts-nocheck +import { SubaccountId, SubaccountIdAmino, SubaccountIdSDKType } from "../subaccounts/subaccount"; +import { QuotingParams, QuotingParamsAmino, QuotingParamsSDKType, VaultParams, VaultParamsAmino, VaultParamsSDKType } from "./params"; +import { VaultId, VaultIdAmino, VaultIdSDKType } from "./vault"; +import { NumShares, NumSharesAmino, NumSharesSDKType } from "./share"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * MsgDepositToMegavault deposits the specified asset from the subaccount to + * megavault. + */ +export interface MsgDepositToMegavault { + /** The subaccount to deposit from. */ + subaccountId?: SubaccountId; + /** Number of quote quantums to deposit. */ + quoteQuantums: Uint8Array; +} +export interface MsgDepositToMegavaultProtoMsg { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavault"; + value: Uint8Array; +} +/** + * MsgDepositToMegavault deposits the specified asset from the subaccount to + * megavault. + */ +export interface MsgDepositToMegavaultAmino { + /** The subaccount to deposit from. */ + subaccount_id?: SubaccountIdAmino; + /** Number of quote quantums to deposit. */ + quote_quantums?: string; +} +export interface MsgDepositToMegavaultAminoMsg { + type: "/dydxprotocol.vault.MsgDepositToMegavault"; + value: MsgDepositToMegavaultAmino; +} +/** + * MsgDepositToMegavault deposits the specified asset from the subaccount to + * megavault. + */ +export interface MsgDepositToMegavaultSDKType { + subaccount_id?: SubaccountIdSDKType; + quote_quantums: Uint8Array; +} +/** MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. */ +export interface MsgDepositToMegavaultResponse { + /** The number of shares minted from the deposit. */ + mintedShares: NumShares; +} +export interface MsgDepositToMegavaultResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavaultResponse"; + value: Uint8Array; +} +/** MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. */ +export interface MsgDepositToMegavaultResponseAmino { + /** The number of shares minted from the deposit. */ + minted_shares?: NumSharesAmino; +} +export interface MsgDepositToMegavaultResponseAminoMsg { + type: "/dydxprotocol.vault.MsgDepositToMegavaultResponse"; + value: MsgDepositToMegavaultResponseAmino; +} +/** MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. */ +export interface MsgDepositToMegavaultResponseSDKType { + minted_shares: NumSharesSDKType; +} +/** + * MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request + * type. + */ +export interface MsgUpdateDefaultQuotingParams { + authority: string; + /** The quoting parameters to update to. Every field must be set. */ + defaultQuotingParams: QuotingParams; +} +export interface MsgUpdateDefaultQuotingParamsProtoMsg { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams"; + value: Uint8Array; +} +/** + * MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request + * type. + */ +export interface MsgUpdateDefaultQuotingParamsAmino { + authority?: string; + /** The quoting parameters to update to. Every field must be set. */ + default_quoting_params?: QuotingParamsAmino; +} +export interface MsgUpdateDefaultQuotingParamsAminoMsg { + type: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams"; + value: MsgUpdateDefaultQuotingParamsAmino; +} +/** + * MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request + * type. + */ +export interface MsgUpdateDefaultQuotingParamsSDKType { + authority: string; + default_quoting_params: QuotingParamsSDKType; +} +/** + * MsgUpdateDefaultQuotingParamsResponse is the Msg/UpdateDefaultQuotingParams + * response type. + */ +export interface MsgUpdateDefaultQuotingParamsResponse {} +export interface MsgUpdateDefaultQuotingParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateDefaultQuotingParamsResponse is the Msg/UpdateDefaultQuotingParams + * response type. + */ +export interface MsgUpdateDefaultQuotingParamsResponseAmino {} +export interface MsgUpdateDefaultQuotingParamsResponseAminoMsg { + type: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParamsResponse"; + value: MsgUpdateDefaultQuotingParamsResponseAmino; +} +/** + * MsgUpdateDefaultQuotingParamsResponse is the Msg/UpdateDefaultQuotingParams + * response type. + */ +export interface MsgUpdateDefaultQuotingParamsResponseSDKType {} +/** MsgSetVaultParams is the Msg/SetVaultParams request type. */ +export interface MsgSetVaultParams { + authority: string; + /** The vault to set params of. */ + vaultId: VaultId; + /** The parameters to set. */ + vaultParams: VaultParams; +} +export interface MsgSetVaultParamsProtoMsg { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParams"; + value: Uint8Array; +} +/** MsgSetVaultParams is the Msg/SetVaultParams request type. */ +export interface MsgSetVaultParamsAmino { + authority?: string; + /** The vault to set params of. */ + vault_id?: VaultIdAmino; + /** The parameters to set. */ + vault_params?: VaultParamsAmino; +} +export interface MsgSetVaultParamsAminoMsg { + type: "/dydxprotocol.vault.MsgSetVaultParams"; + value: MsgSetVaultParamsAmino; +} +/** MsgSetVaultParams is the Msg/SetVaultParams request type. */ +export interface MsgSetVaultParamsSDKType { + authority: string; + vault_id: VaultIdSDKType; + vault_params: VaultParamsSDKType; +} +/** MsgSetVaultParamsResponse is the Msg/SetVaultParams response type. */ +export interface MsgSetVaultParamsResponse {} +export interface MsgSetVaultParamsResponseProtoMsg { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParamsResponse"; + value: Uint8Array; +} +/** MsgSetVaultParamsResponse is the Msg/SetVaultParams response type. */ +export interface MsgSetVaultParamsResponseAmino {} +export interface MsgSetVaultParamsResponseAminoMsg { + type: "/dydxprotocol.vault.MsgSetVaultParamsResponse"; + value: MsgSetVaultParamsResponseAmino; +} +/** MsgSetVaultParamsResponse is the Msg/SetVaultParams response type. */ +export interface MsgSetVaultParamsResponseSDKType {} +function createBaseMsgDepositToMegavault(): MsgDepositToMegavault { + return { + subaccountId: undefined, + quoteQuantums: new Uint8Array() + }; +} +export const MsgDepositToMegavault = { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavault", + encode(message: MsgDepositToMegavault, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subaccountId !== undefined) { + SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.quoteQuantums.length !== 0) { + writer.uint32(18).bytes(message.quoteQuantums); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositToMegavault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositToMegavault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.quoteQuantums = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDepositToMegavault { + const message = createBaseMsgDepositToMegavault(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; + message.quoteQuantums = object.quoteQuantums ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgDepositToMegavaultAmino): MsgDepositToMegavault { + const message = createBaseMsgDepositToMegavault(); + if (object.subaccount_id !== undefined && object.subaccount_id !== null) { + message.subaccountId = SubaccountId.fromAmino(object.subaccount_id); + } + if (object.quote_quantums !== undefined && object.quote_quantums !== null) { + message.quoteQuantums = bytesFromBase64(object.quote_quantums); + } + return message; + }, + toAmino(message: MsgDepositToMegavault): MsgDepositToMegavaultAmino { + const obj: any = {}; + obj.subaccount_id = message.subaccountId ? SubaccountId.toAmino(message.subaccountId) : undefined; + obj.quote_quantums = message.quoteQuantums ? base64FromBytes(message.quoteQuantums) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDepositToMegavaultAminoMsg): MsgDepositToMegavault { + return MsgDepositToMegavault.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDepositToMegavaultProtoMsg): MsgDepositToMegavault { + return MsgDepositToMegavault.decode(message.value); + }, + toProto(message: MsgDepositToMegavault): Uint8Array { + return MsgDepositToMegavault.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositToMegavault): MsgDepositToMegavaultProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavault", + value: MsgDepositToMegavault.encode(message).finish() + }; + } +}; +function createBaseMsgDepositToMegavaultResponse(): MsgDepositToMegavaultResponse { + return { + mintedShares: NumShares.fromPartial({}) + }; +} +export const MsgDepositToMegavaultResponse = { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavaultResponse", + encode(message: MsgDepositToMegavaultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mintedShares !== undefined) { + NumShares.encode(message.mintedShares, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositToMegavaultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositToMegavaultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mintedShares = NumShares.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDepositToMegavaultResponse { + const message = createBaseMsgDepositToMegavaultResponse(); + message.mintedShares = object.mintedShares !== undefined && object.mintedShares !== null ? NumShares.fromPartial(object.mintedShares) : undefined; + return message; + }, + fromAmino(object: MsgDepositToMegavaultResponseAmino): MsgDepositToMegavaultResponse { + const message = createBaseMsgDepositToMegavaultResponse(); + if (object.minted_shares !== undefined && object.minted_shares !== null) { + message.mintedShares = NumShares.fromAmino(object.minted_shares); + } + return message; + }, + toAmino(message: MsgDepositToMegavaultResponse): MsgDepositToMegavaultResponseAmino { + const obj: any = {}; + obj.minted_shares = message.mintedShares ? NumShares.toAmino(message.mintedShares) : undefined; + return obj; + }, + fromAminoMsg(object: MsgDepositToMegavaultResponseAminoMsg): MsgDepositToMegavaultResponse { + return MsgDepositToMegavaultResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDepositToMegavaultResponseProtoMsg): MsgDepositToMegavaultResponse { + return MsgDepositToMegavaultResponse.decode(message.value); + }, + toProto(message: MsgDepositToMegavaultResponse): Uint8Array { + return MsgDepositToMegavaultResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositToMegavaultResponse): MsgDepositToMegavaultResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.MsgDepositToMegavaultResponse", + value: MsgDepositToMegavaultResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateDefaultQuotingParams(): MsgUpdateDefaultQuotingParams { + return { + authority: "", + defaultQuotingParams: QuotingParams.fromPartial({}) + }; +} +export const MsgUpdateDefaultQuotingParams = { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams", + encode(message: MsgUpdateDefaultQuotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.defaultQuotingParams !== undefined) { + QuotingParams.encode(message.defaultQuotingParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDefaultQuotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDefaultQuotingParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.defaultQuotingParams = QuotingParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateDefaultQuotingParams { + const message = createBaseMsgUpdateDefaultQuotingParams(); + message.authority = object.authority ?? ""; + message.defaultQuotingParams = object.defaultQuotingParams !== undefined && object.defaultQuotingParams !== null ? QuotingParams.fromPartial(object.defaultQuotingParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdateDefaultQuotingParamsAmino): MsgUpdateDefaultQuotingParams { + const message = createBaseMsgUpdateDefaultQuotingParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.default_quoting_params !== undefined && object.default_quoting_params !== null) { + message.defaultQuotingParams = QuotingParams.fromAmino(object.default_quoting_params); + } + return message; + }, + toAmino(message: MsgUpdateDefaultQuotingParams): MsgUpdateDefaultQuotingParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.default_quoting_params = message.defaultQuotingParams ? QuotingParams.toAmino(message.defaultQuotingParams) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateDefaultQuotingParamsAminoMsg): MsgUpdateDefaultQuotingParams { + return MsgUpdateDefaultQuotingParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateDefaultQuotingParamsProtoMsg): MsgUpdateDefaultQuotingParams { + return MsgUpdateDefaultQuotingParams.decode(message.value); + }, + toProto(message: MsgUpdateDefaultQuotingParams): Uint8Array { + return MsgUpdateDefaultQuotingParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDefaultQuotingParams): MsgUpdateDefaultQuotingParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams", + value: MsgUpdateDefaultQuotingParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateDefaultQuotingParamsResponse(): MsgUpdateDefaultQuotingParamsResponse { + return {}; +} +export const MsgUpdateDefaultQuotingParamsResponse = { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParamsResponse", + encode(_: MsgUpdateDefaultQuotingParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDefaultQuotingParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDefaultQuotingParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateDefaultQuotingParamsResponse { + const message = createBaseMsgUpdateDefaultQuotingParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateDefaultQuotingParamsResponseAmino): MsgUpdateDefaultQuotingParamsResponse { + const message = createBaseMsgUpdateDefaultQuotingParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateDefaultQuotingParamsResponse): MsgUpdateDefaultQuotingParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateDefaultQuotingParamsResponseAminoMsg): MsgUpdateDefaultQuotingParamsResponse { + return MsgUpdateDefaultQuotingParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateDefaultQuotingParamsResponseProtoMsg): MsgUpdateDefaultQuotingParamsResponse { + return MsgUpdateDefaultQuotingParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateDefaultQuotingParamsResponse): Uint8Array { + return MsgUpdateDefaultQuotingParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDefaultQuotingParamsResponse): MsgUpdateDefaultQuotingParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.MsgUpdateDefaultQuotingParamsResponse", + value: MsgUpdateDefaultQuotingParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetVaultParams(): MsgSetVaultParams { + return { + authority: "", + vaultId: VaultId.fromPartial({}), + vaultParams: VaultParams.fromPartial({}) + }; +} +export const MsgSetVaultParams = { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParams", + encode(message: MsgSetVaultParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.vaultId !== undefined) { + VaultId.encode(message.vaultId, writer.uint32(18).fork()).ldelim(); + } + if (message.vaultParams !== undefined) { + VaultParams.encode(message.vaultParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetVaultParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetVaultParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.vaultId = VaultId.decode(reader, reader.uint32()); + break; + case 3: + message.vaultParams = VaultParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetVaultParams { + const message = createBaseMsgSetVaultParams(); + message.authority = object.authority ?? ""; + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? VaultId.fromPartial(object.vaultId) : undefined; + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? VaultParams.fromPartial(object.vaultParams) : undefined; + return message; + }, + fromAmino(object: MsgSetVaultParamsAmino): MsgSetVaultParams { + const message = createBaseMsgSetVaultParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.vault_id !== undefined && object.vault_id !== null) { + message.vaultId = VaultId.fromAmino(object.vault_id); + } + if (object.vault_params !== undefined && object.vault_params !== null) { + message.vaultParams = VaultParams.fromAmino(object.vault_params); + } + return message; + }, + toAmino(message: MsgSetVaultParams): MsgSetVaultParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.vault_id = message.vaultId ? VaultId.toAmino(message.vaultId) : undefined; + obj.vault_params = message.vaultParams ? VaultParams.toAmino(message.vaultParams) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetVaultParamsAminoMsg): MsgSetVaultParams { + return MsgSetVaultParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetVaultParamsProtoMsg): MsgSetVaultParams { + return MsgSetVaultParams.decode(message.value); + }, + toProto(message: MsgSetVaultParams): Uint8Array { + return MsgSetVaultParams.encode(message).finish(); + }, + toProtoMsg(message: MsgSetVaultParams): MsgSetVaultParamsProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParams", + value: MsgSetVaultParams.encode(message).finish() + }; + } +}; +function createBaseMsgSetVaultParamsResponse(): MsgSetVaultParamsResponse { + return {}; +} +export const MsgSetVaultParamsResponse = { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParamsResponse", + encode(_: MsgSetVaultParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetVaultParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetVaultParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetVaultParamsResponse { + const message = createBaseMsgSetVaultParamsResponse(); + return message; + }, + fromAmino(_: MsgSetVaultParamsResponseAmino): MsgSetVaultParamsResponse { + const message = createBaseMsgSetVaultParamsResponse(); + return message; + }, + toAmino(_: MsgSetVaultParamsResponse): MsgSetVaultParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetVaultParamsResponseAminoMsg): MsgSetVaultParamsResponse { + return MsgSetVaultParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetVaultParamsResponseProtoMsg): MsgSetVaultParamsResponse { + return MsgSetVaultParamsResponse.decode(message.value); + }, + toProto(message: MsgSetVaultParamsResponse): Uint8Array { + return MsgSetVaultParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetVaultParamsResponse): MsgSetVaultParamsResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.MsgSetVaultParamsResponse", + value: MsgSetVaultParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vault/vault.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/vault.ts new file mode 100644 index 00000000..f7ae57e2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vault/vault.ts @@ -0,0 +1,195 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** VaultType represents different types of vaults. */ +export enum VaultType { + /** VAULT_TYPE_UNSPECIFIED - Default value, invalid and unused. */ + VAULT_TYPE_UNSPECIFIED = 0, + /** VAULT_TYPE_CLOB - Vault is associated with a CLOB pair. */ + VAULT_TYPE_CLOB = 1, + UNRECOGNIZED = -1, +} +export const VaultTypeSDKType = VaultType; +export const VaultTypeAmino = VaultType; +export function vaultTypeFromJSON(object: any): VaultType { + switch (object) { + case 0: + case "VAULT_TYPE_UNSPECIFIED": + return VaultType.VAULT_TYPE_UNSPECIFIED; + case 1: + case "VAULT_TYPE_CLOB": + return VaultType.VAULT_TYPE_CLOB; + case -1: + case "UNRECOGNIZED": + default: + return VaultType.UNRECOGNIZED; + } +} +export function vaultTypeToJSON(object: VaultType): string { + switch (object) { + case VaultType.VAULT_TYPE_UNSPECIFIED: + return "VAULT_TYPE_UNSPECIFIED"; + case VaultType.VAULT_TYPE_CLOB: + return "VAULT_TYPE_CLOB"; + case VaultType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** VaultStatus represents the status of a vault. */ +export enum VaultStatus { + /** VAULT_STATUS_UNSPECIFIED - Default value, invalid and unused. */ + VAULT_STATUS_UNSPECIFIED = 0, + /** VAULT_STATUS_DEACTIVATED - Don’t place orders. Does not count toward global vault balances. */ + VAULT_STATUS_DEACTIVATED = 1, + /** VAULT_STATUS_STAND_BY - Don’t place orders. Does count towards global vault balances. */ + VAULT_STATUS_STAND_BY = 2, + /** VAULT_STATUS_QUOTING - Places orders on both sides of the book. */ + VAULT_STATUS_QUOTING = 3, + /** VAULT_STATUS_CLOSE_ONLY - Only place orders that close the position. */ + VAULT_STATUS_CLOSE_ONLY = 4, + UNRECOGNIZED = -1, +} +export const VaultStatusSDKType = VaultStatus; +export const VaultStatusAmino = VaultStatus; +export function vaultStatusFromJSON(object: any): VaultStatus { + switch (object) { + case 0: + case "VAULT_STATUS_UNSPECIFIED": + return VaultStatus.VAULT_STATUS_UNSPECIFIED; + case 1: + case "VAULT_STATUS_DEACTIVATED": + return VaultStatus.VAULT_STATUS_DEACTIVATED; + case 2: + case "VAULT_STATUS_STAND_BY": + return VaultStatus.VAULT_STATUS_STAND_BY; + case 3: + case "VAULT_STATUS_QUOTING": + return VaultStatus.VAULT_STATUS_QUOTING; + case 4: + case "VAULT_STATUS_CLOSE_ONLY": + return VaultStatus.VAULT_STATUS_CLOSE_ONLY; + case -1: + case "UNRECOGNIZED": + default: + return VaultStatus.UNRECOGNIZED; + } +} +export function vaultStatusToJSON(object: VaultStatus): string { + switch (object) { + case VaultStatus.VAULT_STATUS_UNSPECIFIED: + return "VAULT_STATUS_UNSPECIFIED"; + case VaultStatus.VAULT_STATUS_DEACTIVATED: + return "VAULT_STATUS_DEACTIVATED"; + case VaultStatus.VAULT_STATUS_STAND_BY: + return "VAULT_STATUS_STAND_BY"; + case VaultStatus.VAULT_STATUS_QUOTING: + return "VAULT_STATUS_QUOTING"; + case VaultStatus.VAULT_STATUS_CLOSE_ONLY: + return "VAULT_STATUS_CLOSE_ONLY"; + case VaultStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** VaultId uniquely identifies a vault by its type and number. */ +export interface VaultId { + /** Type of the vault. */ + type: VaultType; + /** Unique ID of the vault within above type. */ + number: number; +} +export interface VaultIdProtoMsg { + typeUrl: "/dydxprotocol.vault.VaultId"; + value: Uint8Array; +} +/** VaultId uniquely identifies a vault by its type and number. */ +export interface VaultIdAmino { + /** Type of the vault. */ + type?: VaultType; + /** Unique ID of the vault within above type. */ + number?: number; +} +export interface VaultIdAminoMsg { + type: "/dydxprotocol.vault.VaultId"; + value: VaultIdAmino; +} +/** VaultId uniquely identifies a vault by its type and number. */ +export interface VaultIdSDKType { + type: VaultType; + number: number; +} +function createBaseVaultId(): VaultId { + return { + type: 0, + number: 0 + }; +} +export const VaultId = { + typeUrl: "/dydxprotocol.vault.VaultId", + encode(message: VaultId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VaultId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVaultId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.number = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VaultId { + const message = createBaseVaultId(); + message.type = object.type ?? 0; + message.number = object.number ?? 0; + return message; + }, + fromAmino(object: VaultIdAmino): VaultId { + const message = createBaseVaultId(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + return message; + }, + toAmino(message: VaultId): VaultIdAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.number = message.number === 0 ? undefined : message.number; + return obj; + }, + fromAminoMsg(object: VaultIdAminoMsg): VaultId { + return VaultId.fromAmino(object.value); + }, + fromProtoMsg(message: VaultIdProtoMsg): VaultId { + return VaultId.decode(message.value); + }, + toProto(message: VaultId): Uint8Array { + return VaultId.encode(message).finish(); + }, + toProtoMsg(message: VaultId): VaultIdProtoMsg { + return { + typeUrl: "/dydxprotocol.vault.VaultId", + value: VaultId.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/genesis.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/genesis.ts new file mode 100644 index 00000000..c3f287e3 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/genesis.ts @@ -0,0 +1,90 @@ +//@ts-nocheck +import { VestEntry, VestEntryAmino, VestEntrySDKType } from "./vest_entry"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the vest module's genesis state. */ +export interface GenesisState { + /** The vest entries at genesis. */ + vestEntries: VestEntry[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/dydxprotocol.vest.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the vest module's genesis state. */ +export interface GenesisStateAmino { + /** The vest entries at genesis. */ + vest_entries?: VestEntryAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/dydxprotocol.vest.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the vest module's genesis state. */ +export interface GenesisStateSDKType { + vest_entries: VestEntrySDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + vestEntries: [] + }; +} +export const GenesisState = { + typeUrl: "/dydxprotocol.vest.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.vestEntries) { + VestEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vestEntries.push(VestEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.vestEntries = object.vestEntries?.map(e => VestEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.vestEntries = object.vest_entries?.map(e => VestEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.vestEntries) { + obj.vest_entries = message.vestEntries.map(e => e ? VestEntry.toAmino(e) : undefined); + } else { + obj.vest_entries = message.vestEntries; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/query.rpc.Query.ts new file mode 100644 index 00000000..db3fa993 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/query.rpc.Query.ts @@ -0,0 +1,31 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryVestEntryRequest, QueryVestEntryResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the VestEntry. */ + vestEntry(request: QueryVestEntryRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.vestEntry = this.vestEntry.bind(this); + } + vestEntry(request: QueryVestEntryRequest): Promise { + const data = QueryVestEntryRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vest.Query", "VestEntry", data); + return promise.then(data => QueryVestEntryResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + vestEntry(request: QueryVestEntryRequest): Promise { + return queryService.vestEntry(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/query.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/query.ts new file mode 100644 index 00000000..ffdd86ff --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/query.ts @@ -0,0 +1,169 @@ +//@ts-nocheck +import { VestEntry, VestEntryAmino, VestEntrySDKType } from "./vest_entry"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryVestEntryRequest is a request type for the VestEntry RPC method. */ +export interface QueryVestEntryRequest { + vesterAccount: string; +} +export interface QueryVestEntryRequestProtoMsg { + typeUrl: "/dydxprotocol.vest.QueryVestEntryRequest"; + value: Uint8Array; +} +/** QueryVestEntryRequest is a request type for the VestEntry RPC method. */ +export interface QueryVestEntryRequestAmino { + vester_account?: string; +} +export interface QueryVestEntryRequestAminoMsg { + type: "/dydxprotocol.vest.QueryVestEntryRequest"; + value: QueryVestEntryRequestAmino; +} +/** QueryVestEntryRequest is a request type for the VestEntry RPC method. */ +export interface QueryVestEntryRequestSDKType { + vester_account: string; +} +/** QueryVestEntryResponse is a response type for the VestEntry RPC method. */ +export interface QueryVestEntryResponse { + entry: VestEntry; +} +export interface QueryVestEntryResponseProtoMsg { + typeUrl: "/dydxprotocol.vest.QueryVestEntryResponse"; + value: Uint8Array; +} +/** QueryVestEntryResponse is a response type for the VestEntry RPC method. */ +export interface QueryVestEntryResponseAmino { + entry?: VestEntryAmino; +} +export interface QueryVestEntryResponseAminoMsg { + type: "/dydxprotocol.vest.QueryVestEntryResponse"; + value: QueryVestEntryResponseAmino; +} +/** QueryVestEntryResponse is a response type for the VestEntry RPC method. */ +export interface QueryVestEntryResponseSDKType { + entry: VestEntrySDKType; +} +function createBaseQueryVestEntryRequest(): QueryVestEntryRequest { + return { + vesterAccount: "" + }; +} +export const QueryVestEntryRequest = { + typeUrl: "/dydxprotocol.vest.QueryVestEntryRequest", + encode(message: QueryVestEntryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vesterAccount !== "") { + writer.uint32(10).string(message.vesterAccount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVestEntryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVestEntryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vesterAccount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVestEntryRequest { + const message = createBaseQueryVestEntryRequest(); + message.vesterAccount = object.vesterAccount ?? ""; + return message; + }, + fromAmino(object: QueryVestEntryRequestAmino): QueryVestEntryRequest { + const message = createBaseQueryVestEntryRequest(); + if (object.vester_account !== undefined && object.vester_account !== null) { + message.vesterAccount = object.vester_account; + } + return message; + }, + toAmino(message: QueryVestEntryRequest): QueryVestEntryRequestAmino { + const obj: any = {}; + obj.vester_account = message.vesterAccount === "" ? undefined : message.vesterAccount; + return obj; + }, + fromAminoMsg(object: QueryVestEntryRequestAminoMsg): QueryVestEntryRequest { + return QueryVestEntryRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVestEntryRequestProtoMsg): QueryVestEntryRequest { + return QueryVestEntryRequest.decode(message.value); + }, + toProto(message: QueryVestEntryRequest): Uint8Array { + return QueryVestEntryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVestEntryRequest): QueryVestEntryRequestProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.QueryVestEntryRequest", + value: QueryVestEntryRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVestEntryResponse(): QueryVestEntryResponse { + return { + entry: VestEntry.fromPartial({}) + }; +} +export const QueryVestEntryResponse = { + typeUrl: "/dydxprotocol.vest.QueryVestEntryResponse", + encode(message: QueryVestEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.entry !== undefined) { + VestEntry.encode(message.entry, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVestEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVestEntryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entry = VestEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVestEntryResponse { + const message = createBaseQueryVestEntryResponse(); + message.entry = object.entry !== undefined && object.entry !== null ? VestEntry.fromPartial(object.entry) : undefined; + return message; + }, + fromAmino(object: QueryVestEntryResponseAmino): QueryVestEntryResponse { + const message = createBaseQueryVestEntryResponse(); + if (object.entry !== undefined && object.entry !== null) { + message.entry = VestEntry.fromAmino(object.entry); + } + return message; + }, + toAmino(message: QueryVestEntryResponse): QueryVestEntryResponseAmino { + const obj: any = {}; + obj.entry = message.entry ? VestEntry.toAmino(message.entry) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVestEntryResponseAminoMsg): QueryVestEntryResponse { + return QueryVestEntryResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVestEntryResponseProtoMsg): QueryVestEntryResponse { + return QueryVestEntryResponse.decode(message.value); + }, + toProto(message: QueryVestEntryResponse): Uint8Array { + return QueryVestEntryResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVestEntryResponse): QueryVestEntryResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.QueryVestEntryResponse", + value: QueryVestEntryResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.amino.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.amino.ts new file mode 100644 index 00000000..cb50aa68 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgSetVestEntry, MsgDeleteVestEntry } from "./tx"; +export const AminoConverter = { + "/dydxprotocol.vest.MsgSetVestEntry": { + aminoType: "/dydxprotocol.vest.MsgSetVestEntry", + toAmino: MsgSetVestEntry.toAmino, + fromAmino: MsgSetVestEntry.fromAmino + }, + "/dydxprotocol.vest.MsgDeleteVestEntry": { + aminoType: "/dydxprotocol.vest.MsgDeleteVestEntry", + toAmino: MsgDeleteVestEntry.toAmino, + fromAmino: MsgDeleteVestEntry.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.registry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.registry.ts new file mode 100644 index 00000000..720e9469 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSetVestEntry, MsgDeleteVestEntry } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/dydxprotocol.vest.MsgSetVestEntry", MsgSetVestEntry], ["/dydxprotocol.vest.MsgDeleteVestEntry", MsgDeleteVestEntry]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setVestEntry(value: MsgSetVestEntry) { + return { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntry", + value: MsgSetVestEntry.encode(value).finish() + }; + }, + deleteVestEntry(value: MsgDeleteVestEntry) { + return { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntry", + value: MsgDeleteVestEntry.encode(value).finish() + }; + } + }, + withTypeUrl: { + setVestEntry(value: MsgSetVestEntry) { + return { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntry", + value + }; + }, + deleteVestEntry(value: MsgDeleteVestEntry) { + return { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntry", + value + }; + } + }, + fromPartial: { + setVestEntry(value: MsgSetVestEntry) { + return { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntry", + value: MsgSetVestEntry.fromPartial(value) + }; + }, + deleteVestEntry(value: MsgDeleteVestEntry) { + return { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntry", + value: MsgDeleteVestEntry.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.rpc.msg.ts new file mode 100644 index 00000000..9143cf7a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.rpc.msg.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgSetVestEntry, MsgSetVestEntryResponse, MsgDeleteVestEntry, MsgDeleteVestEntryResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** SetVestEntry sets a VestEntry in state. */ + setVestEntry(request: MsgSetVestEntry): Promise; + /** DeleteVestEntry deletes a VestEntry from state. */ + deleteVestEntry(request: MsgDeleteVestEntry): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setVestEntry = this.setVestEntry.bind(this); + this.deleteVestEntry = this.deleteVestEntry.bind(this); + } + setVestEntry(request: MsgSetVestEntry): Promise { + const data = MsgSetVestEntry.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vest.Msg", "SetVestEntry", data); + return promise.then(data => MsgSetVestEntryResponse.decode(new BinaryReader(data))); + } + deleteVestEntry(request: MsgDeleteVestEntry): Promise { + const data = MsgDeleteVestEntry.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vest.Msg", "DeleteVestEntry", data); + return promise.then(data => MsgDeleteVestEntryResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.ts new file mode 100644 index 00000000..328ad673 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/tx.ts @@ -0,0 +1,335 @@ +//@ts-nocheck +import { VestEntry, VestEntryAmino, VestEntrySDKType } from "./vest_entry"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** MsgDeleteVestEntry is the Msg/DeleteVestEntry request type. */ +export interface MsgDeleteVestEntry { + /** authority is the address that controls the module. */ + authority: string; + /** The vester account of the vest entry to delete. */ + vesterAccount: string; +} +export interface MsgDeleteVestEntryProtoMsg { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntry"; + value: Uint8Array; +} +/** MsgDeleteVestEntry is the Msg/DeleteVestEntry request type. */ +export interface MsgDeleteVestEntryAmino { + /** authority is the address that controls the module. */ + authority?: string; + /** The vester account of the vest entry to delete. */ + vester_account?: string; +} +export interface MsgDeleteVestEntryAminoMsg { + type: "/dydxprotocol.vest.MsgDeleteVestEntry"; + value: MsgDeleteVestEntryAmino; +} +/** MsgDeleteVestEntry is the Msg/DeleteVestEntry request type. */ +export interface MsgDeleteVestEntrySDKType { + authority: string; + vester_account: string; +} +/** MsgDeleteVestEntryResponse is the Msg/DeleteVestEntry response type. */ +export interface MsgDeleteVestEntryResponse {} +export interface MsgDeleteVestEntryResponseProtoMsg { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntryResponse"; + value: Uint8Array; +} +/** MsgDeleteVestEntryResponse is the Msg/DeleteVestEntry response type. */ +export interface MsgDeleteVestEntryResponseAmino {} +export interface MsgDeleteVestEntryResponseAminoMsg { + type: "/dydxprotocol.vest.MsgDeleteVestEntryResponse"; + value: MsgDeleteVestEntryResponseAmino; +} +/** MsgDeleteVestEntryResponse is the Msg/DeleteVestEntry response type. */ +export interface MsgDeleteVestEntryResponseSDKType {} +/** MsgSetVestEntry is the Msg/SetVestEntry request type. */ +export interface MsgSetVestEntry { + /** authority is the address that controls the module. */ + authority: string; + /** The vest entry to set. */ + entry: VestEntry; +} +export interface MsgSetVestEntryProtoMsg { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntry"; + value: Uint8Array; +} +/** MsgSetVestEntry is the Msg/SetVestEntry request type. */ +export interface MsgSetVestEntryAmino { + /** authority is the address that controls the module. */ + authority?: string; + /** The vest entry to set. */ + entry?: VestEntryAmino; +} +export interface MsgSetVestEntryAminoMsg { + type: "/dydxprotocol.vest.MsgSetVestEntry"; + value: MsgSetVestEntryAmino; +} +/** MsgSetVestEntry is the Msg/SetVestEntry request type. */ +export interface MsgSetVestEntrySDKType { + authority: string; + entry: VestEntrySDKType; +} +/** MsgSetVestEntryResponse is the Msg/SetVestEntry response type. */ +export interface MsgSetVestEntryResponse {} +export interface MsgSetVestEntryResponseProtoMsg { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntryResponse"; + value: Uint8Array; +} +/** MsgSetVestEntryResponse is the Msg/SetVestEntry response type. */ +export interface MsgSetVestEntryResponseAmino {} +export interface MsgSetVestEntryResponseAminoMsg { + type: "/dydxprotocol.vest.MsgSetVestEntryResponse"; + value: MsgSetVestEntryResponseAmino; +} +/** MsgSetVestEntryResponse is the Msg/SetVestEntry response type. */ +export interface MsgSetVestEntryResponseSDKType {} +function createBaseMsgDeleteVestEntry(): MsgDeleteVestEntry { + return { + authority: "", + vesterAccount: "" + }; +} +export const MsgDeleteVestEntry = { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntry", + encode(message: MsgDeleteVestEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.vesterAccount !== "") { + writer.uint32(18).string(message.vesterAccount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeleteVestEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteVestEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.vesterAccount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDeleteVestEntry { + const message = createBaseMsgDeleteVestEntry(); + message.authority = object.authority ?? ""; + message.vesterAccount = object.vesterAccount ?? ""; + return message; + }, + fromAmino(object: MsgDeleteVestEntryAmino): MsgDeleteVestEntry { + const message = createBaseMsgDeleteVestEntry(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.vester_account !== undefined && object.vester_account !== null) { + message.vesterAccount = object.vester_account; + } + return message; + }, + toAmino(message: MsgDeleteVestEntry): MsgDeleteVestEntryAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.vester_account = message.vesterAccount === "" ? undefined : message.vesterAccount; + return obj; + }, + fromAminoMsg(object: MsgDeleteVestEntryAminoMsg): MsgDeleteVestEntry { + return MsgDeleteVestEntry.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDeleteVestEntryProtoMsg): MsgDeleteVestEntry { + return MsgDeleteVestEntry.decode(message.value); + }, + toProto(message: MsgDeleteVestEntry): Uint8Array { + return MsgDeleteVestEntry.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteVestEntry): MsgDeleteVestEntryProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntry", + value: MsgDeleteVestEntry.encode(message).finish() + }; + } +}; +function createBaseMsgDeleteVestEntryResponse(): MsgDeleteVestEntryResponse { + return {}; +} +export const MsgDeleteVestEntryResponse = { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntryResponse", + encode(_: MsgDeleteVestEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeleteVestEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteVestEntryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDeleteVestEntryResponse { + const message = createBaseMsgDeleteVestEntryResponse(); + return message; + }, + fromAmino(_: MsgDeleteVestEntryResponseAmino): MsgDeleteVestEntryResponse { + const message = createBaseMsgDeleteVestEntryResponse(); + return message; + }, + toAmino(_: MsgDeleteVestEntryResponse): MsgDeleteVestEntryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDeleteVestEntryResponseAminoMsg): MsgDeleteVestEntryResponse { + return MsgDeleteVestEntryResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDeleteVestEntryResponseProtoMsg): MsgDeleteVestEntryResponse { + return MsgDeleteVestEntryResponse.decode(message.value); + }, + toProto(message: MsgDeleteVestEntryResponse): Uint8Array { + return MsgDeleteVestEntryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteVestEntryResponse): MsgDeleteVestEntryResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.MsgDeleteVestEntryResponse", + value: MsgDeleteVestEntryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetVestEntry(): MsgSetVestEntry { + return { + authority: "", + entry: VestEntry.fromPartial({}) + }; +} +export const MsgSetVestEntry = { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntry", + encode(message: MsgSetVestEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.entry !== undefined) { + VestEntry.encode(message.entry, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetVestEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetVestEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.entry = VestEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetVestEntry { + const message = createBaseMsgSetVestEntry(); + message.authority = object.authority ?? ""; + message.entry = object.entry !== undefined && object.entry !== null ? VestEntry.fromPartial(object.entry) : undefined; + return message; + }, + fromAmino(object: MsgSetVestEntryAmino): MsgSetVestEntry { + const message = createBaseMsgSetVestEntry(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.entry !== undefined && object.entry !== null) { + message.entry = VestEntry.fromAmino(object.entry); + } + return message; + }, + toAmino(message: MsgSetVestEntry): MsgSetVestEntryAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.entry = message.entry ? VestEntry.toAmino(message.entry) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetVestEntryAminoMsg): MsgSetVestEntry { + return MsgSetVestEntry.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetVestEntryProtoMsg): MsgSetVestEntry { + return MsgSetVestEntry.decode(message.value); + }, + toProto(message: MsgSetVestEntry): Uint8Array { + return MsgSetVestEntry.encode(message).finish(); + }, + toProtoMsg(message: MsgSetVestEntry): MsgSetVestEntryProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntry", + value: MsgSetVestEntry.encode(message).finish() + }; + } +}; +function createBaseMsgSetVestEntryResponse(): MsgSetVestEntryResponse { + return {}; +} +export const MsgSetVestEntryResponse = { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntryResponse", + encode(_: MsgSetVestEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetVestEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetVestEntryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetVestEntryResponse { + const message = createBaseMsgSetVestEntryResponse(); + return message; + }, + fromAmino(_: MsgSetVestEntryResponseAmino): MsgSetVestEntryResponse { + const message = createBaseMsgSetVestEntryResponse(); + return message; + }, + toAmino(_: MsgSetVestEntryResponse): MsgSetVestEntryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetVestEntryResponseAminoMsg): MsgSetVestEntryResponse { + return MsgSetVestEntryResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetVestEntryResponseProtoMsg): MsgSetVestEntryResponse { + return MsgSetVestEntryResponse.decode(message.value); + }, + toProto(message: MsgSetVestEntryResponse): Uint8Array { + return MsgSetVestEntryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetVestEntryResponse): MsgSetVestEntryResponseProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.MsgSetVestEntryResponse", + value: MsgSetVestEntryResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/dydxprotocol/vest/vest_entry.ts b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/vest_entry.ts new file mode 100644 index 00000000..9235ea84 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/dydxprotocol/vest/vest_entry.ts @@ -0,0 +1,178 @@ +//@ts-nocheck +import { Timestamp } from "../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { toTimestamp, fromTimestamp } from "../../helpers"; +/** + * VestEntry specifies a Vester Account and the rate at which tokens are + * dripped into the corresponding Treasury Account. + */ +export interface VestEntry { + /** + * The module account to vest tokens from. + * This is also the key to this `VestEntry` in state. + */ + vesterAccount: string; + /** The module account to vest tokens to. */ + treasuryAccount: string; + /** The denom of the token to vest. */ + denom: string; + /** The start time of vest. Before this time, no vest will occur. */ + startTime: Date; + /** + * The end time of vest. At this target date, all funds should be in the + * Treasury Account and none left in the Vester Account. + */ + endTime: Date; +} +export interface VestEntryProtoMsg { + typeUrl: "/dydxprotocol.vest.VestEntry"; + value: Uint8Array; +} +/** + * VestEntry specifies a Vester Account and the rate at which tokens are + * dripped into the corresponding Treasury Account. + */ +export interface VestEntryAmino { + /** + * The module account to vest tokens from. + * This is also the key to this `VestEntry` in state. + */ + vester_account?: string; + /** The module account to vest tokens to. */ + treasury_account?: string; + /** The denom of the token to vest. */ + denom?: string; + /** The start time of vest. Before this time, no vest will occur. */ + start_time?: string; + /** + * The end time of vest. At this target date, all funds should be in the + * Treasury Account and none left in the Vester Account. + */ + end_time?: string; +} +export interface VestEntryAminoMsg { + type: "/dydxprotocol.vest.VestEntry"; + value: VestEntryAmino; +} +/** + * VestEntry specifies a Vester Account and the rate at which tokens are + * dripped into the corresponding Treasury Account. + */ +export interface VestEntrySDKType { + vester_account: string; + treasury_account: string; + denom: string; + start_time: Date; + end_time: Date; +} +function createBaseVestEntry(): VestEntry { + return { + vesterAccount: "", + treasuryAccount: "", + denom: "", + startTime: new Date(), + endTime: new Date() + }; +} +export const VestEntry = { + typeUrl: "/dydxprotocol.vest.VestEntry", + encode(message: VestEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vesterAccount !== "") { + writer.uint32(10).string(message.vesterAccount); + } + if (message.treasuryAccount !== "") { + writer.uint32(18).string(message.treasuryAccount); + } + if (message.denom !== "") { + writer.uint32(26).string(message.denom); + } + if (message.startTime !== undefined) { + Timestamp.encode(toTimestamp(message.startTime), writer.uint32(34).fork()).ldelim(); + } + if (message.endTime !== undefined) { + Timestamp.encode(toTimestamp(message.endTime), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VestEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVestEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vesterAccount = reader.string(); + break; + case 2: + message.treasuryAccount = reader.string(); + break; + case 3: + message.denom = reader.string(); + break; + case 4: + message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.endTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VestEntry { + const message = createBaseVestEntry(); + message.vesterAccount = object.vesterAccount ?? ""; + message.treasuryAccount = object.treasuryAccount ?? ""; + message.denom = object.denom ?? ""; + message.startTime = object.startTime ?? undefined; + message.endTime = object.endTime ?? undefined; + return message; + }, + fromAmino(object: VestEntryAmino): VestEntry { + const message = createBaseVestEntry(); + if (object.vester_account !== undefined && object.vester_account !== null) { + message.vesterAccount = object.vester_account; + } + if (object.treasury_account !== undefined && object.treasury_account !== null) { + message.treasuryAccount = object.treasury_account; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + return message; + }, + toAmino(message: VestEntry): VestEntryAmino { + const obj: any = {}; + obj.vester_account = message.vesterAccount === "" ? undefined : message.vesterAccount; + obj.treasury_account = message.treasuryAccount === "" ? undefined : message.treasuryAccount; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; + return obj; + }, + fromAminoMsg(object: VestEntryAminoMsg): VestEntry { + return VestEntry.fromAmino(object.value); + }, + fromProtoMsg(message: VestEntryProtoMsg): VestEntry { + return VestEntry.decode(message.value); + }, + toProto(message: VestEntry): Uint8Array { + return VestEntry.encode(message).finish(); + }, + toProtoMsg(message: VestEntry): VestEntryProtoMsg { + return { + typeUrl: "/dydxprotocol.vest.VestEntry", + value: VestEntry.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/gogoproto/bundle.ts b/dydxjs/packages/dydxjs/src/gogoproto/bundle.ts new file mode 100644 index 00000000..84aedfc9 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/gogoproto/bundle.ts @@ -0,0 +1,5 @@ +//@ts-nocheck +import * as _189 from "./gogo"; +export const gogoproto = { + ..._189 +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/gogoproto/gogo.ts b/dydxjs/packages/dydxjs/src/gogoproto/gogo.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/gogoproto/gogo.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/api/annotations.ts b/dydxjs/packages/dydxjs/src/google/api/annotations.ts new file mode 100644 index 00000000..693da49f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/api/annotations.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/api/http.ts b/dydxjs/packages/dydxjs/src/google/api/http.ts new file mode 100644 index 00000000..5e2e9c8c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/api/http.ts @@ -0,0 +1,1352 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} +export interface HttpProtoMsg { + typeUrl: "/google.api.Http"; + value: Uint8Array; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpAmino { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules?: HttpRuleAmino[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion?: boolean; +} +export interface HttpAminoMsg { + type: "/google.api.Http"; + value: HttpAmino; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpSDKType { + rules: HttpRuleSDKType[]; + fully_decode_reserved_expansion: boolean; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPattern; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} +export interface HttpRuleProtoMsg { + typeUrl: "/google.api.HttpRule"; + value: Uint8Array; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleAmino { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector?: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPatternAmino; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body?: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + response_body?: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings?: HttpRuleAmino[]; +} +export interface HttpRuleAminoMsg { + type: "/google.api.HttpRule"; + value: HttpRuleAmino; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleSDKType { + selector: string; + get?: string; + put?: string; + post?: string; + delete?: string; + patch?: string; + custom?: CustomHttpPatternSDKType; + body: string; + response_body: string; + additional_bindings: HttpRuleSDKType[]; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} +export interface CustomHttpPatternProtoMsg { + typeUrl: "/google.api.CustomHttpPattern"; + value: Uint8Array; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternAmino { + /** The name of this custom HTTP verb. */ + kind?: string; + /** The path matched by this custom verb. */ + path?: string; +} +export interface CustomHttpPatternAminoMsg { + type: "/google.api.CustomHttpPattern"; + value: CustomHttpPatternAmino; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternSDKType { + kind: string; + path: string; +} +function createBaseHttp(): Http { + return { + rules: [], + fullyDecodeReservedExpansion: false + }; +} +export const Http = { + typeUrl: "/google.api.Http", + encode(message: Http, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Http { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; + return message; + }, + fromAmino(object: HttpAmino): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromAmino(e)) || []; + if (object.fully_decode_reserved_expansion !== undefined && object.fully_decode_reserved_expansion !== null) { + message.fullyDecodeReservedExpansion = object.fully_decode_reserved_expansion; + } + return message; + }, + toAmino(message: Http): HttpAmino { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map(e => e ? HttpRule.toAmino(e) : undefined); + } else { + obj.rules = message.rules; + } + obj.fully_decode_reserved_expansion = message.fullyDecodeReservedExpansion === false ? undefined : message.fullyDecodeReservedExpansion; + return obj; + }, + fromAminoMsg(object: HttpAminoMsg): Http { + return Http.fromAmino(object.value); + }, + fromProtoMsg(message: HttpProtoMsg): Http { + return Http.decode(message.value); + }, + toProto(message: Http): Uint8Array { + return Http.encode(message).finish(); + }, + toProtoMsg(message: Http): HttpProtoMsg { + return { + typeUrl: "/google.api.Http", + value: Http.encode(message).finish() + }; + } +}; +function createBaseHttpRule(): HttpRule { + return { + selector: "", + get: undefined, + put: undefined, + post: undefined, + delete: undefined, + patch: undefined, + custom: undefined, + body: "", + responseBody: "", + additionalBindings: [] + }; +} +export const HttpRule = { + typeUrl: "/google.api.HttpRule", + encode(message: HttpRule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ""; + message.get = object.get ?? undefined; + message.put = object.put ?? undefined; + message.post = object.post ?? undefined; + message.delete = object.delete ?? undefined; + message.patch = object.patch ?? undefined; + message.custom = object.custom !== undefined && object.custom !== null ? CustomHttpPattern.fromPartial(object.custom) : undefined; + message.body = object.body ?? ""; + message.responseBody = object.responseBody ?? ""; + message.additionalBindings = object.additionalBindings?.map(e => HttpRule.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HttpRuleAmino): HttpRule { + const message = createBaseHttpRule(); + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromAmino(object.custom); + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.responseBody = object.response_body; + } + message.additionalBindings = object.additional_bindings?.map(e => HttpRule.fromAmino(e)) || []; + return message; + }, + toAmino(message: HttpRule): HttpRuleAmino { + const obj: any = {}; + obj.selector = message.selector === "" ? undefined : message.selector; + obj.get = message.get === null ? undefined : message.get; + obj.put = message.put === null ? undefined : message.put; + obj.post = message.post === null ? undefined : message.post; + obj.delete = message.delete === null ? undefined : message.delete; + obj.patch = message.patch === null ? undefined : message.patch; + obj.custom = message.custom ? CustomHttpPattern.toAmino(message.custom) : undefined; + obj.body = message.body === "" ? undefined : message.body; + obj.response_body = message.responseBody === "" ? undefined : message.responseBody; + if (message.additionalBindings) { + obj.additional_bindings = message.additionalBindings.map(e => e ? HttpRule.toAmino(e) : undefined); + } else { + obj.additional_bindings = message.additionalBindings; + } + return obj; + }, + fromAminoMsg(object: HttpRuleAminoMsg): HttpRule { + return HttpRule.fromAmino(object.value); + }, + fromProtoMsg(message: HttpRuleProtoMsg): HttpRule { + return HttpRule.decode(message.value); + }, + toProto(message: HttpRule): Uint8Array { + return HttpRule.encode(message).finish(); + }, + toProtoMsg(message: HttpRule): HttpRuleProtoMsg { + return { + typeUrl: "/google.api.HttpRule", + value: HttpRule.encode(message).finish() + }; + } +}; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { + kind: "", + path: "" + }; +} +export const CustomHttpPattern = { + typeUrl: "/google.api.CustomHttpPattern", + encode(message: CustomHttpPattern, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ""; + message.path = object.path ?? ""; + return message; + }, + fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + return message; + }, + toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { + const obj: any = {}; + obj.kind = message.kind === "" ? undefined : message.kind; + obj.path = message.path === "" ? undefined : message.path; + return obj; + }, + fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern { + return CustomHttpPattern.fromAmino(object.value); + }, + fromProtoMsg(message: CustomHttpPatternProtoMsg): CustomHttpPattern { + return CustomHttpPattern.decode(message.value); + }, + toProto(message: CustomHttpPattern): Uint8Array { + return CustomHttpPattern.encode(message).finish(); + }, + toProtoMsg(message: CustomHttpPattern): CustomHttpPatternProtoMsg { + return { + typeUrl: "/google.api.CustomHttpPattern", + value: CustomHttpPattern.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/bundle.ts b/dydxjs/packages/dydxjs/src/google/bundle.ts new file mode 100644 index 00000000..dd7936ce --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/bundle.ts @@ -0,0 +1,15 @@ +//@ts-nocheck +import * as _190 from "./protobuf/any"; +import * as _191 from "./protobuf/descriptor"; +import * as _192 from "./protobuf/duration"; +import * as _193 from "./protobuf/empty"; +import * as _194 from "./protobuf/timestamp"; +export namespace google { + export const protobuf = { + ..._190, + ..._191, + ..._192, + ..._193, + ..._194 + }; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/protobuf/any.ts b/dydxjs/packages/dydxjs/src/google/protobuf/any.ts new file mode 100644 index 00000000..0998bb2e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/protobuf/any.ts @@ -0,0 +1,399 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + $typeUrl?: "/google.protobuf.Any" | string; + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} +export interface AnyProtoMsg { + typeUrl: "/google.protobuf.Any"; + value: Uint8Array; +} +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnyAmino { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + type: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: any; +} +export interface AnyAminoMsg { + type: string; + value: AnyAmino; +} +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnySDKType { + $typeUrl?: "/google.protobuf.Any" | string; + type_url: string; + value: Uint8Array; +} +function createBaseAny(): Any { + return { + $typeUrl: "/google.protobuf.Any", + typeUrl: "", + value: new Uint8Array() + }; +} +export const Any = { + typeUrl: "/google.protobuf.Any", + encode(message: Any, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: AnyAmino): Any { + return { + typeUrl: object.type, + value: object.value + }; + }, + toAmino(message: Any): AnyAmino { + const obj: any = {}; + obj.type = message.typeUrl; + obj.value = message.value; + return obj; + }, + fromAminoMsg(object: AnyAminoMsg): Any { + return Any.fromAmino(object.value); + }, + fromProtoMsg(message: AnyProtoMsg): Any { + return Any.decode(message.value); + }, + toProto(message: Any): Uint8Array { + return Any.encode(message).finish(); + }, + toProtoMsg(message: Any): AnyProtoMsg { + return { + typeUrl: "/google.protobuf.Any", + value: Any.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/protobuf/descriptor.ts b/dydxjs/packages/dydxjs/src/google/protobuf/descriptor.ts new file mode 100644 index 00000000..978d2daf --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/protobuf/descriptor.ts @@ -0,0 +1,5181 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_TypeSDKType = FieldDescriptorProto_Type; +export const FieldDescriptorProto_TypeAmino = FieldDescriptorProto_Type; +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} +export const FieldDescriptorProto_LabelSDKType = FieldDescriptorProto_Label; +export const FieldDescriptorProto_LabelAmino = FieldDescriptorProto_Label; +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} +export const FileOptions_OptimizeModeSDKType = FileOptions_OptimizeMode; +export const FileOptions_OptimizeModeAmino = FileOptions_OptimizeMode; +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_CTypeSDKType = FieldOptions_CType; +export const FieldOptions_CTypeAmino = FieldOptions_CType; +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} +export const FieldOptions_JSTypeSDKType = FieldOptions_JSType; +export const FieldOptions_JSTypeAmino = FieldOptions_JSType; +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} +export const MethodOptions_IdempotencyLevelSDKType = MethodOptions_IdempotencyLevel; +export const MethodOptions_IdempotencyLevelAmino = MethodOptions_IdempotencyLevel; +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} +export interface FileDescriptorSetProtoMsg { + typeUrl: "/google.protobuf.FileDescriptorSet"; + value: Uint8Array; +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSetAmino { + file?: FileDescriptorProtoAmino[]; +} +export interface FileDescriptorSetAminoMsg { + type: "/google.protobuf.FileDescriptorSet"; + value: FileDescriptorSetAmino; +} +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSetSDKType { + file: FileDescriptorProtoSDKType[]; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} +export interface FileDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.FileDescriptorProto"; + value: Uint8Array; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProtoAmino { + /** file name, relative to root of source tree */ + name?: string; + /** e.g. "foo", "foo.bar", etc. */ + package?: string; + /** Names of files imported by this file. */ + dependency?: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency?: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency?: number[]; + /** All top-level definitions in this file. */ + message_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + service?: ServiceDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; + options?: FileOptionsAmino; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + source_code_info?: SourceCodeInfoAmino; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax?: string; +} +export interface FileDescriptorProtoAminoMsg { + type: "/google.protobuf.FileDescriptorProto"; + value: FileDescriptorProtoAmino; +} +/** Describes a complete .proto file. */ +export interface FileDescriptorProtoSDKType { + name: string; + package: string; + dependency: string[]; + public_dependency: number[]; + weak_dependency: number[]; + message_type: DescriptorProtoSDKType[]; + enum_type: EnumDescriptorProtoSDKType[]; + service: ServiceDescriptorProtoSDKType[]; + extension: FieldDescriptorProtoSDKType[]; + options?: FileOptionsSDKType; + source_code_info?: SourceCodeInfoSDKType; + syntax: string; +} +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} +export interface DescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.DescriptorProto"; + value: Uint8Array; +} +/** Describes a message type. */ +export interface DescriptorProtoAmino { + name?: string; + field?: FieldDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; + nested_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + extension_range?: DescriptorProto_ExtensionRangeAmino[]; + oneof_decl?: OneofDescriptorProtoAmino[]; + options?: MessageOptionsAmino; + reserved_range?: DescriptorProto_ReservedRangeAmino[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name?: string[]; +} +export interface DescriptorProtoAminoMsg { + type: "/google.protobuf.DescriptorProto"; + value: DescriptorProtoAmino; +} +/** Describes a message type. */ +export interface DescriptorProtoSDKType { + name: string; + field: FieldDescriptorProtoSDKType[]; + extension: FieldDescriptorProtoSDKType[]; + nested_type: DescriptorProtoSDKType[]; + enum_type: EnumDescriptorProtoSDKType[]; + extension_range: DescriptorProto_ExtensionRangeSDKType[]; + oneof_decl: OneofDescriptorProtoSDKType[]; + options?: MessageOptionsSDKType; + reserved_range: DescriptorProto_ReservedRangeSDKType[]; + reserved_name: string[]; +} +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptions; +} +export interface DescriptorProto_ExtensionRangeProtoMsg { + typeUrl: "/google.protobuf.ExtensionRange"; + value: Uint8Array; +} +export interface DescriptorProto_ExtensionRangeAmino { + /** Inclusive. */ + start?: number; + /** Exclusive. */ + end?: number; + options?: ExtensionRangeOptionsAmino; +} +export interface DescriptorProto_ExtensionRangeAminoMsg { + type: "/google.protobuf.ExtensionRange"; + value: DescriptorProto_ExtensionRangeAmino; +} +export interface DescriptorProto_ExtensionRangeSDKType { + start: number; + end: number; + options?: ExtensionRangeOptionsSDKType; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} +export interface DescriptorProto_ReservedRangeProtoMsg { + typeUrl: "/google.protobuf.ReservedRange"; + value: Uint8Array; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRangeAmino { + /** Inclusive. */ + start?: number; + /** Exclusive. */ + end?: number; +} +export interface DescriptorProto_ReservedRangeAminoMsg { + type: "/google.protobuf.ReservedRange"; + value: DescriptorProto_ReservedRangeAmino; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRangeSDKType { + start: number; + end: number; +} +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ExtensionRangeOptionsProtoMsg { + typeUrl: "/google.protobuf.ExtensionRangeOptions"; + value: Uint8Array; +} +export interface ExtensionRangeOptionsAmino { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface ExtensionRangeOptionsAminoMsg { + type: "/google.protobuf.ExtensionRangeOptions"; + value: ExtensionRangeOptionsAmino; +} +export interface ExtensionRangeOptionsSDKType { + uninterpreted_option: UninterpretedOptionSDKType[]; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: FieldOptions; +} +export interface FieldDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.FieldDescriptorProto"; + value: Uint8Array; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProtoAmino { + name?: string; + number?: number; + label?: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type?: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + type_name?: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee?: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + default_value?: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index?: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + json_name?: string; + options?: FieldOptionsAmino; +} +export interface FieldDescriptorProtoAminoMsg { + type: "/google.protobuf.FieldDescriptorProto"; + value: FieldDescriptorProtoAmino; +} +/** Describes a field within a message. */ +export interface FieldDescriptorProtoSDKType { + name: string; + number: number; + label: FieldDescriptorProto_Label; + type: FieldDescriptorProto_Type; + type_name: string; + extendee: string; + default_value: string; + oneof_index: number; + json_name: string; + options?: FieldOptionsSDKType; +} +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} +export interface OneofDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.OneofDescriptorProto"; + value: Uint8Array; +} +/** Describes a oneof. */ +export interface OneofDescriptorProtoAmino { + name?: string; + options?: OneofOptionsAmino; +} +export interface OneofDescriptorProtoAminoMsg { + type: "/google.protobuf.OneofDescriptorProto"; + value: OneofDescriptorProtoAmino; +} +/** Describes a oneof. */ +export interface OneofDescriptorProtoSDKType { + name: string; + options?: OneofOptionsSDKType; +} +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} +export interface EnumDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.EnumDescriptorProto"; + value: Uint8Array; +} +/** Describes an enum type. */ +export interface EnumDescriptorProtoAmino { + name?: string; + value?: EnumValueDescriptorProtoAmino[]; + options?: EnumOptionsAmino; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reserved_range?: EnumDescriptorProto_EnumReservedRangeAmino[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name?: string[]; +} +export interface EnumDescriptorProtoAminoMsg { + type: "/google.protobuf.EnumDescriptorProto"; + value: EnumDescriptorProtoAmino; +} +/** Describes an enum type. */ +export interface EnumDescriptorProtoSDKType { + name: string; + value: EnumValueDescriptorProtoSDKType[]; + options?: EnumOptionsSDKType; + reserved_range: EnumDescriptorProto_EnumReservedRangeSDKType[]; + reserved_name: string[]; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} +export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { + typeUrl: "/google.protobuf.EnumReservedRange"; + value: Uint8Array; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRangeAmino { + /** Inclusive. */ + start?: number; + /** Inclusive. */ + end?: number; +} +export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { + type: "/google.protobuf.EnumReservedRange"; + value: EnumDescriptorProto_EnumReservedRangeAmino; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRangeSDKType { + start: number; + end: number; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} +export interface EnumValueDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.EnumValueDescriptorProto"; + value: Uint8Array; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProtoAmino { + name?: string; + number?: number; + options?: EnumValueOptionsAmino; +} +export interface EnumValueDescriptorProtoAminoMsg { + type: "/google.protobuf.EnumValueDescriptorProto"; + value: EnumValueDescriptorProtoAmino; +} +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProtoSDKType { + name: string; + number: number; + options?: EnumValueOptionsSDKType; +} +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} +export interface ServiceDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.ServiceDescriptorProto"; + value: Uint8Array; +} +/** Describes a service. */ +export interface ServiceDescriptorProtoAmino { + name?: string; + method?: MethodDescriptorProtoAmino[]; + options?: ServiceOptionsAmino; +} +export interface ServiceDescriptorProtoAminoMsg { + type: "/google.protobuf.ServiceDescriptorProto"; + value: ServiceDescriptorProtoAmino; +} +/** Describes a service. */ +export interface ServiceDescriptorProtoSDKType { + name: string; + method: MethodDescriptorProtoSDKType[]; + options?: ServiceOptionsSDKType; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} +export interface MethodDescriptorProtoProtoMsg { + typeUrl: "/google.protobuf.MethodDescriptorProto"; + value: Uint8Array; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProtoAmino { + name?: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type?: string; + output_type?: string; + options?: MethodOptionsAmino; + /** Identifies if client streams multiple client messages */ + client_streaming?: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming?: boolean; +} +export interface MethodDescriptorProtoAminoMsg { + type: "/google.protobuf.MethodDescriptorProto"; + value: MethodDescriptorProtoAmino; +} +/** Describes a method of a service. */ +export interface MethodDescriptorProtoSDKType { + name: string; + input_type: string; + output_type: string; + options?: MethodOptionsSDKType; + client_streaming: boolean; + server_streaming: boolean; +} +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + javaOuterClassname: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** This option does nothing. */ + /** @deprecated */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FileOptionsProtoMsg { + typeUrl: "/google.protobuf.FileOptions"; + value: Uint8Array; +} +export interface FileOptionsAmino { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + java_package?: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + java_outer_classname?: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + java_multiple_files?: boolean; + /** This option does nothing. */ + /** @deprecated */ + java_generate_equals_and_hash?: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + java_string_check_utf8?: boolean; + optimize_for?: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + go_package?: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated?: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas?: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix?: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace?: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swift_prefix?: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix?: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + php_namespace?: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + php_metadata_namespace?: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + ruby_package?: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface FileOptionsAminoMsg { + type: "/google.protobuf.FileOptions"; + value: FileOptionsAmino; +} +export interface FileOptionsSDKType { + java_package: string; + java_outer_classname: string; + java_multiple_files: boolean; + /** @deprecated */ + java_generate_equals_and_hash: boolean; + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + go_package: string; + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + deprecated: boolean; + cc_enable_arenas: boolean; + objc_class_prefix: string; + csharp_namespace: string; + swift_prefix: string; + php_class_prefix: string; + php_namespace: string; + php_metadata_namespace: string; + ruby_package: string; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MessageOptionsProtoMsg { + typeUrl: "/google.protobuf.MessageOptions"; + value: Uint8Array; +} +export interface MessageOptionsAmino { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + message_set_wire_format?: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + no_standard_descriptor_accessor?: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated?: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + map_entry?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface MessageOptionsAminoMsg { + type: "/google.protobuf.MessageOptions"; + value: MessageOptionsAmino; +} +export interface MessageOptionsSDKType { + message_set_wire_format: boolean; + no_standard_descriptor_accessor: boolean; + deprecated: boolean; + map_entry: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface FieldOptionsProtoMsg { + typeUrl: "/google.protobuf.FieldOptions"; + value: Uint8Array; +} +export interface FieldOptionsAmino { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype?: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed?: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype?: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy?: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated?: boolean; + /** For Google-internal migration only. Do not use. */ + weak?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface FieldOptionsAminoMsg { + type: "/google.protobuf.FieldOptions"; + value: FieldOptionsAmino; +} +export interface FieldOptionsSDKType { + ctype: FieldOptions_CType; + packed: boolean; + jstype: FieldOptions_JSType; + lazy: boolean; + deprecated: boolean; + weak: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface OneofOptionsProtoMsg { + typeUrl: "/google.protobuf.OneofOptions"; + value: Uint8Array; +} +export interface OneofOptionsAmino { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface OneofOptionsAminoMsg { + type: "/google.protobuf.OneofOptions"; + value: OneofOptionsAmino; +} +export interface OneofOptionsSDKType { + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumOptionsProtoMsg { + typeUrl: "/google.protobuf.EnumOptions"; + value: Uint8Array; +} +export interface EnumOptionsAmino { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias?: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface EnumOptionsAminoMsg { + type: "/google.protobuf.EnumOptions"; + value: EnumOptionsAmino; +} +export interface EnumOptionsSDKType { + allow_alias: boolean; + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface EnumValueOptionsProtoMsg { + typeUrl: "/google.protobuf.EnumValueOptions"; + value: Uint8Array; +} +export interface EnumValueOptionsAmino { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface EnumValueOptionsAminoMsg { + type: "/google.protobuf.EnumValueOptions"; + value: EnumValueOptionsAmino; +} +export interface EnumValueOptionsSDKType { + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface ServiceOptionsProtoMsg { + typeUrl: "/google.protobuf.ServiceOptions"; + value: Uint8Array; +} +export interface ServiceOptionsAmino { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated?: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface ServiceOptionsAminoMsg { + type: "/google.protobuf.ServiceOptions"; + value: ServiceOptionsAmino; +} +export interface ServiceOptionsSDKType { + deprecated: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} +export interface MethodOptionsProtoMsg { + typeUrl: "/google.protobuf.MethodOptions"; + value: Uint8Array; +} +export interface MethodOptionsAmino { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated?: boolean; + idempotency_level?: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option?: UninterpretedOptionAmino[]; +} +export interface MethodOptionsAminoMsg { + type: "/google.protobuf.MethodOptions"; + value: MethodOptionsAmino; +} +export interface MethodOptionsSDKType { + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: bigint; + negativeIntValue: bigint; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} +export interface UninterpretedOptionProtoMsg { + typeUrl: "/google.protobuf.UninterpretedOption"; + value: Uint8Array; +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOptionAmino { + name?: UninterpretedOption_NamePartAmino[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value?: string; + positive_int_value?: string; + negative_int_value?: string; + double_value?: number; + string_value?: string; + aggregate_value?: string; +} +export interface UninterpretedOptionAminoMsg { + type: "/google.protobuf.UninterpretedOption"; + value: UninterpretedOptionAmino; +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOptionSDKType { + name: UninterpretedOption_NamePartSDKType[]; + identifier_value: string; + positive_int_value: bigint; + negative_int_value: bigint; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} +export interface UninterpretedOption_NamePartProtoMsg { + typeUrl: "/google.protobuf.NamePart"; + value: Uint8Array; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePartAmino { + name_part?: string; + is_extension?: boolean; +} +export interface UninterpretedOption_NamePartAminoMsg { + type: "/google.protobuf.NamePart"; + value: UninterpretedOption_NamePartAmino; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePartSDKType { + name_part: string; + is_extension: boolean; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} +export interface SourceCodeInfoProtoMsg { + typeUrl: "/google.protobuf.SourceCodeInfo"; + value: Uint8Array; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoAmino { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location?: SourceCodeInfo_LocationAmino[]; +} +export interface SourceCodeInfoAminoMsg { + type: "/google.protobuf.SourceCodeInfo"; + value: SourceCodeInfoAmino; +} +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoSDKType { + location: SourceCodeInfo_LocationSDKType[]; +} +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} +export interface SourceCodeInfo_LocationProtoMsg { + typeUrl: "/google.protobuf.Location"; + value: Uint8Array; +} +export interface SourceCodeInfo_LocationAmino { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path?: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span?: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments?: string[]; +} +export interface SourceCodeInfo_LocationAminoMsg { + type: "/google.protobuf.Location"; + value: SourceCodeInfo_LocationAmino; +} +export interface SourceCodeInfo_LocationSDKType { + path: number[]; + span: number[]; + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} +export interface GeneratedCodeInfoProtoMsg { + typeUrl: "/google.protobuf.GeneratedCodeInfo"; + value: Uint8Array; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfoAmino { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation?: GeneratedCodeInfo_AnnotationAmino[]; +} +export interface GeneratedCodeInfoAminoMsg { + type: "/google.protobuf.GeneratedCodeInfo"; + value: GeneratedCodeInfoAmino; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfoSDKType { + annotation: GeneratedCodeInfo_AnnotationSDKType[]; +} +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} +export interface GeneratedCodeInfo_AnnotationProtoMsg { + typeUrl: "/google.protobuf.Annotation"; + value: Uint8Array; +} +export interface GeneratedCodeInfo_AnnotationAmino { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path?: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file?: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin?: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end?: number; +} +export interface GeneratedCodeInfo_AnnotationAminoMsg { + type: "/google.protobuf.Annotation"; + value: GeneratedCodeInfo_AnnotationAmino; +} +export interface GeneratedCodeInfo_AnnotationSDKType { + path: number[]; + source_file: string; + begin: number; + end: number; +} +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { + file: [] + }; +} +export const FileDescriptorSet = { + typeUrl: "/google.protobuf.FileDescriptorSet", + encode(message: FileDescriptorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); + } else { + obj.file = message.file; + } + return obj; + }, + fromAminoMsg(object: FileDescriptorSetAminoMsg): FileDescriptorSet { + return FileDescriptorSet.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorSetProtoMsg): FileDescriptorSet { + return FileDescriptorSet.decode(message.value); + }, + toProto(message: FileDescriptorSet): Uint8Array { + return FileDescriptorSet.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorSet): FileDescriptorSetProtoMsg { + return { + typeUrl: "/google.protobuf.FileDescriptorSet", + value: FileDescriptorSet.encode(message).finish() + }; + } +}; +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: "", + package: "", + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: "" + }; +} +export const FileDescriptorProto = { + typeUrl: "/google.protobuf.FileDescriptorProto", + encode(message: FileDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ""; + message.package = object.package ?? ""; + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.publicDependency?.map(e => e) || []; + message.weakDependency = object.weakDependency?.map(e => e) || []; + message.messageType = object.messageType?.map(e => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? FileOptions.fromPartial(object.options) : undefined; + message.sourceCodeInfo = object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) : undefined; + message.syntax = object.syntax ?? ""; + return message; + }, + fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.public_dependency?.map(e => e) || []; + message.weakDependency = object.weak_dependency?.map(e => e) || []; + message.messageType = object.message_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromAmino(object.options); + } + if (object.source_code_info !== undefined && object.source_code_info !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromAmino(object.source_code_info); + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } + return message; + }, + toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.package = message.package === "" ? undefined : message.package; + if (message.dependency) { + obj.dependency = message.dependency.map(e => e); + } else { + obj.dependency = message.dependency; + } + if (message.publicDependency) { + obj.public_dependency = message.publicDependency.map(e => e); + } else { + obj.public_dependency = message.publicDependency; + } + if (message.weakDependency) { + obj.weak_dependency = message.weakDependency.map(e => e); + } else { + obj.weak_dependency = message.weakDependency; + } + if (message.messageType) { + obj.message_type = message.messageType.map(e => e ? DescriptorProto.toAmino(e) : undefined); + } else { + obj.message_type = message.messageType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); + } else { + obj.enum_type = message.enumType; + } + if (message.service) { + obj.service = message.service.map(e => e ? ServiceDescriptorProto.toAmino(e) : undefined); + } else { + obj.service = message.service; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.extension = message.extension; + } + obj.options = message.options ? FileOptions.toAmino(message.options) : undefined; + obj.source_code_info = message.sourceCodeInfo ? SourceCodeInfo.toAmino(message.sourceCodeInfo) : undefined; + obj.syntax = message.syntax === "" ? undefined : message.syntax; + return obj; + }, + fromAminoMsg(object: FileDescriptorProtoAminoMsg): FileDescriptorProto { + return FileDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FileDescriptorProtoProtoMsg): FileDescriptorProto { + return FileDescriptorProto.decode(message.value); + }, + toProto(message: FileDescriptorProto): Uint8Array { + return FileDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorProto): FileDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.FileDescriptorProto", + value: FileDescriptorProto.encode(message).finish() + }; + } +}; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [] + }; +} +export const DescriptorProto = { + typeUrl: "/google.protobuf.DescriptorProto", + encode(message: DescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ""; + message.field = object.field?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = object.nestedType?.map(e => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map(e => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = object.extensionRange?.map(e => DescriptorProto_ExtensionRange.fromPartial(e)) || []; + message.oneofDecl = object.oneofDecl?.map(e => OneofDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? MessageOptions.fromPartial(object.options) : undefined; + message.reservedRange = object.reservedRange?.map(e => DescriptorProto_ReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map(e => e) || []; + return message; + }, + fromAmino(object: DescriptorProtoAmino): DescriptorProto { + const message = createBaseDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.field = object.field?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.nestedType = object.nested_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.extensionRange = object.extension_range?.map(e => DescriptorProto_ExtensionRange.fromAmino(e)) || []; + message.oneofDecl = object.oneof_decl?.map(e => OneofDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => DescriptorProto_ReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; + }, + toAmino(message: DescriptorProto): DescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.field) { + obj.field = message.field.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.field = message.field; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); + } else { + obj.extension = message.extension; + } + if (message.nestedType) { + obj.nested_type = message.nestedType.map(e => e ? DescriptorProto.toAmino(e) : undefined); + } else { + obj.nested_type = message.nestedType; + } + if (message.enumType) { + obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); + } else { + obj.enum_type = message.enumType; + } + if (message.extensionRange) { + obj.extension_range = message.extensionRange.map(e => e ? DescriptorProto_ExtensionRange.toAmino(e) : undefined); + } else { + obj.extension_range = message.extensionRange; + } + if (message.oneofDecl) { + obj.oneof_decl = message.oneofDecl.map(e => e ? OneofDescriptorProto.toAmino(e) : undefined); + } else { + obj.oneof_decl = message.oneofDecl; + } + obj.options = message.options ? MessageOptions.toAmino(message.options) : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map(e => e ? DescriptorProto_ReservedRange.toAmino(e) : undefined); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map(e => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: DescriptorProtoAminoMsg): DescriptorProto { + return DescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProtoProtoMsg): DescriptorProto { + return DescriptorProto.decode(message.value); + }, + toProto(message: DescriptorProto): Uint8Array { + return DescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto): DescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.DescriptorProto", + value: DescriptorProto.encode(message).finish() + }; + } +}; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { + start: 0, + end: 0, + options: undefined + }; +} +export const DescriptorProto_ExtensionRange = { + typeUrl: "/google.protobuf.ExtensionRange", + encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = object.options !== undefined && object.options !== null ? ExtensionRangeOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: DescriptorProto_ExtensionRangeAmino): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + obj.options = message.options ? ExtensionRangeOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: DescriptorProto_ExtensionRangeAminoMsg): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProto_ExtensionRangeProtoMsg): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.decode(message.value); + }, + toProto(message: DescriptorProto_ExtensionRange): Uint8Array { + return DescriptorProto_ExtensionRange.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeProtoMsg { + return { + typeUrl: "/google.protobuf.ExtensionRange", + value: DescriptorProto_ExtensionRange.encode(message).finish() + }; + } +}; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { + start: 0, + end: 0 + }; +} +export const DescriptorProto_ReservedRange = { + typeUrl: "/google.protobuf.ReservedRange", + encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino(object: DescriptorProto_ReservedRangeAmino): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg(object: DescriptorProto_ReservedRangeAminoMsg): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromAmino(object.value); + }, + fromProtoMsg(message: DescriptorProto_ReservedRangeProtoMsg): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.decode(message.value); + }, + toProto(message: DescriptorProto_ReservedRange): Uint8Array { + return DescriptorProto_ReservedRange.encode(message).finish(); + }, + toProtoMsg(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeProtoMsg { + return { + typeUrl: "/google.protobuf.ReservedRange", + value: DescriptorProto_ReservedRange.encode(message).finish() + }; + } +}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { + uninterpretedOption: [] + }; +} +export const ExtensionRangeOptions = { + typeUrl: "/google.protobuf.ExtensionRangeOptions", + encode(message: ExtensionRangeOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: ExtensionRangeOptionsAminoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ExtensionRangeOptionsProtoMsg): ExtensionRangeOptions { + return ExtensionRangeOptions.decode(message.value); + }, + toProto(message: ExtensionRangeOptions): Uint8Array { + return ExtensionRangeOptions.encode(message).finish(); + }, + toProtoMsg(message: ExtensionRangeOptions): ExtensionRangeOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.ExtensionRangeOptions", + value: ExtensionRangeOptions.encode(message).finish() + }; + } +}; +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + options: undefined + }; +} +export const FieldDescriptorProto = { + typeUrl: "/google.protobuf.FieldDescriptorProto", + encode(message: FieldDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ""; + message.extendee = object.extendee ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ""; + message.options = object.options !== undefined && object.options !== null ? FieldOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.typeName = object.type_name; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneofIndex = object.oneof_index; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.jsonName = object.json_name; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.label = message.label === 1 ? undefined : message.label; + obj.type = message.type === 1 ? undefined : message.type; + obj.type_name = message.typeName === "" ? undefined : message.typeName; + obj.extendee = message.extendee === "" ? undefined : message.extendee; + obj.default_value = message.defaultValue === "" ? undefined : message.defaultValue; + obj.oneof_index = message.oneofIndex === 0 ? undefined : message.oneofIndex; + obj.json_name = message.jsonName === "" ? undefined : message.jsonName; + obj.options = message.options ? FieldOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: FieldDescriptorProtoAminoMsg): FieldDescriptorProto { + return FieldDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: FieldDescriptorProtoProtoMsg): FieldDescriptorProto { + return FieldDescriptorProto.decode(message.value); + }, + toProto(message: FieldDescriptorProto): Uint8Array { + return FieldDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: FieldDescriptorProto): FieldDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.FieldDescriptorProto", + value: FieldDescriptorProto.encode(message).finish() + }; + } +}; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { + name: "", + options: undefined + }; +} +export const OneofDescriptorProto = { + typeUrl: "/google.protobuf.OneofDescriptorProto", + encode(message: OneofDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ""; + message.options = object.options !== undefined && object.options !== null ? OneofOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.options = message.options ? OneofOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: OneofDescriptorProtoAminoMsg): OneofDescriptorProto { + return OneofDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: OneofDescriptorProtoProtoMsg): OneofDescriptorProto { + return OneofDescriptorProto.decode(message.value); + }, + toProto(message: OneofDescriptorProto): Uint8Array { + return OneofDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: OneofDescriptorProto): OneofDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.OneofDescriptorProto", + value: OneofDescriptorProto.encode(message).finish() + }; + } +}; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { + name: "", + value: [], + options: undefined, + reservedRange: [], + reservedName: [] + }; +} +export const EnumDescriptorProto = { + typeUrl: "/google.protobuf.EnumDescriptorProto", + encode(message: EnumDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ""; + message.value = object.value?.map(e => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? EnumOptions.fromPartial(object.options) : undefined; + message.reservedRange = object.reservedRange?.map(e => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map(e => e) || []; + return message; + }, + fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.value = object.value?.map(e => EnumValueDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; + }, + toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.value) { + obj.value = message.value.map(e => e ? EnumValueDescriptorProto.toAmino(e) : undefined); + } else { + obj.value = message.value; + } + obj.options = message.options ? EnumOptions.toAmino(message.options) : undefined; + if (message.reservedRange) { + obj.reserved_range = message.reservedRange.map(e => e ? EnumDescriptorProto_EnumReservedRange.toAmino(e) : undefined); + } else { + obj.reserved_range = message.reservedRange; + } + if (message.reservedName) { + obj.reserved_name = message.reservedName.map(e => e); + } else { + obj.reserved_name = message.reservedName; + } + return obj; + }, + fromAminoMsg(object: EnumDescriptorProtoAminoMsg): EnumDescriptorProto { + return EnumDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: EnumDescriptorProtoProtoMsg): EnumDescriptorProto { + return EnumDescriptorProto.decode(message.value); + }, + toProto(message: EnumDescriptorProto): Uint8Array { + return EnumDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: EnumDescriptorProto): EnumDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.EnumDescriptorProto", + value: EnumDescriptorProto.encode(message).finish() + }; + } +}; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { + start: 0, + end: 0 + }; +} +export const EnumDescriptorProto_EnumReservedRange = { + typeUrl: "/google.protobuf.EnumReservedRange", + encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino(object: EnumDescriptorProto_EnumReservedRangeAmino): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeAmino { + const obj: any = {}; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg(object: EnumDescriptorProto_EnumReservedRangeAminoMsg): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromAmino(object.value); + }, + fromProtoMsg(message: EnumDescriptorProto_EnumReservedRangeProtoMsg): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.decode(message.value); + }, + toProto(message: EnumDescriptorProto_EnumReservedRange): Uint8Array { + return EnumDescriptorProto_EnumReservedRange.encode(message).finish(); + }, + toProtoMsg(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeProtoMsg { + return { + typeUrl: "/google.protobuf.EnumReservedRange", + value: EnumDescriptorProto_EnumReservedRange.encode(message).finish() + }; + } +}; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { + name: "", + number: 0, + options: undefined + }; +} +export const EnumValueDescriptorProto = { + typeUrl: "/google.protobuf.EnumValueDescriptorProto", + encode(message: EnumValueDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.options = object.options !== undefined && object.options !== null ? EnumValueOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.options = message.options ? EnumValueOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: EnumValueDescriptorProtoAminoMsg): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: EnumValueDescriptorProtoProtoMsg): EnumValueDescriptorProto { + return EnumValueDescriptorProto.decode(message.value); + }, + toProto(message: EnumValueDescriptorProto): Uint8Array { + return EnumValueDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: EnumValueDescriptorProto): EnumValueDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.EnumValueDescriptorProto", + value: EnumValueDescriptorProto.encode(message).finish() + }; + } +}; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { + name: "", + method: [], + options: undefined + }; +} +export const ServiceDescriptorProto = { + typeUrl: "/google.protobuf.ServiceDescriptorProto", + encode(message: ServiceDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ""; + message.method = object.method?.map(e => MethodDescriptorProto.fromPartial(e)) || []; + message.options = object.options !== undefined && object.options !== null ? ServiceOptions.fromPartial(object.options) : undefined; + return message; + }, + fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.method = object.method?.map(e => MethodDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.method) { + obj.method = message.method.map(e => e ? MethodDescriptorProto.toAmino(e) : undefined); + } else { + obj.method = message.method; + } + obj.options = message.options ? ServiceOptions.toAmino(message.options) : undefined; + return obj; + }, + fromAminoMsg(object: ServiceDescriptorProtoAminoMsg): ServiceDescriptorProto { + return ServiceDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceDescriptorProtoProtoMsg): ServiceDescriptorProto { + return ServiceDescriptorProto.decode(message.value); + }, + toProto(message: ServiceDescriptorProto): Uint8Array { + return ServiceDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: ServiceDescriptorProto): ServiceDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.ServiceDescriptorProto", + value: ServiceDescriptorProto.encode(message).finish() + }; + } +}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false + }; +} +export const MethodDescriptorProto = { + typeUrl: "/google.protobuf.MethodDescriptorProto", + encode(message: MethodDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ""; + message.inputType = object.inputType ?? ""; + message.outputType = object.outputType ?? ""; + message.options = object.options !== undefined && object.options !== null ? MethodOptions.fromPartial(object.options) : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, + fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.inputType = object.input_type; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.outputType = object.output_type; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromAmino(object.options); + } + if (object.client_streaming !== undefined && object.client_streaming !== null) { + message.clientStreaming = object.client_streaming; + } + if (object.server_streaming !== undefined && object.server_streaming !== null) { + message.serverStreaming = object.server_streaming; + } + return message; + }, + toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.input_type = message.inputType === "" ? undefined : message.inputType; + obj.output_type = message.outputType === "" ? undefined : message.outputType; + obj.options = message.options ? MethodOptions.toAmino(message.options) : undefined; + obj.client_streaming = message.clientStreaming === false ? undefined : message.clientStreaming; + obj.server_streaming = message.serverStreaming === false ? undefined : message.serverStreaming; + return obj; + }, + fromAminoMsg(object: MethodDescriptorProtoAminoMsg): MethodDescriptorProto { + return MethodDescriptorProto.fromAmino(object.value); + }, + fromProtoMsg(message: MethodDescriptorProtoProtoMsg): MethodDescriptorProto { + return MethodDescriptorProto.decode(message.value); + }, + toProto(message: MethodDescriptorProto): Uint8Array { + return MethodDescriptorProto.encode(message).finish(); + }, + toProtoMsg(message: MethodDescriptorProto): MethodDescriptorProtoProtoMsg { + return { + typeUrl: "/google.protobuf.MethodDescriptorProto", + value: MethodDescriptorProto.encode(message).finish() + }; + } +}; +function createBaseFileOptions(): FileOptions { + return { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", + uninterpretedOption: [] + }; +} +export const FileOptions = { + typeUrl: "/google.protobuf.FileOptions", + encode(message: FileOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32() as any; + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ""; + message.javaOuterClassname = object.javaOuterClassname ?? ""; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ""; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.phpGenericServices = object.phpGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? false; + message.objcClassPrefix = object.objcClassPrefix ?? ""; + message.csharpNamespace = object.csharpNamespace ?? ""; + message.swiftPrefix = object.swiftPrefix ?? ""; + message.phpClassPrefix = object.phpClassPrefix ?? ""; + message.phpNamespace = object.phpNamespace ?? ""; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; + message.rubyPackage = object.rubyPackage ?? ""; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileOptionsAmino): FileOptions { + const message = createBaseFileOptions(); + if (object.java_package !== undefined && object.java_package !== null) { + message.javaPackage = object.java_package; + } + if (object.java_outer_classname !== undefined && object.java_outer_classname !== null) { + message.javaOuterClassname = object.java_outer_classname; + } + if (object.java_multiple_files !== undefined && object.java_multiple_files !== null) { + message.javaMultipleFiles = object.java_multiple_files; + } + if (object.java_generate_equals_and_hash !== undefined && object.java_generate_equals_and_hash !== null) { + message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; + } + if (object.java_string_check_utf8 !== undefined && object.java_string_check_utf8 !== null) { + message.javaStringCheckUtf8 = object.java_string_check_utf8; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimizeFor = object.optimize_for; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.goPackage = object.go_package; + } + if (object.cc_generic_services !== undefined && object.cc_generic_services !== null) { + message.ccGenericServices = object.cc_generic_services; + } + if (object.java_generic_services !== undefined && object.java_generic_services !== null) { + message.javaGenericServices = object.java_generic_services; + } + if (object.py_generic_services !== undefined && object.py_generic_services !== null) { + message.pyGenericServices = object.py_generic_services; + } + if (object.php_generic_services !== undefined && object.php_generic_services !== null) { + message.phpGenericServices = object.php_generic_services; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.cc_enable_arenas !== undefined && object.cc_enable_arenas !== null) { + message.ccEnableArenas = object.cc_enable_arenas; + } + if (object.objc_class_prefix !== undefined && object.objc_class_prefix !== null) { + message.objcClassPrefix = object.objc_class_prefix; + } + if (object.csharp_namespace !== undefined && object.csharp_namespace !== null) { + message.csharpNamespace = object.csharp_namespace; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swiftPrefix = object.swift_prefix; + } + if (object.php_class_prefix !== undefined && object.php_class_prefix !== null) { + message.phpClassPrefix = object.php_class_prefix; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.phpNamespace = object.php_namespace; + } + if (object.php_metadata_namespace !== undefined && object.php_metadata_namespace !== null) { + message.phpMetadataNamespace = object.php_metadata_namespace; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.rubyPackage = object.ruby_package; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileOptions): FileOptionsAmino { + const obj: any = {}; + obj.java_package = message.javaPackage === "" ? undefined : message.javaPackage; + obj.java_outer_classname = message.javaOuterClassname === "" ? undefined : message.javaOuterClassname; + obj.java_multiple_files = message.javaMultipleFiles === false ? undefined : message.javaMultipleFiles; + obj.java_generate_equals_and_hash = message.javaGenerateEqualsAndHash === false ? undefined : message.javaGenerateEqualsAndHash; + obj.java_string_check_utf8 = message.javaStringCheckUtf8 === false ? undefined : message.javaStringCheckUtf8; + obj.optimize_for = message.optimizeFor === 1 ? undefined : message.optimizeFor; + obj.go_package = message.goPackage === "" ? undefined : message.goPackage; + obj.cc_generic_services = message.ccGenericServices === false ? undefined : message.ccGenericServices; + obj.java_generic_services = message.javaGenericServices === false ? undefined : message.javaGenericServices; + obj.py_generic_services = message.pyGenericServices === false ? undefined : message.pyGenericServices; + obj.php_generic_services = message.phpGenericServices === false ? undefined : message.phpGenericServices; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.cc_enable_arenas = message.ccEnableArenas === false ? undefined : message.ccEnableArenas; + obj.objc_class_prefix = message.objcClassPrefix === "" ? undefined : message.objcClassPrefix; + obj.csharp_namespace = message.csharpNamespace === "" ? undefined : message.csharpNamespace; + obj.swift_prefix = message.swiftPrefix === "" ? undefined : message.swiftPrefix; + obj.php_class_prefix = message.phpClassPrefix === "" ? undefined : message.phpClassPrefix; + obj.php_namespace = message.phpNamespace === "" ? undefined : message.phpNamespace; + obj.php_metadata_namespace = message.phpMetadataNamespace === "" ? undefined : message.phpMetadataNamespace; + obj.ruby_package = message.rubyPackage === "" ? undefined : message.rubyPackage; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FileOptionsAminoMsg): FileOptions { + return FileOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FileOptionsProtoMsg): FileOptions { + return FileOptions.decode(message.value); + }, + toProto(message: FileOptions): Uint8Array { + return FileOptions.encode(message).finish(); + }, + toProtoMsg(message: FileOptions): FileOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.FileOptions", + value: FileOptions.encode(message).finish() + }; + } +}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [] + }; +} +export const MessageOptions = { + typeUrl: "/google.protobuf.MessageOptions", + encode(message: MessageOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MessageOptionsAmino): MessageOptions { + const message = createBaseMessageOptions(); + if (object.message_set_wire_format !== undefined && object.message_set_wire_format !== null) { + message.messageSetWireFormat = object.message_set_wire_format; + } + if (object.no_standard_descriptor_accessor !== undefined && object.no_standard_descriptor_accessor !== null) { + message.noStandardDescriptorAccessor = object.no_standard_descriptor_accessor; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.mapEntry = object.map_entry; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: MessageOptions): MessageOptionsAmino { + const obj: any = {}; + obj.message_set_wire_format = message.messageSetWireFormat === false ? undefined : message.messageSetWireFormat; + obj.no_standard_descriptor_accessor = message.noStandardDescriptorAccessor === false ? undefined : message.noStandardDescriptorAccessor; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.map_entry = message.mapEntry === false ? undefined : message.mapEntry; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MessageOptionsAminoMsg): MessageOptions { + return MessageOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MessageOptionsProtoMsg): MessageOptions { + return MessageOptions.decode(message.value); + }, + toProto(message: MessageOptions): Uint8Array { + return MessageOptions.encode(message).finish(); + }, + toProtoMsg(message: MessageOptions): MessageOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.MessageOptions", + value: MessageOptions.encode(message).finish() + }; + } +}; +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 1, + packed: false, + jstype: 1, + lazy: false, + deprecated: false, + weak: false, + uninterpretedOption: [] + }; +} +export const FieldOptions = { + typeUrl: "/google.protobuf.FieldOptions", + encode(message: FieldOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ctype !== 1) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 1) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 1; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 1; + message.lazy = object.lazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FieldOptionsAmino): FieldOptions { + const message = createBaseFieldOptions(); + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: FieldOptions): FieldOptionsAmino { + const obj: any = {}; + obj.ctype = message.ctype === 1 ? undefined : message.ctype; + obj.packed = message.packed === false ? undefined : message.packed; + obj.jstype = message.jstype === 1 ? undefined : message.jstype; + obj.lazy = message.lazy === false ? undefined : message.lazy; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.weak = message.weak === false ? undefined : message.weak; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: FieldOptionsAminoMsg): FieldOptions { + return FieldOptions.fromAmino(object.value); + }, + fromProtoMsg(message: FieldOptionsProtoMsg): FieldOptions { + return FieldOptions.decode(message.value); + }, + toProto(message: FieldOptions): Uint8Array { + return FieldOptions.encode(message).finish(); + }, + toProtoMsg(message: FieldOptions): FieldOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.FieldOptions", + value: FieldOptions.encode(message).finish() + }; + } +}; +function createBaseOneofOptions(): OneofOptions { + return { + uninterpretedOption: [] + }; +} +export const OneofOptions = { + typeUrl: "/google.protobuf.OneofOptions", + encode(message: OneofOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OneofOptionsAmino): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: OneofOptions): OneofOptionsAmino { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: OneofOptionsAminoMsg): OneofOptions { + return OneofOptions.fromAmino(object.value); + }, + fromProtoMsg(message: OneofOptionsProtoMsg): OneofOptions { + return OneofOptions.decode(message.value); + }, + toProto(message: OneofOptions): Uint8Array { + return OneofOptions.encode(message).finish(); + }, + toProtoMsg(message: OneofOptions): OneofOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.OneofOptions", + value: OneofOptions.encode(message).finish() + }; + } +}; +function createBaseEnumOptions(): EnumOptions { + return { + allowAlias: false, + deprecated: false, + uninterpretedOption: [] + }; +} +export const EnumOptions = { + typeUrl: "/google.protobuf.EnumOptions", + encode(message: EnumOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowAlias === true) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EnumOptionsAmino): EnumOptions { + const message = createBaseEnumOptions(); + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allowAlias = object.allow_alias; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: EnumOptions): EnumOptionsAmino { + const obj: any = {}; + obj.allow_alias = message.allowAlias === false ? undefined : message.allowAlias; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumOptionsAminoMsg): EnumOptions { + return EnumOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumOptionsProtoMsg): EnumOptions { + return EnumOptions.decode(message.value); + }, + toProto(message: EnumOptions): Uint8Array { + return EnumOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumOptions): EnumOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.EnumOptions", + value: EnumOptions.encode(message).finish() + }; + } +}; +function createBaseEnumValueOptions(): EnumValueOptions { + return { + deprecated: false, + uninterpretedOption: [] + }; +} +export const EnumValueOptions = { + typeUrl: "/google.protobuf.EnumValueOptions", + encode(message: EnumValueOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { + const message = createBaseEnumValueOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: EnumValueOptions): EnumValueOptionsAmino { + const obj: any = {}; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: EnumValueOptionsAminoMsg): EnumValueOptions { + return EnumValueOptions.fromAmino(object.value); + }, + fromProtoMsg(message: EnumValueOptionsProtoMsg): EnumValueOptions { + return EnumValueOptions.decode(message.value); + }, + toProto(message: EnumValueOptions): Uint8Array { + return EnumValueOptions.encode(message).finish(); + }, + toProtoMsg(message: EnumValueOptions): EnumValueOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.EnumValueOptions", + value: EnumValueOptions.encode(message).finish() + }; + } +}; +function createBaseServiceOptions(): ServiceOptions { + return { + deprecated: false, + uninterpretedOption: [] + }; +} +export const ServiceOptions = { + typeUrl: "/google.protobuf.ServiceOptions", + encode(message: ServiceOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ServiceOptionsAmino): ServiceOptions { + const message = createBaseServiceOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: ServiceOptions): ServiceOptionsAmino { + const obj: any = {}; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: ServiceOptionsAminoMsg): ServiceOptions { + return ServiceOptions.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceOptionsProtoMsg): ServiceOptions { + return ServiceOptions.decode(message.value); + }, + toProto(message: ServiceOptions): Uint8Array { + return ServiceOptions.encode(message).finish(); + }, + toProtoMsg(message: ServiceOptions): ServiceOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.ServiceOptions", + value: ServiceOptions.encode(message).finish() + }; + } +}; +function createBaseMethodOptions(): MethodOptions { + return { + deprecated: false, + idempotencyLevel: 1, + uninterpretedOption: [] + }; +} +export const MethodOptions = { + typeUrl: "/google.protobuf.MethodOptions", + encode(message: MethodOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== 1) { + writer.uint32(272).int32(message.idempotencyLevel); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32() as any; + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 1; + message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MethodOptionsAmino): MethodOptions { + const message = createBaseMethodOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.idempotency_level !== undefined && object.idempotency_level !== null) { + message.idempotencyLevel = object.idempotency_level; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; + }, + toAmino(message: MethodOptions): MethodOptionsAmino { + const obj: any = {}; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.idempotency_level = message.idempotencyLevel === 1 ? undefined : message.idempotencyLevel; + if (message.uninterpretedOption) { + obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); + } else { + obj.uninterpreted_option = message.uninterpretedOption; + } + return obj; + }, + fromAminoMsg(object: MethodOptionsAminoMsg): MethodOptions { + return MethodOptions.fromAmino(object.value); + }, + fromProtoMsg(message: MethodOptionsProtoMsg): MethodOptions { + return MethodOptions.decode(message.value); + }, + toProto(message: MethodOptions): Uint8Array { + return MethodOptions.encode(message).finish(); + }, + toProtoMsg(message: MethodOptions): MethodOptionsProtoMsg { + return { + typeUrl: "/google.protobuf.MethodOptions", + value: MethodOptions.encode(message).finish() + }; + } +}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: BigInt(0), + negativeIntValue: BigInt(0), + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "" + }; +} +export const UninterpretedOption = { + typeUrl: "/google.protobuf.UninterpretedOption", + encode(message: UninterpretedOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (message.positiveIntValue !== BigInt(0)) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== BigInt(0)) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromPartial(e)) || []; + message.identifierValue = object.identifierValue ?? ""; + message.positiveIntValue = object.positiveIntValue !== undefined && object.positiveIntValue !== null ? BigInt(object.positiveIntValue.toString()) : BigInt(0); + message.negativeIntValue = object.negativeIntValue !== undefined && object.negativeIntValue !== null ? BigInt(object.negativeIntValue.toString()) : BigInt(0); + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; + return message; + }, + fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromAmino(e)) || []; + if (object.identifier_value !== undefined && object.identifier_value !== null) { + message.identifierValue = object.identifier_value; + } + if (object.positive_int_value !== undefined && object.positive_int_value !== null) { + message.positiveIntValue = BigInt(object.positive_int_value); + } + if (object.negative_int_value !== undefined && object.negative_int_value !== null) { + message.negativeIntValue = BigInt(object.negative_int_value); + } + if (object.double_value !== undefined && object.double_value !== null) { + message.doubleValue = object.double_value; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.stringValue = bytesFromBase64(object.string_value); + } + if (object.aggregate_value !== undefined && object.aggregate_value !== null) { + message.aggregateValue = object.aggregate_value; + } + return message; + }, + toAmino(message: UninterpretedOption): UninterpretedOptionAmino { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map(e => e ? UninterpretedOption_NamePart.toAmino(e) : undefined); + } else { + obj.name = message.name; + } + obj.identifier_value = message.identifierValue === "" ? undefined : message.identifierValue; + obj.positive_int_value = message.positiveIntValue !== BigInt(0) ? message.positiveIntValue.toString() : undefined; + obj.negative_int_value = message.negativeIntValue !== BigInt(0) ? message.negativeIntValue.toString() : undefined; + obj.double_value = message.doubleValue === 0 ? undefined : message.doubleValue; + obj.string_value = message.stringValue ? base64FromBytes(message.stringValue) : undefined; + obj.aggregate_value = message.aggregateValue === "" ? undefined : message.aggregateValue; + return obj; + }, + fromAminoMsg(object: UninterpretedOptionAminoMsg): UninterpretedOption { + return UninterpretedOption.fromAmino(object.value); + }, + fromProtoMsg(message: UninterpretedOptionProtoMsg): UninterpretedOption { + return UninterpretedOption.decode(message.value); + }, + toProto(message: UninterpretedOption): Uint8Array { + return UninterpretedOption.encode(message).finish(); + }, + toProtoMsg(message: UninterpretedOption): UninterpretedOptionProtoMsg { + return { + typeUrl: "/google.protobuf.UninterpretedOption", + value: UninterpretedOption.encode(message).finish() + }; + } +}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { + namePart: "", + isExtension: false + }; +} +export const UninterpretedOption_NamePart = { + typeUrl: "/google.protobuf.NamePart", + encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; + return message; + }, + fromAmino(object: UninterpretedOption_NamePartAmino): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + if (object.name_part !== undefined && object.name_part !== null) { + message.namePart = object.name_part; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.isExtension = object.is_extension; + } + return message; + }, + toAmino(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartAmino { + const obj: any = {}; + obj.name_part = message.namePart === "" ? undefined : message.namePart; + obj.is_extension = message.isExtension === false ? undefined : message.isExtension; + return obj; + }, + fromAminoMsg(object: UninterpretedOption_NamePartAminoMsg): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromAmino(object.value); + }, + fromProtoMsg(message: UninterpretedOption_NamePartProtoMsg): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.decode(message.value); + }, + toProto(message: UninterpretedOption_NamePart): Uint8Array { + return UninterpretedOption_NamePart.encode(message).finish(); + }, + toProtoMsg(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartProtoMsg { + return { + typeUrl: "/google.protobuf.NamePart", + value: UninterpretedOption_NamePart.encode(message).finish() + }; + } +}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { + location: [] + }; +} +export const SourceCodeInfo = { + typeUrl: "/google.protobuf.SourceCodeInfo", + encode(message: SourceCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromAmino(e)) || []; + return message; + }, + toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map(e => e ? SourceCodeInfo_Location.toAmino(e) : undefined); + } else { + obj.location = message.location; + } + return obj; + }, + fromAminoMsg(object: SourceCodeInfoAminoMsg): SourceCodeInfo { + return SourceCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: SourceCodeInfoProtoMsg): SourceCodeInfo { + return SourceCodeInfo.decode(message.value); + }, + toProto(message: SourceCodeInfo): Uint8Array { + return SourceCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: SourceCodeInfo): SourceCodeInfoProtoMsg { + return { + typeUrl: "/google.protobuf.SourceCodeInfo", + value: SourceCodeInfo.encode(message).finish() + }; + } +}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { + path: [], + span: [], + leadingComments: "", + trailingComments: "", + leadingDetachedComments: [] + }; +} +export const SourceCodeInfo_Location = { + typeUrl: "/google.protobuf.Location", + encode(message: SourceCodeInfo_Location, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + message.leadingComments = object.leadingComments ?? ""; + message.trailingComments = object.trailingComments ?? ""; + message.leadingDetachedComments = object.leadingDetachedComments?.map(e => e) || []; + return message; + }, + fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + if (object.leading_comments !== undefined && object.leading_comments !== null) { + message.leadingComments = object.leading_comments; + } + if (object.trailing_comments !== undefined && object.trailing_comments !== null) { + message.trailingComments = object.trailing_comments; + } + message.leadingDetachedComments = object.leading_detached_comments?.map(e => e) || []; + return message; + }, + toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + if (message.span) { + obj.span = message.span.map(e => e); + } else { + obj.span = message.span; + } + obj.leading_comments = message.leadingComments === "" ? undefined : message.leadingComments; + obj.trailing_comments = message.trailingComments === "" ? undefined : message.trailingComments; + if (message.leadingDetachedComments) { + obj.leading_detached_comments = message.leadingDetachedComments.map(e => e); + } else { + obj.leading_detached_comments = message.leadingDetachedComments; + } + return obj; + }, + fromAminoMsg(object: SourceCodeInfo_LocationAminoMsg): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromAmino(object.value); + }, + fromProtoMsg(message: SourceCodeInfo_LocationProtoMsg): SourceCodeInfo_Location { + return SourceCodeInfo_Location.decode(message.value); + }, + toProto(message: SourceCodeInfo_Location): Uint8Array { + return SourceCodeInfo_Location.encode(message).finish(); + }, + toProtoMsg(message: SourceCodeInfo_Location): SourceCodeInfo_LocationProtoMsg { + return { + typeUrl: "/google.protobuf.Location", + value: SourceCodeInfo_Location.encode(message).finish() + }; + } +}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { + annotation: [] + }; +} +export const GeneratedCodeInfo = { + typeUrl: "/google.protobuf.GeneratedCodeInfo", + encode(message: GeneratedCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromAmino(e)) || []; + return message; + }, + toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map(e => e ? GeneratedCodeInfo_Annotation.toAmino(e) : undefined); + } else { + obj.annotation = message.annotation; + } + return obj; + }, + fromAminoMsg(object: GeneratedCodeInfoAminoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: GeneratedCodeInfoProtoMsg): GeneratedCodeInfo { + return GeneratedCodeInfo.decode(message.value); + }, + toProto(message: GeneratedCodeInfo): Uint8Array { + return GeneratedCodeInfo.encode(message).finish(); + }, + toProtoMsg(message: GeneratedCodeInfo): GeneratedCodeInfoProtoMsg { + return { + typeUrl: "/google.protobuf.GeneratedCodeInfo", + value: GeneratedCodeInfo.encode(message).finish() + }; + } +}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { + path: [], + sourceFile: "", + begin: 0, + end: 0 + }; +} +export const GeneratedCodeInfo_Annotation = { + typeUrl: "/google.protobuf.Annotation", + encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + message.sourceFile = object.sourceFile ?? ""; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + return message; + }, + fromAmino(object: GeneratedCodeInfo_AnnotationAmino): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + if (object.source_file !== undefined && object.source_file !== null) { + message.sourceFile = object.source_file; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; + }, + toAmino(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationAmino { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + obj.source_file = message.sourceFile === "" ? undefined : message.sourceFile; + obj.begin = message.begin === 0 ? undefined : message.begin; + obj.end = message.end === 0 ? undefined : message.end; + return obj; + }, + fromAminoMsg(object: GeneratedCodeInfo_AnnotationAminoMsg): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromAmino(object.value); + }, + fromProtoMsg(message: GeneratedCodeInfo_AnnotationProtoMsg): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.decode(message.value); + }, + toProto(message: GeneratedCodeInfo_Annotation): Uint8Array { + return GeneratedCodeInfo_Annotation.encode(message).finish(); + }, + toProtoMsg(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationProtoMsg { + return { + typeUrl: "/google.protobuf.Annotation", + value: GeneratedCodeInfo_Annotation.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/protobuf/duration.ts b/dydxjs/packages/dydxjs/src/google/protobuf/duration.ts new file mode 100644 index 00000000..b1f793dd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/protobuf/duration.ts @@ -0,0 +1,281 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} +export interface DurationProtoMsg { + typeUrl: "/google.protobuf.Duration"; + value: Uint8Array; +} +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export type DurationAmino = string; +export interface DurationAminoMsg { + type: "/google.protobuf.Duration"; + value: DurationAmino; +} +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface DurationSDKType { + seconds: bigint; + nanos: number; +} +function createBaseDuration(): Duration { + return { + seconds: BigInt(0), + nanos: 0 + }; +} +export const Duration = { + typeUrl: "/google.protobuf.Duration", + encode(message: Duration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: DurationAmino): Duration { + const value = BigInt(object); + return { + seconds: value / BigInt("1000000000"), + nanos: Number(value % BigInt("1000000000")) + }; + }, + toAmino(message: Duration): DurationAmino { + return (message.seconds * BigInt("1000000000") + BigInt(message.nanos)).toString(); + }, + fromAminoMsg(object: DurationAminoMsg): Duration { + return Duration.fromAmino(object.value); + }, + fromProtoMsg(message: DurationProtoMsg): Duration { + return Duration.decode(message.value); + }, + toProto(message: Duration): Uint8Array { + return Duration.encode(message).finish(); + }, + toProtoMsg(message: Duration): DurationProtoMsg { + return { + typeUrl: "/google.protobuf.Duration", + value: Duration.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/protobuf/empty.ts b/dydxjs/packages/dydxjs/src/google/protobuf/empty.ts new file mode 100644 index 00000000..919ef384 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/protobuf/empty.ts @@ -0,0 +1,96 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface Empty {} +export interface EmptyProtoMsg { + typeUrl: "/google.protobuf.Empty"; + value: Uint8Array; +} +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface EmptyAmino {} +export interface EmptyAminoMsg { + type: "/google.protobuf.Empty"; + value: EmptyAmino; +} +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface EmptySDKType {} +function createBaseEmpty(): Empty { + return {}; +} +export const Empty = { + typeUrl: "/google.protobuf.Empty", + encode(_: Empty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Empty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmpty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Empty { + const message = createBaseEmpty(); + return message; + }, + fromAmino(_: EmptyAmino): Empty { + const message = createBaseEmpty(); + return message; + }, + toAmino(_: Empty): EmptyAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: EmptyAminoMsg): Empty { + return Empty.fromAmino(object.value); + }, + fromProtoMsg(message: EmptyProtoMsg): Empty { + return Empty.decode(message.value); + }, + toProto(message: Empty): Uint8Array { + return Empty.encode(message).finish(); + }, + toProtoMsg(message: Empty): EmptyProtoMsg { + return { + typeUrl: "/google.protobuf.Empty", + value: Empty.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/google/protobuf/timestamp.ts b/dydxjs/packages/dydxjs/src/google/protobuf/timestamp.ts new file mode 100644 index 00000000..5dc8630a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/google/protobuf/timestamp.ts @@ -0,0 +1,348 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { fromJsonTimestamp, fromTimestamp } from "../../helpers"; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} +export interface TimestampProtoMsg { + typeUrl: "/google.protobuf.Timestamp"; + value: Uint8Array; +} +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export type TimestampAmino = string; +export interface TimestampAminoMsg { + type: "/google.protobuf.Timestamp"; + value: TimestampAmino; +} +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface TimestampSDKType { + seconds: bigint; + nanos: number; +} +function createBaseTimestamp(): Timestamp { + return { + seconds: BigInt(0), + nanos: 0 + }; +} +export const Timestamp = { + typeUrl: "/google.protobuf.Timestamp", + encode(message: Timestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); + message.nanos = object.nanos ?? 0; + return message; + }, + fromAmino(object: TimestampAmino): Timestamp { + return fromJsonTimestamp(object); + }, + toAmino(message: Timestamp): TimestampAmino { + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); + }, + fromAminoMsg(object: TimestampAminoMsg): Timestamp { + return Timestamp.fromAmino(object.value); + }, + fromProtoMsg(message: TimestampProtoMsg): Timestamp { + return Timestamp.decode(message.value); + }, + toProto(message: Timestamp): Uint8Array { + return Timestamp.encode(message).finish(); + }, + toProtoMsg(message: Timestamp): TimestampProtoMsg { + return { + typeUrl: "/google.protobuf.Timestamp", + value: Timestamp.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/v4-client-js/src/codegen/helpers.ts b/dydxjs/packages/dydxjs/src/helpers.ts similarity index 68% rename from v4-client-js/src/codegen/helpers.ts rename to dydxjs/packages/dydxjs/src/helpers.ts index 419f00ec..2e79a854 100644 --- a/v4-client-js/src/codegen/helpers.ts +++ b/dydxjs/packages/dydxjs/src/helpers.ts @@ -1,20 +1,10 @@ +//@ts-nocheck /** - * This file and any referenced files were automatically generated by @osmonauts/telescope@0.80.0 - * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. - */ +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ -import * as _m0 from 'protobufjs/minimal'; -import Long from 'long'; - -// @ts-ignore -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - - _m0.configure(); -} - -export { Long }; declare var self: any | undefined; declare var window: any | undefined; @@ -28,7 +18,8 @@ var globalThis: any = (() => { })(); const atob: (b64: string) => string = - globalThis.atob || ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')); + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')); export function bytesFromBase64(b64: string): Uint8Array { const bin = atob(b64); @@ -40,7 +31,8 @@ export function bytesFromBase64(b64: string): Uint8Array { } const btoa: (bin: string) => string = - globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')); + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')); export function base64FromBytes(arr: Uint8Array): string { const bin: string[] = []; @@ -55,7 +47,9 @@ export interface AminoHeight { readonly revision_height?: string; } -export function omitDefault(input: T): T | undefined { +export function omitDefault( + input: T +): T | undefined { if (typeof input === 'string') { return input === '' ? undefined : input; } @@ -64,8 +58,12 @@ export function omitDefault(input: T): T | und return input === 0 ? undefined : input; } - if (Long.isLong(input)) { - return input.isZero() ? undefined : input; + if (typeof input === "boolean"){ + return input === false ? undefined : input; + } + + if (typeof input === 'bigint') { + return input === BigInt(0) ? undefined : input; } throw new Error(`Got unsupported type ${typeof input}`); @@ -77,7 +75,7 @@ interface Duration { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds: Long; + seconds: bigint; /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 @@ -92,13 +90,16 @@ interface Duration { export function toDuration(duration: string): Duration { return { - seconds: Long.fromNumber(Math.floor(parseInt(duration) / 1000000000)), - nanos: parseInt(duration) % 1000000000, + seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)), + nanos: parseInt(duration) % 1000000000 }; } export function fromDuration(duration: Duration): string { - return (parseInt(duration.seconds.toString()) * 1000000000 + duration.nanos).toString(); + return ( + parseInt(duration.seconds.toString()) * 1000000000 + + duration.nanos + ).toString(); } export function isSet(value: any): boolean { @@ -111,8 +112,8 @@ export function isObject(value: any): boolean { export interface PageRequest { key: Uint8Array; - offset: Long; - limit: Long; + offset: bigint; + limit: bigint; countTotal: boolean; reverse: boolean; } @@ -129,7 +130,10 @@ export interface Params { params: PageRequestParams; } -export const setPaginationParams = (options: Params, pagination?: PageRequest) => { +export const setPaginationParams = ( + options: Params, + pagination?: PageRequest +) => { if (!pagination) { return options; } @@ -142,7 +146,9 @@ export const setPaginationParams = (options: Params, pagination?: PageRequest) = // let uint8arr = new Uint8Array(Buffer.from(data,'base64')); // Uint8Array to String - options.params['pagination.key'] = Buffer.from(pagination.key).toString('base64'); + options.params['pagination.key'] = Buffer.from(pagination.key).toString( + 'base64' + ); } if (typeof pagination?.limit !== 'undefined') { options.params['pagination.limit'] = pagination.limit.toString(); @@ -157,27 +163,40 @@ export const setPaginationParams = (options: Params, pagination?: PageRequest) = return options; }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | bigint + | boolean + | undefined; export type DeepPartial = T extends Builtin ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record>, never>; + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + >; export interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request( + service: string, + method: string, + data: Uint8Array + ): Promise; } interface Timestamp { @@ -186,7 +205,7 @@ interface Timestamp { * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to * 9999-12-31T23:59:59Z inclusive. */ - seconds: Long; + seconds: bigint; /** * Non-negative fractions of a second at nanosecond resolution. Negative * second values with fractions must still have non-negative nanos values @@ -202,27 +221,22 @@ export function toTimestamp(date: Date): Timestamp { const nanos = (date.getTime() % 1000) * 1000000; return { seconds, - nanos, + nanos }; } export function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1000; + let millis = Number(t.seconds) * 1000; millis += t.nanos / 1000000; return new Date(millis); } -const fromJSON = (object: any): Timestamp => { - return { - seconds: isSet(object.seconds) ? Long.fromString(object.seconds) : Long.ZERO, - nanos: isSet(object.nanos) ? Number(object.nanos) : 0, - }; -}; - const timestampFromJSON = (object: any): Timestamp => { return { - seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, - nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + seconds: isSet(object.seconds) + ? BigInt(object.seconds.toString()) + : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 }; }; @@ -237,5 +251,6 @@ export function fromJsonTimestamp(o: any): Timestamp { } function numberToLong(number: number) { - return Long.fromNumber(number); + return BigInt(Math.trunc(number)); } + diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/genesis.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/genesis.ts new file mode 100644 index 00000000..5b97f25a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/genesis.ts @@ -0,0 +1,124 @@ +//@ts-nocheck +import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisState { + portId: string; + denomTraces: DenomTrace[]; + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisStateAmino { + port_id?: string; + denom_traces?: DenomTraceAmino[]; + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisStateSDKType { + port_id: string; + denom_traces: DenomTraceSDKType[]; + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + portId: "", + denomTraces: [], + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/ibc.applications.transfer.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + for (const v of message.denomTraces) { + DenomTrace.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.denomTraces.push(DenomTrace.decode(reader, reader.uint32())); + break; + case 3: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.portId = object.portId ?? ""; + message.denomTraces = object.denomTraces?.map(e => DenomTrace.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + if (message.denomTraces) { + obj.denom_traces = message.denomTraces.map(e => e ? DenomTrace.toAmino(e) : undefined); + } else { + obj.denom_traces = message.denomTraces; + } + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/query.rpc.Query.ts new file mode 100644 index 00000000..b45b377d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/query.rpc.Query.ts @@ -0,0 +1,55 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryDenomTraceRequest, QueryDenomTraceResponse, QueryDenomTracesRequest, QueryDenomTracesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** DenomTrace queries a denomination trace information. */ + denomTrace(request: QueryDenomTraceRequest): Promise; + /** DenomTraces queries all denomination traces. */ + denomTraces(request?: QueryDenomTracesRequest): Promise; + /** Params queries all parameters of the ibc-transfer module. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.denomTrace = this.denomTrace.bind(this); + this.denomTraces = this.denomTraces.bind(this); + this.params = this.params.bind(this); + } + denomTrace(request: QueryDenomTraceRequest): Promise { + const data = QueryDenomTraceRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); + return promise.then(data => QueryDenomTraceResponse.decode(new BinaryReader(data))); + } + denomTraces(request: QueryDenomTracesRequest = { + pagination: undefined + }): Promise { + const data = QueryDenomTracesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTraces", data); + return promise.then(data => QueryDenomTracesResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + denomTrace(request: QueryDenomTraceRequest): Promise { + return queryService.denomTrace(request); + }, + denomTraces(request?: QueryDenomTracesRequest): Promise { + return queryService.denomTraces(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/query.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/query.ts new file mode 100644 index 00000000..ed2c83b7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/query.ts @@ -0,0 +1,584 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC + * method + */ +export interface QueryDenomTraceRequest { + /** hash (in hex format) of the denomination trace information. */ + hash: string; +} +export interface QueryDenomTraceRequestProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceRequest"; + value: Uint8Array; +} +/** + * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC + * method + */ +export interface QueryDenomTraceRequestAmino { + /** hash (in hex format) of the denomination trace information. */ + hash?: string; +} +export interface QueryDenomTraceRequestAminoMsg { + type: "cosmos-sdk/QueryDenomTraceRequest"; + value: QueryDenomTraceRequestAmino; +} +/** + * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC + * method + */ +export interface QueryDenomTraceRequestSDKType { + hash: string; +} +/** + * QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC + * method. + */ +export interface QueryDenomTraceResponse { + /** denom_trace returns the requested denomination trace information. */ + denomTrace?: DenomTrace; +} +export interface QueryDenomTraceResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse"; + value: Uint8Array; +} +/** + * QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC + * method. + */ +export interface QueryDenomTraceResponseAmino { + /** denom_trace returns the requested denomination trace information. */ + denom_trace?: DenomTraceAmino; +} +export interface QueryDenomTraceResponseAminoMsg { + type: "cosmos-sdk/QueryDenomTraceResponse"; + value: QueryDenomTraceResponseAmino; +} +/** + * QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC + * method. + */ +export interface QueryDenomTraceResponseSDKType { + denom_trace?: DenomTraceSDKType; +} +/** + * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC + * method + */ +export interface QueryDenomTracesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDenomTracesRequestProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest"; + value: Uint8Array; +} +/** + * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC + * method + */ +export interface QueryDenomTracesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDenomTracesRequestAminoMsg { + type: "cosmos-sdk/QueryDenomTracesRequest"; + value: QueryDenomTracesRequestAmino; +} +/** + * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC + * method + */ +export interface QueryDenomTracesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC + * method. + */ +export interface QueryDenomTracesResponse { + /** denom_traces returns all denominations trace information. */ + denomTraces: DenomTrace[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomTracesResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse"; + value: Uint8Array; +} +/** + * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC + * method. + */ +export interface QueryDenomTracesResponseAmino { + /** denom_traces returns all denominations trace information. */ + denom_traces?: DenomTraceAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomTracesResponseAminoMsg { + type: "cosmos-sdk/QueryDenomTracesResponse"; + value: QueryDenomTracesResponseAmino; +} +/** + * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC + * method. + */ +export interface QueryDenomTracesResponseSDKType { + denom_traces: DenomTraceSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params?: ParamsSDKType; +} +function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { + return { + hash: "" + }; +} +export const QueryDenomTraceRequest = { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceRequest", + encode(message: QueryDenomTraceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTraceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTraceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomTraceRequest { + const message = createBaseQueryDenomTraceRequest(); + message.hash = object.hash ?? ""; + return message; + }, + fromAmino(object: QueryDenomTraceRequestAmino): QueryDenomTraceRequest { + const message = createBaseQueryDenomTraceRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; + }, + toAmino(message: QueryDenomTraceRequest): QueryDenomTraceRequestAmino { + const obj: any = {}; + obj.hash = message.hash === "" ? undefined : message.hash; + return obj; + }, + fromAminoMsg(object: QueryDenomTraceRequestAminoMsg): QueryDenomTraceRequest { + return QueryDenomTraceRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomTraceRequest): QueryDenomTraceRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomTraceRequest", + value: QueryDenomTraceRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomTraceRequestProtoMsg): QueryDenomTraceRequest { + return QueryDenomTraceRequest.decode(message.value); + }, + toProto(message: QueryDenomTraceRequest): Uint8Array { + return QueryDenomTraceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomTraceRequest): QueryDenomTraceRequestProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceRequest", + value: QueryDenomTraceRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomTraceResponse(): QueryDenomTraceResponse { + return { + denomTrace: undefined + }; +} +export const QueryDenomTraceResponse = { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse", + encode(message: QueryDenomTraceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomTrace !== undefined) { + DenomTrace.encode(message.denomTrace, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTraceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTraceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomTrace = DenomTrace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomTraceResponse { + const message = createBaseQueryDenomTraceResponse(); + message.denomTrace = object.denomTrace !== undefined && object.denomTrace !== null ? DenomTrace.fromPartial(object.denomTrace) : undefined; + return message; + }, + fromAmino(object: QueryDenomTraceResponseAmino): QueryDenomTraceResponse { + const message = createBaseQueryDenomTraceResponse(); + if (object.denom_trace !== undefined && object.denom_trace !== null) { + message.denomTrace = DenomTrace.fromAmino(object.denom_trace); + } + return message; + }, + toAmino(message: QueryDenomTraceResponse): QueryDenomTraceResponseAmino { + const obj: any = {}; + obj.denom_trace = message.denomTrace ? DenomTrace.toAmino(message.denomTrace) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomTraceResponseAminoMsg): QueryDenomTraceResponse { + return QueryDenomTraceResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomTraceResponse): QueryDenomTraceResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomTraceResponse", + value: QueryDenomTraceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomTraceResponseProtoMsg): QueryDenomTraceResponse { + return QueryDenomTraceResponse.decode(message.value); + }, + toProto(message: QueryDenomTraceResponse): Uint8Array { + return QueryDenomTraceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomTraceResponse): QueryDenomTraceResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse", + value: QueryDenomTraceResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomTracesRequest(): QueryDenomTracesRequest { + return { + pagination: undefined + }; +} +export const QueryDenomTracesRequest = { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest", + encode(message: QueryDenomTracesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTracesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTracesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomTracesRequest { + const message = createBaseQueryDenomTracesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomTracesRequestAmino): QueryDenomTracesRequest { + const message = createBaseQueryDenomTracesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomTracesRequest): QueryDenomTracesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomTracesRequestAminoMsg): QueryDenomTracesRequest { + return QueryDenomTracesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomTracesRequest): QueryDenomTracesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomTracesRequest", + value: QueryDenomTracesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomTracesRequestProtoMsg): QueryDenomTracesRequest { + return QueryDenomTracesRequest.decode(message.value); + }, + toProto(message: QueryDenomTracesRequest): Uint8Array { + return QueryDenomTracesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomTracesRequest): QueryDenomTracesRequestProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest", + value: QueryDenomTracesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomTracesResponse(): QueryDenomTracesResponse { + return { + denomTraces: [], + pagination: undefined + }; +} +export const QueryDenomTracesResponse = { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse", + encode(message: QueryDenomTracesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomTraces) { + DenomTrace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTracesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTracesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomTraces.push(DenomTrace.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomTracesResponse { + const message = createBaseQueryDenomTracesResponse(); + message.denomTraces = object.denomTraces?.map(e => DenomTrace.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomTracesResponseAmino): QueryDenomTracesResponse { + const message = createBaseQueryDenomTracesResponse(); + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomTracesResponse): QueryDenomTracesResponseAmino { + const obj: any = {}; + if (message.denomTraces) { + obj.denom_traces = message.denomTraces.map(e => e ? DenomTrace.toAmino(e) : undefined); + } else { + obj.denom_traces = message.denomTraces; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomTracesResponseAminoMsg): QueryDenomTracesResponse { + return QueryDenomTracesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomTracesResponse): QueryDenomTracesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomTracesResponse", + value: QueryDenomTracesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomTracesResponseProtoMsg): QueryDenomTracesResponse { + return QueryDenomTracesResponse.decode(message.value); + }, + toProto(message: QueryDenomTracesResponse): Uint8Array { + return QueryDenomTracesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomTracesResponse): QueryDenomTracesResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse", + value: QueryDenomTracesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/ibc.applications.transfer.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} +export const QueryParamsResponse = { + typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/transfer.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/transfer.ts new file mode 100644 index 00000000..17df6cef --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/transfer.ts @@ -0,0 +1,260 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTrace { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path: string; + /** base denomination of the relayed fungible token. */ + baseDenom: string; +} +export interface DenomTraceProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.DenomTrace"; + value: Uint8Array; +} +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTraceAmino { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path?: string; + /** base denomination of the relayed fungible token. */ + base_denom?: string; +} +export interface DenomTraceAminoMsg { + type: "cosmos-sdk/DenomTrace"; + value: DenomTraceAmino; +} +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTraceSDKType { + path: string; + base_denom: string; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface Params { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + sendEnabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receiveEnabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Params"; + value: Uint8Array; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface ParamsAmino { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + send_enabled?: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receive_enabled?: boolean; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface ParamsSDKType { + send_enabled: boolean; + receive_enabled: boolean; +} +function createBaseDenomTrace(): DenomTrace { + return { + path: "", + baseDenom: "" + }; +} +export const DenomTrace = { + typeUrl: "/ibc.applications.transfer.v1.DenomTrace", + encode(message: DenomTrace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.baseDenom !== "") { + writer.uint32(18).string(message.baseDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomTrace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomTrace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.baseDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomTrace { + const message = createBaseDenomTrace(); + message.path = object.path ?? ""; + message.baseDenom = object.baseDenom ?? ""; + return message; + }, + fromAmino(object: DenomTraceAmino): DenomTrace { + const message = createBaseDenomTrace(); + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; + }, + toAmino(message: DenomTrace): DenomTraceAmino { + const obj: any = {}; + obj.path = message.path === "" ? undefined : message.path; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; + return obj; + }, + fromAminoMsg(object: DenomTraceAminoMsg): DenomTrace { + return DenomTrace.fromAmino(object.value); + }, + toAminoMsg(message: DenomTrace): DenomTraceAminoMsg { + return { + type: "cosmos-sdk/DenomTrace", + value: DenomTrace.toAmino(message) + }; + }, + fromProtoMsg(message: DenomTraceProtoMsg): DenomTrace { + return DenomTrace.decode(message.value); + }, + toProto(message: DenomTrace): Uint8Array { + return DenomTrace.encode(message).finish(); + }, + toProtoMsg(message: DenomTrace): DenomTraceProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.DenomTrace", + value: DenomTrace.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + sendEnabled: false, + receiveEnabled: false + }; +} +export const Params = { + typeUrl: "/ibc.applications.transfer.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sendEnabled === true) { + writer.uint32(8).bool(message.sendEnabled); + } + if (message.receiveEnabled === true) { + writer.uint32(16).bool(message.receiveEnabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled = reader.bool(); + break; + case 2: + message.receiveEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled ?? false; + message.receiveEnabled = object.receiveEnabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.send_enabled !== undefined && object.send_enabled !== null) { + message.sendEnabled = object.send_enabled; + } + if (object.receive_enabled !== undefined && object.receive_enabled !== null) { + message.receiveEnabled = object.receive_enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.send_enabled = message.sendEnabled === false ? undefined : message.sendEnabled; + obj.receive_enabled = message.receiveEnabled === false ? undefined : message.receiveEnabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.amino.ts new file mode 100644 index 00000000..7295985b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgTransfer } from "./tx"; +export const AminoConverter = { + "/ibc.applications.transfer.v1.MsgTransfer": { + aminoType: "cosmos-sdk/MsgTransfer", + toAmino: MsgTransfer.toAmino, + fromAmino: MsgTransfer.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.registry.ts new file mode 100644 index 00000000..dae96a3a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgTransfer } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.encode(value).finish() + }; + } + }, + withTypeUrl: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value + }; + } + }, + fromPartial: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..3bc6a71d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.rpc.msg.ts @@ -0,0 +1,21 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgTransfer, MsgTransferResponse } from "./tx"; +/** Msg defines the ibc/transfer Msg service. */ +export interface Msg { + /** Transfer defines a rpc handler method for MsgTransfer. */ + transfer(request: MsgTransfer): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.transfer = this.transfer.bind(this); + } + transfer(request: MsgTransfer): Promise { + const data = MsgTransfer.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); + return promise.then(data => MsgTransferResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 00000000..bf226dd1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,291 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransfer { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** the tokens to be transferred */ + token: Coin; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: Height; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: bigint; +} +export interface MsgTransferProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer"; + value: Uint8Array; +} +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransferAmino { + /** the port on which the packet will be sent */ + source_port?: string; + /** the channel by which the packet will be sent */ + source_channel?: string; + /** the tokens to be transferred */ + token?: CoinAmino; + /** the sender address */ + sender?: string; + /** the recipient address on the destination chain */ + receiver?: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeout_height?: HeightAmino; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeout_timestamp?: string; +} +export interface MsgTransferAminoMsg { + type: "cosmos-sdk/MsgTransfer"; + value: MsgTransferAmino; +} +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransferSDKType { + source_port: string; + source_channel: string; + token: CoinSDKType; + sender: string; + receiver: string; + timeout_height: HeightSDKType; + timeout_timestamp: bigint; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse {} +export interface MsgTransferResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse"; + value: Uint8Array; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseAmino {} +export interface MsgTransferResponseAminoMsg { + type: "cosmos-sdk/MsgTransferResponse"; + value: MsgTransferResponseAmino; +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseSDKType {} +function createBaseMsgTransfer(): MsgTransfer { + return { + sourcePort: "", + sourceChannel: "", + token: Coin.fromPartial({}), + sender: "", + receiver: "", + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0) + }; +} +export const MsgTransfer = { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + encode(message: MsgTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sourcePort !== "") { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(18).string(message.sourceChannel); + } + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(26).fork()).ldelim(); + } + if (message.sender !== "") { + writer.uint32(34).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(42).string(message.receiver); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(56).uint64(message.timeoutTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.token = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTransfer { + const message = createBaseMsgTransfer(); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.token = object.token !== undefined && object.token !== null ? Coin.fromPartial(object.token) : undefined; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgTransferAmino): MsgTransfer { + const message = createBaseMsgTransfer(); + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + return message; + }, + toAmino(message: MsgTransfer): MsgTransferAmino { + const obj: any = {}; + obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; + obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; + obj.token = message.token ? Coin.toAmino(message.token) : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; + obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgTransferAminoMsg): MsgTransfer { + return MsgTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransfer): MsgTransferAminoMsg { + return { + type: "cosmos-sdk/MsgTransfer", + value: MsgTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferProtoMsg): MsgTransfer { + return MsgTransfer.decode(message.value); + }, + toProto(message: MsgTransfer): Uint8Array { + return MsgTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgTransfer): MsgTransferProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.encode(message).finish() + }; + } +}; +function createBaseMsgTransferResponse(): MsgTransferResponse { + return {}; +} +export const MsgTransferResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + encode(_: MsgTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + return message; + }, + fromAmino(_: MsgTransferResponseAmino): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + return message; + }, + toAmino(_: MsgTransferResponse): MsgTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransferResponseAminoMsg): MsgTransferResponse { + return MsgTransferResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferResponse): MsgTransferResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTransferResponse", + value: MsgTransferResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferResponseProtoMsg): MsgTransferResponse { + return MsgTransferResponse.decode(message.value); + }, + toProto(message: MsgTransferResponse): Uint8Array { + return MsgTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferResponse): MsgTransferResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + value: MsgTransferResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v2/packet.ts b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v2/packet.ts new file mode 100644 index 00000000..5e887f54 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/applications/transfer/v2/packet.ts @@ -0,0 +1,156 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketData { + /** the token denomination to be transferred */ + denom: string; + /** the token amount to be transferred */ + amount: string; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; +} +export interface FungibleTokenPacketDataProtoMsg { + typeUrl: "/ibc.applications.transfer.v2.FungibleTokenPacketData"; + value: Uint8Array; +} +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketDataAmino { + /** the token denomination to be transferred */ + denom?: string; + /** the token amount to be transferred */ + amount?: string; + /** the sender address */ + sender?: string; + /** the recipient address on the destination chain */ + receiver?: string; +} +export interface FungibleTokenPacketDataAminoMsg { + type: "cosmos-sdk/FungibleTokenPacketData"; + value: FungibleTokenPacketDataAmino; +} +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketDataSDKType { + denom: string; + amount: string; + sender: string; + receiver: string; +} +function createBaseFungibleTokenPacketData(): FungibleTokenPacketData { + return { + denom: "", + amount: "", + sender: "", + receiver: "" + }; +} +export const FungibleTokenPacketData = { + typeUrl: "/ibc.applications.transfer.v2.FungibleTokenPacketData", + encode(message: FungibleTokenPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(34).string(message.receiver); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FungibleTokenPacketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFungibleTokenPacketData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FungibleTokenPacketData { + const message = createBaseFungibleTokenPacketData(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + return message; + }, + fromAmino(object: FungibleTokenPacketDataAmino): FungibleTokenPacketData { + const message = createBaseFungibleTokenPacketData(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + return message; + }, + toAmino(message: FungibleTokenPacketData): FungibleTokenPacketDataAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; + return obj; + }, + fromAminoMsg(object: FungibleTokenPacketDataAminoMsg): FungibleTokenPacketData { + return FungibleTokenPacketData.fromAmino(object.value); + }, + toAminoMsg(message: FungibleTokenPacketData): FungibleTokenPacketDataAminoMsg { + return { + type: "cosmos-sdk/FungibleTokenPacketData", + value: FungibleTokenPacketData.toAmino(message) + }; + }, + fromProtoMsg(message: FungibleTokenPacketDataProtoMsg): FungibleTokenPacketData { + return FungibleTokenPacketData.decode(message.value); + }, + toProto(message: FungibleTokenPacketData): Uint8Array { + return FungibleTokenPacketData.encode(message).finish(); + }, + toProtoMsg(message: FungibleTokenPacketData): FungibleTokenPacketDataProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v2.FungibleTokenPacketData", + value: FungibleTokenPacketData.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/bundle.ts b/dydxjs/packages/dydxjs/src/ibc/bundle.ts new file mode 100644 index 00000000..fd770ddd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/bundle.ts @@ -0,0 +1,127 @@ +//@ts-nocheck +import * as _195 from "./applications/transfer/v1/genesis"; +import * as _196 from "./applications/transfer/v1/query"; +import * as _197 from "./applications/transfer/v1/transfer"; +import * as _198 from "./applications/transfer/v1/tx"; +import * as _199 from "./applications/transfer/v2/packet"; +import * as _200 from "./core/channel/v1/channel"; +import * as _201 from "./core/channel/v1/genesis"; +import * as _202 from "./core/channel/v1/query"; +import * as _203 from "./core/channel/v1/tx"; +import * as _204 from "./core/client/v1/client"; +import * as _205 from "./core/client/v1/genesis"; +import * as _206 from "./core/client/v1/query"; +import * as _207 from "./core/client/v1/tx"; +import * as _208 from "./core/commitment/v1/commitment"; +import * as _209 from "./core/connection/v1/connection"; +import * as _210 from "./core/connection/v1/genesis"; +import * as _211 from "./core/connection/v1/query"; +import * as _212 from "./core/connection/v1/tx"; +import * as _213 from "./lightclients/localhost/v1/localhost"; +import * as _214 from "./lightclients/solomachine/v1/solomachine"; +import * as _215 from "./lightclients/solomachine/v2/solomachine"; +import * as _216 from "./lightclients/tendermint/v1/tendermint"; +import * as _374 from "./applications/transfer/v1/tx.amino"; +import * as _375 from "./core/channel/v1/tx.amino"; +import * as _376 from "./core/client/v1/tx.amino"; +import * as _377 from "./core/connection/v1/tx.amino"; +import * as _378 from "./applications/transfer/v1/tx.registry"; +import * as _379 from "./core/channel/v1/tx.registry"; +import * as _380 from "./core/client/v1/tx.registry"; +import * as _381 from "./core/connection/v1/tx.registry"; +import * as _382 from "./applications/transfer/v1/query.rpc.Query"; +import * as _383 from "./core/channel/v1/query.rpc.Query"; +import * as _384 from "./core/client/v1/query.rpc.Query"; +import * as _385 from "./core/connection/v1/query.rpc.Query"; +import * as _386 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _387 from "./core/channel/v1/tx.rpc.msg"; +import * as _388 from "./core/client/v1/tx.rpc.msg"; +import * as _389 from "./core/connection/v1/tx.rpc.msg"; +import * as _413 from "./rpc.query"; +import * as _414 from "./rpc.tx"; +export namespace ibc { + export namespace applications { + export namespace transfer { + export const v1 = { + ..._195, + ..._196, + ..._197, + ..._198, + ..._374, + ..._378, + ..._382, + ..._386 + }; + export const v2 = { + ..._199 + }; + } + } + export namespace core { + export namespace channel { + export const v1 = { + ..._200, + ..._201, + ..._202, + ..._203, + ..._375, + ..._379, + ..._383, + ..._387 + }; + } + export namespace client { + export const v1 = { + ..._204, + ..._205, + ..._206, + ..._207, + ..._376, + ..._380, + ..._384, + ..._388 + }; + } + export namespace commitment { + export const v1 = { + ..._208 + }; + } + export namespace connection { + export const v1 = { + ..._209, + ..._210, + ..._211, + ..._212, + ..._377, + ..._381, + ..._385, + ..._389 + }; + } + } + export namespace lightclients { + export namespace localhost { + export const v1 = { + ..._213 + }; + } + export namespace solomachine { + export const v1 = { + ..._214 + }; + export const v2 = { + ..._215 + }; + } + export namespace tendermint { + export const v1 = { + ..._216 + }; + } + } + export const ClientFactory = { + ..._413, + ..._414 + }; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/client.ts b/dydxjs/packages/dydxjs/src/ibc/client.ts new file mode 100644 index 00000000..df50a9e1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/client.ts @@ -0,0 +1,55 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as ibcApplicationsTransferV1TxRegistry from "./applications/transfer/v1/tx.registry"; +import * as ibcCoreChannelV1TxRegistry from "./core/channel/v1/tx.registry"; +import * as ibcCoreClientV1TxRegistry from "./core/client/v1/tx.registry"; +import * as ibcCoreConnectionV1TxRegistry from "./core/connection/v1/tx.registry"; +import * as ibcApplicationsTransferV1TxAmino from "./applications/transfer/v1/tx.amino"; +import * as ibcCoreChannelV1TxAmino from "./core/channel/v1/tx.amino"; +import * as ibcCoreClientV1TxAmino from "./core/client/v1/tx.amino"; +import * as ibcCoreConnectionV1TxAmino from "./core/connection/v1/tx.amino"; +export const ibcAminoConverters = { + ...ibcApplicationsTransferV1TxAmino.AminoConverter, + ...ibcCoreChannelV1TxAmino.AminoConverter, + ...ibcCoreClientV1TxAmino.AminoConverter, + ...ibcCoreConnectionV1TxAmino.AminoConverter +}; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry]; +export const getSigningIbcClientOptions = ({ + defaultTypes = defaultRegistryTypes +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...ibcProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...ibcAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningIbcClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningIbcClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/channel.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/channel.ts new file mode 100644 index 00000000..4a790f3a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/channel.ts @@ -0,0 +1,1114 @@ +//@ts-nocheck +import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ + STATE_TRYOPEN = 2, + /** + * STATE_OPEN - A channel has completed the handshake. Open channels are + * ready to send and receive packets. + */ + STATE_OPEN = 3, + /** + * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + * packets. + */ + STATE_CLOSED = 4, + UNRECOGNIZED = -1, +} +export const StateSDKType = State; +export const StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case 4: + case "STATE_CLOSED": + return State.STATE_CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.STATE_CLOSED: + return "STATE_CLOSED"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Order defines if a channel is ORDERED or UNORDERED */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ + ORDER_NONE_UNSPECIFIED = 0, + /** + * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + * which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1, +} +export const OrderSDKType = Order; +export const OrderAmino = Order; +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case "ORDER_NONE_UNSPECIFIED": + return Order.ORDER_NONE_UNSPECIFIED; + case 1: + case "ORDER_UNORDERED": + return Order.ORDER_UNORDERED; + case 2: + case "ORDER_ORDERED": + return Order.ORDER_ORDERED; + case -1: + case "UNRECOGNIZED": + default: + return Order.UNRECOGNIZED; + } +} +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return "ORDER_NONE_UNSPECIFIED"; + case Order.ORDER_UNORDERED: + return "ORDER_UNORDERED"; + case Order.ORDER_ORDERED: + return "ORDER_ORDERED"; + case Order.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; +} +export interface ChannelProtoMsg { + typeUrl: "/ibc.core.channel.v1.Channel"; + value: Uint8Array; +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface ChannelAmino { + /** current state of the channel end */ + state?: State; + /** whether the channel is ordered or unordered */ + ordering?: Order; + /** counterparty channel end */ + counterparty?: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops?: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version?: string; +} +export interface ChannelAminoMsg { + type: "cosmos-sdk/Channel"; + value: ChannelAmino; +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface ChannelSDKType { + state: State; + ordering: Order; + counterparty: CounterpartySDKType; + connection_hops: string[]; + version: string; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + portId: string; + /** channel identifier */ + channelId: string; +} +export interface IdentifiedChannelProtoMsg { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel"; + value: Uint8Array; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelAmino { + /** current state of the channel end */ + state?: State; + /** whether the channel is ordered or unordered */ + ordering?: Order; + /** counterparty channel end */ + counterparty?: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops?: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version?: string; + /** port identifier */ + port_id?: string; + /** channel identifier */ + channel_id?: string; +} +export interface IdentifiedChannelAminoMsg { + type: "cosmos-sdk/IdentifiedChannel"; + value: IdentifiedChannelAmino; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelSDKType { + state: State; + ordering: Order; + counterparty: CounterpartySDKType; + connection_hops: string[]; + version: string; + port_id: string; + channel_id: string; +} +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string; + /** channel end on the counterparty chain */ + channelId: string; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.channel.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines a channel end counterparty */ +export interface CounterpartyAmino { + /** port on the counterparty chain which owns the other end of the channel. */ + port_id?: string; + /** channel end on the counterparty chain */ + channel_id?: string; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** Counterparty defines a channel end counterparty */ +export interface CounterpartySDKType { + port_id: string; + channel_id: string; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: bigint; + /** identifies the port on the sending chain. */ + sourcePort: string; + /** identifies the channel end on the sending chain. */ + sourceChannel: string; + /** identifies the port on the receiving chain. */ + destinationPort: string; + /** identifies the channel end on the receiving chain. */ + destinationChannel: string; + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array; + /** block height after which the packet times out */ + timeoutHeight: Height; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: bigint; +} +export interface PacketProtoMsg { + typeUrl: "/ibc.core.channel.v1.Packet"; + value: Uint8Array; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketAmino { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence?: string; + /** identifies the port on the sending chain. */ + source_port?: string; + /** identifies the channel end on the sending chain. */ + source_channel?: string; + /** identifies the port on the receiving chain. */ + destination_port?: string; + /** identifies the channel end on the receiving chain. */ + destination_channel?: string; + /** actual opaque bytes transferred directly to the application module */ + data?: string; + /** block height after which the packet times out */ + timeout_height?: HeightAmino; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeout_timestamp?: string; +} +export interface PacketAminoMsg { + type: "cosmos-sdk/Packet"; + value: PacketAmino; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketSDKType { + sequence: bigint; + source_port: string; + source_channel: string; + destination_port: string; + destination_channel: string; + data: Uint8Array; + timeout_height: HeightSDKType; + timeout_timestamp: bigint; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string; + /** channel unique identifier. */ + channelId: string; + /** packet sequence. */ + sequence: bigint; + /** embedded data that represents packet state. */ + data: Uint8Array; +} +export interface PacketStateProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketState"; + value: Uint8Array; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketStateAmino { + /** channel port identifier. */ + port_id?: string; + /** channel unique identifier. */ + channel_id?: string; + /** packet sequence. */ + sequence?: string; + /** embedded data that represents packet state. */ + data?: string; +} +export interface PacketStateAminoMsg { + type: "cosmos-sdk/PacketState"; + value: PacketStateAmino; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketStateSDKType { + port_id: string; + channel_id: string; + sequence: bigint; + data: Uint8Array; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result?: Uint8Array; + error?: string; +} +export interface AcknowledgementProtoMsg { + typeUrl: "/ibc.core.channel.v1.Acknowledgement"; + value: Uint8Array; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface AcknowledgementAmino { + result?: string; + error?: string; +} +export interface AcknowledgementAminoMsg { + type: "cosmos-sdk/Acknowledgement"; + value: AcknowledgementAmino; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface AcknowledgementSDKType { + result?: Uint8Array; + error?: string; +} +function createBaseChannel(): Channel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "" + }; +} +export const Channel = { + typeUrl: "/ibc.core.channel.v1.Channel", + encode(message: Channel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Channel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Channel { + const message = createBaseChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.connectionHops = object.connectionHops?.map(e => e) || []; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: ChannelAmino): Channel { + const message = createBaseChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: Channel): ChannelAmino { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = message.connectionHops; + } + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: ChannelAminoMsg): Channel { + return Channel.fromAmino(object.value); + }, + toAminoMsg(message: Channel): ChannelAminoMsg { + return { + type: "cosmos-sdk/Channel", + value: Channel.toAmino(message) + }; + }, + fromProtoMsg(message: ChannelProtoMsg): Channel { + return Channel.decode(message.value); + }, + toProto(message: Channel): Uint8Array { + return Channel.encode(message).finish(); + }, + toProtoMsg(message: Channel): ChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Channel", + value: Channel.encode(message).finish() + }; + } +}; +function createBaseIdentifiedChannel(): IdentifiedChannel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "", + portId: "", + channelId: "" + }; +} +export const IdentifiedChannel = { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + encode(message: IdentifiedChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.portId !== "") { + writer.uint32(50).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(58).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IdentifiedChannel { + const message = createBaseIdentifiedChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.connectionHops = object.connectionHops?.map(e => e) || []; + message.version = object.version ?? ""; + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { + const message = createBaseIdentifiedChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = message.connectionHops; + } + obj.version = message.version === "" ? undefined : message.version; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel { + return IdentifiedChannel.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedChannel): IdentifiedChannelAminoMsg { + return { + type: "cosmos-sdk/IdentifiedChannel", + value: IdentifiedChannel.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedChannelProtoMsg): IdentifiedChannel { + return IdentifiedChannel.decode(message.value); + }, + toProto(message: IdentifiedChannel): Uint8Array { + return IdentifiedChannel.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedChannel): IdentifiedChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + value: IdentifiedChannel.encode(message).finish() + }; + } +}; +function createBaseCounterparty(): Counterparty { + return { + portId: "", + channelId: "" + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.channel.v1.Counterparty", + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Counterparty { + const message = createBaseCounterparty(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: Counterparty): CounterpartyAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +function createBasePacket(): Packet { + return { + sequence: BigInt(0), + sourcePort: "", + sourceChannel: "", + destinationPort: "", + destinationChannel: "", + data: new Uint8Array(), + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0) + }; +} +export const Packet = { + typeUrl: "/ibc.core.channel.v1.Packet", + encode(message: Packet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.sourcePort !== "") { + writer.uint32(18).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(26).string(message.sourceChannel); + } + if (message.destinationPort !== "") { + writer.uint32(34).string(message.destinationPort); + } + if (message.destinationChannel !== "") { + writer.uint32(42).string(message.destinationChannel); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(64).uint64(message.timeoutTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Packet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Packet { + const message = createBasePacket(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.destinationPort = object.destinationPort ?? ""; + message.destinationChannel = object.destinationChannel ?? ""; + message.data = object.data ?? new Uint8Array(); + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketAmino): Packet { + const message = createBasePacket(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.destination_port !== undefined && object.destination_port !== null) { + message.destinationPort = object.destination_port; + } + if (object.destination_channel !== undefined && object.destination_channel !== null) { + message.destinationChannel = object.destination_channel; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + return message; + }, + toAmino(message: Packet): PacketAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; + obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; + obj.destination_port = message.destinationPort === "" ? undefined : message.destinationPort; + obj.destination_channel = message.destinationChannel === "" ? undefined : message.destinationChannel; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketAminoMsg): Packet { + return Packet.fromAmino(object.value); + }, + toAminoMsg(message: Packet): PacketAminoMsg { + return { + type: "cosmos-sdk/Packet", + value: Packet.toAmino(message) + }; + }, + fromProtoMsg(message: PacketProtoMsg): Packet { + return Packet.decode(message.value); + }, + toProto(message: Packet): Uint8Array { + return Packet.encode(message).finish(); + }, + toProtoMsg(message: Packet): PacketProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Packet", + value: Packet.encode(message).finish() + }; + } +}; +function createBasePacketState(): PacketState { + return { + portId: "", + channelId: "", + sequence: BigInt(0), + data: new Uint8Array() + }; +} +export const PacketState = { + typeUrl: "/ibc.core.channel.v1.PacketState", + encode(message: PacketState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + if (message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketState { + const message = createBasePacketState(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketStateAmino): PacketState { + const message = createBasePacketState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: PacketState): PacketStateAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: PacketStateAminoMsg): PacketState { + return PacketState.fromAmino(object.value); + }, + toAminoMsg(message: PacketState): PacketStateAminoMsg { + return { + type: "cosmos-sdk/PacketState", + value: PacketState.toAmino(message) + }; + }, + fromProtoMsg(message: PacketStateProtoMsg): PacketState { + return PacketState.decode(message.value); + }, + toProto(message: PacketState): Uint8Array { + return PacketState.encode(message).finish(); + }, + toProtoMsg(message: PacketState): PacketStateProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketState", + value: PacketState.encode(message).finish() + }; + } +}; +function createBaseAcknowledgement(): Acknowledgement { + return { + result: undefined, + error: undefined + }; +} +export const Acknowledgement = { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + encode(message: Acknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== undefined) { + writer.uint32(170).bytes(message.result); + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Acknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Acknowledgement { + const message = createBaseAcknowledgement(); + message.result = object.result ?? undefined; + message.error = object.error ?? undefined; + return message; + }, + fromAmino(object: AcknowledgementAmino): Acknowledgement { + const message = createBaseAcknowledgement(); + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: Acknowledgement): AcknowledgementAmino { + const obj: any = {}; + obj.result = message.result ? base64FromBytes(message.result) : undefined; + obj.error = message.error === null ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: AcknowledgementAminoMsg): Acknowledgement { + return Acknowledgement.fromAmino(object.value); + }, + toAminoMsg(message: Acknowledgement): AcknowledgementAminoMsg { + return { + type: "cosmos-sdk/Acknowledgement", + value: Acknowledgement.toAmino(message) + }; + }, + fromProtoMsg(message: AcknowledgementProtoMsg): Acknowledgement { + return Acknowledgement.decode(message.value); + }, + toProto(message: Acknowledgement): Uint8Array { + return Acknowledgement.encode(message).finish(); + }, + toProtoMsg(message: Acknowledgement): AcknowledgementProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + value: Acknowledgement.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/genesis.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/genesis.ts new file mode 100644 index 00000000..bcfdcd05 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/genesis.ts @@ -0,0 +1,341 @@ +//@ts-nocheck +import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisState { + channels: IdentifiedChannel[]; + acknowledgements: PacketState[]; + commitments: PacketState[]; + receipts: PacketState[]; + sendSequences: PacketSequence[]; + recvSequences: PacketSequence[]; + ackSequences: PacketSequence[]; + /** the sequence for the next generated channel identifier */ + nextChannelSequence: bigint; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.channel.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisStateAmino { + channels?: IdentifiedChannelAmino[]; + acknowledgements?: PacketStateAmino[]; + commitments?: PacketStateAmino[]; + receipts?: PacketStateAmino[]; + send_sequences?: PacketSequenceAmino[]; + recv_sequences?: PacketSequenceAmino[]; + ack_sequences?: PacketSequenceAmino[]; + /** the sequence for the next generated channel identifier */ + next_channel_sequence?: string; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisStateSDKType { + channels: IdentifiedChannelSDKType[]; + acknowledgements: PacketStateSDKType[]; + commitments: PacketStateSDKType[]; + receipts: PacketStateSDKType[]; + send_sequences: PacketSequenceSDKType[]; + recv_sequences: PacketSequenceSDKType[]; + ack_sequences: PacketSequenceSDKType[]; + next_channel_sequence: bigint; +} +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequence { + portId: string; + channelId: string; + sequence: bigint; +} +export interface PacketSequenceProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketSequence"; + value: Uint8Array; +} +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequenceAmino { + port_id?: string; + channel_id?: string; + sequence?: string; +} +export interface PacketSequenceAminoMsg { + type: "cosmos-sdk/PacketSequence"; + value: PacketSequenceAmino; +} +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequenceSDKType { + port_id: string; + channel_id: string; + sequence: bigint; +} +function createBaseGenesisState(): GenesisState { + return { + channels: [], + acknowledgements: [], + commitments: [], + receipts: [], + sendSequences: [], + recvSequences: [], + ackSequences: [], + nextChannelSequence: BigInt(0) + }; +} +export const GenesisState = { + typeUrl: "/ibc.core.channel.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.acknowledgements) { + PacketState.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.commitments) { + PacketState.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.receipts) { + PacketState.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.sendSequences) { + PacketSequence.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.recvSequences) { + PacketSequence.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.ackSequences) { + PacketSequence.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.nextChannelSequence !== BigInt(0)) { + writer.uint32(64).uint64(message.nextChannelSequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.acknowledgements.push(PacketState.decode(reader, reader.uint32())); + break; + case 3: + message.commitments.push(PacketState.decode(reader, reader.uint32())); + break; + case 4: + message.receipts.push(PacketState.decode(reader, reader.uint32())); + break; + case 5: + message.sendSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 6: + message.recvSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 7: + message.ackSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 8: + message.nextChannelSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromPartial(e)) || []; + message.commitments = object.commitments?.map(e => PacketState.fromPartial(e)) || []; + message.receipts = object.receipts?.map(e => PacketState.fromPartial(e)) || []; + message.sendSequences = object.sendSequences?.map(e => PacketSequence.fromPartial(e)) || []; + message.recvSequences = object.recvSequences?.map(e => PacketSequence.fromPartial(e)) || []; + message.ackSequences = object.ackSequences?.map(e => PacketSequence.fromPartial(e)) || []; + message.nextChannelSequence = object.nextChannelSequence !== undefined && object.nextChannelSequence !== null ? BigInt(object.nextChannelSequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromAmino(e)) || []; + message.commitments = object.commitments?.map(e => PacketState.fromAmino(e)) || []; + message.receipts = object.receipts?.map(e => PacketState.fromAmino(e)) || []; + message.sendSequences = object.send_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + message.recvSequences = object.recv_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + message.ackSequences = object.ack_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + if (object.next_channel_sequence !== undefined && object.next_channel_sequence !== null) { + message.nextChannelSequence = BigInt(object.next_channel_sequence); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map(e => e ? IdentifiedChannel.toAmino(e) : undefined); + } else { + obj.channels = message.channels; + } + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map(e => e ? PacketState.toAmino(e) : undefined); + } else { + obj.acknowledgements = message.acknowledgements; + } + if (message.commitments) { + obj.commitments = message.commitments.map(e => e ? PacketState.toAmino(e) : undefined); + } else { + obj.commitments = message.commitments; + } + if (message.receipts) { + obj.receipts = message.receipts.map(e => e ? PacketState.toAmino(e) : undefined); + } else { + obj.receipts = message.receipts; + } + if (message.sendSequences) { + obj.send_sequences = message.sendSequences.map(e => e ? PacketSequence.toAmino(e) : undefined); + } else { + obj.send_sequences = message.sendSequences; + } + if (message.recvSequences) { + obj.recv_sequences = message.recvSequences.map(e => e ? PacketSequence.toAmino(e) : undefined); + } else { + obj.recv_sequences = message.recvSequences; + } + if (message.ackSequences) { + obj.ack_sequences = message.ackSequences.map(e => e ? PacketSequence.toAmino(e) : undefined); + } else { + obj.ack_sequences = message.ackSequences; + } + obj.next_channel_sequence = message.nextChannelSequence !== BigInt(0) ? message.nextChannelSequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBasePacketSequence(): PacketSequence { + return { + portId: "", + channelId: "", + sequence: BigInt(0) + }; +} +export const PacketSequence = { + typeUrl: "/ibc.core.channel.v1.PacketSequence", + encode(message: PacketSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketSequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketSequence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketSequence { + const message = createBasePacketSequence(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketSequenceAmino): PacketSequence { + const message = createBasePacketSequence(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: PacketSequence): PacketSequenceAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketSequenceAminoMsg): PacketSequence { + return PacketSequence.fromAmino(object.value); + }, + toAminoMsg(message: PacketSequence): PacketSequenceAminoMsg { + return { + type: "cosmos-sdk/PacketSequence", + value: PacketSequence.toAmino(message) + }; + }, + fromProtoMsg(message: PacketSequenceProtoMsg): PacketSequence { + return PacketSequence.decode(message.value); + }, + toProto(message: PacketSequence): Uint8Array { + return PacketSequence.encode(message).finish(); + }, + toProtoMsg(message: PacketSequence): PacketSequenceProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketSequence", + value: PacketSequence.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/query.rpc.Query.ts new file mode 100644 index 00000000..fc6887c2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/query.rpc.Query.ts @@ -0,0 +1,189 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryChannelRequest, QueryChannelResponse, QueryChannelsRequest, QueryChannelsResponse, QueryConnectionChannelsRequest, QueryConnectionChannelsResponse, QueryChannelClientStateRequest, QueryChannelClientStateResponse, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponse, QueryPacketCommitmentRequest, QueryPacketCommitmentResponse, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponse, QueryPacketReceiptRequest, QueryPacketReceiptResponse, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponse, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponse, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponse, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponse, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse } from "./query"; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Channel queries an IBC Channel. */ + channel(request: QueryChannelRequest): Promise; + /** Channels queries all the IBC channels of a chain. */ + channels(request?: QueryChannelsRequest): Promise; + /** + * ConnectionChannels queries all the channels associated with a connection + * end. + */ + connectionChannels(request: QueryConnectionChannelsRequest): Promise; + /** + * ChannelClientState queries for the client state for the channel associated + * with the provided channel identifiers. + */ + channelClientState(request: QueryChannelClientStateRequest): Promise; + /** + * ChannelConsensusState queries for the consensus state for the channel + * associated with the provided channel identifiers. + */ + channelConsensusState(request: QueryChannelConsensusStateRequest): Promise; + /** PacketCommitment queries a stored packet commitment hash. */ + packetCommitment(request: QueryPacketCommitmentRequest): Promise; + /** + * PacketCommitments returns all the packet commitments hashes associated + * with a channel. + */ + packetCommitments(request: QueryPacketCommitmentsRequest): Promise; + /** + * PacketReceipt queries if a given packet sequence has been received on the + * queried chain + */ + packetReceipt(request: QueryPacketReceiptRequest): Promise; + /** PacketAcknowledgement queries a stored packet acknowledgement hash. */ + packetAcknowledgement(request: QueryPacketAcknowledgementRequest): Promise; + /** + * PacketAcknowledgements returns all the packet acknowledgements associated + * with a channel. + */ + packetAcknowledgements(request: QueryPacketAcknowledgementsRequest): Promise; + /** + * UnreceivedPackets returns all the unreceived IBC packets associated with a + * channel and sequences. + */ + unreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise; + /** + * UnreceivedAcks returns all the unreceived IBC acknowledgements associated + * with a channel and sequences. + */ + unreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; + /** NextSequenceReceive returns the next receive sequence for a given channel. */ + nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.channel = this.channel.bind(this); + this.channels = this.channels.bind(this); + this.connectionChannels = this.connectionChannels.bind(this); + this.channelClientState = this.channelClientState.bind(this); + this.channelConsensusState = this.channelConsensusState.bind(this); + this.packetCommitment = this.packetCommitment.bind(this); + this.packetCommitments = this.packetCommitments.bind(this); + this.packetReceipt = this.packetReceipt.bind(this); + this.packetAcknowledgement = this.packetAcknowledgement.bind(this); + this.packetAcknowledgements = this.packetAcknowledgements.bind(this); + this.unreceivedPackets = this.unreceivedPackets.bind(this); + this.unreceivedAcks = this.unreceivedAcks.bind(this); + this.nextSequenceReceive = this.nextSequenceReceive.bind(this); + } + channel(request: QueryChannelRequest): Promise { + const data = QueryChannelRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channel", data); + return promise.then(data => QueryChannelResponse.decode(new BinaryReader(data))); + } + channels(request: QueryChannelsRequest = { + pagination: undefined + }): Promise { + const data = QueryChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channels", data); + return promise.then(data => QueryChannelsResponse.decode(new BinaryReader(data))); + } + connectionChannels(request: QueryConnectionChannelsRequest): Promise { + const data = QueryConnectionChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ConnectionChannels", data); + return promise.then(data => QueryConnectionChannelsResponse.decode(new BinaryReader(data))); + } + channelClientState(request: QueryChannelClientStateRequest): Promise { + const data = QueryChannelClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelClientState", data); + return promise.then(data => QueryChannelClientStateResponse.decode(new BinaryReader(data))); + } + channelConsensusState(request: QueryChannelConsensusStateRequest): Promise { + const data = QueryChannelConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelConsensusState", data); + return promise.then(data => QueryChannelConsensusStateResponse.decode(new BinaryReader(data))); + } + packetCommitment(request: QueryPacketCommitmentRequest): Promise { + const data = QueryPacketCommitmentRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitment", data); + return promise.then(data => QueryPacketCommitmentResponse.decode(new BinaryReader(data))); + } + packetCommitments(request: QueryPacketCommitmentsRequest): Promise { + const data = QueryPacketCommitmentsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitments", data); + return promise.then(data => QueryPacketCommitmentsResponse.decode(new BinaryReader(data))); + } + packetReceipt(request: QueryPacketReceiptRequest): Promise { + const data = QueryPacketReceiptRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketReceipt", data); + return promise.then(data => QueryPacketReceiptResponse.decode(new BinaryReader(data))); + } + packetAcknowledgement(request: QueryPacketAcknowledgementRequest): Promise { + const data = QueryPacketAcknowledgementRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgement", data); + return promise.then(data => QueryPacketAcknowledgementResponse.decode(new BinaryReader(data))); + } + packetAcknowledgements(request: QueryPacketAcknowledgementsRequest): Promise { + const data = QueryPacketAcknowledgementsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgements", data); + return promise.then(data => QueryPacketAcknowledgementsResponse.decode(new BinaryReader(data))); + } + unreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise { + const data = QueryUnreceivedPacketsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedPackets", data); + return promise.then(data => QueryUnreceivedPacketsResponse.decode(new BinaryReader(data))); + } + unreceivedAcks(request: QueryUnreceivedAcksRequest): Promise { + const data = QueryUnreceivedAcksRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedAcks", data); + return promise.then(data => QueryUnreceivedAcksResponse.decode(new BinaryReader(data))); + } + nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { + const data = QueryNextSequenceReceiveRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); + return promise.then(data => QueryNextSequenceReceiveResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + channel(request: QueryChannelRequest): Promise { + return queryService.channel(request); + }, + channels(request?: QueryChannelsRequest): Promise { + return queryService.channels(request); + }, + connectionChannels(request: QueryConnectionChannelsRequest): Promise { + return queryService.connectionChannels(request); + }, + channelClientState(request: QueryChannelClientStateRequest): Promise { + return queryService.channelClientState(request); + }, + channelConsensusState(request: QueryChannelConsensusStateRequest): Promise { + return queryService.channelConsensusState(request); + }, + packetCommitment(request: QueryPacketCommitmentRequest): Promise { + return queryService.packetCommitment(request); + }, + packetCommitments(request: QueryPacketCommitmentsRequest): Promise { + return queryService.packetCommitments(request); + }, + packetReceipt(request: QueryPacketReceiptRequest): Promise { + return queryService.packetReceipt(request); + }, + packetAcknowledgement(request: QueryPacketAcknowledgementRequest): Promise { + return queryService.packetAcknowledgement(request); + }, + packetAcknowledgements(request: QueryPacketAcknowledgementsRequest): Promise { + return queryService.packetAcknowledgements(request); + }, + unreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise { + return queryService.unreceivedPackets(request); + }, + unreceivedAcks(request: QueryUnreceivedAcksRequest): Promise { + return queryService.unreceivedAcks(request); + }, + nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { + return queryService.nextSequenceReceive(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/query.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/query.ts new file mode 100644 index 00000000..1a120e98 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/query.ts @@ -0,0 +1,3450 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Channel, ChannelAmino, ChannelSDKType, IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType } from "../../client/v1/client"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** QueryChannelRequest is the request type for the Query/Channel RPC method */ +export interface QueryChannelRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} +export interface QueryChannelRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelRequest"; + value: Uint8Array; +} +/** QueryChannelRequest is the request type for the Query/Channel RPC method */ +export interface QueryChannelRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; +} +export interface QueryChannelRequestAminoMsg { + type: "cosmos-sdk/QueryChannelRequest"; + value: QueryChannelRequestAmino; +} +/** QueryChannelRequest is the request type for the Query/Channel RPC method */ +export interface QueryChannelRequestSDKType { + port_id: string; + channel_id: string; +} +/** + * QueryChannelResponse is the response type for the Query/Channel RPC method. + * Besides the Channel end, it includes a proof and the height from which the + * proof was retrieved. + */ +export interface QueryChannelResponse { + /** channel associated with the request identifiers */ + channel?: Channel; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryChannelResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelResponse"; + value: Uint8Array; +} +/** + * QueryChannelResponse is the response type for the Query/Channel RPC method. + * Besides the Channel end, it includes a proof and the height from which the + * proof was retrieved. + */ +export interface QueryChannelResponseAmino { + /** channel associated with the request identifiers */ + channel?: ChannelAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryChannelResponseAminoMsg { + type: "cosmos-sdk/QueryChannelResponse"; + value: QueryChannelResponseAmino; +} +/** + * QueryChannelResponse is the response type for the Query/Channel RPC method. + * Besides the Channel end, it includes a proof and the height from which the + * proof was retrieved. + */ +export interface QueryChannelResponseSDKType { + channel?: ChannelSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryChannelsRequest is the request type for the Query/Channels RPC method */ +export interface QueryChannelsRequest { + /** pagination request */ + pagination?: PageRequest; +} +export interface QueryChannelsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest"; + value: Uint8Array; +} +/** QueryChannelsRequest is the request type for the Query/Channels RPC method */ +export interface QueryChannelsRequestAmino { + /** pagination request */ + pagination?: PageRequestAmino; +} +export interface QueryChannelsRequestAminoMsg { + type: "cosmos-sdk/QueryChannelsRequest"; + value: QueryChannelsRequestAmino; +} +/** QueryChannelsRequest is the request type for the Query/Channels RPC method */ +export interface QueryChannelsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ +export interface QueryChannelsResponse { + /** list of stored channels of the chain. */ + channels: IdentifiedChannel[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height: Height; +} +export interface QueryChannelsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse"; + value: Uint8Array; +} +/** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ +export interface QueryChannelsResponseAmino { + /** list of stored channels of the chain. */ + channels?: IdentifiedChannelAmino[]; + /** pagination response */ + pagination?: PageResponseAmino; + /** query block height */ + height?: HeightAmino; +} +export interface QueryChannelsResponseAminoMsg { + type: "cosmos-sdk/QueryChannelsResponse"; + value: QueryChannelsResponseAmino; +} +/** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ +export interface QueryChannelsResponseSDKType { + channels: IdentifiedChannelSDKType[]; + pagination?: PageResponseSDKType; + height: HeightSDKType; +} +/** + * QueryConnectionChannelsRequest is the request type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsRequest { + /** connection unique identifier */ + connection: string; + /** pagination request */ + pagination?: PageRequest; +} +export interface QueryConnectionChannelsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest"; + value: Uint8Array; +} +/** + * QueryConnectionChannelsRequest is the request type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsRequestAmino { + /** connection unique identifier */ + connection?: string; + /** pagination request */ + pagination?: PageRequestAmino; +} +export interface QueryConnectionChannelsRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionChannelsRequest"; + value: QueryConnectionChannelsRequestAmino; +} +/** + * QueryConnectionChannelsRequest is the request type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsRequestSDKType { + connection: string; + pagination?: PageRequestSDKType; +} +/** + * QueryConnectionChannelsResponse is the Response type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsResponse { + /** list of channels associated with a connection. */ + channels: IdentifiedChannel[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height: Height; +} +export interface QueryConnectionChannelsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse"; + value: Uint8Array; +} +/** + * QueryConnectionChannelsResponse is the Response type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsResponseAmino { + /** list of channels associated with a connection. */ + channels?: IdentifiedChannelAmino[]; + /** pagination response */ + pagination?: PageResponseAmino; + /** query block height */ + height?: HeightAmino; +} +export interface QueryConnectionChannelsResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionChannelsResponse"; + value: QueryConnectionChannelsResponseAmino; +} +/** + * QueryConnectionChannelsResponse is the Response type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsResponseSDKType { + channels: IdentifiedChannelSDKType[]; + pagination?: PageResponseSDKType; + height: HeightSDKType; +} +/** + * QueryChannelClientStateRequest is the request type for the Query/ClientState + * RPC method + */ +export interface QueryChannelClientStateRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} +export interface QueryChannelClientStateRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest"; + value: Uint8Array; +} +/** + * QueryChannelClientStateRequest is the request type for the Query/ClientState + * RPC method + */ +export interface QueryChannelClientStateRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; +} +export interface QueryChannelClientStateRequestAminoMsg { + type: "cosmos-sdk/QueryChannelClientStateRequest"; + value: QueryChannelClientStateRequestAmino; +} +/** + * QueryChannelClientStateRequest is the request type for the Query/ClientState + * RPC method + */ +export interface QueryChannelClientStateRequestSDKType { + port_id: string; + channel_id: string; +} +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelClientStateResponse { + /** client state associated with the channel */ + identifiedClientState?: IdentifiedClientState; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryChannelClientStateResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse"; + value: Uint8Array; +} +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelClientStateResponseAmino { + /** client state associated with the channel */ + identified_client_state?: IdentifiedClientStateAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryChannelClientStateResponseAminoMsg { + type: "cosmos-sdk/QueryChannelClientStateResponse"; + value: QueryChannelClientStateResponseAmino; +} +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelClientStateResponseSDKType { + identified_client_state?: IdentifiedClientStateSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryChannelConsensusStateRequest is the request type for the + * Query/ConsensusState RPC method + */ +export interface QueryChannelConsensusStateRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** revision number of the consensus state */ + revisionNumber: bigint; + /** revision height of the consensus state */ + revisionHeight: bigint; +} +export interface QueryChannelConsensusStateRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryChannelConsensusStateRequest is the request type for the + * Query/ConsensusState RPC method + */ +export interface QueryChannelConsensusStateRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** revision number of the consensus state */ + revision_number?: string; + /** revision height of the consensus state */ + revision_height?: string; +} +export interface QueryChannelConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryChannelConsensusStateRequest"; + value: QueryChannelConsensusStateRequestAmino; +} +/** + * QueryChannelConsensusStateRequest is the request type for the + * Query/ConsensusState RPC method + */ +export interface QueryChannelConsensusStateRequestSDKType { + port_id: string; + channel_id: string; + revision_number: bigint; + revision_height: bigint; +} +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelConsensusStateResponse { + /** consensus state associated with the channel */ + consensusState?: Any; + /** client ID associated with the consensus state */ + clientId: string; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryChannelConsensusStateResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelConsensusStateResponseAmino { + /** consensus state associated with the channel */ + consensus_state?: AnyAmino; + /** client ID associated with the consensus state */ + client_id?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryChannelConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryChannelConsensusStateResponse"; + value: QueryChannelConsensusStateResponseAmino; +} +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelConsensusStateResponseSDKType { + consensus_state?: AnySDKType; + client_id: string; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryPacketCommitmentRequest is the request type for the + * Query/PacketCommitment RPC method + */ +export interface QueryPacketCommitmentRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: bigint; +} +export interface QueryPacketCommitmentRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest"; + value: Uint8Array; +} +/** + * QueryPacketCommitmentRequest is the request type for the + * Query/PacketCommitment RPC method + */ +export interface QueryPacketCommitmentRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** packet sequence */ + sequence?: string; +} +export interface QueryPacketCommitmentRequestAminoMsg { + type: "cosmos-sdk/QueryPacketCommitmentRequest"; + value: QueryPacketCommitmentRequestAmino; +} +/** + * QueryPacketCommitmentRequest is the request type for the + * Query/PacketCommitment RPC method + */ +export interface QueryPacketCommitmentRequestSDKType { + port_id: string; + channel_id: string; + sequence: bigint; +} +/** + * QueryPacketCommitmentResponse defines the client query response for a packet + * which also includes a proof and the height from which the proof was + * retrieved + */ +export interface QueryPacketCommitmentResponse { + /** packet associated with the request fields */ + commitment: Uint8Array; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryPacketCommitmentResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentResponse"; + value: Uint8Array; +} +/** + * QueryPacketCommitmentResponse defines the client query response for a packet + * which also includes a proof and the height from which the proof was + * retrieved + */ +export interface QueryPacketCommitmentResponseAmino { + /** packet associated with the request fields */ + commitment?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryPacketCommitmentResponseAminoMsg { + type: "cosmos-sdk/QueryPacketCommitmentResponse"; + value: QueryPacketCommitmentResponseAmino; +} +/** + * QueryPacketCommitmentResponse defines the client query response for a packet + * which also includes a proof and the height from which the proof was + * retrieved + */ +export interface QueryPacketCommitmentResponseSDKType { + commitment: Uint8Array; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryPacketCommitmentsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** pagination request */ + pagination?: PageRequest; +} +export interface QueryPacketCommitmentsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest"; + value: Uint8Array; +} +/** + * QueryPacketCommitmentsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** pagination request */ + pagination?: PageRequestAmino; +} +export interface QueryPacketCommitmentsRequestAminoMsg { + type: "cosmos-sdk/QueryPacketCommitmentsRequest"; + value: QueryPacketCommitmentsRequestAmino; +} +/** + * QueryPacketCommitmentsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsRequestSDKType { + port_id: string; + channel_id: string; + pagination?: PageRequestSDKType; +} +/** + * QueryPacketCommitmentsResponse is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsResponse { + commitments: PacketState[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height: Height; +} +export interface QueryPacketCommitmentsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsResponse"; + value: Uint8Array; +} +/** + * QueryPacketCommitmentsResponse is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsResponseAmino { + commitments?: PacketStateAmino[]; + /** pagination response */ + pagination?: PageResponseAmino; + /** query block height */ + height?: HeightAmino; +} +export interface QueryPacketCommitmentsResponseAminoMsg { + type: "cosmos-sdk/QueryPacketCommitmentsResponse"; + value: QueryPacketCommitmentsResponseAmino; +} +/** + * QueryPacketCommitmentsResponse is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsResponseSDKType { + commitments: PacketStateSDKType[]; + pagination?: PageResponseSDKType; + height: HeightSDKType; +} +/** + * QueryPacketReceiptRequest is the request type for the + * Query/PacketReceipt RPC method + */ +export interface QueryPacketReceiptRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: bigint; +} +export interface QueryPacketReceiptRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptRequest"; + value: Uint8Array; +} +/** + * QueryPacketReceiptRequest is the request type for the + * Query/PacketReceipt RPC method + */ +export interface QueryPacketReceiptRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** packet sequence */ + sequence?: string; +} +export interface QueryPacketReceiptRequestAminoMsg { + type: "cosmos-sdk/QueryPacketReceiptRequest"; + value: QueryPacketReceiptRequestAmino; +} +/** + * QueryPacketReceiptRequest is the request type for the + * Query/PacketReceipt RPC method + */ +export interface QueryPacketReceiptRequestSDKType { + port_id: string; + channel_id: string; + sequence: bigint; +} +/** + * QueryPacketReceiptResponse defines the client query response for a packet + * receipt which also includes a proof, and the height from which the proof was + * retrieved + */ +export interface QueryPacketReceiptResponse { + /** success flag for if receipt exists */ + received: boolean; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryPacketReceiptResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptResponse"; + value: Uint8Array; +} +/** + * QueryPacketReceiptResponse defines the client query response for a packet + * receipt which also includes a proof, and the height from which the proof was + * retrieved + */ +export interface QueryPacketReceiptResponseAmino { + /** success flag for if receipt exists */ + received?: boolean; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryPacketReceiptResponseAminoMsg { + type: "cosmos-sdk/QueryPacketReceiptResponse"; + value: QueryPacketReceiptResponseAmino; +} +/** + * QueryPacketReceiptResponse defines the client query response for a packet + * receipt which also includes a proof, and the height from which the proof was + * retrieved + */ +export interface QueryPacketReceiptResponseSDKType { + received: boolean; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryPacketAcknowledgementRequest is the request type for the + * Query/PacketAcknowledgement RPC method + */ +export interface QueryPacketAcknowledgementRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: bigint; +} +export interface QueryPacketAcknowledgementRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementRequest"; + value: Uint8Array; +} +/** + * QueryPacketAcknowledgementRequest is the request type for the + * Query/PacketAcknowledgement RPC method + */ +export interface QueryPacketAcknowledgementRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** packet sequence */ + sequence?: string; +} +export interface QueryPacketAcknowledgementRequestAminoMsg { + type: "cosmos-sdk/QueryPacketAcknowledgementRequest"; + value: QueryPacketAcknowledgementRequestAmino; +} +/** + * QueryPacketAcknowledgementRequest is the request type for the + * Query/PacketAcknowledgement RPC method + */ +export interface QueryPacketAcknowledgementRequestSDKType { + port_id: string; + channel_id: string; + sequence: bigint; +} +/** + * QueryPacketAcknowledgementResponse defines the client query response for a + * packet which also includes a proof and the height from which the + * proof was retrieved + */ +export interface QueryPacketAcknowledgementResponse { + /** packet associated with the request fields */ + acknowledgement: Uint8Array; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryPacketAcknowledgementResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementResponse"; + value: Uint8Array; +} +/** + * QueryPacketAcknowledgementResponse defines the client query response for a + * packet which also includes a proof and the height from which the + * proof was retrieved + */ +export interface QueryPacketAcknowledgementResponseAmino { + /** packet associated with the request fields */ + acknowledgement?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryPacketAcknowledgementResponseAminoMsg { + type: "cosmos-sdk/QueryPacketAcknowledgementResponse"; + value: QueryPacketAcknowledgementResponseAmino; +} +/** + * QueryPacketAcknowledgementResponse defines the client query response for a + * packet which also includes a proof and the height from which the + * proof was retrieved + */ +export interface QueryPacketAcknowledgementResponseSDKType { + acknowledgement: Uint8Array; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryPacketAcknowledgementsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketAcknowledgementsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** pagination request */ + pagination?: PageRequest; + /** list of packet sequences */ + packetCommitmentSequences: bigint[]; +} +export interface QueryPacketAcknowledgementsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest"; + value: Uint8Array; +} +/** + * QueryPacketAcknowledgementsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketAcknowledgementsRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** pagination request */ + pagination?: PageRequestAmino; + /** list of packet sequences */ + packet_commitment_sequences?: string[]; +} +export interface QueryPacketAcknowledgementsRequestAminoMsg { + type: "cosmos-sdk/QueryPacketAcknowledgementsRequest"; + value: QueryPacketAcknowledgementsRequestAmino; +} +/** + * QueryPacketAcknowledgementsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketAcknowledgementsRequestSDKType { + port_id: string; + channel_id: string; + pagination?: PageRequestSDKType; + packet_commitment_sequences: bigint[]; +} +/** + * QueryPacketAcknowledgemetsResponse is the request type for the + * Query/QueryPacketAcknowledgements RPC method + */ +export interface QueryPacketAcknowledgementsResponse { + acknowledgements: PacketState[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height: Height; +} +export interface QueryPacketAcknowledgementsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse"; + value: Uint8Array; +} +/** + * QueryPacketAcknowledgemetsResponse is the request type for the + * Query/QueryPacketAcknowledgements RPC method + */ +export interface QueryPacketAcknowledgementsResponseAmino { + acknowledgements?: PacketStateAmino[]; + /** pagination response */ + pagination?: PageResponseAmino; + /** query block height */ + height?: HeightAmino; +} +export interface QueryPacketAcknowledgementsResponseAminoMsg { + type: "cosmos-sdk/QueryPacketAcknowledgementsResponse"; + value: QueryPacketAcknowledgementsResponseAmino; +} +/** + * QueryPacketAcknowledgemetsResponse is the request type for the + * Query/QueryPacketAcknowledgements RPC method + */ +export interface QueryPacketAcknowledgementsResponseSDKType { + acknowledgements: PacketStateSDKType[]; + pagination?: PageResponseSDKType; + height: HeightSDKType; +} +/** + * QueryUnreceivedPacketsRequest is the request type for the + * Query/UnreceivedPackets RPC method + */ +export interface QueryUnreceivedPacketsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** list of packet sequences */ + packetCommitmentSequences: bigint[]; +} +export interface QueryUnreceivedPacketsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsRequest"; + value: Uint8Array; +} +/** + * QueryUnreceivedPacketsRequest is the request type for the + * Query/UnreceivedPackets RPC method + */ +export interface QueryUnreceivedPacketsRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** list of packet sequences */ + packet_commitment_sequences?: string[]; +} +export interface QueryUnreceivedPacketsRequestAminoMsg { + type: "cosmos-sdk/QueryUnreceivedPacketsRequest"; + value: QueryUnreceivedPacketsRequestAmino; +} +/** + * QueryUnreceivedPacketsRequest is the request type for the + * Query/UnreceivedPackets RPC method + */ +export interface QueryUnreceivedPacketsRequestSDKType { + port_id: string; + channel_id: string; + packet_commitment_sequences: bigint[]; +} +/** + * QueryUnreceivedPacketsResponse is the response type for the + * Query/UnreceivedPacketCommitments RPC method + */ +export interface QueryUnreceivedPacketsResponse { + /** list of unreceived packet sequences */ + sequences: bigint[]; + /** query block height */ + height: Height; +} +export interface QueryUnreceivedPacketsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsResponse"; + value: Uint8Array; +} +/** + * QueryUnreceivedPacketsResponse is the response type for the + * Query/UnreceivedPacketCommitments RPC method + */ +export interface QueryUnreceivedPacketsResponseAmino { + /** list of unreceived packet sequences */ + sequences?: string[]; + /** query block height */ + height?: HeightAmino; +} +export interface QueryUnreceivedPacketsResponseAminoMsg { + type: "cosmos-sdk/QueryUnreceivedPacketsResponse"; + value: QueryUnreceivedPacketsResponseAmino; +} +/** + * QueryUnreceivedPacketsResponse is the response type for the + * Query/UnreceivedPacketCommitments RPC method + */ +export interface QueryUnreceivedPacketsResponseSDKType { + sequences: bigint[]; + height: HeightSDKType; +} +/** + * QueryUnreceivedAcks is the request type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** list of acknowledgement sequences */ + packetAckSequences: bigint[]; +} +export interface QueryUnreceivedAcksRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksRequest"; + value: Uint8Array; +} +/** + * QueryUnreceivedAcks is the request type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** list of acknowledgement sequences */ + packet_ack_sequences?: string[]; +} +export interface QueryUnreceivedAcksRequestAminoMsg { + type: "cosmos-sdk/QueryUnreceivedAcksRequest"; + value: QueryUnreceivedAcksRequestAmino; +} +/** + * QueryUnreceivedAcks is the request type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksRequestSDKType { + port_id: string; + channel_id: string; + packet_ack_sequences: bigint[]; +} +/** + * QueryUnreceivedAcksResponse is the response type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksResponse { + /** list of unreceived acknowledgement sequences */ + sequences: bigint[]; + /** query block height */ + height: Height; +} +export interface QueryUnreceivedAcksResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksResponse"; + value: Uint8Array; +} +/** + * QueryUnreceivedAcksResponse is the response type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksResponseAmino { + /** list of unreceived acknowledgement sequences */ + sequences?: string[]; + /** query block height */ + height?: HeightAmino; +} +export interface QueryUnreceivedAcksResponseAminoMsg { + type: "cosmos-sdk/QueryUnreceivedAcksResponse"; + value: QueryUnreceivedAcksResponseAmino; +} +/** + * QueryUnreceivedAcksResponse is the response type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksResponseSDKType { + sequences: bigint[]; + height: HeightSDKType; +} +/** + * QueryNextSequenceReceiveRequest is the request type for the + * Query/QueryNextSequenceReceiveRequest RPC method + */ +export interface QueryNextSequenceReceiveRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} +export interface QueryNextSequenceReceiveRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveRequest"; + value: Uint8Array; +} +/** + * QueryNextSequenceReceiveRequest is the request type for the + * Query/QueryNextSequenceReceiveRequest RPC method + */ +export interface QueryNextSequenceReceiveRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; +} +export interface QueryNextSequenceReceiveRequestAminoMsg { + type: "cosmos-sdk/QueryNextSequenceReceiveRequest"; + value: QueryNextSequenceReceiveRequestAmino; +} +/** + * QueryNextSequenceReceiveRequest is the request type for the + * Query/QueryNextSequenceReceiveRequest RPC method + */ +export interface QueryNextSequenceReceiveRequestSDKType { + port_id: string; + channel_id: string; +} +/** + * QuerySequenceResponse is the request type for the + * Query/QueryNextSequenceReceiveResponse RPC method + */ +export interface QueryNextSequenceReceiveResponse { + /** next sequence receive number */ + nextSequenceReceive: bigint; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryNextSequenceReceiveResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveResponse"; + value: Uint8Array; +} +/** + * QuerySequenceResponse is the request type for the + * Query/QueryNextSequenceReceiveResponse RPC method + */ +export interface QueryNextSequenceReceiveResponseAmino { + /** next sequence receive number */ + next_sequence_receive?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryNextSequenceReceiveResponseAminoMsg { + type: "cosmos-sdk/QueryNextSequenceReceiveResponse"; + value: QueryNextSequenceReceiveResponseAmino; +} +/** + * QuerySequenceResponse is the request type for the + * Query/QueryNextSequenceReceiveResponse RPC method + */ +export interface QueryNextSequenceReceiveResponseSDKType { + next_sequence_receive: bigint; + proof: Uint8Array; + proof_height: HeightSDKType; +} +function createBaseQueryChannelRequest(): QueryChannelRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryChannelRequest = { + typeUrl: "/ibc.core.channel.v1.QueryChannelRequest", + encode(message: QueryChannelRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelRequest { + const message = createBaseQueryChannelRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryChannelRequestAmino): QueryChannelRequest { + const message = createBaseQueryChannelRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryChannelRequest): QueryChannelRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: QueryChannelRequestAminoMsg): QueryChannelRequest { + return QueryChannelRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelRequest): QueryChannelRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChannelRequest", + value: QueryChannelRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelRequestProtoMsg): QueryChannelRequest { + return QueryChannelRequest.decode(message.value); + }, + toProto(message: QueryChannelRequest): Uint8Array { + return QueryChannelRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelRequest): QueryChannelRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelRequest", + value: QueryChannelRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChannelResponse(): QueryChannelResponse { + return { + channel: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryChannelResponse = { + typeUrl: "/ibc.core.channel.v1.QueryChannelResponse", + encode(message: QueryChannelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelResponse { + const message = createBaseQueryChannelResponse(); + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryChannelResponseAmino): QueryChannelResponse { + const message = createBaseQueryChannelResponse(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryChannelResponse): QueryChannelResponseAmino { + const obj: any = {}; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryChannelResponseAminoMsg): QueryChannelResponse { + return QueryChannelResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelResponse): QueryChannelResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChannelResponse", + value: QueryChannelResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelResponseProtoMsg): QueryChannelResponse { + return QueryChannelResponse.decode(message.value); + }, + toProto(message: QueryChannelResponse): Uint8Array { + return QueryChannelResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelResponse): QueryChannelResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelResponse", + value: QueryChannelResponse.encode(message).finish() + }; + } +}; +function createBaseQueryChannelsRequest(): QueryChannelsRequest { + return { + pagination: undefined + }; +} +export const QueryChannelsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest", + encode(message: QueryChannelsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelsRequest { + const message = createBaseQueryChannelsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryChannelsRequestAmino): QueryChannelsRequest { + const message = createBaseQueryChannelsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryChannelsRequest): QueryChannelsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChannelsRequestAminoMsg): QueryChannelsRequest { + return QueryChannelsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelsRequest): QueryChannelsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChannelsRequest", + value: QueryChannelsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelsRequestProtoMsg): QueryChannelsRequest { + return QueryChannelsRequest.decode(message.value); + }, + toProto(message: QueryChannelsRequest): Uint8Array { + return QueryChannelsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelsRequest): QueryChannelsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest", + value: QueryChannelsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChannelsResponse(): QueryChannelsResponse { + return { + channels: [], + pagination: undefined, + height: Height.fromPartial({}) + }; +} +export const QueryChannelsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse", + encode(message: QueryChannelsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelsResponse { + const message = createBaseQueryChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryChannelsResponseAmino): QueryChannelsResponse { + const message = createBaseQueryChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryChannelsResponse): QueryChannelsResponseAmino { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map(e => e ? IdentifiedChannel.toAmino(e) : undefined); + } else { + obj.channels = message.channels; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: QueryChannelsResponseAminoMsg): QueryChannelsResponse { + return QueryChannelsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelsResponse): QueryChannelsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChannelsResponse", + value: QueryChannelsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelsResponseProtoMsg): QueryChannelsResponse { + return QueryChannelsResponse.decode(message.value); + }, + toProto(message: QueryChannelsResponse): Uint8Array { + return QueryChannelsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelsResponse): QueryChannelsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse", + value: QueryChannelsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionChannelsRequest(): QueryConnectionChannelsRequest { + return { + connection: "", + pagination: undefined + }; +} +export const QueryConnectionChannelsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest", + encode(message: QueryConnectionChannelsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connection !== "") { + writer.uint32(10).string(message.connection); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionChannelsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionChannelsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionChannelsRequest { + const message = createBaseQueryConnectionChannelsRequest(); + message.connection = object.connection ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConnectionChannelsRequestAmino): QueryConnectionChannelsRequest { + const message = createBaseQueryConnectionChannelsRequest(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = object.connection; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConnectionChannelsRequest): QueryConnectionChannelsRequestAmino { + const obj: any = {}; + obj.connection = message.connection === "" ? undefined : message.connection; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConnectionChannelsRequestAminoMsg): QueryConnectionChannelsRequest { + return QueryConnectionChannelsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionChannelsRequest): QueryConnectionChannelsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionChannelsRequest", + value: QueryConnectionChannelsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionChannelsRequestProtoMsg): QueryConnectionChannelsRequest { + return QueryConnectionChannelsRequest.decode(message.value); + }, + toProto(message: QueryConnectionChannelsRequest): Uint8Array { + return QueryConnectionChannelsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionChannelsRequest): QueryConnectionChannelsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest", + value: QueryConnectionChannelsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionChannelsResponse(): QueryConnectionChannelsResponse { + return { + channels: [], + pagination: undefined, + height: Height.fromPartial({}) + }; +} +export const QueryConnectionChannelsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse", + encode(message: QueryConnectionChannelsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionChannelsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionChannelsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionChannelsResponse { + const message = createBaseQueryConnectionChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryConnectionChannelsResponseAmino): QueryConnectionChannelsResponse { + const message = createBaseQueryConnectionChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryConnectionChannelsResponse): QueryConnectionChannelsResponseAmino { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map(e => e ? IdentifiedChannel.toAmino(e) : undefined); + } else { + obj.channels = message.channels; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionChannelsResponseAminoMsg): QueryConnectionChannelsResponse { + return QueryConnectionChannelsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionChannelsResponse): QueryConnectionChannelsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionChannelsResponse", + value: QueryConnectionChannelsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionChannelsResponseProtoMsg): QueryConnectionChannelsResponse { + return QueryConnectionChannelsResponse.decode(message.value); + }, + toProto(message: QueryConnectionChannelsResponse): Uint8Array { + return QueryConnectionChannelsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionChannelsResponse): QueryConnectionChannelsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse", + value: QueryConnectionChannelsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryChannelClientStateRequest(): QueryChannelClientStateRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryChannelClientStateRequest = { + typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest", + encode(message: QueryChannelClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelClientStateRequest { + const message = createBaseQueryChannelClientStateRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryChannelClientStateRequestAmino): QueryChannelClientStateRequest { + const message = createBaseQueryChannelClientStateRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryChannelClientStateRequest): QueryChannelClientStateRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: QueryChannelClientStateRequestAminoMsg): QueryChannelClientStateRequest { + return QueryChannelClientStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelClientStateRequest): QueryChannelClientStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChannelClientStateRequest", + value: QueryChannelClientStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelClientStateRequestProtoMsg): QueryChannelClientStateRequest { + return QueryChannelClientStateRequest.decode(message.value); + }, + toProto(message: QueryChannelClientStateRequest): Uint8Array { + return QueryChannelClientStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelClientStateRequest): QueryChannelClientStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest", + value: QueryChannelClientStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChannelClientStateResponse(): QueryChannelClientStateResponse { + return { + identifiedClientState: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryChannelClientStateResponse = { + typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse", + encode(message: QueryChannelClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelClientStateResponse { + const message = createBaseQueryChannelClientStateResponse(); + message.identifiedClientState = object.identifiedClientState !== undefined && object.identifiedClientState !== null ? IdentifiedClientState.fromPartial(object.identifiedClientState) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryChannelClientStateResponseAmino): QueryChannelClientStateResponse { + const message = createBaseQueryChannelClientStateResponse(); + if (object.identified_client_state !== undefined && object.identified_client_state !== null) { + message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryChannelClientStateResponse): QueryChannelClientStateResponseAmino { + const obj: any = {}; + obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryChannelClientStateResponseAminoMsg): QueryChannelClientStateResponse { + return QueryChannelClientStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelClientStateResponse): QueryChannelClientStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChannelClientStateResponse", + value: QueryChannelClientStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelClientStateResponseProtoMsg): QueryChannelClientStateResponse { + return QueryChannelClientStateResponse.decode(message.value); + }, + toProto(message: QueryChannelClientStateResponse): Uint8Array { + return QueryChannelClientStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelClientStateResponse): QueryChannelClientStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse", + value: QueryChannelClientStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryChannelConsensusStateRequest(): QueryChannelConsensusStateRequest { + return { + portId: "", + channelId: "", + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const QueryChannelConsensusStateRequest = { + typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest", + encode(message: QueryChannelConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(32).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.revisionNumber = reader.uint64(); + break; + case 4: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelConsensusStateRequest { + const message = createBaseQueryChannelConsensusStateRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryChannelConsensusStateRequestAmino): QueryChannelConsensusStateRequest { + const message = createBaseQueryChannelConsensusStateRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + return message; + }, + toAmino(message: QueryChannelConsensusStateRequest): QueryChannelConsensusStateRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryChannelConsensusStateRequestAminoMsg): QueryChannelConsensusStateRequest { + return QueryChannelConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelConsensusStateRequest): QueryChannelConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChannelConsensusStateRequest", + value: QueryChannelConsensusStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelConsensusStateRequestProtoMsg): QueryChannelConsensusStateRequest { + return QueryChannelConsensusStateRequest.decode(message.value); + }, + toProto(message: QueryChannelConsensusStateRequest): Uint8Array { + return QueryChannelConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelConsensusStateRequest): QueryChannelConsensusStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest", + value: QueryChannelConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChannelConsensusStateResponse(): QueryChannelConsensusStateResponse { + return { + consensusState: undefined, + clientId: "", + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryChannelConsensusStateResponse = { + typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse", + encode(message: QueryChannelConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelConsensusStateResponse { + const message = createBaseQueryChannelConsensusStateResponse(); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.clientId = object.clientId ?? ""; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryChannelConsensusStateResponseAmino): QueryChannelConsensusStateResponse { + const message = createBaseQueryChannelConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryChannelConsensusStateResponse): QueryChannelConsensusStateResponseAmino { + const obj: any = {}; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryChannelConsensusStateResponseAminoMsg): QueryChannelConsensusStateResponse { + return QueryChannelConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelConsensusStateResponse): QueryChannelConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChannelConsensusStateResponse", + value: QueryChannelConsensusStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelConsensusStateResponseProtoMsg): QueryChannelConsensusStateResponse { + return QueryChannelConsensusStateResponse.decode(message.value); + }, + toProto(message: QueryChannelConsensusStateResponse): Uint8Array { + return QueryChannelConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelConsensusStateResponse): QueryChannelConsensusStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse", + value: QueryChannelConsensusStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPacketCommitmentRequest(): QueryPacketCommitmentRequest { + return { + portId: "", + channelId: "", + sequence: BigInt(0) + }; +} +export const QueryPacketCommitmentRequest = { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest", + encode(message: QueryPacketCommitmentRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketCommitmentRequest { + const message = createBaseQueryPacketCommitmentRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryPacketCommitmentRequestAmino): QueryPacketCommitmentRequest { + const message = createBaseQueryPacketCommitmentRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: QueryPacketCommitmentRequest): QueryPacketCommitmentRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryPacketCommitmentRequestAminoMsg): QueryPacketCommitmentRequest { + return QueryPacketCommitmentRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketCommitmentRequest): QueryPacketCommitmentRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPacketCommitmentRequest", + value: QueryPacketCommitmentRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketCommitmentRequestProtoMsg): QueryPacketCommitmentRequest { + return QueryPacketCommitmentRequest.decode(message.value); + }, + toProto(message: QueryPacketCommitmentRequest): Uint8Array { + return QueryPacketCommitmentRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketCommitmentRequest): QueryPacketCommitmentRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest", + value: QueryPacketCommitmentRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPacketCommitmentResponse(): QueryPacketCommitmentResponse { + return { + commitment: new Uint8Array(), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryPacketCommitmentResponse = { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentResponse", + encode(message: QueryPacketCommitmentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.commitment.length !== 0) { + writer.uint32(10).bytes(message.commitment); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitment = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketCommitmentResponse { + const message = createBaseQueryPacketCommitmentResponse(); + message.commitment = object.commitment ?? new Uint8Array(); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryPacketCommitmentResponseAmino): QueryPacketCommitmentResponse { + const message = createBaseQueryPacketCommitmentResponse(); + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryPacketCommitmentResponse): QueryPacketCommitmentResponseAmino { + const obj: any = {}; + obj.commitment = message.commitment ? base64FromBytes(message.commitment) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryPacketCommitmentResponseAminoMsg): QueryPacketCommitmentResponse { + return QueryPacketCommitmentResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketCommitmentResponse): QueryPacketCommitmentResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPacketCommitmentResponse", + value: QueryPacketCommitmentResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketCommitmentResponseProtoMsg): QueryPacketCommitmentResponse { + return QueryPacketCommitmentResponse.decode(message.value); + }, + toProto(message: QueryPacketCommitmentResponse): Uint8Array { + return QueryPacketCommitmentResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketCommitmentResponse): QueryPacketCommitmentResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentResponse", + value: QueryPacketCommitmentResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPacketCommitmentsRequest(): QueryPacketCommitmentsRequest { + return { + portId: "", + channelId: "", + pagination: undefined + }; +} +export const QueryPacketCommitmentsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest", + encode(message: QueryPacketCommitmentsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketCommitmentsRequest { + const message = createBaseQueryPacketCommitmentsRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPacketCommitmentsRequestAmino): QueryPacketCommitmentsRequest { + const message = createBaseQueryPacketCommitmentsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryPacketCommitmentsRequest): QueryPacketCommitmentsRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPacketCommitmentsRequestAminoMsg): QueryPacketCommitmentsRequest { + return QueryPacketCommitmentsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketCommitmentsRequest): QueryPacketCommitmentsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPacketCommitmentsRequest", + value: QueryPacketCommitmentsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketCommitmentsRequestProtoMsg): QueryPacketCommitmentsRequest { + return QueryPacketCommitmentsRequest.decode(message.value); + }, + toProto(message: QueryPacketCommitmentsRequest): Uint8Array { + return QueryPacketCommitmentsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketCommitmentsRequest): QueryPacketCommitmentsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest", + value: QueryPacketCommitmentsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPacketCommitmentsResponse(): QueryPacketCommitmentsResponse { + return { + commitments: [], + pagination: undefined, + height: Height.fromPartial({}) + }; +} +export const QueryPacketCommitmentsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsResponse", + encode(message: QueryPacketCommitmentsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.commitments) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitments.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketCommitmentsResponse { + const message = createBaseQueryPacketCommitmentsResponse(); + message.commitments = object.commitments?.map(e => PacketState.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryPacketCommitmentsResponseAmino): QueryPacketCommitmentsResponse { + const message = createBaseQueryPacketCommitmentsResponse(); + message.commitments = object.commitments?.map(e => PacketState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryPacketCommitmentsResponse): QueryPacketCommitmentsResponseAmino { + const obj: any = {}; + if (message.commitments) { + obj.commitments = message.commitments.map(e => e ? PacketState.toAmino(e) : undefined); + } else { + obj.commitments = message.commitments; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: QueryPacketCommitmentsResponseAminoMsg): QueryPacketCommitmentsResponse { + return QueryPacketCommitmentsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketCommitmentsResponse): QueryPacketCommitmentsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPacketCommitmentsResponse", + value: QueryPacketCommitmentsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketCommitmentsResponseProtoMsg): QueryPacketCommitmentsResponse { + return QueryPacketCommitmentsResponse.decode(message.value); + }, + toProto(message: QueryPacketCommitmentsResponse): Uint8Array { + return QueryPacketCommitmentsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketCommitmentsResponse): QueryPacketCommitmentsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsResponse", + value: QueryPacketCommitmentsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPacketReceiptRequest(): QueryPacketReceiptRequest { + return { + portId: "", + channelId: "", + sequence: BigInt(0) + }; +} +export const QueryPacketReceiptRequest = { + typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptRequest", + encode(message: QueryPacketReceiptRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketReceiptRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketReceiptRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketReceiptRequest { + const message = createBaseQueryPacketReceiptRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryPacketReceiptRequestAmino): QueryPacketReceiptRequest { + const message = createBaseQueryPacketReceiptRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: QueryPacketReceiptRequest): QueryPacketReceiptRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryPacketReceiptRequestAminoMsg): QueryPacketReceiptRequest { + return QueryPacketReceiptRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketReceiptRequest): QueryPacketReceiptRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPacketReceiptRequest", + value: QueryPacketReceiptRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketReceiptRequestProtoMsg): QueryPacketReceiptRequest { + return QueryPacketReceiptRequest.decode(message.value); + }, + toProto(message: QueryPacketReceiptRequest): Uint8Array { + return QueryPacketReceiptRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketReceiptRequest): QueryPacketReceiptRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptRequest", + value: QueryPacketReceiptRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPacketReceiptResponse(): QueryPacketReceiptResponse { + return { + received: false, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryPacketReceiptResponse = { + typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptResponse", + encode(message: QueryPacketReceiptResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.received === true) { + writer.uint32(16).bool(message.received); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketReceiptResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketReceiptResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.received = reader.bool(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketReceiptResponse { + const message = createBaseQueryPacketReceiptResponse(); + message.received = object.received ?? false; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryPacketReceiptResponseAmino): QueryPacketReceiptResponse { + const message = createBaseQueryPacketReceiptResponse(); + if (object.received !== undefined && object.received !== null) { + message.received = object.received; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryPacketReceiptResponse): QueryPacketReceiptResponseAmino { + const obj: any = {}; + obj.received = message.received === false ? undefined : message.received; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryPacketReceiptResponseAminoMsg): QueryPacketReceiptResponse { + return QueryPacketReceiptResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketReceiptResponse): QueryPacketReceiptResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPacketReceiptResponse", + value: QueryPacketReceiptResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketReceiptResponseProtoMsg): QueryPacketReceiptResponse { + return QueryPacketReceiptResponse.decode(message.value); + }, + toProto(message: QueryPacketReceiptResponse): Uint8Array { + return QueryPacketReceiptResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketReceiptResponse): QueryPacketReceiptResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptResponse", + value: QueryPacketReceiptResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPacketAcknowledgementRequest(): QueryPacketAcknowledgementRequest { + return { + portId: "", + channelId: "", + sequence: BigInt(0) + }; +} +export const QueryPacketAcknowledgementRequest = { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementRequest", + encode(message: QueryPacketAcknowledgementRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketAcknowledgementRequest { + const message = createBaseQueryPacketAcknowledgementRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryPacketAcknowledgementRequestAmino): QueryPacketAcknowledgementRequest { + const message = createBaseQueryPacketAcknowledgementRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: QueryPacketAcknowledgementRequest): QueryPacketAcknowledgementRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryPacketAcknowledgementRequestAminoMsg): QueryPacketAcknowledgementRequest { + return QueryPacketAcknowledgementRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketAcknowledgementRequest): QueryPacketAcknowledgementRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPacketAcknowledgementRequest", + value: QueryPacketAcknowledgementRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketAcknowledgementRequestProtoMsg): QueryPacketAcknowledgementRequest { + return QueryPacketAcknowledgementRequest.decode(message.value); + }, + toProto(message: QueryPacketAcknowledgementRequest): Uint8Array { + return QueryPacketAcknowledgementRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketAcknowledgementRequest): QueryPacketAcknowledgementRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementRequest", + value: QueryPacketAcknowledgementRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPacketAcknowledgementResponse(): QueryPacketAcknowledgementResponse { + return { + acknowledgement: new Uint8Array(), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryPacketAcknowledgementResponse = { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementResponse", + encode(message: QueryPacketAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.acknowledgement.length !== 0) { + writer.uint32(10).bytes(message.acknowledgement); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgement = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketAcknowledgementResponse { + const message = createBaseQueryPacketAcknowledgementResponse(); + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryPacketAcknowledgementResponseAmino): QueryPacketAcknowledgementResponse { + const message = createBaseQueryPacketAcknowledgementResponse(); + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryPacketAcknowledgementResponse): QueryPacketAcknowledgementResponseAmino { + const obj: any = {}; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryPacketAcknowledgementResponseAminoMsg): QueryPacketAcknowledgementResponse { + return QueryPacketAcknowledgementResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketAcknowledgementResponse): QueryPacketAcknowledgementResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPacketAcknowledgementResponse", + value: QueryPacketAcknowledgementResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketAcknowledgementResponseProtoMsg): QueryPacketAcknowledgementResponse { + return QueryPacketAcknowledgementResponse.decode(message.value); + }, + toProto(message: QueryPacketAcknowledgementResponse): Uint8Array { + return QueryPacketAcknowledgementResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketAcknowledgementResponse): QueryPacketAcknowledgementResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementResponse", + value: QueryPacketAcknowledgementResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPacketAcknowledgementsRequest(): QueryPacketAcknowledgementsRequest { + return { + portId: "", + channelId: "", + pagination: undefined, + packetCommitmentSequences: [] + }; +} +export const QueryPacketAcknowledgementsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", + encode(message: QueryPacketAcknowledgementsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.packetCommitmentSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetCommitmentSequences.push(reader.uint64()); + } + } else { + message.packetCommitmentSequences.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketAcknowledgementsRequest { + const message = createBaseQueryPacketAcknowledgementsRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + message.packetCommitmentSequences = object.packetCommitmentSequences?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: QueryPacketAcknowledgementsRequestAmino): QueryPacketAcknowledgementsRequest { + const message = createBaseQueryPacketAcknowledgementsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + message.packetCommitmentSequences = object.packet_commitment_sequences?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: QueryPacketAcknowledgementsRequest): QueryPacketAcknowledgementsRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + if (message.packetCommitmentSequences) { + obj.packet_commitment_sequences = message.packetCommitmentSequences.map(e => e.toString()); + } else { + obj.packet_commitment_sequences = message.packetCommitmentSequences; + } + return obj; + }, + fromAminoMsg(object: QueryPacketAcknowledgementsRequestAminoMsg): QueryPacketAcknowledgementsRequest { + return QueryPacketAcknowledgementsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketAcknowledgementsRequest): QueryPacketAcknowledgementsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryPacketAcknowledgementsRequest", + value: QueryPacketAcknowledgementsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketAcknowledgementsRequestProtoMsg): QueryPacketAcknowledgementsRequest { + return QueryPacketAcknowledgementsRequest.decode(message.value); + }, + toProto(message: QueryPacketAcknowledgementsRequest): Uint8Array { + return QueryPacketAcknowledgementsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketAcknowledgementsRequest): QueryPacketAcknowledgementsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", + value: QueryPacketAcknowledgementsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPacketAcknowledgementsResponse(): QueryPacketAcknowledgementsResponse { + return { + acknowledgements: [], + pagination: undefined, + height: Height.fromPartial({}) + }; +} +export const QueryPacketAcknowledgementsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", + encode(message: QueryPacketAcknowledgementsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.acknowledgements) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgements.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPacketAcknowledgementsResponse { + const message = createBaseQueryPacketAcknowledgementsResponse(); + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryPacketAcknowledgementsResponseAmino): QueryPacketAcknowledgementsResponse { + const message = createBaseQueryPacketAcknowledgementsResponse(); + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryPacketAcknowledgementsResponse): QueryPacketAcknowledgementsResponseAmino { + const obj: any = {}; + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map(e => e ? PacketState.toAmino(e) : undefined); + } else { + obj.acknowledgements = message.acknowledgements; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: QueryPacketAcknowledgementsResponseAminoMsg): QueryPacketAcknowledgementsResponse { + return QueryPacketAcknowledgementsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPacketAcknowledgementsResponse): QueryPacketAcknowledgementsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryPacketAcknowledgementsResponse", + value: QueryPacketAcknowledgementsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPacketAcknowledgementsResponseProtoMsg): QueryPacketAcknowledgementsResponse { + return QueryPacketAcknowledgementsResponse.decode(message.value); + }, + toProto(message: QueryPacketAcknowledgementsResponse): Uint8Array { + return QueryPacketAcknowledgementsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPacketAcknowledgementsResponse): QueryPacketAcknowledgementsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", + value: QueryPacketAcknowledgementsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUnreceivedPacketsRequest(): QueryUnreceivedPacketsRequest { + return { + portId: "", + channelId: "", + packetCommitmentSequences: [] + }; +} +export const QueryUnreceivedPacketsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsRequest", + encode(message: QueryUnreceivedPacketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + writer.uint32(26).fork(); + for (const v of message.packetCommitmentSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedPacketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedPacketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetCommitmentSequences.push(reader.uint64()); + } + } else { + message.packetCommitmentSequences.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnreceivedPacketsRequest { + const message = createBaseQueryUnreceivedPacketsRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.packetCommitmentSequences = object.packetCommitmentSequences?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: QueryUnreceivedPacketsRequestAmino): QueryUnreceivedPacketsRequest { + const message = createBaseQueryUnreceivedPacketsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.packetCommitmentSequences = object.packet_commitment_sequences?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: QueryUnreceivedPacketsRequest): QueryUnreceivedPacketsRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + if (message.packetCommitmentSequences) { + obj.packet_commitment_sequences = message.packetCommitmentSequences.map(e => e.toString()); + } else { + obj.packet_commitment_sequences = message.packetCommitmentSequences; + } + return obj; + }, + fromAminoMsg(object: QueryUnreceivedPacketsRequestAminoMsg): QueryUnreceivedPacketsRequest { + return QueryUnreceivedPacketsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnreceivedPacketsRequest): QueryUnreceivedPacketsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUnreceivedPacketsRequest", + value: QueryUnreceivedPacketsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnreceivedPacketsRequestProtoMsg): QueryUnreceivedPacketsRequest { + return QueryUnreceivedPacketsRequest.decode(message.value); + }, + toProto(message: QueryUnreceivedPacketsRequest): Uint8Array { + return QueryUnreceivedPacketsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnreceivedPacketsRequest): QueryUnreceivedPacketsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsRequest", + value: QueryUnreceivedPacketsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUnreceivedPacketsResponse(): QueryUnreceivedPacketsResponse { + return { + sequences: [], + height: Height.fromPartial({}) + }; +} +export const QueryUnreceivedPacketsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsResponse", + encode(message: QueryUnreceivedPacketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedPacketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedPacketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.sequences.push(reader.uint64()); + } + } else { + message.sequences.push(reader.uint64()); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnreceivedPacketsResponse { + const message = createBaseQueryUnreceivedPacketsResponse(); + message.sequences = object.sequences?.map(e => BigInt(e.toString())) || []; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryUnreceivedPacketsResponseAmino): QueryUnreceivedPacketsResponse { + const message = createBaseQueryUnreceivedPacketsResponse(); + message.sequences = object.sequences?.map(e => BigInt(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryUnreceivedPacketsResponse): QueryUnreceivedPacketsResponseAmino { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map(e => e.toString()); + } else { + obj.sequences = message.sequences; + } + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: QueryUnreceivedPacketsResponseAminoMsg): QueryUnreceivedPacketsResponse { + return QueryUnreceivedPacketsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnreceivedPacketsResponse): QueryUnreceivedPacketsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUnreceivedPacketsResponse", + value: QueryUnreceivedPacketsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnreceivedPacketsResponseProtoMsg): QueryUnreceivedPacketsResponse { + return QueryUnreceivedPacketsResponse.decode(message.value); + }, + toProto(message: QueryUnreceivedPacketsResponse): Uint8Array { + return QueryUnreceivedPacketsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnreceivedPacketsResponse): QueryUnreceivedPacketsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsResponse", + value: QueryUnreceivedPacketsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUnreceivedAcksRequest(): QueryUnreceivedAcksRequest { + return { + portId: "", + channelId: "", + packetAckSequences: [] + }; +} +export const QueryUnreceivedAcksRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksRequest", + encode(message: QueryUnreceivedAcksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + writer.uint32(26).fork(); + for (const v of message.packetAckSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedAcksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedAcksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetAckSequences.push(reader.uint64()); + } + } else { + message.packetAckSequences.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnreceivedAcksRequest { + const message = createBaseQueryUnreceivedAcksRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.packetAckSequences = object.packetAckSequences?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: QueryUnreceivedAcksRequestAmino): QueryUnreceivedAcksRequest { + const message = createBaseQueryUnreceivedAcksRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.packetAckSequences = object.packet_ack_sequences?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: QueryUnreceivedAcksRequest): QueryUnreceivedAcksRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + if (message.packetAckSequences) { + obj.packet_ack_sequences = message.packetAckSequences.map(e => e.toString()); + } else { + obj.packet_ack_sequences = message.packetAckSequences; + } + return obj; + }, + fromAminoMsg(object: QueryUnreceivedAcksRequestAminoMsg): QueryUnreceivedAcksRequest { + return QueryUnreceivedAcksRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnreceivedAcksRequest): QueryUnreceivedAcksRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUnreceivedAcksRequest", + value: QueryUnreceivedAcksRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnreceivedAcksRequestProtoMsg): QueryUnreceivedAcksRequest { + return QueryUnreceivedAcksRequest.decode(message.value); + }, + toProto(message: QueryUnreceivedAcksRequest): Uint8Array { + return QueryUnreceivedAcksRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnreceivedAcksRequest): QueryUnreceivedAcksRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksRequest", + value: QueryUnreceivedAcksRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUnreceivedAcksResponse(): QueryUnreceivedAcksResponse { + return { + sequences: [], + height: Height.fromPartial({}) + }; +} +export const QueryUnreceivedAcksResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksResponse", + encode(message: QueryUnreceivedAcksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedAcksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedAcksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.sequences.push(reader.uint64()); + } + } else { + message.sequences.push(reader.uint64()); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnreceivedAcksResponse { + const message = createBaseQueryUnreceivedAcksResponse(); + message.sequences = object.sequences?.map(e => BigInt(e.toString())) || []; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryUnreceivedAcksResponseAmino): QueryUnreceivedAcksResponse { + const message = createBaseQueryUnreceivedAcksResponse(); + message.sequences = object.sequences?.map(e => BigInt(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryUnreceivedAcksResponse): QueryUnreceivedAcksResponseAmino { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map(e => e.toString()); + } else { + obj.sequences = message.sequences; + } + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: QueryUnreceivedAcksResponseAminoMsg): QueryUnreceivedAcksResponse { + return QueryUnreceivedAcksResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUnreceivedAcksResponse): QueryUnreceivedAcksResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUnreceivedAcksResponse", + value: QueryUnreceivedAcksResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUnreceivedAcksResponseProtoMsg): QueryUnreceivedAcksResponse { + return QueryUnreceivedAcksResponse.decode(message.value); + }, + toProto(message: QueryUnreceivedAcksResponse): Uint8Array { + return QueryUnreceivedAcksResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnreceivedAcksResponse): QueryUnreceivedAcksResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksResponse", + value: QueryUnreceivedAcksResponse.encode(message).finish() + }; + } +}; +function createBaseQueryNextSequenceReceiveRequest(): QueryNextSequenceReceiveRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryNextSequenceReceiveRequest = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveRequest", + encode(message: QueryNextSequenceReceiveRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceReceiveRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceReceiveRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextSequenceReceiveRequest { + const message = createBaseQueryNextSequenceReceiveRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryNextSequenceReceiveRequestAmino): QueryNextSequenceReceiveRequest { + const message = createBaseQueryNextSequenceReceiveRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryNextSequenceReceiveRequest): QueryNextSequenceReceiveRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceReceiveRequestAminoMsg): QueryNextSequenceReceiveRequest { + return QueryNextSequenceReceiveRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceReceiveRequest): QueryNextSequenceReceiveRequestAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceReceiveRequest", + value: QueryNextSequenceReceiveRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceReceiveRequestProtoMsg): QueryNextSequenceReceiveRequest { + return QueryNextSequenceReceiveRequest.decode(message.value); + }, + toProto(message: QueryNextSequenceReceiveRequest): Uint8Array { + return QueryNextSequenceReceiveRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceReceiveRequest): QueryNextSequenceReceiveRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveRequest", + value: QueryNextSequenceReceiveRequest.encode(message).finish() + }; + } +}; +function createBaseQueryNextSequenceReceiveResponse(): QueryNextSequenceReceiveResponse { + return { + nextSequenceReceive: BigInt(0), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryNextSequenceReceiveResponse = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveResponse", + encode(message: QueryNextSequenceReceiveResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextSequenceReceive !== BigInt(0)) { + writer.uint32(8).uint64(message.nextSequenceReceive); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceReceiveResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceReceiveResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceReceive = reader.uint64(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextSequenceReceiveResponse { + const message = createBaseQueryNextSequenceReceiveResponse(); + message.nextSequenceReceive = object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null ? BigInt(object.nextSequenceReceive.toString()) : BigInt(0); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryNextSequenceReceiveResponseAmino): QueryNextSequenceReceiveResponse { + const message = createBaseQueryNextSequenceReceiveResponse(); + if (object.next_sequence_receive !== undefined && object.next_sequence_receive !== null) { + message.nextSequenceReceive = BigInt(object.next_sequence_receive); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryNextSequenceReceiveResponse): QueryNextSequenceReceiveResponseAmino { + const obj: any = {}; + obj.next_sequence_receive = message.nextSequenceReceive !== BigInt(0) ? message.nextSequenceReceive.toString() : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceReceiveResponseAminoMsg): QueryNextSequenceReceiveResponse { + return QueryNextSequenceReceiveResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceReceiveResponse): QueryNextSequenceReceiveResponseAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceReceiveResponse", + value: QueryNextSequenceReceiveResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceReceiveResponseProtoMsg): QueryNextSequenceReceiveResponse { + return QueryNextSequenceReceiveResponse.decode(message.value); + }, + toProto(message: QueryNextSequenceReceiveResponse): Uint8Array { + return QueryNextSequenceReceiveResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceReceiveResponse): QueryNextSequenceReceiveResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveResponse", + value: QueryNextSequenceReceiveResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.amino.ts new file mode 100644 index 00000000..1e278a9d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.amino.ts @@ -0,0 +1,54 @@ +//@ts-nocheck +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; +export const AminoConverter = { + "/ibc.core.channel.v1.MsgChannelOpenInit": { + aminoType: "cosmos-sdk/MsgChannelOpenInit", + toAmino: MsgChannelOpenInit.toAmino, + fromAmino: MsgChannelOpenInit.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelOpenTry": { + aminoType: "cosmos-sdk/MsgChannelOpenTry", + toAmino: MsgChannelOpenTry.toAmino, + fromAmino: MsgChannelOpenTry.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelOpenAck": { + aminoType: "cosmos-sdk/MsgChannelOpenAck", + toAmino: MsgChannelOpenAck.toAmino, + fromAmino: MsgChannelOpenAck.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelOpenConfirm": { + aminoType: "cosmos-sdk/MsgChannelOpenConfirm", + toAmino: MsgChannelOpenConfirm.toAmino, + fromAmino: MsgChannelOpenConfirm.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelCloseInit": { + aminoType: "cosmos-sdk/MsgChannelCloseInit", + toAmino: MsgChannelCloseInit.toAmino, + fromAmino: MsgChannelCloseInit.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelCloseConfirm": { + aminoType: "cosmos-sdk/MsgChannelCloseConfirm", + toAmino: MsgChannelCloseConfirm.toAmino, + fromAmino: MsgChannelCloseConfirm.fromAmino + }, + "/ibc.core.channel.v1.MsgRecvPacket": { + aminoType: "cosmos-sdk/MsgRecvPacket", + toAmino: MsgRecvPacket.toAmino, + fromAmino: MsgRecvPacket.fromAmino + }, + "/ibc.core.channel.v1.MsgTimeout": { + aminoType: "cosmos-sdk/MsgTimeout", + toAmino: MsgTimeout.toAmino, + fromAmino: MsgTimeout.fromAmino + }, + "/ibc.core.channel.v1.MsgTimeoutOnClose": { + aminoType: "cosmos-sdk/MsgTimeoutOnClose", + toAmino: MsgTimeoutOnClose.toAmino, + fromAmino: MsgTimeoutOnClose.fromAmino + }, + "/ibc.core.channel.v1.MsgAcknowledgement": { + aminoType: "cosmos-sdk/MsgAcknowledgement", + toAmino: MsgAcknowledgement.toAmino, + fromAmino: MsgAcknowledgement.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.registry.ts new file mode 100644 index 00000000..dbcbbecd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.registry.ts @@ -0,0 +1,197 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.encode(value).finish() + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.encode(value).finish() + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.encode(value).finish() + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.encode(value).finish() + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.encode(value).finish() + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.encode(value).finish() + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.encode(value).finish() + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.encode(value).finish() + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.encode(value).finish() + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.encode(value).finish() + }; + } + }, + withTypeUrl: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value + }; + } + }, + fromPartial: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.fromPartial(value) + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.fromPartial(value) + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.fromPartial(value) + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.fromPartial(value) + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.fromPartial(value) + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.fromPartial(value) + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.fromPartial(value) + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.fromPartial(value) + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.fromPartial(value) + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..a6c96622 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.rpc.msg.ts @@ -0,0 +1,96 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse } from "./tx"; +/** Msg defines the ibc/channel Msg service. */ +export interface Msg { + /** ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ + channelOpenInit(request: MsgChannelOpenInit): Promise; + /** ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. */ + channelOpenTry(request: MsgChannelOpenTry): Promise; + /** ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. */ + channelOpenAck(request: MsgChannelOpenAck): Promise; + /** ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. */ + channelOpenConfirm(request: MsgChannelOpenConfirm): Promise; + /** ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. */ + channelCloseInit(request: MsgChannelCloseInit): Promise; + /** + * ChannelCloseConfirm defines a rpc handler method for + * MsgChannelCloseConfirm. + */ + channelCloseConfirm(request: MsgChannelCloseConfirm): Promise; + /** RecvPacket defines a rpc handler method for MsgRecvPacket. */ + recvPacket(request: MsgRecvPacket): Promise; + /** Timeout defines a rpc handler method for MsgTimeout. */ + timeout(request: MsgTimeout): Promise; + /** TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. */ + timeoutOnClose(request: MsgTimeoutOnClose): Promise; + /** Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ + acknowledgement(request: MsgAcknowledgement): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.channelOpenInit = this.channelOpenInit.bind(this); + this.channelOpenTry = this.channelOpenTry.bind(this); + this.channelOpenAck = this.channelOpenAck.bind(this); + this.channelOpenConfirm = this.channelOpenConfirm.bind(this); + this.channelCloseInit = this.channelCloseInit.bind(this); + this.channelCloseConfirm = this.channelCloseConfirm.bind(this); + this.recvPacket = this.recvPacket.bind(this); + this.timeout = this.timeout.bind(this); + this.timeoutOnClose = this.timeoutOnClose.bind(this); + this.acknowledgement = this.acknowledgement.bind(this); + } + channelOpenInit(request: MsgChannelOpenInit): Promise { + const data = MsgChannelOpenInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenInit", data); + return promise.then(data => MsgChannelOpenInitResponse.decode(new BinaryReader(data))); + } + channelOpenTry(request: MsgChannelOpenTry): Promise { + const data = MsgChannelOpenTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenTry", data); + return promise.then(data => MsgChannelOpenTryResponse.decode(new BinaryReader(data))); + } + channelOpenAck(request: MsgChannelOpenAck): Promise { + const data = MsgChannelOpenAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenAck", data); + return promise.then(data => MsgChannelOpenAckResponse.decode(new BinaryReader(data))); + } + channelOpenConfirm(request: MsgChannelOpenConfirm): Promise { + const data = MsgChannelOpenConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenConfirm", data); + return promise.then(data => MsgChannelOpenConfirmResponse.decode(new BinaryReader(data))); + } + channelCloseInit(request: MsgChannelCloseInit): Promise { + const data = MsgChannelCloseInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseInit", data); + return promise.then(data => MsgChannelCloseInitResponse.decode(new BinaryReader(data))); + } + channelCloseConfirm(request: MsgChannelCloseConfirm): Promise { + const data = MsgChannelCloseConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseConfirm", data); + return promise.then(data => MsgChannelCloseConfirmResponse.decode(new BinaryReader(data))); + } + recvPacket(request: MsgRecvPacket): Promise { + const data = MsgRecvPacket.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "RecvPacket", data); + return promise.then(data => MsgRecvPacketResponse.decode(new BinaryReader(data))); + } + timeout(request: MsgTimeout): Promise { + const data = MsgTimeout.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Timeout", data); + return promise.then(data => MsgTimeoutResponse.decode(new BinaryReader(data))); + } + timeoutOnClose(request: MsgTimeoutOnClose): Promise { + const data = MsgTimeoutOnClose.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "TimeoutOnClose", data); + return promise.then(data => MsgTimeoutOnCloseResponse.decode(new BinaryReader(data))); + } + acknowledgement(request: MsgAcknowledgement): Promise { + const data = MsgAcknowledgement.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data); + return promise.then(data => MsgAcknowledgementResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.ts b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.ts new file mode 100644 index 00000000..12c792a2 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/channel/v1/tx.ts @@ -0,0 +1,2275 @@ +//@ts-nocheck +import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType } from "./channel"; +import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInit { + portId: string; + channel: Channel; + signer: string; +} +export interface MsgChannelOpenInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit"; + value: Uint8Array; +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInitAmino { + port_id?: string; + channel?: ChannelAmino; + signer?: string; +} +export interface MsgChannelOpenInitAminoMsg { + type: "cosmos-sdk/MsgChannelOpenInit"; + value: MsgChannelOpenInitAmino; +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInitSDKType { + port_id: string; + channel: ChannelSDKType; + signer: string; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponse {} +export interface MsgChannelOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse"; + value: Uint8Array; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseAmino {} +export interface MsgChannelOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenInitResponse"; + value: MsgChannelOpenInitResponseAmino; +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseSDKType {} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. + */ +export interface MsgChannelOpenTry { + portId: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the channel identifier of the previous channel in state INIT + */ + previousChannelId: string; + channel: Channel; + counterpartyVersion: string; + proofInit: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenTryProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry"; + value: Uint8Array; +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. + */ +export interface MsgChannelOpenTryAmino { + port_id?: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the channel identifier of the previous channel in state INIT + */ + previous_channel_id?: string; + channel?: ChannelAmino; + counterparty_version?: string; + proof_init?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelOpenTryAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTry"; + value: MsgChannelOpenTryAmino; +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. + */ +export interface MsgChannelOpenTrySDKType { + port_id: string; + previous_channel_id: string; + channel: ChannelSDKType; + counterparty_version: string; + proof_init: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponse {} +export interface MsgChannelOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse"; + value: Uint8Array; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseAmino {} +export interface MsgChannelOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenTryResponse"; + value: MsgChannelOpenTryResponseAmino; +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseSDKType {} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + */ +export interface MsgChannelOpenAck { + portId: string; + channelId: string; + counterpartyChannelId: string; + counterpartyVersion: string; + proofTry: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenAckProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck"; + value: Uint8Array; +} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + */ +export interface MsgChannelOpenAckAmino { + port_id?: string; + channel_id?: string; + counterparty_channel_id?: string; + counterparty_version?: string; + proof_try?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelOpenAckAminoMsg { + type: "cosmos-sdk/MsgChannelOpenAck"; + value: MsgChannelOpenAckAmino; +} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + */ +export interface MsgChannelOpenAckSDKType { + port_id: string; + channel_id: string; + counterparty_channel_id: string; + counterparty_version: string; + proof_try: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponse {} +export interface MsgChannelOpenAckResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse"; + value: Uint8Array; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponseAmino {} +export interface MsgChannelOpenAckResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenAckResponse"; + value: MsgChannelOpenAckResponseAmino; +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponseSDKType {} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirm { + portId: string; + channelId: string; + proofAck: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelOpenConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm"; + value: Uint8Array; +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirmAmino { + port_id?: string; + channel_id?: string; + proof_ack?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirm"; + value: MsgChannelOpenConfirmAmino; +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirmSDKType { + port_id: string; + channel_id: string; + proof_ack: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponse {} +export interface MsgChannelOpenConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse"; + value: Uint8Array; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponseAmino {} +export interface MsgChannelOpenConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirmResponse"; + value: MsgChannelOpenConfirmResponseAmino; +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponseSDKType {} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInit { + portId: string; + channelId: string; + signer: string; +} +export interface MsgChannelCloseInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit"; + value: Uint8Array; +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInitAmino { + port_id?: string; + channel_id?: string; + signer?: string; +} +export interface MsgChannelCloseInitAminoMsg { + type: "cosmos-sdk/MsgChannelCloseInit"; + value: MsgChannelCloseInitAmino; +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInitSDKType { + port_id: string; + channel_id: string; + signer: string; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponse {} +export interface MsgChannelCloseInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse"; + value: Uint8Array; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponseAmino {} +export interface MsgChannelCloseInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelCloseInitResponse"; + value: MsgChannelCloseInitResponseAmino; +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponseSDKType {} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirm { + portId: string; + channelId: string; + proofInit: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelCloseConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; + value: Uint8Array; +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirmAmino { + port_id?: string; + channel_id?: string; + proof_init?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelCloseConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirm"; + value: MsgChannelCloseConfirmAmino; +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirmSDKType { + port_id: string; + channel_id: string; + proof_init: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponse {} +export interface MsgChannelCloseConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse"; + value: Uint8Array; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponseAmino {} +export interface MsgChannelCloseConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirmResponse"; + value: MsgChannelCloseConfirmResponseAmino; +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponseSDKType {} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacket { + packet: Packet; + proofCommitment: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgRecvPacketProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket"; + value: Uint8Array; +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacketAmino { + packet?: PacketAmino; + proof_commitment?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgRecvPacketAminoMsg { + type: "cosmos-sdk/MsgRecvPacket"; + value: MsgRecvPacketAmino; +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacketSDKType { + packet: PacketSDKType; + proof_commitment: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponse {} +export interface MsgRecvPacketResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse"; + value: Uint8Array; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseAmino {} +export interface MsgRecvPacketResponseAminoMsg { + type: "cosmos-sdk/MsgRecvPacketResponse"; + value: MsgRecvPacketResponseAmino; +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseSDKType {} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeout { + packet: Packet; + proofUnreceived: Uint8Array; + proofHeight: Height; + nextSequenceRecv: bigint; + signer: string; +} +export interface MsgTimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeout"; + value: Uint8Array; +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeoutAmino { + packet?: PacketAmino; + proof_unreceived?: string; + proof_height?: HeightAmino; + next_sequence_recv?: string; + signer?: string; +} +export interface MsgTimeoutAminoMsg { + type: "cosmos-sdk/MsgTimeout"; + value: MsgTimeoutAmino; +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeoutSDKType { + packet: PacketSDKType; + proof_unreceived: Uint8Array; + proof_height: HeightSDKType; + next_sequence_recv: bigint; + signer: string; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponse {} +export interface MsgTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse"; + value: Uint8Array; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseAmino {} +export interface MsgTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutResponse"; + value: MsgTimeoutResponseAmino; +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseSDKType {} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnClose { + packet: Packet; + proofUnreceived: Uint8Array; + proofClose: Uint8Array; + proofHeight: Height; + nextSequenceRecv: bigint; + signer: string; +} +export interface MsgTimeoutOnCloseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; + value: Uint8Array; +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnCloseAmino { + packet?: PacketAmino; + proof_unreceived?: string; + proof_close?: string; + proof_height?: HeightAmino; + next_sequence_recv?: string; + signer?: string; +} +export interface MsgTimeoutOnCloseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnClose"; + value: MsgTimeoutOnCloseAmino; +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnCloseSDKType { + packet: PacketSDKType; + proof_unreceived: Uint8Array; + proof_close: Uint8Array; + proof_height: HeightSDKType; + next_sequence_recv: bigint; + signer: string; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponse {} +export interface MsgTimeoutOnCloseResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse"; + value: Uint8Array; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseAmino {} +export interface MsgTimeoutOnCloseResponseAminoMsg { + type: "cosmos-sdk/MsgTimeoutOnCloseResponse"; + value: MsgTimeoutOnCloseResponseAmino; +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseSDKType {} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgement { + packet: Packet; + acknowledgement: Uint8Array; + proofAcked: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgAcknowledgementProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement"; + value: Uint8Array; +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgementAmino { + packet?: PacketAmino; + acknowledgement?: string; + proof_acked?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgAcknowledgementAminoMsg { + type: "cosmos-sdk/MsgAcknowledgement"; + value: MsgAcknowledgementAmino; +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgementSDKType { + packet: PacketSDKType; + acknowledgement: Uint8Array; + proof_acked: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponse {} +export interface MsgAcknowledgementResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse"; + value: Uint8Array; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseAmino {} +export interface MsgAcknowledgementResponseAminoMsg { + type: "cosmos-sdk/MsgAcknowledgementResponse"; + value: MsgAcknowledgementResponseAmino; +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseSDKType {} +function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { + return { + portId: "", + channel: Channel.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + encode(message: MsgChannelOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit(); + message.portId = object.portId ?? ""; + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenInitAmino): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelOpenInit): MsgChannelOpenInitAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenInitAminoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenInit", + value: MsgChannelOpenInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenInitProtoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.decode(message.value); + }, + toProto(message: MsgChannelOpenInit): Uint8Array { + return MsgChannelOpenInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.encode(message).finish() + }; + } +}; +function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { + return {}; +} +export const MsgChannelOpenInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", + encode(_: MsgChannelOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenInitResponseAmino): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse(); + return message; + }, + toAmino(_: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenInitResponseAminoMsg): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenInitResponse", + value: MsgChannelOpenInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenInitResponseProtoMsg): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenInitResponse): Uint8Array { + return MsgChannelOpenInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", + value: MsgChannelOpenInitResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { + return { + portId: "", + previousChannelId: "", + channel: Channel.fromPartial({}), + counterpartyVersion: "", + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenTry = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + encode(message: MsgChannelOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.previousChannelId !== "") { + writer.uint32(18).string(message.previousChannelId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(26).fork()).ldelim(); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofInit.length !== 0) { + writer.uint32(42).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.previousChannelId = reader.string(); + break; + case 3: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofInit = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry(); + message.portId = object.portId ?? ""; + message.previousChannelId = object.previousChannelId ?? ""; + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenTryAmino): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.previous_channel_id !== undefined && object.previous_channel_id !== null) { + message.previousChannelId = object.previous_channel_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelOpenTry): MsgChannelOpenTryAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.previous_channel_id = message.previousChannelId === "" ? undefined : message.previousChannelId; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenTryAminoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenTry", + value: MsgChannelOpenTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenTryProtoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.decode(message.value); + }, + toProto(message: MsgChannelOpenTry): Uint8Array { + return MsgChannelOpenTry.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.encode(message).finish() + }; + } +}; +function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { + return {}; +} +export const MsgChannelOpenTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", + encode(_: MsgChannelOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenTryResponseAmino): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse(); + return message; + }, + toAmino(_: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenTryResponseAminoMsg): MsgChannelOpenTryResponse { + return MsgChannelOpenTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenTryResponse", + value: MsgChannelOpenTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenTryResponseProtoMsg): MsgChannelOpenTryResponse { + return MsgChannelOpenTryResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenTryResponse): Uint8Array { + return MsgChannelOpenTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", + value: MsgChannelOpenTryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { + return { + portId: "", + channelId: "", + counterpartyChannelId: "", + counterpartyVersion: "", + proofTry: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenAck = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + encode(message: MsgChannelOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelId !== "") { + writer.uint32(26).string(message.counterpartyChannelId); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofTry.length !== 0) { + writer.uint32(42).bytes(message.proofTry); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelId = reader.string(); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofTry = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelId = object.counterpartyChannelId ?? ""; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenAckAmino): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_id !== undefined && object.counterparty_channel_id !== null) { + message.counterpartyChannelId = object.counterparty_channel_id; + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelOpenAck): MsgChannelOpenAckAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.counterparty_channel_id = message.counterpartyChannelId === "" ? undefined : message.counterpartyChannelId; + obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenAckAminoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenAck", + value: MsgChannelOpenAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenAckProtoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.decode(message.value); + }, + toProto(message: MsgChannelOpenAck): Uint8Array { + return MsgChannelOpenAck.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.encode(message).finish() + }; + } +}; +function createBaseMsgChannelOpenAckResponse(): MsgChannelOpenAckResponse { + return {}; +} +export const MsgChannelOpenAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", + encode(_: MsgChannelOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenAckResponseAmino): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse(); + return message; + }, + toAmino(_: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenAckResponseAminoMsg): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenAckResponse", + value: MsgChannelOpenAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenAckResponseProtoMsg): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenAckResponse): Uint8Array { + return MsgChannelOpenAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", + value: MsgChannelOpenAckResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { + return { + portId: "", + channelId: "", + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelOpenConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + encode(message: MsgChannelOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.proofAck.length !== 0) { + writer.uint32(26).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofAck = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelOpenConfirmAmino): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenConfirmAminoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenConfirmProtoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.decode(message.value); + }, + toProto(message: MsgChannelOpenConfirm): Uint8Array { + return MsgChannelOpenConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.encode(message).finish() + }; + } +}; +function createBaseMsgChannelOpenConfirmResponse(): MsgChannelOpenConfirmResponse { + return {}; +} +export const MsgChannelOpenConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", + encode(_: MsgChannelOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; + }, + fromAmino(_: MsgChannelOpenConfirmResponseAmino): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; + }, + toAmino(_: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelOpenConfirmResponseAminoMsg): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelOpenConfirmResponse", + value: MsgChannelOpenConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelOpenConfirmResponseProtoMsg): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelOpenConfirmResponse): Uint8Array { + return MsgChannelOpenConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", + value: MsgChannelOpenConfirmResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { + return { + portId: "", + channelId: "", + signer: "" + }; +} +export const MsgChannelCloseInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + encode(message: MsgChannelCloseInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelCloseInitAmino): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelCloseInit): MsgChannelCloseInitAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseInitAminoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseInit", + value: MsgChannelCloseInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseInitProtoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.decode(message.value); + }, + toProto(message: MsgChannelCloseInit): Uint8Array { + return MsgChannelCloseInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.encode(message).finish() + }; + } +}; +function createBaseMsgChannelCloseInitResponse(): MsgChannelCloseInitResponse { + return {}; +} +export const MsgChannelCloseInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", + encode(_: MsgChannelCloseInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse(); + return message; + }, + fromAmino(_: MsgChannelCloseInitResponseAmino): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse(); + return message; + }, + toAmino(_: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseInitResponseAminoMsg): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseInitResponse", + value: MsgChannelCloseInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseInitResponseProtoMsg): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.decode(message.value); + }, + toProto(message: MsgChannelCloseInitResponse): Uint8Array { + return MsgChannelCloseInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", + value: MsgChannelCloseInitResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { + return { + portId: "", + channelId: "", + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelCloseConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + encode(message: MsgChannelCloseConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.proofInit.length !== 0) { + writer.uint32(26).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofInit = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelCloseConfirm { + const message = createBaseMsgChannelCloseConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelCloseConfirmAmino): MsgChannelCloseConfirm { + const message = createBaseMsgChannelCloseConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseConfirmAminoMsg): MsgChannelCloseConfirm { + return MsgChannelCloseConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseConfirmProtoMsg): MsgChannelCloseConfirm { + return MsgChannelCloseConfirm.decode(message.value); + }, + toProto(message: MsgChannelCloseConfirm): Uint8Array { + return MsgChannelCloseConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.encode(message).finish() + }; + } +}; +function createBaseMsgChannelCloseConfirmResponse(): MsgChannelCloseConfirmResponse { + return {}; +} +export const MsgChannelCloseConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse", + encode(_: MsgChannelCloseConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; + }, + fromAmino(_: MsgChannelCloseConfirmResponseAmino): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; + }, + toAmino(_: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelCloseConfirmResponseAminoMsg): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelCloseConfirmResponse", + value: MsgChannelCloseConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelCloseConfirmResponseProtoMsg): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelCloseConfirmResponse): Uint8Array { + return MsgChannelCloseConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse", + value: MsgChannelCloseConfirmResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRecvPacket(): MsgRecvPacket { + return { + packet: Packet.fromPartial({}), + proofCommitment: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgRecvPacket = { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + encode(message: MsgRecvPacket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofCommitment.length !== 0) { + writer.uint32(18).bytes(message.proofCommitment); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofCommitment = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRecvPacket { + const message = createBaseMsgRecvPacket(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofCommitment = object.proofCommitment ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgRecvPacketAmino): MsgRecvPacket { + const message = createBaseMsgRecvPacket(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_commitment !== undefined && object.proof_commitment !== null) { + message.proofCommitment = bytesFromBase64(object.proof_commitment); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgRecvPacket): MsgRecvPacketAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_commitment = message.proofCommitment ? base64FromBytes(message.proofCommitment) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgRecvPacketAminoMsg): MsgRecvPacket { + return MsgRecvPacket.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecvPacket): MsgRecvPacketAminoMsg { + return { + type: "cosmos-sdk/MsgRecvPacket", + value: MsgRecvPacket.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecvPacketProtoMsg): MsgRecvPacket { + return MsgRecvPacket.decode(message.value); + }, + toProto(message: MsgRecvPacket): Uint8Array { + return MsgRecvPacket.encode(message).finish(); + }, + toProtoMsg(message: MsgRecvPacket): MsgRecvPacketProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.encode(message).finish() + }; + } +}; +function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { + return {}; +} +export const MsgRecvPacketResponse = { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse", + encode(_: MsgRecvPacketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse(); + return message; + }, + fromAmino(_: MsgRecvPacketResponseAmino): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse(); + return message; + }, + toAmino(_: MsgRecvPacketResponse): MsgRecvPacketResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRecvPacketResponseAminoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRecvPacketResponse", + value: MsgRecvPacketResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecvPacketResponseProtoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.decode(message.value); + }, + toProto(message: MsgRecvPacketResponse): Uint8Array { + return MsgRecvPacketResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse", + value: MsgRecvPacketResponse.encode(message).finish() + }; + } +}; +function createBaseMsgTimeout(): MsgTimeout { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + signer: "" + }; +} +export const MsgTimeout = { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + encode(message: MsgTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(32).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.nextSequenceRecv = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTimeout { + const message = createBaseMsgTimeout(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.nextSequenceRecv = object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null ? BigInt(object.nextSequenceRecv.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgTimeoutAmino): MsgTimeout { + const message = createBaseMsgTimeout(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgTimeout): MsgTimeoutAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.next_sequence_recv = message.nextSequenceRecv !== BigInt(0) ? message.nextSequenceRecv.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgTimeoutAminoMsg): MsgTimeout { + return MsgTimeout.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeout): MsgTimeoutAminoMsg { + return { + type: "cosmos-sdk/MsgTimeout", + value: MsgTimeout.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutProtoMsg): MsgTimeout { + return MsgTimeout.decode(message.value); + }, + toProto(message: MsgTimeout): Uint8Array { + return MsgTimeout.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeout): MsgTimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.encode(message).finish() + }; + } +}; +function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { + return {}; +} +export const MsgTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse", + encode(_: MsgTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse(); + return message; + }, + fromAmino(_: MsgTimeoutResponseAmino): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse(); + return message; + }, + toAmino(_: MsgTimeoutResponse): MsgTimeoutResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTimeoutResponseAminoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutResponse", + value: MsgTimeoutResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutResponseProtoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.decode(message.value); + }, + toProto(message: MsgTimeoutResponse): Uint8Array { + return MsgTimeoutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse", + value: MsgTimeoutResponse.encode(message).finish() + }; + } +}; +function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofClose: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + signer: "" + }; +} +export const MsgTimeoutOnClose = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + encode(message: MsgTimeoutOnClose, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofClose.length !== 0) { + writer.uint32(26).bytes(message.proofClose); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(40).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnClose { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnClose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofClose = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.nextSequenceRecv = reader.uint64(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTimeoutOnClose { + const message = createBaseMsgTimeoutOnClose(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + message.proofClose = object.proofClose ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.nextSequenceRecv = object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null ? BigInt(object.nextSequenceRecv.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgTimeoutOnCloseAmino): MsgTimeoutOnClose { + const message = createBaseMsgTimeoutOnClose(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_close !== undefined && object.proof_close !== null) { + message.proofClose = bytesFromBase64(object.proof_close); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + obj.proof_close = message.proofClose ? base64FromBytes(message.proofClose) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.next_sequence_recv = message.nextSequenceRecv !== BigInt(0) ? message.nextSequenceRecv.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgTimeoutOnCloseAminoMsg): MsgTimeoutOnClose { + return MsgTimeoutOnClose.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutOnClose", + value: MsgTimeoutOnClose.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutOnCloseProtoMsg): MsgTimeoutOnClose { + return MsgTimeoutOnClose.decode(message.value); + }, + toProto(message: MsgTimeoutOnClose): Uint8Array { + return MsgTimeoutOnClose.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.encode(message).finish() + }; + } +}; +function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { + return {}; +} +export const MsgTimeoutOnCloseResponse = { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + encode(_: MsgTimeoutOnCloseResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnCloseResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnCloseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse(); + return message; + }, + fromAmino(_: MsgTimeoutOnCloseResponseAmino): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse(); + return message; + }, + toAmino(_: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTimeoutOnCloseResponseAminoMsg): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTimeoutOnCloseResponse", + value: MsgTimeoutOnCloseResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTimeoutOnCloseResponseProtoMsg): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.decode(message.value); + }, + toProto(message: MsgTimeoutOnCloseResponse): Uint8Array { + return MsgTimeoutOnCloseResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + value: MsgTimeoutOnCloseResponse.encode(message).finish() + }; + } +}; +function createBaseMsgAcknowledgement(): MsgAcknowledgement { + return { + packet: Packet.fromPartial({}), + acknowledgement: new Uint8Array(), + proofAcked: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgAcknowledgement = { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + encode(message: MsgAcknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + if (message.proofAcked.length !== 0) { + writer.uint32(26).bytes(message.proofAcked); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + case 3: + message.proofAcked = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + message.proofAcked = object.proofAcked ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgAcknowledgementAmino): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof_acked !== undefined && object.proof_acked !== null) { + message.proofAcked = bytesFromBase64(object.proof_acked); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgAcknowledgement): MsgAcknowledgementAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof_acked = message.proofAcked ? base64FromBytes(message.proofAcked) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgAcknowledgementAminoMsg): MsgAcknowledgement { + return MsgAcknowledgement.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcknowledgement): MsgAcknowledgementAminoMsg { + return { + type: "cosmos-sdk/MsgAcknowledgement", + value: MsgAcknowledgement.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcknowledgementProtoMsg): MsgAcknowledgement { + return MsgAcknowledgement.decode(message.value); + }, + toProto(message: MsgAcknowledgement): Uint8Array { + return MsgAcknowledgement.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgement): MsgAcknowledgementProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.encode(message).finish() + }; + } +}; +function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { + return {}; +} +export const MsgAcknowledgementResponse = { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse", + encode(_: MsgAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgementResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgementResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse(); + return message; + }, + fromAmino(_: MsgAcknowledgementResponseAmino): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse(); + return message; + }, + toAmino(_: MsgAcknowledgementResponse): MsgAcknowledgementResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAcknowledgementResponseAminoMsg): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseAminoMsg { + return { + type: "cosmos-sdk/MsgAcknowledgementResponse", + value: MsgAcknowledgementResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAcknowledgementResponseProtoMsg): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.decode(message.value); + }, + toProto(message: MsgAcknowledgementResponse): Uint8Array { + return MsgAcknowledgementResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse", + value: MsgAcknowledgementResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/client.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/client.ts new file mode 100644 index 00000000..c2949ed9 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/client.ts @@ -0,0 +1,915 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino, PlanSDKType } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState?: Any; +} +export interface IdentifiedClientStateProtoMsg { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; + value: Uint8Array; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateAmino { + /** client identifier */ + client_id?: string; + /** client state */ + client_state?: AnyAmino; +} +export interface IdentifiedClientStateAminoMsg { + type: "cosmos-sdk/IdentifiedClientState"; + value: IdentifiedClientStateAmino; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateSDKType { + client_id: string; + client_state?: AnySDKType; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: Height; + /** consensus state */ + consensusState?: Any; +} +export interface ConsensusStateWithHeightProtoMsg { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; + value: Uint8Array; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightAmino { + /** consensus state height */ + height?: HeightAmino; + /** consensus state */ + consensus_state?: AnyAmino; +} +export interface ConsensusStateWithHeightAminoMsg { + type: "cosmos-sdk/ConsensusStateWithHeight"; + value: ConsensusStateWithHeightAmino; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightSDKType { + height: HeightSDKType; + consensus_state?: AnySDKType; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} +export interface ClientConsensusStatesProtoMsg { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates"; + value: Uint8Array; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesAmino { + /** client identifier */ + client_id?: string; + /** consensus states and their heights associated with the client */ + consensus_states?: ConsensusStateWithHeightAmino[]; +} +export interface ClientConsensusStatesAminoMsg { + type: "cosmos-sdk/ClientConsensusStates"; + value: ClientConsensusStatesAmino; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesSDKType { + client_id: string; + consensus_states: ConsensusStateWithHeightSDKType[]; +} +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposal { + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string; +} +export interface ClientUpdateProposalProtoMsg { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal"; + value: Uint8Array; +} +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposalAmino { + /** the title of the update proposal */ + title?: string; + /** the description of the proposal */ + description?: string; + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substitute_client_id?: string; +} +export interface ClientUpdateProposalAminoMsg { + type: "cosmos-sdk/ClientUpdateProposal"; + value: ClientUpdateProposalAmino; +} +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposalSDKType { + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; + title: string; + description: string; + subject_client_id: string; + substitute_client_id: string; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposal { + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; + title: string; + description: string; + plan: Plan; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgradedClientState?: Any; +} +export interface UpgradeProposalProtoMsg { + typeUrl: "/ibc.core.client.v1.UpgradeProposal"; + value: Uint8Array; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposalAmino { + title?: string; + description?: string; + plan?: PlanAmino; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgraded_client_state?: AnyAmino; +} +export interface UpgradeProposalAminoMsg { + type: "cosmos-sdk/UpgradeProposal"; + value: UpgradeProposalAmino; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposalSDKType { + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; + title: string; + description: string; + plan: PlanSDKType; + upgraded_client_state?: AnySDKType; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: bigint; + /** the height within the given revision */ + revisionHeight: bigint; +} +export interface HeightProtoMsg { + typeUrl: "/ibc.core.client.v1.Height"; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number?: string; + /** the height within the given revision */ + revision_height?: string; +} +export interface HeightAminoMsg { + type: "cosmos-sdk/Height"; + value: HeightAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightSDKType { + revision_number: bigint; + revision_height: bigint; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** allowed_clients defines the list of allowed client state types. */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** allowed_clients defines the list of allowed client state types. */ + allowed_clients?: string[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsSDKType { + allowed_clients: string[]; +} +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { + clientId: "", + clientState: undefined + }; +} +export const IdentifiedClientState = { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + encode(message: IdentifiedClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + return message; + }, + fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; + }, + toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedClientStateAminoMsg): IdentifiedClientState { + return IdentifiedClientState.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedClientState): IdentifiedClientStateAminoMsg { + return { + type: "cosmos-sdk/IdentifiedClientState", + value: IdentifiedClientState.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedClientStateProtoMsg): IdentifiedClientState { + return IdentifiedClientState.decode(message.value); + }, + toProto(message: IdentifiedClientState): Uint8Array { + return IdentifiedClientState.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedClientState): IdentifiedClientStateProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + value: IdentifiedClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { + height: Height.fromPartial({}), + consensusState: undefined + }; +} +export const ConsensusStateWithHeight = { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + encode(message: ConsensusStateWithHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + return message; + }, + fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateWithHeightAminoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightAminoMsg { + return { + type: "cosmos-sdk/ConsensusStateWithHeight", + value: ConsensusStateWithHeight.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateWithHeightProtoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.decode(message.value); + }, + toProto(message: ConsensusStateWithHeight): Uint8Array { + return ConsensusStateWithHeight.encode(message).finish(); + }, + toProtoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + value: ConsensusStateWithHeight.encode(message).finish() + }; + } +}; +function createBaseClientConsensusStates(): ClientConsensusStates { + return { + clientId: "", + consensusStates: [] + }; +} +export const ClientConsensusStates = { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + encode(message: ClientConsensusStates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map(e => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + return message; + }, + toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toAmino(e) : undefined); + } else { + obj.consensus_states = message.consensusStates; + } + return obj; + }, + fromAminoMsg(object: ClientConsensusStatesAminoMsg): ClientConsensusStates { + return ClientConsensusStates.fromAmino(object.value); + }, + toAminoMsg(message: ClientConsensusStates): ClientConsensusStatesAminoMsg { + return { + type: "cosmos-sdk/ClientConsensusStates", + value: ClientConsensusStates.toAmino(message) + }; + }, + fromProtoMsg(message: ClientConsensusStatesProtoMsg): ClientConsensusStates { + return ClientConsensusStates.decode(message.value); + }, + toProto(message: ClientConsensusStates): Uint8Array { + return ClientConsensusStates.encode(message).finish(); + }, + toProtoMsg(message: ClientConsensusStates): ClientConsensusStatesProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + value: ClientConsensusStates.encode(message).finish() + }; + } +}; +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { + $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + title: "", + description: "", + subjectClientId: "", + substituteClientId: "" + }; +} +export const ClientUpdateProposal = { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + return message; + }, + fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.subject_client_id !== undefined && object.subject_client_id !== null) { + message.subjectClientId = object.subject_client_id; + } + if (object.substitute_client_id !== undefined && object.substitute_client_id !== null) { + message.substituteClientId = object.substitute_client_id; + } + return message; + }, + toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.subject_client_id = message.subjectClientId === "" ? undefined : message.subjectClientId; + obj.substitute_client_id = message.substituteClientId === "" ? undefined : message.substituteClientId; + return obj; + }, + fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { + return ClientUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { + return ClientUpdateProposal.decode(message.value); + }, + toProto(message: ClientUpdateProposal): Uint8Array { + return ClientUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: ClientUpdateProposal): ClientUpdateProposalProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(message).finish() + }; + } +}; +function createBaseUpgradeProposal(): UpgradeProposal { + return { + $typeUrl: "/ibc.core.client.v1.UpgradeProposal", + title: "", + description: "", + plan: Plan.fromPartial({}), + upgradedClientState: undefined + }; +} +export const UpgradeProposal = { + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + encode(message: UpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: UpgradeProposalAmino): UpgradeProposal { + const message = createBaseUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: UpgradeProposal): UpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + return obj; + }, + fromAminoMsg(object: UpgradeProposalAminoMsg): UpgradeProposal { + return UpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { + return UpgradeProposal.decode(message.value); + }, + toProto(message: UpgradeProposal): Uint8Array { + return UpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: UpgradeProposal): UpgradeProposalProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(message).finish() + }; + } +}; +function createBaseHeight(): Height { + return { + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", + encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Height { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HeightAmino): Height { + return { + revisionNumber: BigInt(object.revision_number || "0"), + revisionHeight: BigInt(object.revision_height || "0") + }; + }, + toAmino(message: Height): HeightAmino { + const obj: any = {}; + obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HeightAminoMsg): Height { + return Height.fromAmino(object.value); + }, + toAminoMsg(message: Height): HeightAminoMsg { + return { + type: "cosmos-sdk/Height", + value: Height.toAmino(message) + }; + }, + fromProtoMsg(message: HeightProtoMsg): Height { + return Height.decode(message.value); + }, + toProto(message: Height): Uint8Array { + return Height.encode(message).finish(); + }, + toProtoMsg(message: Height): HeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Height", + value: Height.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + allowedClients: [] + }; +} +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedClients = object.allowed_clients?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedClients) { + obj.allowed_clients = message.allowedClients.map(e => e); + } else { + obj.allowed_clients = message.allowedClients; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/genesis.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/genesis.ts new file mode 100644 index 00000000..11c02eed --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/genesis.ts @@ -0,0 +1,416 @@ +//@ts-nocheck +import { IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ClientConsensusStates, ClientConsensusStatesAmino, ClientConsensusStatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisState { + /** client states with their corresponding identifiers */ + clients: IdentifiedClientState[]; + /** consensus states from each client */ + clientsConsensus: ClientConsensusStates[]; + /** metadata from each client */ + clientsMetadata: IdentifiedGenesisMetadata[]; + params: Params; + /** create localhost on initialization */ + createLocalhost: boolean; + /** the sequence for the next generated client identifier */ + nextClientSequence: bigint; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.client.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisStateAmino { + /** client states with their corresponding identifiers */ + clients?: IdentifiedClientStateAmino[]; + /** consensus states from each client */ + clients_consensus?: ClientConsensusStatesAmino[]; + /** metadata from each client */ + clients_metadata?: IdentifiedGenesisMetadataAmino[]; + params?: ParamsAmino; + /** create localhost on initialization */ + create_localhost?: boolean; + /** the sequence for the next generated client identifier */ + next_client_sequence?: string; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisStateSDKType { + clients: IdentifiedClientStateSDKType[]; + clients_consensus: ClientConsensusStatesSDKType[]; + clients_metadata: IdentifiedGenesisMetadataSDKType[]; + params: ParamsSDKType; + create_localhost: boolean; + next_client_sequence: bigint; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadata { + /** store key of metadata without clientID-prefix */ + key: Uint8Array; + /** metadata value */ + value: Uint8Array; +} +export interface GenesisMetadataProtoMsg { + typeUrl: "/ibc.core.client.v1.GenesisMetadata"; + value: Uint8Array; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadataAmino { + /** store key of metadata without clientID-prefix */ + key?: string; + /** metadata value */ + value?: string; +} +export interface GenesisMetadataAminoMsg { + type: "cosmos-sdk/GenesisMetadata"; + value: GenesisMetadataAmino; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadataSDKType { + key: Uint8Array; + value: Uint8Array; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadata { + clientId: string; + clientMetadata: GenesisMetadata[]; +} +export interface IdentifiedGenesisMetadataProtoMsg { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata"; + value: Uint8Array; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadataAmino { + client_id?: string; + client_metadata?: GenesisMetadataAmino[]; +} +export interface IdentifiedGenesisMetadataAminoMsg { + type: "cosmos-sdk/IdentifiedGenesisMetadata"; + value: IdentifiedGenesisMetadataAmino; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadataSDKType { + client_id: string; + client_metadata: GenesisMetadataSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + clients: [], + clientsConsensus: [], + clientsMetadata: [], + params: Params.fromPartial({}), + createLocalhost: false, + nextClientSequence: BigInt(0) + }; +} +export const GenesisState = { + typeUrl: "/ibc.core.client.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.clients) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientsConsensus) { + ClientConsensusStates.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.clientsMetadata) { + IdentifiedGenesisMetadata.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + if (message.createLocalhost === true) { + writer.uint32(40).bool(message.createLocalhost); + } + if (message.nextClientSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.nextClientSequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clients.push(IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.clientsConsensus.push(ClientConsensusStates.decode(reader, reader.uint32())); + break; + case 3: + message.clientsMetadata.push(IdentifiedGenesisMetadata.decode(reader, reader.uint32())); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + case 5: + message.createLocalhost = reader.bool(); + break; + case 6: + message.nextClientSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.clients = object.clients?.map(e => IdentifiedClientState.fromPartial(e)) || []; + message.clientsConsensus = object.clientsConsensus?.map(e => ClientConsensusStates.fromPartial(e)) || []; + message.clientsMetadata = object.clientsMetadata?.map(e => IdentifiedGenesisMetadata.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.createLocalhost = object.createLocalhost ?? false; + message.nextClientSequence = object.nextClientSequence !== undefined && object.nextClientSequence !== null ? BigInt(object.nextClientSequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.clients = object.clients?.map(e => IdentifiedClientState.fromAmino(e)) || []; + message.clientsConsensus = object.clients_consensus?.map(e => ClientConsensusStates.fromAmino(e)) || []; + message.clientsMetadata = object.clients_metadata?.map(e => IdentifiedGenesisMetadata.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.create_localhost !== undefined && object.create_localhost !== null) { + message.createLocalhost = object.create_localhost; + } + if (object.next_client_sequence !== undefined && object.next_client_sequence !== null) { + message.nextClientSequence = BigInt(object.next_client_sequence); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.clients) { + obj.clients = message.clients.map(e => e ? IdentifiedClientState.toAmino(e) : undefined); + } else { + obj.clients = message.clients; + } + if (message.clientsConsensus) { + obj.clients_consensus = message.clientsConsensus.map(e => e ? ClientConsensusStates.toAmino(e) : undefined); + } else { + obj.clients_consensus = message.clientsConsensus; + } + if (message.clientsMetadata) { + obj.clients_metadata = message.clientsMetadata.map(e => e ? IdentifiedGenesisMetadata.toAmino(e) : undefined); + } else { + obj.clients_metadata = message.clientsMetadata; + } + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.create_localhost = message.createLocalhost === false ? undefined : message.createLocalhost; + obj.next_client_sequence = message.nextClientSequence !== BigInt(0) ? message.nextClientSequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseGenesisMetadata(): GenesisMetadata { + return { + key: new Uint8Array(), + value: new Uint8Array() + }; +} +export const GenesisMetadata = { + typeUrl: "/ibc.core.client.v1.GenesisMetadata", + encode(message: GenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisMetadata { + const message = createBaseGenesisMetadata(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisMetadataAmino): GenesisMetadata { + const message = createBaseGenesisMetadata(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisMetadata): GenesisMetadataAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisMetadataAminoMsg): GenesisMetadata { + return GenesisMetadata.fromAmino(object.value); + }, + toAminoMsg(message: GenesisMetadata): GenesisMetadataAminoMsg { + return { + type: "cosmos-sdk/GenesisMetadata", + value: GenesisMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisMetadataProtoMsg): GenesisMetadata { + return GenesisMetadata.decode(message.value); + }, + toProto(message: GenesisMetadata): Uint8Array { + return GenesisMetadata.encode(message).finish(); + }, + toProtoMsg(message: GenesisMetadata): GenesisMetadataProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.GenesisMetadata", + value: GenesisMetadata.encode(message).finish() + }; + } +}; +function createBaseIdentifiedGenesisMetadata(): IdentifiedGenesisMetadata { + return { + clientId: "", + clientMetadata: [] + }; +} +export const IdentifiedGenesisMetadata = { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata", + encode(message: IdentifiedGenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.clientMetadata) { + GenesisMetadata.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedGenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedGenesisMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMetadata.push(GenesisMetadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IdentifiedGenesisMetadata { + const message = createBaseIdentifiedGenesisMetadata(); + message.clientId = object.clientId ?? ""; + message.clientMetadata = object.clientMetadata?.map(e => GenesisMetadata.fromPartial(e)) || []; + return message; + }, + fromAmino(object: IdentifiedGenesisMetadataAmino): IdentifiedGenesisMetadata { + const message = createBaseIdentifiedGenesisMetadata(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.clientMetadata = object.client_metadata?.map(e => GenesisMetadata.fromAmino(e)) || []; + return message; + }, + toAmino(message: IdentifiedGenesisMetadata): IdentifiedGenesisMetadataAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.clientMetadata) { + obj.client_metadata = message.clientMetadata.map(e => e ? GenesisMetadata.toAmino(e) : undefined); + } else { + obj.client_metadata = message.clientMetadata; + } + return obj; + }, + fromAminoMsg(object: IdentifiedGenesisMetadataAminoMsg): IdentifiedGenesisMetadata { + return IdentifiedGenesisMetadata.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedGenesisMetadata): IdentifiedGenesisMetadataAminoMsg { + return { + type: "cosmos-sdk/IdentifiedGenesisMetadata", + value: IdentifiedGenesisMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedGenesisMetadataProtoMsg): IdentifiedGenesisMetadata { + return IdentifiedGenesisMetadata.decode(message.value); + }, + toProto(message: IdentifiedGenesisMetadata): Uint8Array { + return IdentifiedGenesisMetadata.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedGenesisMetadata): IdentifiedGenesisMetadataProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata", + value: IdentifiedGenesisMetadata.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/query.rpc.Query.ts new file mode 100644 index 00000000..57652ab4 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/query.rpc.Query.ts @@ -0,0 +1,116 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryClientStateRequest, QueryClientStateResponse, QueryClientStatesRequest, QueryClientStatesResponse, QueryConsensusStateRequest, QueryConsensusStateResponse, QueryConsensusStatesRequest, QueryConsensusStatesResponse, QueryClientStatusRequest, QueryClientStatusResponse, QueryClientParamsRequest, QueryClientParamsResponse, QueryUpgradedClientStateRequest, QueryUpgradedClientStateResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse } from "./query"; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** ClientState queries an IBC light client. */ + clientState(request: QueryClientStateRequest): Promise; + /** ClientStates queries all the IBC light clients of a chain. */ + clientStates(request?: QueryClientStatesRequest): Promise; + /** + * ConsensusState queries a consensus state associated with a client state at + * a given height. + */ + consensusState(request: QueryConsensusStateRequest): Promise; + /** + * ConsensusStates queries all the consensus state associated with a given + * client. + */ + consensusStates(request: QueryConsensusStatesRequest): Promise; + /** Status queries the status of an IBC client. */ + clientStatus(request: QueryClientStatusRequest): Promise; + /** ClientParams queries all parameters of the ibc client. */ + clientParams(request?: QueryClientParamsRequest): Promise; + /** UpgradedClientState queries an Upgraded IBC light client. */ + upgradedClientState(request?: QueryUpgradedClientStateRequest): Promise; + /** UpgradedConsensusState queries an Upgraded IBC consensus state. */ + upgradedConsensusState(request?: QueryUpgradedConsensusStateRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.clientState = this.clientState.bind(this); + this.clientStates = this.clientStates.bind(this); + this.consensusState = this.consensusState.bind(this); + this.consensusStates = this.consensusStates.bind(this); + this.clientStatus = this.clientStatus.bind(this); + this.clientParams = this.clientParams.bind(this); + this.upgradedClientState = this.upgradedClientState.bind(this); + this.upgradedConsensusState = this.upgradedConsensusState.bind(this); + } + clientState(request: QueryClientStateRequest): Promise { + const data = QueryClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientState", data); + return promise.then(data => QueryClientStateResponse.decode(new BinaryReader(data))); + } + clientStates(request: QueryClientStatesRequest = { + pagination: undefined + }): Promise { + const data = QueryClientStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStates", data); + return promise.then(data => QueryClientStatesResponse.decode(new BinaryReader(data))); + } + consensusState(request: QueryConsensusStateRequest): Promise { + const data = QueryConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusState", data); + return promise.then(data => QueryConsensusStateResponse.decode(new BinaryReader(data))); + } + consensusStates(request: QueryConsensusStatesRequest): Promise { + const data = QueryConsensusStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStates", data); + return promise.then(data => QueryConsensusStatesResponse.decode(new BinaryReader(data))); + } + clientStatus(request: QueryClientStatusRequest): Promise { + const data = QueryClientStatusRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStatus", data); + return promise.then(data => QueryClientStatusResponse.decode(new BinaryReader(data))); + } + clientParams(request: QueryClientParamsRequest = {}): Promise { + const data = QueryClientParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientParams", data); + return promise.then(data => QueryClientParamsResponse.decode(new BinaryReader(data))); + } + upgradedClientState(request: QueryUpgradedClientStateRequest = {}): Promise { + const data = QueryUpgradedClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedClientState", data); + return promise.then(data => QueryUpgradedClientStateResponse.decode(new BinaryReader(data))); + } + upgradedConsensusState(request: QueryUpgradedConsensusStateRequest = {}): Promise { + const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedConsensusState", data); + return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + clientState(request: QueryClientStateRequest): Promise { + return queryService.clientState(request); + }, + clientStates(request?: QueryClientStatesRequest): Promise { + return queryService.clientStates(request); + }, + consensusState(request: QueryConsensusStateRequest): Promise { + return queryService.consensusState(request); + }, + consensusStates(request: QueryConsensusStatesRequest): Promise { + return queryService.consensusStates(request); + }, + clientStatus(request: QueryClientStatusRequest): Promise { + return queryService.clientStatus(request); + }, + clientParams(request?: QueryClientParamsRequest): Promise { + return queryService.clientParams(request); + }, + upgradedClientState(request?: QueryUpgradedClientStateRequest): Promise { + return queryService.upgradedClientState(request); + }, + upgradedConsensusState(request?: QueryUpgradedConsensusStateRequest): Promise { + return queryService.upgradedConsensusState(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/query.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/query.ts new file mode 100644 index 00000000..4f7d0c26 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/query.ts @@ -0,0 +1,1727 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ConsensusStateWithHeight, ConsensusStateWithHeightAmino, ConsensusStateWithHeightSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequest { + /** client state unique identifier */ + clientId: string; +} +export interface QueryClientStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStateRequest"; + value: Uint8Array; +} +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequestAmino { + /** client state unique identifier */ + client_id?: string; +} +export interface QueryClientStateRequestAminoMsg { + type: "cosmos-sdk/QueryClientStateRequest"; + value: QueryClientStateRequestAmino; +} +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequestSDKType { + client_id: string; +} +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponse { + /** client state associated with the request identifier */ + clientState?: Any; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryClientStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStateResponse"; + value: Uint8Array; +} +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponseAmino { + /** client state associated with the request identifier */ + client_state?: AnyAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryClientStateResponseAminoMsg { + type: "cosmos-sdk/QueryClientStateResponse"; + value: QueryClientStateResponseAmino; +} +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponseSDKType { + client_state?: AnySDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequest { + /** pagination request */ + pagination?: PageRequest; +} +export interface QueryClientStatesRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest"; + value: Uint8Array; +} +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequestAmino { + /** pagination request */ + pagination?: PageRequestAmino; +} +export interface QueryClientStatesRequestAminoMsg { + type: "cosmos-sdk/QueryClientStatesRequest"; + value: QueryClientStatesRequestAmino; +} +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponse { + /** list of stored ClientStates of the chain. */ + clientStates: IdentifiedClientState[]; + /** pagination response */ + pagination?: PageResponse; +} +export interface QueryClientStatesResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse"; + value: Uint8Array; +} +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponseAmino { + /** list of stored ClientStates of the chain. */ + client_states?: IdentifiedClientStateAmino[]; + /** pagination response */ + pagination?: PageResponseAmino; +} +export interface QueryClientStatesResponseAminoMsg { + type: "cosmos-sdk/QueryClientStatesResponse"; + value: QueryClientStatesResponseAmino; +} +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponseSDKType { + client_states: IdentifiedClientStateSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequest { + /** client identifier */ + clientId: string; + /** consensus state revision number */ + revisionNumber: bigint; + /** consensus state revision height */ + revisionHeight: bigint; + /** + * latest_height overrrides the height field and queries the latest stored + * ConsensusState + */ + latestHeight: boolean; +} +export interface QueryConsensusStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequestAmino { + /** client identifier */ + client_id?: string; + /** consensus state revision number */ + revision_number?: string; + /** consensus state revision height */ + revision_height?: string; + /** + * latest_height overrrides the height field and queries the latest stored + * ConsensusState + */ + latest_height?: boolean; +} +export interface QueryConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryConsensusStateRequest"; + value: QueryConsensusStateRequestAmino; +} +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequestSDKType { + client_id: string; + revision_number: bigint; + revision_height: bigint; + latest_height: boolean; +} +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponse { + /** consensus state associated with the client identifier at the given height */ + consensusState?: Any; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryConsensusStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponseAmino { + /** consensus state associated with the client identifier at the given height */ + consensus_state?: AnyAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryConsensusStateResponse"; + value: QueryConsensusStateResponseAmino; +} +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponseSDKType { + consensus_state?: AnySDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequest { + /** client identifier */ + clientId: string; + /** pagination request */ + pagination?: PageRequest; +} +export interface QueryConsensusStatesRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest"; + value: Uint8Array; +} +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequestAmino { + /** client identifier */ + client_id?: string; + /** pagination request */ + pagination?: PageRequestAmino; +} +export interface QueryConsensusStatesRequestAminoMsg { + type: "cosmos-sdk/QueryConsensusStatesRequest"; + value: QueryConsensusStatesRequestAmino; +} +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequestSDKType { + client_id: string; + pagination?: PageRequestSDKType; +} +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponse { + /** consensus states associated with the identifier */ + consensusStates: ConsensusStateWithHeight[]; + /** pagination response */ + pagination?: PageResponse; +} +export interface QueryConsensusStatesResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse"; + value: Uint8Array; +} +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponseAmino { + /** consensus states associated with the identifier */ + consensus_states?: ConsensusStateWithHeightAmino[]; + /** pagination response */ + pagination?: PageResponseAmino; +} +export interface QueryConsensusStatesResponseAminoMsg { + type: "cosmos-sdk/QueryConsensusStatesResponse"; + value: QueryConsensusStatesResponseAmino; +} +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponseSDKType { + consensus_states: ConsensusStateWithHeightSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC + * method + */ +export interface QueryClientStatusRequest { + /** client unique identifier */ + clientId: string; +} +export interface QueryClientStatusRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest"; + value: Uint8Array; +} +/** + * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC + * method + */ +export interface QueryClientStatusRequestAmino { + /** client unique identifier */ + client_id?: string; +} +export interface QueryClientStatusRequestAminoMsg { + type: "cosmos-sdk/QueryClientStatusRequest"; + value: QueryClientStatusRequestAmino; +} +/** + * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC + * method + */ +export interface QueryClientStatusRequestSDKType { + client_id: string; +} +/** + * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC + * method. It returns the current status of the IBC client. + */ +export interface QueryClientStatusResponse { + status: string; +} +export interface QueryClientStatusResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse"; + value: Uint8Array; +} +/** + * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC + * method. It returns the current status of the IBC client. + */ +export interface QueryClientStatusResponseAmino { + status?: string; +} +export interface QueryClientStatusResponseAminoMsg { + type: "cosmos-sdk/QueryClientStatusResponse"; + value: QueryClientStatusResponseAmino; +} +/** + * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC + * method. It returns the current status of the IBC client. + */ +export interface QueryClientStatusResponseSDKType { + status: string; +} +/** + * QueryClientParamsRequest is the request type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsRequest {} +export interface QueryClientParamsRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest"; + value: Uint8Array; +} +/** + * QueryClientParamsRequest is the request type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsRequestAmino {} +export interface QueryClientParamsRequestAminoMsg { + type: "cosmos-sdk/QueryClientParamsRequest"; + value: QueryClientParamsRequestAmino; +} +/** + * QueryClientParamsRequest is the request type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsRequestSDKType {} +/** + * QueryClientParamsResponse is the response type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} +export interface QueryClientParamsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse"; + value: Uint8Array; +} +/** + * QueryClientParamsResponse is the response type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryClientParamsResponseAminoMsg { + type: "cosmos-sdk/QueryClientParamsResponse"; + value: QueryClientParamsResponseAmino; +} +/** + * QueryClientParamsResponse is the response type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsResponseSDKType { + params?: ParamsSDKType; +} +/** + * QueryUpgradedClientStateRequest is the request type for the + * Query/UpgradedClientState RPC method + */ +export interface QueryUpgradedClientStateRequest {} +export interface QueryUpgradedClientStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest"; + value: Uint8Array; +} +/** + * QueryUpgradedClientStateRequest is the request type for the + * Query/UpgradedClientState RPC method + */ +export interface QueryUpgradedClientStateRequestAmino {} +export interface QueryUpgradedClientStateRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradedClientStateRequest"; + value: QueryUpgradedClientStateRequestAmino; +} +/** + * QueryUpgradedClientStateRequest is the request type for the + * Query/UpgradedClientState RPC method + */ +export interface QueryUpgradedClientStateRequestSDKType {} +/** + * QueryUpgradedClientStateResponse is the response type for the + * Query/UpgradedClientState RPC method. + */ +export interface QueryUpgradedClientStateResponse { + /** client state associated with the request identifier */ + upgradedClientState?: Any; +} +export interface QueryUpgradedClientStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse"; + value: Uint8Array; +} +/** + * QueryUpgradedClientStateResponse is the response type for the + * Query/UpgradedClientState RPC method. + */ +export interface QueryUpgradedClientStateResponseAmino { + /** client state associated with the request identifier */ + upgraded_client_state?: AnyAmino; +} +export interface QueryUpgradedClientStateResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradedClientStateResponse"; + value: QueryUpgradedClientStateResponseAmino; +} +/** + * QueryUpgradedClientStateResponse is the response type for the + * Query/UpgradedClientState RPC method. + */ +export interface QueryUpgradedClientStateResponseSDKType { + upgraded_client_state?: AnySDKType; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the + * Query/UpgradedConsensusState RPC method + */ +export interface QueryUpgradedConsensusStateRequest {} +export interface QueryUpgradedConsensusStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the + * Query/UpgradedConsensusState RPC method + */ +export interface QueryUpgradedConsensusStateRequestAmino {} +export interface QueryUpgradedConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradedConsensusStateRequest"; + value: QueryUpgradedConsensusStateRequestAmino; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the + * Query/UpgradedConsensusState RPC method + */ +export interface QueryUpgradedConsensusStateRequestSDKType {} +/** + * QueryUpgradedConsensusStateResponse is the response type for the + * Query/UpgradedConsensusState RPC method. + */ +export interface QueryUpgradedConsensusStateResponse { + /** Consensus state associated with the request identifier */ + upgradedConsensusState?: Any; +} +export interface QueryUpgradedConsensusStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryUpgradedConsensusStateResponse is the response type for the + * Query/UpgradedConsensusState RPC method. + */ +export interface QueryUpgradedConsensusStateResponseAmino { + /** Consensus state associated with the request identifier */ + upgraded_consensus_state?: AnyAmino; +} +export interface QueryUpgradedConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradedConsensusStateResponse"; + value: QueryUpgradedConsensusStateResponseAmino; +} +/** + * QueryUpgradedConsensusStateResponse is the response type for the + * Query/UpgradedConsensusState RPC method. + */ +export interface QueryUpgradedConsensusStateResponseSDKType { + upgraded_consensus_state?: AnySDKType; +} +function createBaseQueryClientStateRequest(): QueryClientStateRequest { + return { + clientId: "" + }; +} +export const QueryClientStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientStateRequest", + encode(message: QueryClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStateRequest { + const message = createBaseQueryClientStateRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: QueryClientStateRequestAmino): QueryClientStateRequest { + const message = createBaseQueryClientStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: QueryClientStateRequest): QueryClientStateRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + return obj; + }, + fromAminoMsg(object: QueryClientStateRequestAminoMsg): QueryClientStateRequest { + return QueryClientStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStateRequest): QueryClientStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientStateRequest", + value: QueryClientStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientStateRequestProtoMsg): QueryClientStateRequest { + return QueryClientStateRequest.decode(message.value); + }, + toProto(message: QueryClientStateRequest): Uint8Array { + return QueryClientStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStateRequest): QueryClientStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStateRequest", + value: QueryClientStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientStateResponse(): QueryClientStateResponse { + return { + clientState: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryClientStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientStateResponse", + encode(message: QueryClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStateResponse { + const message = createBaseQueryClientStateResponse(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryClientStateResponseAmino): QueryClientStateResponse { + const message = createBaseQueryClientStateResponse(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryClientStateResponse): QueryClientStateResponseAmino { + const obj: any = {}; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryClientStateResponseAminoMsg): QueryClientStateResponse { + return QueryClientStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStateResponse): QueryClientStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientStateResponse", + value: QueryClientStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientStateResponseProtoMsg): QueryClientStateResponse { + return QueryClientStateResponse.decode(message.value); + }, + toProto(message: QueryClientStateResponse): Uint8Array { + return QueryClientStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStateResponse): QueryClientStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStateResponse", + value: QueryClientStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatesRequest(): QueryClientStatesRequest { + return { + pagination: undefined + }; +} +export const QueryClientStatesRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest", + encode(message: QueryClientStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatesRequest { + const message = createBaseQueryClientStatesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryClientStatesRequestAmino): QueryClientStatesRequest { + const message = createBaseQueryClientStatesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryClientStatesRequest): QueryClientStatesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClientStatesRequestAminoMsg): QueryClientStatesRequest { + return QueryClientStatesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatesRequest): QueryClientStatesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatesRequest", + value: QueryClientStatesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientStatesRequestProtoMsg): QueryClientStatesRequest { + return QueryClientStatesRequest.decode(message.value); + }, + toProto(message: QueryClientStatesRequest): Uint8Array { + return QueryClientStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatesRequest): QueryClientStatesRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest", + value: QueryClientStatesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatesResponse(): QueryClientStatesResponse { + return { + clientStates: [], + pagination: undefined + }; +} +export const QueryClientStatesResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse", + encode(message: QueryClientStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.clientStates) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientStates.push(IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatesResponse { + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.clientStates?.map(e => IdentifiedClientState.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryClientStatesResponseAmino): QueryClientStatesResponse { + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.client_states?.map(e => IdentifiedClientState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryClientStatesResponse): QueryClientStatesResponseAmino { + const obj: any = {}; + if (message.clientStates) { + obj.client_states = message.clientStates.map(e => e ? IdentifiedClientState.toAmino(e) : undefined); + } else { + obj.client_states = message.clientStates; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClientStatesResponseAminoMsg): QueryClientStatesResponse { + return QueryClientStatesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatesResponse): QueryClientStatesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatesResponse", + value: QueryClientStatesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientStatesResponseProtoMsg): QueryClientStatesResponse { + return QueryClientStatesResponse.decode(message.value); + }, + toProto(message: QueryClientStatesResponse): Uint8Array { + return QueryClientStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatesResponse): QueryClientStatesResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse", + value: QueryClientStatesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStateRequest(): QueryConsensusStateRequest { + return { + clientId: "", + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), + latestHeight: false + }; +} +export const QueryConsensusStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest", + encode(message: QueryConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.revisionHeight); + } + if (message.latestHeight === true) { + writer.uint32(32).bool(message.latestHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + case 4: + message.latestHeight = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStateRequest { + const message = createBaseQueryConsensusStateRequest(); + message.clientId = object.clientId ?? ""; + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + message.latestHeight = object.latestHeight ?? false; + return message; + }, + fromAmino(object: QueryConsensusStateRequestAmino): QueryConsensusStateRequest { + const message = createBaseQueryConsensusStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = object.latest_height; + } + return message; + }, + toAmino(message: QueryConsensusStateRequest): QueryConsensusStateRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; + obj.latest_height = message.latestHeight === false ? undefined : message.latestHeight; + return obj; + }, + fromAminoMsg(object: QueryConsensusStateRequestAminoMsg): QueryConsensusStateRequest { + return QueryConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStateRequest): QueryConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStateRequest", + value: QueryConsensusStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConsensusStateRequestProtoMsg): QueryConsensusStateRequest { + return QueryConsensusStateRequest.decode(message.value); + }, + toProto(message: QueryConsensusStateRequest): Uint8Array { + return QueryConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStateRequest): QueryConsensusStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest", + value: QueryConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { + return { + consensusState: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConsensusStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse", + encode(message: QueryConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStateResponse { + const message = createBaseQueryConsensusStateResponse(); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStateResponseAmino): QueryConsensusStateResponse { + const message = createBaseQueryConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConsensusStateResponse): QueryConsensusStateResponseAmino { + const obj: any = {}; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryConsensusStateResponseAminoMsg): QueryConsensusStateResponse { + return QueryConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStateResponse): QueryConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStateResponse", + value: QueryConsensusStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConsensusStateResponseProtoMsg): QueryConsensusStateResponse { + return QueryConsensusStateResponse.decode(message.value); + }, + toProto(message: QueryConsensusStateResponse): Uint8Array { + return QueryConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStateResponse): QueryConsensusStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse", + value: QueryConsensusStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStatesRequest(): QueryConsensusStatesRequest { + return { + clientId: "", + pagination: undefined + }; +} +export const QueryConsensusStatesRequest = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest", + encode(message: QueryConsensusStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStatesRequest { + const message = createBaseQueryConsensusStatesRequest(); + message.clientId = object.clientId ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStatesRequestAmino): QueryConsensusStatesRequest { + const message = createBaseQueryConsensusStatesRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConsensusStatesRequest): QueryConsensusStatesRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConsensusStatesRequestAminoMsg): QueryConsensusStatesRequest { + return QueryConsensusStatesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStatesRequest): QueryConsensusStatesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStatesRequest", + value: QueryConsensusStatesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConsensusStatesRequestProtoMsg): QueryConsensusStatesRequest { + return QueryConsensusStatesRequest.decode(message.value); + }, + toProto(message: QueryConsensusStatesRequest): Uint8Array { + return QueryConsensusStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStatesRequest): QueryConsensusStatesRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest", + value: QueryConsensusStatesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStatesResponse(): QueryConsensusStatesResponse { + return { + consensusStates: [], + pagination: undefined + }; +} +export const QueryConsensusStatesResponse = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse", + encode(message: QueryConsensusStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStatesResponse { + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensusStates?.map(e => ConsensusStateWithHeight.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStatesResponseAmino): QueryConsensusStatesResponse { + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConsensusStatesResponse): QueryConsensusStatesResponseAmino { + const obj: any = {}; + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toAmino(e) : undefined); + } else { + obj.consensus_states = message.consensusStates; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConsensusStatesResponseAminoMsg): QueryConsensusStatesResponse { + return QueryConsensusStatesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStatesResponse): QueryConsensusStatesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStatesResponse", + value: QueryConsensusStatesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConsensusStatesResponseProtoMsg): QueryConsensusStatesResponse { + return QueryConsensusStatesResponse.decode(message.value); + }, + toProto(message: QueryConsensusStatesResponse): Uint8Array { + return QueryConsensusStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStatesResponse): QueryConsensusStatesResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse", + value: QueryConsensusStatesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatusRequest(): QueryClientStatusRequest { + return { + clientId: "" + }; +} +export const QueryClientStatusRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest", + encode(message: QueryClientStatusRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatusRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatusRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatusRequest { + const message = createBaseQueryClientStatusRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: QueryClientStatusRequestAmino): QueryClientStatusRequest { + const message = createBaseQueryClientStatusRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: QueryClientStatusRequest): QueryClientStatusRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + return obj; + }, + fromAminoMsg(object: QueryClientStatusRequestAminoMsg): QueryClientStatusRequest { + return QueryClientStatusRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatusRequest): QueryClientStatusRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatusRequest", + value: QueryClientStatusRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientStatusRequestProtoMsg): QueryClientStatusRequest { + return QueryClientStatusRequest.decode(message.value); + }, + toProto(message: QueryClientStatusRequest): Uint8Array { + return QueryClientStatusRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatusRequest): QueryClientStatusRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest", + value: QueryClientStatusRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatusResponse(): QueryClientStatusResponse { + return { + status: "" + }; +} +export const QueryClientStatusResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse", + encode(message: QueryClientStatusResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatusResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatusResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatusResponse { + const message = createBaseQueryClientStatusResponse(); + message.status = object.status ?? ""; + return message; + }, + fromAmino(object: QueryClientStatusResponseAmino): QueryClientStatusResponse { + const message = createBaseQueryClientStatusResponse(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: QueryClientStatusResponse): QueryClientStatusResponseAmino { + const obj: any = {}; + obj.status = message.status === "" ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: QueryClientStatusResponseAminoMsg): QueryClientStatusResponse { + return QueryClientStatusResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatusResponse): QueryClientStatusResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatusResponse", + value: QueryClientStatusResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientStatusResponseProtoMsg): QueryClientStatusResponse { + return QueryClientStatusResponse.decode(message.value); + }, + toProto(message: QueryClientStatusResponse): Uint8Array { + return QueryClientStatusResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatusResponse): QueryClientStatusResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse", + value: QueryClientStatusResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientParamsRequest(): QueryClientParamsRequest { + return {}; +} +export const QueryClientParamsRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest", + encode(_: QueryClientParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryClientParamsRequest { + const message = createBaseQueryClientParamsRequest(); + return message; + }, + fromAmino(_: QueryClientParamsRequestAmino): QueryClientParamsRequest { + const message = createBaseQueryClientParamsRequest(); + return message; + }, + toAmino(_: QueryClientParamsRequest): QueryClientParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryClientParamsRequestAminoMsg): QueryClientParamsRequest { + return QueryClientParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientParamsRequest): QueryClientParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientParamsRequest", + value: QueryClientParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientParamsRequestProtoMsg): QueryClientParamsRequest { + return QueryClientParamsRequest.decode(message.value); + }, + toProto(message: QueryClientParamsRequest): Uint8Array { + return QueryClientParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientParamsRequest): QueryClientParamsRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest", + value: QueryClientParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientParamsResponse(): QueryClientParamsResponse { + return { + params: undefined + }; +} +export const QueryClientParamsResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse", + encode(message: QueryClientParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientParamsResponse { + const message = createBaseQueryClientParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryClientParamsResponseAmino): QueryClientParamsResponse { + const message = createBaseQueryClientParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryClientParamsResponse): QueryClientParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClientParamsResponseAminoMsg): QueryClientParamsResponse { + return QueryClientParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientParamsResponse): QueryClientParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientParamsResponse", + value: QueryClientParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientParamsResponseProtoMsg): QueryClientParamsResponse { + return QueryClientParamsResponse.decode(message.value); + }, + toProto(message: QueryClientParamsResponse): Uint8Array { + return QueryClientParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientParamsResponse): QueryClientParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse", + value: QueryClientParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedClientStateRequest(): QueryUpgradedClientStateRequest { + return {}; +} +export const QueryUpgradedClientStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest", + encode(_: QueryUpgradedClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryUpgradedClientStateRequest { + const message = createBaseQueryUpgradedClientStateRequest(); + return message; + }, + fromAmino(_: QueryUpgradedClientStateRequestAmino): QueryUpgradedClientStateRequest { + const message = createBaseQueryUpgradedClientStateRequest(); + return message; + }, + toAmino(_: QueryUpgradedClientStateRequest): QueryUpgradedClientStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradedClientStateRequestAminoMsg): QueryUpgradedClientStateRequest { + return QueryUpgradedClientStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedClientStateRequest): QueryUpgradedClientStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedClientStateRequest", + value: QueryUpgradedClientStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradedClientStateRequestProtoMsg): QueryUpgradedClientStateRequest { + return QueryUpgradedClientStateRequest.decode(message.value); + }, + toProto(message: QueryUpgradedClientStateRequest): Uint8Array { + return QueryUpgradedClientStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedClientStateRequest): QueryUpgradedClientStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest", + value: QueryUpgradedClientStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateResponse { + return { + upgradedClientState: undefined + }; +} +export const QueryUpgradedClientStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse", + encode(message: QueryUpgradedClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradedClientStateResponse { + const message = createBaseQueryUpgradedClientStateResponse(); + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: QueryUpgradedClientStateResponseAmino): QueryUpgradedClientStateResponse { + const message = createBaseQueryUpgradedClientStateResponse(); + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: QueryUpgradedClientStateResponse): QueryUpgradedClientStateResponseAmino { + const obj: any = {}; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUpgradedClientStateResponseAminoMsg): QueryUpgradedClientStateResponse { + return QueryUpgradedClientStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedClientStateResponse): QueryUpgradedClientStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedClientStateResponse", + value: QueryUpgradedClientStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradedClientStateResponseProtoMsg): QueryUpgradedClientStateResponse { + return QueryUpgradedClientStateResponse.decode(message.value); + }, + toProto(message: QueryUpgradedClientStateResponse): Uint8Array { + return QueryUpgradedClientStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedClientStateResponse): QueryUpgradedClientStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse", + value: QueryUpgradedClientStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { + return {}; +} +export const QueryUpgradedConsensusStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest", + encode(_: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryUpgradedConsensusStateRequest { + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; + }, + fromAmino(_: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; + }, + toAmino(_: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradedConsensusStateRequestAminoMsg): QueryUpgradedConsensusStateRequest { + return QueryUpgradedConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedConsensusStateRequest", + value: QueryUpgradedConsensusStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradedConsensusStateRequestProtoMsg): QueryUpgradedConsensusStateRequest { + return QueryUpgradedConsensusStateRequest.decode(message.value); + }, + toProto(message: QueryUpgradedConsensusStateRequest): Uint8Array { + return QueryUpgradedConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest", + value: QueryUpgradedConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { + return { + upgradedConsensusState: undefined + }; +} +export const QueryUpgradedConsensusStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + encode(message: QueryUpgradedConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradedConsensusState !== undefined) { + Any.encode(message.upgradedConsensusState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradedConsensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradedConsensusStateResponse { + const message = createBaseQueryUpgradedConsensusStateResponse(); + message.upgradedConsensusState = object.upgradedConsensusState !== undefined && object.upgradedConsensusState !== null ? Any.fromPartial(object.upgradedConsensusState) : undefined; + return message; + }, + fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = Any.fromAmino(object.upgraded_consensus_state); + } + return message; + }, + toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { + const obj: any = {}; + obj.upgraded_consensus_state = message.upgradedConsensusState ? Any.toAmino(message.upgradedConsensusState) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUpgradedConsensusStateResponseAminoMsg): QueryUpgradedConsensusStateResponse { + return QueryUpgradedConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedConsensusStateResponse", + value: QueryUpgradedConsensusStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradedConsensusStateResponseProtoMsg): QueryUpgradedConsensusStateResponse { + return QueryUpgradedConsensusStateResponse.decode(message.value); + }, + toProto(message: QueryUpgradedConsensusStateResponse): Uint8Array { + return QueryUpgradedConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + value: QueryUpgradedConsensusStateResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.amino.ts new file mode 100644 index 00000000..1e8e1dca --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.amino.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; +export const AminoConverter = { + "/ibc.core.client.v1.MsgCreateClient": { + aminoType: "cosmos-sdk/MsgCreateClient", + toAmino: MsgCreateClient.toAmino, + fromAmino: MsgCreateClient.fromAmino + }, + "/ibc.core.client.v1.MsgUpdateClient": { + aminoType: "cosmos-sdk/MsgUpdateClient", + toAmino: MsgUpdateClient.toAmino, + fromAmino: MsgUpdateClient.fromAmino + }, + "/ibc.core.client.v1.MsgUpgradeClient": { + aminoType: "cosmos-sdk/MsgUpgradeClient", + toAmino: MsgUpgradeClient.toAmino, + fromAmino: MsgUpgradeClient.fromAmino + }, + "/ibc.core.client.v1.MsgSubmitMisbehaviour": { + aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", + toAmino: MsgSubmitMisbehaviour.toAmino, + fromAmino: MsgSubmitMisbehaviour.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.registry.ts new file mode 100644 index 00000000..fe83153f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.registry.ts @@ -0,0 +1,89 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.encode(value).finish() + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.encode(value).finish() + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.encode(value).finish() + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.encode(value).finish() + }; + } + }, + withTypeUrl: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value + }; + } + }, + fromPartial: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.fromPartial(value) + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.fromPartial(value) + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.fromPartial(value) + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..894e0158 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.rpc.msg.ts @@ -0,0 +1,45 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse } from "./tx"; +/** Msg defines the ibc/client Msg service. */ +export interface Msg { + /** CreateClient defines a rpc handler method for MsgCreateClient. */ + createClient(request: MsgCreateClient): Promise; + /** UpdateClient defines a rpc handler method for MsgUpdateClient. */ + updateClient(request: MsgUpdateClient): Promise; + /** UpgradeClient defines a rpc handler method for MsgUpgradeClient. */ + upgradeClient(request: MsgUpgradeClient): Promise; + /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ + submitMisbehaviour(request: MsgSubmitMisbehaviour): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createClient = this.createClient.bind(this); + this.updateClient = this.updateClient.bind(this); + this.upgradeClient = this.upgradeClient.bind(this); + this.submitMisbehaviour = this.submitMisbehaviour.bind(this); + } + createClient(request: MsgCreateClient): Promise { + const data = MsgCreateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "CreateClient", data); + return promise.then(data => MsgCreateClientResponse.decode(new BinaryReader(data))); + } + updateClient(request: MsgUpdateClient): Promise { + const data = MsgUpdateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClient", data); + return promise.then(data => MsgUpdateClientResponse.decode(new BinaryReader(data))); + } + upgradeClient(request: MsgUpgradeClient): Promise { + const data = MsgUpgradeClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpgradeClient", data); + return promise.then(data => MsgUpgradeClientResponse.decode(new BinaryReader(data))); + } + submitMisbehaviour(request: MsgSubmitMisbehaviour): Promise { + const data = MsgSubmitMisbehaviour.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); + return promise.then(data => MsgSubmitMisbehaviourResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.ts b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.ts new file mode 100644 index 00000000..d5f84f11 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/client/v1/tx.ts @@ -0,0 +1,883 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClient { + /** light client state */ + clientState?: Any; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensusState?: Any; + /** signer address */ + signer: string; +} +export interface MsgCreateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClient"; + value: Uint8Array; +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientAmino { + /** light client state */ + client_state?: AnyAmino; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensus_state?: AnyAmino; + /** signer address */ + signer?: string; +} +export interface MsgCreateClientAminoMsg { + type: "cosmos-sdk/MsgCreateClient"; + value: MsgCreateClientAmino; +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientSDKType { + client_state?: AnySDKType; + consensus_state?: AnySDKType; + signer: string; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse {} +export interface MsgCreateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; + value: Uint8Array; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseAmino {} +export interface MsgCreateClientResponseAminoMsg { + type: "cosmos-sdk/MsgCreateClientResponse"; + value: MsgCreateClientResponseAmino; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseSDKType {} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given header. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string; + /** header to update the light client */ + header?: Any; + /** signer address */ + signer: string; +} +export interface MsgUpdateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient"; + value: Uint8Array; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given header. + */ +export interface MsgUpdateClientAmino { + /** client unique identifier */ + client_id?: string; + /** header to update the light client */ + header?: AnyAmino; + /** signer address */ + signer?: string; +} +export interface MsgUpdateClientAminoMsg { + type: "cosmos-sdk/MsgUpdateClient"; + value: MsgUpdateClientAmino; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given header. + */ +export interface MsgUpdateClientSDKType { + client_id: string; + header?: AnySDKType; + signer: string; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponse {} +export interface MsgUpdateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse"; + value: Uint8Array; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseAmino {} +export interface MsgUpdateClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateClientResponse"; + value: MsgUpdateClientResponseAmino; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseSDKType {} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClient { + /** client unique identifier */ + clientId: string; + /** upgraded client state */ + clientState?: Any; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensusState?: Any; + /** proof that old chain committed to new client */ + proofUpgradeClient: Uint8Array; + /** proof that old chain committed to new consensus state */ + proofUpgradeConsensusState: Uint8Array; + /** signer address */ + signer: string; +} +export interface MsgUpgradeClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient"; + value: Uint8Array; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientAmino { + /** client unique identifier */ + client_id?: string; + /** upgraded client state */ + client_state?: AnyAmino; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensus_state?: AnyAmino; + /** proof that old chain committed to new client */ + proof_upgrade_client?: string; + /** proof that old chain committed to new consensus state */ + proof_upgrade_consensus_state?: string; + /** signer address */ + signer?: string; +} +export interface MsgUpgradeClientAminoMsg { + type: "cosmos-sdk/MsgUpgradeClient"; + value: MsgUpgradeClientAmino; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientSDKType { + client_id: string; + client_state?: AnySDKType; + consensus_state?: AnySDKType; + proof_upgrade_client: Uint8Array; + proof_upgrade_consensus_state: Uint8Array; + signer: string; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponse {} +export interface MsgUpgradeClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse"; + value: Uint8Array; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseAmino {} +export interface MsgUpgradeClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpgradeClientResponse"; + value: MsgUpgradeClientResponseAmino; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseSDKType {} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + */ +export interface MsgSubmitMisbehaviour { + /** client unique identifier */ + clientId: string; + /** misbehaviour used for freezing the light client */ + misbehaviour?: Any; + /** signer address */ + signer: string; +} +export interface MsgSubmitMisbehaviourProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour"; + value: Uint8Array; +} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + */ +export interface MsgSubmitMisbehaviourAmino { + /** client unique identifier */ + client_id?: string; + /** misbehaviour used for freezing the light client */ + misbehaviour?: AnyAmino; + /** signer address */ + signer?: string; +} +export interface MsgSubmitMisbehaviourAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviour"; + value: MsgSubmitMisbehaviourAmino; +} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + */ +export interface MsgSubmitMisbehaviourSDKType { + client_id: string; + misbehaviour?: AnySDKType; + signer: string; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponse {} +export interface MsgSubmitMisbehaviourResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse"; + value: Uint8Array; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseAmino {} +export interface MsgSubmitMisbehaviourResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse"; + value: MsgSubmitMisbehaviourResponseAmino; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseSDKType {} +function createBaseMsgCreateClient(): MsgCreateClient { + return { + clientState: undefined, + consensusState: undefined, + signer: "" + }; +} +export const MsgCreateClient = { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + encode(message: MsgCreateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateClient { + const message = createBaseMsgCreateClient(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgCreateClientAmino): MsgCreateClient { + const message = createBaseMsgCreateClient(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgCreateClient): MsgCreateClientAmino { + const obj: any = {}; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgCreateClientAminoMsg): MsgCreateClient { + return MsgCreateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClient): MsgCreateClientAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClient", + value: MsgCreateClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateClientProtoMsg): MsgCreateClient { + return MsgCreateClient.decode(message.value); + }, + toProto(message: MsgCreateClient): Uint8Array { + return MsgCreateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClient): MsgCreateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.encode(message).finish() + }; + } +}; +function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { + return {}; +} +export const MsgCreateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + encode(_: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + return message; + }, + fromAmino(_: MsgCreateClientResponseAmino): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + return message; + }, + toAmino(_: MsgCreateClientResponse): MsgCreateClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateClientResponseAminoMsg): MsgCreateClientResponse { + return MsgCreateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClientResponse): MsgCreateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClientResponse", + value: MsgCreateClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateClientResponseProtoMsg): MsgCreateClientResponse { + return MsgCreateClientResponse.decode(message.value); + }, + toProto(message: MsgCreateClientResponse): Uint8Array { + return MsgCreateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClientResponse): MsgCreateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + value: MsgCreateClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateClient(): MsgUpdateClient { + return { + clientId: "", + header: undefined, + signer: "" + }; +} +export const MsgUpdateClient = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + encode(message: MsgUpdateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.header !== undefined) { + Any.encode(message.header, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + message.clientId = object.clientId ?? ""; + message.header = object.header !== undefined && object.header !== null ? Any.fromPartial(object.header) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.header !== undefined && object.header !== null) { + message.header = Any.fromAmino(object.header); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgUpdateClient): MsgUpdateClientAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.header = message.header ? Any.toAmino(message.header) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientAminoMsg): MsgUpdateClient { + return MsgUpdateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClient): MsgUpdateClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClient", + value: MsgUpdateClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateClientProtoMsg): MsgUpdateClient { + return MsgUpdateClient.decode(message.value); + }, + toProto(message: MsgUpdateClient): Uint8Array { + return MsgUpdateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClient): MsgUpdateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { + return {}; +} +export const MsgUpdateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + encode(_: MsgUpdateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + toAmino(_: MsgUpdateClientResponse): MsgUpdateClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientResponseAminoMsg): MsgUpdateClientResponse { + return MsgUpdateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClientResponse): MsgUpdateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClientResponse", + value: MsgUpdateClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateClientResponseProtoMsg): MsgUpdateClientResponse { + return MsgUpdateClientResponse.decode(message.value); + }, + toProto(message: MsgUpdateClientResponse): Uint8Array { + return MsgUpdateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClientResponse): MsgUpdateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + value: MsgUpdateClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpgradeClient(): MsgUpgradeClient { + return { + clientId: "", + clientState: undefined, + consensusState: undefined, + proofUpgradeClient: new Uint8Array(), + proofUpgradeConsensusState: new Uint8Array(), + signer: "" + }; +} +export const MsgUpgradeClient = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + encode(message: MsgUpgradeClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.proofUpgradeClient.length !== 0) { + writer.uint32(34).bytes(message.proofUpgradeClient); + } + if (message.proofUpgradeConsensusState.length !== 0) { + writer.uint32(42).bytes(message.proofUpgradeConsensusState); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.proofUpgradeClient = object.proofUpgradeClient ?? new Uint8Array(); + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState ?? new Uint8Array(); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof_upgrade_client !== undefined && object.proof_upgrade_client !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proof_upgrade_client); + } + if (object.proof_upgrade_consensus_state !== undefined && object.proof_upgrade_consensus_state !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proof_upgrade_consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgUpgradeClient): MsgUpgradeClientAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.proof_upgrade_client = message.proofUpgradeClient ? base64FromBytes(message.proofUpgradeClient) : undefined; + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState ? base64FromBytes(message.proofUpgradeConsensusState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientAminoMsg): MsgUpgradeClient { + return MsgUpgradeClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClient): MsgUpgradeClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClient", + value: MsgUpgradeClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpgradeClientProtoMsg): MsgUpgradeClient { + return MsgUpgradeClient.decode(message.value); + }, + toProto(message: MsgUpgradeClient): Uint8Array { + return MsgUpgradeClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClient): MsgUpgradeClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.encode(message).finish() + }; + } +}; +function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { + return {}; +} +export const MsgUpgradeClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + encode(_: MsgUpgradeClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + toAmino(_: MsgUpgradeClientResponse): MsgUpgradeClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientResponseAminoMsg): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClientResponse): MsgUpgradeClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpgradeClientResponseProtoMsg): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.decode(message.value); + }, + toProto(message: MsgUpgradeClientResponse): Uint8Array { + return MsgUpgradeClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClientResponse): MsgUpgradeClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { + return { + clientId: "", + misbehaviour: undefined, + signer: "" + }; +} +export const MsgSubmitMisbehaviour = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + encode(message: MsgSubmitMisbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.misbehaviour !== undefined) { + Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.misbehaviour = object.misbehaviour !== undefined && object.misbehaviour !== null ? Any.fromPartial(object.misbehaviour) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromAmino(object.misbehaviour); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.misbehaviour = message.misbehaviour ? Any.toAmino(message.misbehaviour) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourAminoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourProtoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.decode(message.value); + }, + toProto(message: MsgSubmitMisbehaviour): Uint8Array { + return MsgSubmitMisbehaviour.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourResponse { + return {}; +} +export const MsgSubmitMisbehaviourResponse = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + encode(_: MsgSubmitMisbehaviourResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + fromAmino(_: MsgSubmitMisbehaviourResponseAmino): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + toAmino(_: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourResponseAminoMsg): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourResponseProtoMsg): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.decode(message.value); + }, + toProto(message: MsgSubmitMisbehaviourResponse): Uint8Array { + return MsgSubmitMisbehaviourResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/commitment/v1/commitment.ts b/dydxjs/packages/dydxjs/src/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 00000000..42877cf8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,415 @@ +//@ts-nocheck +import { CommitmentProof, CommitmentProofAmino, CommitmentProofSDKType } from "../../../../confio/proofs"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRoot { + hash: Uint8Array; +} +export interface MerkleRootProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot"; + value: Uint8Array; +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootAmino { + hash?: string; +} +export interface MerkleRootAminoMsg { + type: "cosmos-sdk/MerkleRoot"; + value: MerkleRootAmino; +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootSDKType { + hash: Uint8Array; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefix { + keyPrefix: Uint8Array; +} +export interface MerklePrefixProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix"; + value: Uint8Array; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixAmino { + key_prefix?: string; +} +export interface MerklePrefixAminoMsg { + type: "cosmos-sdk/MerklePrefix"; + value: MerklePrefixAmino; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixSDKType { + key_prefix: Uint8Array; +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePath { + keyPath: string[]; +} +export interface MerklePathProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerklePath"; + value: Uint8Array; +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePathAmino { + key_path?: string[]; +} +export interface MerklePathAminoMsg { + type: "cosmos-sdk/MerklePath"; + value: MerklePathAmino; +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePathSDKType { + key_path: string[]; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProof { + proofs: CommitmentProof[]; +} +export interface MerkleProofProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleProof"; + value: Uint8Array; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofAmino { + proofs?: CommitmentProofAmino[]; +} +export interface MerkleProofAminoMsg { + type: "cosmos-sdk/MerkleProof"; + value: MerkleProofAmino; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofSDKType { + proofs: CommitmentProofSDKType[]; +} +function createBaseMerkleRoot(): MerkleRoot { + return { + hash: new Uint8Array() + }; +} +export const MerkleRoot = { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + encode(message: MerkleRoot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleRoot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleRoot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerkleRoot { + const message = createBaseMerkleRoot(); + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerkleRootAmino): MerkleRoot { + const message = createBaseMerkleRoot(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: MerkleRoot): MerkleRootAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: MerkleRootAminoMsg): MerkleRoot { + return MerkleRoot.fromAmino(object.value); + }, + toAminoMsg(message: MerkleRoot): MerkleRootAminoMsg { + return { + type: "cosmos-sdk/MerkleRoot", + value: MerkleRoot.toAmino(message) + }; + }, + fromProtoMsg(message: MerkleRootProtoMsg): MerkleRoot { + return MerkleRoot.decode(message.value); + }, + toProto(message: MerkleRoot): Uint8Array { + return MerkleRoot.encode(message).finish(); + }, + toProtoMsg(message: MerkleRoot): MerkleRootProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + value: MerkleRoot.encode(message).finish() + }; + } +}; +function createBaseMerklePrefix(): MerklePrefix { + return { + keyPrefix: new Uint8Array() + }; +} +export const MerklePrefix = { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + encode(message: MerklePrefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.keyPrefix.length !== 0) { + writer.uint32(10).bytes(message.keyPrefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerklePrefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePrefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerklePrefix { + const message = createBaseMerklePrefix(); + message.keyPrefix = object.keyPrefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerklePrefixAmino): MerklePrefix { + const message = createBaseMerklePrefix(); + if (object.key_prefix !== undefined && object.key_prefix !== null) { + message.keyPrefix = bytesFromBase64(object.key_prefix); + } + return message; + }, + toAmino(message: MerklePrefix): MerklePrefixAmino { + const obj: any = {}; + obj.key_prefix = message.keyPrefix ? base64FromBytes(message.keyPrefix) : undefined; + return obj; + }, + fromAminoMsg(object: MerklePrefixAminoMsg): MerklePrefix { + return MerklePrefix.fromAmino(object.value); + }, + toAminoMsg(message: MerklePrefix): MerklePrefixAminoMsg { + return { + type: "cosmos-sdk/MerklePrefix", + value: MerklePrefix.toAmino(message) + }; + }, + fromProtoMsg(message: MerklePrefixProtoMsg): MerklePrefix { + return MerklePrefix.decode(message.value); + }, + toProto(message: MerklePrefix): Uint8Array { + return MerklePrefix.encode(message).finish(); + }, + toProtoMsg(message: MerklePrefix): MerklePrefixProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + value: MerklePrefix.encode(message).finish() + }; + } +}; +function createBaseMerklePath(): MerklePath { + return { + keyPath: [] + }; +} +export const MerklePath = { + typeUrl: "/ibc.core.commitment.v1.MerklePath", + encode(message: MerklePath, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.keyPath) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerklePath { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePath(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPath.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerklePath { + const message = createBaseMerklePath(); + message.keyPath = object.keyPath?.map(e => e) || []; + return message; + }, + fromAmino(object: MerklePathAmino): MerklePath { + const message = createBaseMerklePath(); + message.keyPath = object.key_path?.map(e => e) || []; + return message; + }, + toAmino(message: MerklePath): MerklePathAmino { + const obj: any = {}; + if (message.keyPath) { + obj.key_path = message.keyPath.map(e => e); + } else { + obj.key_path = message.keyPath; + } + return obj; + }, + fromAminoMsg(object: MerklePathAminoMsg): MerklePath { + return MerklePath.fromAmino(object.value); + }, + toAminoMsg(message: MerklePath): MerklePathAminoMsg { + return { + type: "cosmos-sdk/MerklePath", + value: MerklePath.toAmino(message) + }; + }, + fromProtoMsg(message: MerklePathProtoMsg): MerklePath { + return MerklePath.decode(message.value); + }, + toProto(message: MerklePath): Uint8Array { + return MerklePath.encode(message).finish(); + }, + toProtoMsg(message: MerklePath): MerklePathProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerklePath", + value: MerklePath.encode(message).finish() + }; + } +}; +function createBaseMerkleProof(): MerkleProof { + return { + proofs: [] + }; +} +export const MerkleProof = { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + encode(message: MerkleProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proofs) { + CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MerkleProofAmino): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromAmino(e)) || []; + return message; + }, + toAmino(message: MerkleProof): MerkleProofAmino { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map(e => e ? CommitmentProof.toAmino(e) : undefined); + } else { + obj.proofs = message.proofs; + } + return obj; + }, + fromAminoMsg(object: MerkleProofAminoMsg): MerkleProof { + return MerkleProof.fromAmino(object.value); + }, + toAminoMsg(message: MerkleProof): MerkleProofAminoMsg { + return { + type: "cosmos-sdk/MerkleProof", + value: MerkleProof.toAmino(message) + }; + }, + fromProtoMsg(message: MerkleProofProtoMsg): MerkleProof { + return MerkleProof.decode(message.value); + }, + toProto(message: MerkleProof): Uint8Array { + return MerkleProof.encode(message).finish(); + }, + toProtoMsg(message: MerkleProof): MerkleProofProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + value: MerkleProof.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/connection.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/connection.ts new file mode 100644 index 00000000..b7fe616a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/connection.ts @@ -0,0 +1,999 @@ +//@ts-nocheck +import { MerklePrefix, MerklePrefixAmino, MerklePrefixSDKType } from "../../commitment/v1/commitment"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * State defines if a connection is in one of the following states: + * INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. */ + STATE_INIT = 1, + /** + * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + * chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. */ + STATE_OPEN = 3, + UNRECOGNIZED = -1, +} +export const StateSDKType = State; +export const StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty; + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + */ + delayPeriod: bigint; +} +export interface ConnectionEndProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd"; + value: Uint8Array; +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndAmino { + /** client associated with this connection. */ + client_id?: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions?: VersionAmino[]; + /** current state of the connection end. */ + state?: State; + /** counterparty chain associated with this connection. */ + counterparty?: CounterpartyAmino; + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + */ + delay_period?: string; +} +export interface ConnectionEndAminoMsg { + type: "cosmos-sdk/ConnectionEnd"; + value: ConnectionEndAmino; +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndSDKType { + client_id: string; + versions: VersionSDKType[]; + state: State; + counterparty: CounterpartySDKType; + delay_period: bigint; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty; + /** delay period associated with this connection. */ + delayPeriod: bigint; +} +export interface IdentifiedConnectionProtoMsg { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection"; + value: Uint8Array; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionAmino { + /** connection identifier. */ + id?: string; + /** client associated with this connection. */ + client_id?: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions?: VersionAmino[]; + /** current state of the connection end. */ + state?: State; + /** counterparty chain associated with this connection. */ + counterparty?: CounterpartyAmino; + /** delay period associated with this connection. */ + delay_period?: string; +} +export interface IdentifiedConnectionAminoMsg { + type: "cosmos-sdk/IdentifiedConnection"; + value: IdentifiedConnectionAmino; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionSDKType { + id: string; + client_id: string; + versions: VersionSDKType[]; + state: State; + counterparty: CounterpartySDKType; + delay_period: bigint; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefix; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.connection.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartyAmino { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + client_id?: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connection_id?: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix?: MerklePrefixAmino; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartySDKType { + client_id: string; + connection_id: string; + prefix: MerklePrefixSDKType; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[]; +} +export interface ClientPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ClientPaths"; + value: Uint8Array; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsAmino { + /** list of connection paths */ + paths?: string[]; +} +export interface ClientPathsAminoMsg { + type: "cosmos-sdk/ClientPaths"; + value: ClientPathsAmino; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsSDKType { + paths: string[]; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string; + /** list of connection paths */ + paths: string[]; +} +export interface ConnectionPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths"; + value: Uint8Array; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsAmino { + /** client state unique identifier */ + client_id?: string; + /** list of connection paths */ + paths?: string[]; +} +export interface ConnectionPathsAminoMsg { + type: "cosmos-sdk/ConnectionPaths"; + value: ConnectionPathsAmino; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsSDKType { + client_id: string; + paths: string[]; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} +export interface VersionProtoMsg { + typeUrl: "/ibc.core.connection.v1.Version"; + value: Uint8Array; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface VersionAmino { + /** unique version identifier */ + identifier?: string; + /** list of features compatible with the specified identifier */ + features?: string[]; +} +export interface VersionAminoMsg { + type: "cosmos-sdk/Version"; + value: VersionAmino; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface VersionSDKType { + identifier: string; + features: string[]; +} +/** Params defines the set of Connection parameters. */ +export interface Params { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * largest amount of time that the chain might reasonably take to produce the next block under normal operating + * conditions. A safe choice is 3-5x the expected time per block. + */ + maxExpectedTimePerBlock: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of Connection parameters. */ +export interface ParamsAmino { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * largest amount of time that the chain might reasonably take to produce the next block under normal operating + * conditions. A safe choice is 3-5x the expected time per block. + */ + max_expected_time_per_block?: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of Connection parameters. */ +export interface ParamsSDKType { + max_expected_time_per_block: bigint; +} +function createBaseConnectionEnd(): ConnectionEnd { + return { + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const ConnectionEnd = { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + encode(message: ConnectionEnd, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 3: + message.state = reader.int32() as any; + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConnectionEnd { + const message = createBaseConnectionEnd(); + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConnectionEndAmino): ConnectionEnd { + const message = createBaseConnectionEnd(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: ConnectionEnd): ConnectionEndAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.versions = message.versions; + } + obj.state = message.state === 0 ? undefined : message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConnectionEndAminoMsg): ConnectionEnd { + return ConnectionEnd.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionEnd): ConnectionEndAminoMsg { + return { + type: "cosmos-sdk/ConnectionEnd", + value: ConnectionEnd.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionEndProtoMsg): ConnectionEnd { + return ConnectionEnd.decode(message.value); + }, + toProto(message: ConnectionEnd): Uint8Array { + return ConnectionEnd.encode(message).finish(); + }, + toProtoMsg(message: ConnectionEnd): ConnectionEndProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + value: ConnectionEnd.encode(message).finish() + }; + } +}; +function createBaseIdentifiedConnection(): IdentifiedConnection { + return { + id: "", + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const IdentifiedConnection = { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + encode(message: IdentifiedConnection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(48).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 4: + message.state = reader.int32() as any; + break; + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 6: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + message.id = object.id ?? ""; + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: IdentifiedConnectionAmino): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: IdentifiedConnection): IdentifiedConnectionAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.versions = message.versions; + } + obj.state = message.state === 0 ? undefined : message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod.toString() : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedConnectionAminoMsg): IdentifiedConnection { + return IdentifiedConnection.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedConnection): IdentifiedConnectionAminoMsg { + return { + type: "cosmos-sdk/IdentifiedConnection", + value: IdentifiedConnection.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedConnectionProtoMsg): IdentifiedConnection { + return IdentifiedConnection.decode(message.value); + }, + toProto(message: IdentifiedConnection): Uint8Array { + return IdentifiedConnection.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedConnection): IdentifiedConnectionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + value: IdentifiedConnection.encode(message).finish() + }; + } +}; +function createBaseCounterparty(): Counterparty { + return { + clientId: "", + connectionId: "", + prefix: MerklePrefix.fromPartial({}) + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.connection.v1.Counterparty", + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Counterparty { + const message = createBaseCounterparty(); + message.clientId = object.clientId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.prefix = object.prefix !== undefined && object.prefix !== null ? MerklePrefix.fromPartial(object.prefix) : undefined; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromAmino(object.prefix); + } + return message; + }, + toAmino(message: Counterparty): CounterpartyAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.prefix = message.prefix ? MerklePrefix.toAmino(message.prefix) : undefined; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +function createBaseClientPaths(): ClientPaths { + return { + paths: [] + }; +} +export const ClientPaths = { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + encode(message: ClientPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ClientPathsAmino): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ClientPaths): ClientPathsAmino { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = message.paths; + } + return obj; + }, + fromAminoMsg(object: ClientPathsAminoMsg): ClientPaths { + return ClientPaths.fromAmino(object.value); + }, + toAminoMsg(message: ClientPaths): ClientPathsAminoMsg { + return { + type: "cosmos-sdk/ClientPaths", + value: ClientPaths.toAmino(message) + }; + }, + fromProtoMsg(message: ClientPathsProtoMsg): ClientPaths { + return ClientPaths.decode(message.value); + }, + toProto(message: ClientPaths): Uint8Array { + return ClientPaths.encode(message).finish(); + }, + toProtoMsg(message: ClientPaths): ClientPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + value: ClientPaths.encode(message).finish() + }; + } +}; +function createBaseConnectionPaths(): ConnectionPaths { + return { + clientId: "", + paths: [] + }; +} +export const ConnectionPaths = { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + encode(message: ConnectionPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.paths) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConnectionPaths { + const message = createBaseConnectionPaths(); + message.clientId = object.clientId ?? ""; + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ConnectionPathsAmino): ConnectionPaths { + const message = createBaseConnectionPaths(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ConnectionPaths): ConnectionPathsAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = message.paths; + } + return obj; + }, + fromAminoMsg(object: ConnectionPathsAminoMsg): ConnectionPaths { + return ConnectionPaths.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionPaths): ConnectionPathsAminoMsg { + return { + type: "cosmos-sdk/ConnectionPaths", + value: ConnectionPaths.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionPathsProtoMsg): ConnectionPaths { + return ConnectionPaths.decode(message.value); + }, + toProto(message: ConnectionPaths): Uint8Array { + return ConnectionPaths.encode(message).finish(); + }, + toProtoMsg(message: ConnectionPaths): ConnectionPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + value: ConnectionPaths.encode(message).finish() + }; + } +}; +function createBaseVersion(): Version { + return { + identifier: "", + features: [] + }; +} +export const Version = { + typeUrl: "/ibc.core.connection.v1.Version", + encode(message: Version, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.identifier !== "") { + writer.uint32(10).string(message.identifier); + } + for (const v of message.features) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Version { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Version { + const message = createBaseVersion(); + message.identifier = object.identifier ?? ""; + message.features = object.features?.map(e => e) || []; + return message; + }, + fromAmino(object: VersionAmino): Version { + const message = createBaseVersion(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + message.features = object.features?.map(e => e) || []; + return message; + }, + toAmino(message: Version): VersionAmino { + const obj: any = {}; + obj.identifier = message.identifier === "" ? undefined : message.identifier; + if (message.features) { + obj.features = message.features.map(e => e); + } else { + obj.features = message.features; + } + return obj; + }, + fromAminoMsg(object: VersionAminoMsg): Version { + return Version.fromAmino(object.value); + }, + toAminoMsg(message: Version): VersionAminoMsg { + return { + type: "cosmos-sdk/Version", + value: Version.toAmino(message) + }; + }, + fromProtoMsg(message: VersionProtoMsg): Version { + return Version.decode(message.value); + }, + toProto(message: Version): Uint8Array { + return Version.encode(message).finish(); + }, + toProtoMsg(message: Version): VersionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Version", + value: Version.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + maxExpectedTimePerBlock: BigInt(0) + }; +} +export const Params = { + typeUrl: "/ibc.core.connection.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxExpectedTimePerBlock !== BigInt(0)) { + writer.uint32(8).uint64(message.maxExpectedTimePerBlock); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxExpectedTimePerBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.maxExpectedTimePerBlock = object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null ? BigInt(object.maxExpectedTimePerBlock.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.max_expected_time_per_block !== undefined && object.max_expected_time_per_block !== null) { + message.maxExpectedTimePerBlock = BigInt(object.max_expected_time_per_block); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.max_expected_time_per_block = message.maxExpectedTimePerBlock !== BigInt(0) ? message.maxExpectedTimePerBlock.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/genesis.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/genesis.ts new file mode 100644 index 00000000..cd2ce643 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/genesis.ts @@ -0,0 +1,143 @@ +//@ts-nocheck +import { IdentifiedConnection, IdentifiedConnectionAmino, IdentifiedConnectionSDKType, ConnectionPaths, ConnectionPathsAmino, ConnectionPathsSDKType, Params, ParamsAmino, ParamsSDKType } from "./connection"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisState { + connections: IdentifiedConnection[]; + clientConnectionPaths: ConnectionPaths[]; + /** the sequence for the next generated connection identifier */ + nextConnectionSequence: bigint; + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.connection.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisStateAmino { + connections?: IdentifiedConnectionAmino[]; + client_connection_paths?: ConnectionPathsAmino[]; + /** the sequence for the next generated connection identifier */ + next_connection_sequence?: string; + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisStateSDKType { + connections: IdentifiedConnectionSDKType[]; + client_connection_paths: ConnectionPathsSDKType[]; + next_connection_sequence: bigint; + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + connections: [], + clientConnectionPaths: [], + nextConnectionSequence: BigInt(0), + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/ibc.core.connection.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientConnectionPaths) { + ConnectionPaths.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.nextConnectionSequence !== BigInt(0)) { + writer.uint32(24).uint64(message.nextConnectionSequence); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.clientConnectionPaths.push(ConnectionPaths.decode(reader, reader.uint32())); + break; + case 3: + message.nextConnectionSequence = reader.uint64(); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromPartial(e)) || []; + message.clientConnectionPaths = object.clientConnectionPaths?.map(e => ConnectionPaths.fromPartial(e)) || []; + message.nextConnectionSequence = object.nextConnectionSequence !== undefined && object.nextConnectionSequence !== null ? BigInt(object.nextConnectionSequence.toString()) : BigInt(0); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + message.clientConnectionPaths = object.client_connection_paths?.map(e => ConnectionPaths.fromAmino(e)) || []; + if (object.next_connection_sequence !== undefined && object.next_connection_sequence !== null) { + message.nextConnectionSequence = BigInt(object.next_connection_sequence); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map(e => e ? IdentifiedConnection.toAmino(e) : undefined); + } else { + obj.connections = message.connections; + } + if (message.clientConnectionPaths) { + obj.client_connection_paths = message.clientConnectionPaths.map(e => e ? ConnectionPaths.toAmino(e) : undefined); + } else { + obj.client_connection_paths = message.clientConnectionPaths; + } + obj.next_connection_sequence = message.nextConnectionSequence !== BigInt(0) ? message.nextConnectionSequence.toString() : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/query.rpc.Query.ts new file mode 100644 index 00000000..bc22d3a8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/query.rpc.Query.ts @@ -0,0 +1,86 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryConnectionRequest, QueryConnectionResponse, QueryConnectionsRequest, QueryConnectionsResponse, QueryClientConnectionsRequest, QueryClientConnectionsResponse, QueryConnectionClientStateRequest, QueryConnectionClientStateResponse, QueryConnectionConsensusStateRequest, QueryConnectionConsensusStateResponse } from "./query"; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Connection queries an IBC connection end. */ + connection(request: QueryConnectionRequest): Promise; + /** Connections queries all the IBC connections of a chain. */ + connections(request?: QueryConnectionsRequest): Promise; + /** + * ClientConnections queries the connection paths associated with a client + * state. + */ + clientConnections(request: QueryClientConnectionsRequest): Promise; + /** + * ConnectionClientState queries the client state associated with the + * connection. + */ + connectionClientState(request: QueryConnectionClientStateRequest): Promise; + /** + * ConnectionConsensusState queries the consensus state associated with the + * connection. + */ + connectionConsensusState(request: QueryConnectionConsensusStateRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.connection = this.connection.bind(this); + this.connections = this.connections.bind(this); + this.clientConnections = this.clientConnections.bind(this); + this.connectionClientState = this.connectionClientState.bind(this); + this.connectionConsensusState = this.connectionConsensusState.bind(this); + } + connection(request: QueryConnectionRequest): Promise { + const data = QueryConnectionRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connection", data); + return promise.then(data => QueryConnectionResponse.decode(new BinaryReader(data))); + } + connections(request: QueryConnectionsRequest = { + pagination: undefined + }): Promise { + const data = QueryConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connections", data); + return promise.then(data => QueryConnectionsResponse.decode(new BinaryReader(data))); + } + clientConnections(request: QueryClientConnectionsRequest): Promise { + const data = QueryClientConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ClientConnections", data); + return promise.then(data => QueryClientConnectionsResponse.decode(new BinaryReader(data))); + } + connectionClientState(request: QueryConnectionClientStateRequest): Promise { + const data = QueryConnectionClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionClientState", data); + return promise.then(data => QueryConnectionClientStateResponse.decode(new BinaryReader(data))); + } + connectionConsensusState(request: QueryConnectionConsensusStateRequest): Promise { + const data = QueryConnectionConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data); + return promise.then(data => QueryConnectionConsensusStateResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + connection(request: QueryConnectionRequest): Promise { + return queryService.connection(request); + }, + connections(request?: QueryConnectionsRequest): Promise { + return queryService.connections(request); + }, + clientConnections(request: QueryClientConnectionsRequest): Promise { + return queryService.clientConnections(request); + }, + connectionClientState(request: QueryConnectionClientStateRequest): Promise { + return queryService.connectionClientState(request); + }, + connectionConsensusState(request: QueryConnectionConsensusStateRequest): Promise { + return queryService.connectionConsensusState(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/query.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/query.ts new file mode 100644 index 00000000..ebac7bca --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/query.ts @@ -0,0 +1,1229 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType, IdentifiedConnection, IdentifiedConnectionAmino, IdentifiedConnectionSDKType } from "./connection"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType } from "../../client/v1/client"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequest { + /** connection unique identifier */ + connectionId: string; +} +export interface QueryConnectionRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionRequest"; + value: Uint8Array; +} +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequestAmino { + /** connection unique identifier */ + connection_id?: string; +} +export interface QueryConnectionRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionRequest"; + value: QueryConnectionRequestAmino; +} +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequestSDKType { + connection_id: string; +} +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponse { + /** connection associated with the request identifier */ + connection?: ConnectionEnd; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryConnectionResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionResponse"; + value: Uint8Array; +} +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponseAmino { + /** connection associated with the request identifier */ + connection?: ConnectionEndAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryConnectionResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionResponse"; + value: QueryConnectionResponseAmino; +} +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponseSDKType { + connection?: ConnectionEndSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequest { + pagination?: PageRequest; +} +export interface QueryConnectionsRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest"; + value: Uint8Array; +} +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequestAmino { + pagination?: PageRequestAmino; +} +export interface QueryConnectionsRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionsRequest"; + value: QueryConnectionsRequestAmino; +} +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponse { + /** list of stored connections of the chain. */ + connections: IdentifiedConnection[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height: Height; +} +export interface QueryConnectionsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsResponse"; + value: Uint8Array; +} +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponseAmino { + /** list of stored connections of the chain. */ + connections?: IdentifiedConnectionAmino[]; + /** pagination response */ + pagination?: PageResponseAmino; + /** query block height */ + height?: HeightAmino; +} +export interface QueryConnectionsResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionsResponse"; + value: QueryConnectionsResponseAmino; +} +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponseSDKType { + connections: IdentifiedConnectionSDKType[]; + pagination?: PageResponseSDKType; + height: HeightSDKType; +} +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequest { + /** client identifier associated with a connection */ + clientId: string; +} +export interface QueryClientConnectionsRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsRequest"; + value: Uint8Array; +} +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequestAmino { + /** client identifier associated with a connection */ + client_id?: string; +} +export interface QueryClientConnectionsRequestAminoMsg { + type: "cosmos-sdk/QueryClientConnectionsRequest"; + value: QueryClientConnectionsRequestAmino; +} +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequestSDKType { + client_id: string; +} +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponse { + /** slice of all the connection paths associated with a client. */ + connectionPaths: string[]; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was generated */ + proofHeight: Height; +} +export interface QueryClientConnectionsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsResponse"; + value: Uint8Array; +} +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponseAmino { + /** slice of all the connection paths associated with a client. */ + connection_paths?: string[]; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was generated */ + proof_height?: HeightAmino; +} +export interface QueryClientConnectionsResponseAminoMsg { + type: "cosmos-sdk/QueryClientConnectionsResponse"; + value: QueryClientConnectionsResponseAmino; +} +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponseSDKType { + connection_paths: string[]; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequest { + /** connection identifier */ + connectionId: string; +} +export interface QueryConnectionClientStateRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateRequest"; + value: Uint8Array; +} +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequestAmino { + /** connection identifier */ + connection_id?: string; +} +export interface QueryConnectionClientStateRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionClientStateRequest"; + value: QueryConnectionClientStateRequestAmino; +} +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequestSDKType { + connection_id: string; +} +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponse { + /** client state associated with the channel */ + identifiedClientState?: IdentifiedClientState; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryConnectionClientStateResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateResponse"; + value: Uint8Array; +} +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponseAmino { + /** client state associated with the channel */ + identified_client_state?: IdentifiedClientStateAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryConnectionClientStateResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionClientStateResponse"; + value: QueryConnectionClientStateResponseAmino; +} +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponseSDKType { + identified_client_state?: IdentifiedClientStateSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequest { + /** connection identifier */ + connectionId: string; + revisionNumber: bigint; + revisionHeight: bigint; +} +export interface QueryConnectionConsensusStateRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequestAmino { + /** connection identifier */ + connection_id?: string; + revision_number?: string; + revision_height?: string; +} +export interface QueryConnectionConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionConsensusStateRequest"; + value: QueryConnectionConsensusStateRequestAmino; +} +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequestSDKType { + connection_id: string; + revision_number: bigint; + revision_height: bigint; +} +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponse { + /** consensus state associated with the channel */ + consensusState?: Any; + /** client ID associated with the consensus state */ + clientId: string; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryConnectionConsensusStateResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponseAmino { + /** consensus state associated with the channel */ + consensus_state?: AnyAmino; + /** client ID associated with the consensus state */ + client_id?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryConnectionConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionConsensusStateResponse"; + value: QueryConnectionConsensusStateResponseAmino; +} +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponseSDKType { + consensus_state?: AnySDKType; + client_id: string; + proof: Uint8Array; + proof_height: HeightSDKType; +} +function createBaseQueryConnectionRequest(): QueryConnectionRequest { + return { + connectionId: "" + }; +} +export const QueryConnectionRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionRequest", + encode(message: QueryConnectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionRequest { + const message = createBaseQueryConnectionRequest(); + message.connectionId = object.connectionId ?? ""; + return message; + }, + fromAmino(object: QueryConnectionRequestAmino): QueryConnectionRequest { + const message = createBaseQueryConnectionRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; + }, + toAmino(message: QueryConnectionRequest): QueryConnectionRequestAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + return obj; + }, + fromAminoMsg(object: QueryConnectionRequestAminoMsg): QueryConnectionRequest { + return QueryConnectionRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionRequest): QueryConnectionRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionRequest", + value: QueryConnectionRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionRequestProtoMsg): QueryConnectionRequest { + return QueryConnectionRequest.decode(message.value); + }, + toProto(message: QueryConnectionRequest): Uint8Array { + return QueryConnectionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionRequest): QueryConnectionRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionRequest", + value: QueryConnectionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionResponse(): QueryConnectionResponse { + return { + connection: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConnectionResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionResponse", + encode(message: QueryConnectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = ConnectionEnd.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionResponse { + const message = createBaseQueryConnectionResponse(); + message.connection = object.connection !== undefined && object.connection !== null ? ConnectionEnd.fromPartial(object.connection) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConnectionResponseAmino): QueryConnectionResponse { + const message = createBaseQueryConnectionResponse(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConnectionResponse): QueryConnectionResponseAmino { + const obj: any = {}; + obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionResponseAminoMsg): QueryConnectionResponse { + return QueryConnectionResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionResponse): QueryConnectionResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionResponse", + value: QueryConnectionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionResponseProtoMsg): QueryConnectionResponse { + return QueryConnectionResponse.decode(message.value); + }, + toProto(message: QueryConnectionResponse): Uint8Array { + return QueryConnectionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionResponse): QueryConnectionResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionResponse", + value: QueryConnectionResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionsRequest(): QueryConnectionsRequest { + return { + pagination: undefined + }; +} +export const QueryConnectionsRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest", + encode(message: QueryConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionsRequest { + const message = createBaseQueryConnectionsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConnectionsRequestAmino): QueryConnectionsRequest { + const message = createBaseQueryConnectionsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConnectionsRequest): QueryConnectionsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConnectionsRequestAminoMsg): QueryConnectionsRequest { + return QueryConnectionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionsRequest): QueryConnectionsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionsRequest", + value: QueryConnectionsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionsRequestProtoMsg): QueryConnectionsRequest { + return QueryConnectionsRequest.decode(message.value); + }, + toProto(message: QueryConnectionsRequest): Uint8Array { + return QueryConnectionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionsRequest): QueryConnectionsRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest", + value: QueryConnectionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionsResponse(): QueryConnectionsResponse { + return { + connections: [], + pagination: undefined, + height: Height.fromPartial({}) + }; +} +export const QueryConnectionsResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsResponse", + encode(message: QueryConnectionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionsResponse { + const message = createBaseQueryConnectionsResponse(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryConnectionsResponseAmino): QueryConnectionsResponse { + const message = createBaseQueryConnectionsResponse(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryConnectionsResponse): QueryConnectionsResponseAmino { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map(e => e ? IdentifiedConnection.toAmino(e) : undefined); + } else { + obj.connections = message.connections; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionsResponseAminoMsg): QueryConnectionsResponse { + return QueryConnectionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionsResponse): QueryConnectionsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionsResponse", + value: QueryConnectionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionsResponseProtoMsg): QueryConnectionsResponse { + return QueryConnectionsResponse.decode(message.value); + }, + toProto(message: QueryConnectionsResponse): Uint8Array { + return QueryConnectionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionsResponse): QueryConnectionsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsResponse", + value: QueryConnectionsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientConnectionsRequest(): QueryClientConnectionsRequest { + return { + clientId: "" + }; +} +export const QueryClientConnectionsRequest = { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsRequest", + encode(message: QueryClientConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientConnectionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientConnectionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientConnectionsRequest { + const message = createBaseQueryClientConnectionsRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: QueryClientConnectionsRequestAmino): QueryClientConnectionsRequest { + const message = createBaseQueryClientConnectionsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: QueryClientConnectionsRequest): QueryClientConnectionsRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + return obj; + }, + fromAminoMsg(object: QueryClientConnectionsRequestAminoMsg): QueryClientConnectionsRequest { + return QueryClientConnectionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientConnectionsRequest): QueryClientConnectionsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientConnectionsRequest", + value: QueryClientConnectionsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientConnectionsRequestProtoMsg): QueryClientConnectionsRequest { + return QueryClientConnectionsRequest.decode(message.value); + }, + toProto(message: QueryClientConnectionsRequest): Uint8Array { + return QueryClientConnectionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientConnectionsRequest): QueryClientConnectionsRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsRequest", + value: QueryClientConnectionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientConnectionsResponse(): QueryClientConnectionsResponse { + return { + connectionPaths: [], + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryClientConnectionsResponse = { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsResponse", + encode(message: QueryClientConnectionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.connectionPaths) { + writer.uint32(10).string(v!); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientConnectionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientConnectionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionPaths.push(reader.string()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientConnectionsResponse { + const message = createBaseQueryClientConnectionsResponse(); + message.connectionPaths = object.connectionPaths?.map(e => e) || []; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryClientConnectionsResponseAmino): QueryClientConnectionsResponse { + const message = createBaseQueryClientConnectionsResponse(); + message.connectionPaths = object.connection_paths?.map(e => e) || []; + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryClientConnectionsResponse): QueryClientConnectionsResponseAmino { + const obj: any = {}; + if (message.connectionPaths) { + obj.connection_paths = message.connectionPaths.map(e => e); + } else { + obj.connection_paths = message.connectionPaths; + } + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryClientConnectionsResponseAminoMsg): QueryClientConnectionsResponse { + return QueryClientConnectionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientConnectionsResponse): QueryClientConnectionsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientConnectionsResponse", + value: QueryClientConnectionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClientConnectionsResponseProtoMsg): QueryClientConnectionsResponse { + return QueryClientConnectionsResponse.decode(message.value); + }, + toProto(message: QueryClientConnectionsResponse): Uint8Array { + return QueryClientConnectionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientConnectionsResponse): QueryClientConnectionsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsResponse", + value: QueryClientConnectionsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionClientStateRequest(): QueryConnectionClientStateRequest { + return { + connectionId: "" + }; +} +export const QueryConnectionClientStateRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateRequest", + encode(message: QueryConnectionClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionClientStateRequest { + const message = createBaseQueryConnectionClientStateRequest(); + message.connectionId = object.connectionId ?? ""; + return message; + }, + fromAmino(object: QueryConnectionClientStateRequestAmino): QueryConnectionClientStateRequest { + const message = createBaseQueryConnectionClientStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; + }, + toAmino(message: QueryConnectionClientStateRequest): QueryConnectionClientStateRequestAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + return obj; + }, + fromAminoMsg(object: QueryConnectionClientStateRequestAminoMsg): QueryConnectionClientStateRequest { + return QueryConnectionClientStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionClientStateRequest): QueryConnectionClientStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionClientStateRequest", + value: QueryConnectionClientStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionClientStateRequestProtoMsg): QueryConnectionClientStateRequest { + return QueryConnectionClientStateRequest.decode(message.value); + }, + toProto(message: QueryConnectionClientStateRequest): Uint8Array { + return QueryConnectionClientStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionClientStateRequest): QueryConnectionClientStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateRequest", + value: QueryConnectionClientStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionClientStateResponse(): QueryConnectionClientStateResponse { + return { + identifiedClientState: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConnectionClientStateResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateResponse", + encode(message: QueryConnectionClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionClientStateResponse { + const message = createBaseQueryConnectionClientStateResponse(); + message.identifiedClientState = object.identifiedClientState !== undefined && object.identifiedClientState !== null ? IdentifiedClientState.fromPartial(object.identifiedClientState) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConnectionClientStateResponseAmino): QueryConnectionClientStateResponse { + const message = createBaseQueryConnectionClientStateResponse(); + if (object.identified_client_state !== undefined && object.identified_client_state !== null) { + message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConnectionClientStateResponse): QueryConnectionClientStateResponseAmino { + const obj: any = {}; + obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionClientStateResponseAminoMsg): QueryConnectionClientStateResponse { + return QueryConnectionClientStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionClientStateResponse): QueryConnectionClientStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionClientStateResponse", + value: QueryConnectionClientStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionClientStateResponseProtoMsg): QueryConnectionClientStateResponse { + return QueryConnectionClientStateResponse.decode(message.value); + }, + toProto(message: QueryConnectionClientStateResponse): Uint8Array { + return QueryConnectionClientStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionClientStateResponse): QueryConnectionClientStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateResponse", + value: QueryConnectionClientStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionConsensusStateRequest(): QueryConnectionConsensusStateRequest { + return { + connectionId: "", + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const QueryConnectionConsensusStateRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest", + encode(message: QueryConnectionConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionConsensusStateRequest { + const message = createBaseQueryConnectionConsensusStateRequest(); + message.connectionId = object.connectionId ?? ""; + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryConnectionConsensusStateRequestAmino): QueryConnectionConsensusStateRequest { + const message = createBaseQueryConnectionConsensusStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + return message; + }, + toAmino(message: QueryConnectionConsensusStateRequest): QueryConnectionConsensusStateRequestAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryConnectionConsensusStateRequestAminoMsg): QueryConnectionConsensusStateRequest { + return QueryConnectionConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionConsensusStateRequest): QueryConnectionConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionConsensusStateRequest", + value: QueryConnectionConsensusStateRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionConsensusStateRequestProtoMsg): QueryConnectionConsensusStateRequest { + return QueryConnectionConsensusStateRequest.decode(message.value); + }, + toProto(message: QueryConnectionConsensusStateRequest): Uint8Array { + return QueryConnectionConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionConsensusStateRequest): QueryConnectionConsensusStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest", + value: QueryConnectionConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConsensusStateResponse { + return { + consensusState: undefined, + clientId: "", + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConnectionConsensusStateResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse", + encode(message: QueryConnectionConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionConsensusStateResponse { + const message = createBaseQueryConnectionConsensusStateResponse(); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.clientId = object.clientId ?? ""; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConnectionConsensusStateResponseAmino): QueryConnectionConsensusStateResponse { + const message = createBaseQueryConnectionConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConnectionConsensusStateResponse): QueryConnectionConsensusStateResponseAmino { + const obj: any = {}; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionConsensusStateResponseAminoMsg): QueryConnectionConsensusStateResponse { + return QueryConnectionConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionConsensusStateResponse): QueryConnectionConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionConsensusStateResponse", + value: QueryConnectionConsensusStateResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionConsensusStateResponseProtoMsg): QueryConnectionConsensusStateResponse { + return QueryConnectionConsensusStateResponse.decode(message.value); + }, + toProto(message: QueryConnectionConsensusStateResponse): Uint8Array { + return QueryConnectionConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionConsensusStateResponse): QueryConnectionConsensusStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse", + value: QueryConnectionConsensusStateResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.amino.ts new file mode 100644 index 00000000..d30beafa --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.amino.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; +export const AminoConverter = { + "/ibc.core.connection.v1.MsgConnectionOpenInit": { + aminoType: "cosmos-sdk/MsgConnectionOpenInit", + toAmino: MsgConnectionOpenInit.toAmino, + fromAmino: MsgConnectionOpenInit.fromAmino + }, + "/ibc.core.connection.v1.MsgConnectionOpenTry": { + aminoType: "cosmos-sdk/MsgConnectionOpenTry", + toAmino: MsgConnectionOpenTry.toAmino, + fromAmino: MsgConnectionOpenTry.fromAmino + }, + "/ibc.core.connection.v1.MsgConnectionOpenAck": { + aminoType: "cosmos-sdk/MsgConnectionOpenAck", + toAmino: MsgConnectionOpenAck.toAmino, + fromAmino: MsgConnectionOpenAck.fromAmino + }, + "/ibc.core.connection.v1.MsgConnectionOpenConfirm": { + aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", + toAmino: MsgConnectionOpenConfirm.toAmino, + fromAmino: MsgConnectionOpenConfirm.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.registry.ts new file mode 100644 index 00000000..ea9df730 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.registry.ts @@ -0,0 +1,89 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.encode(value).finish() + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.encode(value).finish() + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.encode(value).finish() + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.encode(value).finish() + }; + } + }, + withTypeUrl: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value + }; + } + }, + fromPartial: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.fromPartial(value) + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.fromPartial(value) + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.fromPartial(value) + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..166ba60a --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.rpc.msg.ts @@ -0,0 +1,48 @@ +//@ts-nocheck +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse } from "./tx"; +/** Msg defines the ibc/connection Msg service. */ +export interface Msg { + /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ + connectionOpenInit(request: MsgConnectionOpenInit): Promise; + /** ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. */ + connectionOpenTry(request: MsgConnectionOpenTry): Promise; + /** ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. */ + connectionOpenAck(request: MsgConnectionOpenAck): Promise; + /** + * ConnectionOpenConfirm defines a rpc handler method for + * MsgConnectionOpenConfirm. + */ + connectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.connectionOpenInit = this.connectionOpenInit.bind(this); + this.connectionOpenTry = this.connectionOpenTry.bind(this); + this.connectionOpenAck = this.connectionOpenAck.bind(this); + this.connectionOpenConfirm = this.connectionOpenConfirm.bind(this); + } + connectionOpenInit(request: MsgConnectionOpenInit): Promise { + const data = MsgConnectionOpenInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenInit", data); + return promise.then(data => MsgConnectionOpenInitResponse.decode(new BinaryReader(data))); + } + connectionOpenTry(request: MsgConnectionOpenTry): Promise { + const data = MsgConnectionOpenTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenTry", data); + return promise.then(data => MsgConnectionOpenTryResponse.decode(new BinaryReader(data))); + } + connectionOpenAck(request: MsgConnectionOpenAck): Promise { + const data = MsgConnectionOpenAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenAck", data); + return promise.then(data => MsgConnectionOpenAckResponse.decode(new BinaryReader(data))); + } + connectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise { + const data = MsgConnectionOpenConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); + return promise.then(data => MsgConnectionOpenConfirmResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.ts b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.ts new file mode 100644 index 00000000..ad7cd425 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/core/connection/v1/tx.ts @@ -0,0 +1,1137 @@ +//@ts-nocheck +import { Counterparty, CounterpartyAmino, CounterpartySDKType, Version, VersionAmino, VersionSDKType } from "./connection"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInit { + clientId: string; + counterparty: Counterparty; + version?: Version; + delayPeriod: bigint; + signer: string; +} +export interface MsgConnectionOpenInitProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitAmino { + client_id?: string; + counterparty?: CounterpartyAmino; + version?: VersionAmino; + delay_period?: string; + signer?: string; +} +export interface MsgConnectionOpenInitAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInit"; + value: MsgConnectionOpenInitAmino; +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitSDKType { + client_id: string; + counterparty: CounterpartySDKType; + version?: VersionSDKType; + delay_period: bigint; + signer: string; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponse {} +export interface MsgConnectionOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseAmino {} +export interface MsgConnectionOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInitResponse"; + value: MsgConnectionOpenInitResponseAmino; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseSDKType {} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the connection identifier of the previous connection in state INIT + */ + previousConnectionId: string; + clientState?: Any; + counterparty: Counterparty; + delayPeriod: bigint; + counterpartyVersions: Version[]; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proofInit: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height; + signer: string; +} +export interface MsgConnectionOpenTryProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry"; + value: Uint8Array; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTryAmino { + client_id?: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need + * the connection identifier of the previous connection in state INIT + */ + previous_connection_id?: string; + client_state?: AnyAmino; + counterparty?: CounterpartyAmino; + delay_period?: string; + counterparty_versions?: VersionAmino[]; + proof_height?: HeightAmino; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proof_init?: string; + /** proof of client state included in message */ + proof_client?: string; + /** proof of client consensus state */ + proof_consensus?: string; + consensus_height?: HeightAmino; + signer?: string; +} +export interface MsgConnectionOpenTryAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTry"; + value: MsgConnectionOpenTryAmino; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTrySDKType { + client_id: string; + previous_connection_id: string; + client_state?: AnySDKType; + counterparty: CounterpartySDKType; + delay_period: bigint; + counterparty_versions: VersionSDKType[]; + proof_height: HeightSDKType; + proof_init: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: HeightSDKType; + signer: string; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponse {} +export interface MsgConnectionOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseAmino {} +export interface MsgConnectionOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTryResponse"; + value: MsgConnectionOpenTryResponseAmino; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseSDKType {} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAck { + connectionId: string; + counterpartyConnectionId: string; + version?: Version; + clientState?: Any; + proofHeight: Height; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height; + signer: string; +} +export interface MsgConnectionOpenAckProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck"; + value: Uint8Array; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckAmino { + connection_id?: string; + counterparty_connection_id?: string; + version?: VersionAmino; + client_state?: AnyAmino; + proof_height?: HeightAmino; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proof_try?: string; + /** proof of client state included in message */ + proof_client?: string; + /** proof of client consensus state */ + proof_consensus?: string; + consensus_height?: HeightAmino; + signer?: string; +} +export interface MsgConnectionOpenAckAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAck"; + value: MsgConnectionOpenAckAmino; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckSDKType { + connection_id: string; + counterparty_connection_id: string; + version?: VersionSDKType; + client_state?: AnySDKType; + proof_height: HeightSDKType; + proof_try: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: HeightSDKType; + signer: string; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponse {} +export interface MsgConnectionOpenAckResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseAmino {} +export interface MsgConnectionOpenAckResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAckResponse"; + value: MsgConnectionOpenAckResponseAmino; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseSDKType {} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirm { + connectionId: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proofAck: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgConnectionOpenConfirmProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmAmino { + connection_id?: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proof_ack?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgConnectionOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirm"; + value: MsgConnectionOpenConfirmAmino; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmSDKType { + connection_id: string; + proof_ack: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponse {} +export interface MsgConnectionOpenConfirmResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseAmino {} +export interface MsgConnectionOpenConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse"; + value: MsgConnectionOpenConfirmResponseAmino; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseSDKType {} +function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { + return { + clientId: "", + counterparty: Counterparty.fromPartial({}), + version: undefined, + delayPeriod: BigInt(0), + signer: "" + }; +} +export const MsgConnectionOpenInit = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + encode(message: MsgConnectionOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(18).fork()).ldelim(); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(32).uint64(message.delayPeriod); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.delayPeriod = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + message.clientId = object.clientId ?? ""; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenInitAmino): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenInit): MsgConnectionOpenInitAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.version = message.version ? Version.toAmino(message.version) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitAminoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInit", + value: MsgConnectionOpenInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitProtoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.decode(message.value); + }, + toProto(message: MsgConnectionOpenInit): Uint8Array { + return MsgConnectionOpenInit.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenInitResponse(): MsgConnectionOpenInitResponse { + return {}; +} +export const MsgConnectionOpenInitResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + encode(_: MsgConnectionOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenInitResponseAmino): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitResponseAminoMsg): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitResponseProtoMsg): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenInitResponse): Uint8Array { + return MsgConnectionOpenInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { + return { + clientId: "", + previousConnectionId: "", + clientState: undefined, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0), + counterpartyVersions: [], + proofHeight: Height.fromPartial({}), + proofInit: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgConnectionOpenTry = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + encode(message: MsgConnectionOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.previousConnectionId !== "") { + writer.uint32(18).string(message.previousConnectionId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(26).fork()).ldelim(); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + for (const v of message.counterpartyVersions) { + Version.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.proofInit.length !== 0) { + writer.uint32(66).bytes(message.proofInit); + } + if (message.proofClient.length !== 0) { + writer.uint32(74).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(82).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(98).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.previousConnectionId = reader.string(); + break; + case 3: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + case 6: + message.counterpartyVersions.push(Version.decode(reader, reader.uint32())); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofInit = reader.bytes(); + break; + case 9: + message.proofClient = reader.bytes(); + break; + case 10: + message.proofConsensus = reader.bytes(); + break; + case 11: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 12: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry(); + message.clientId = object.clientId ?? ""; + message.previousConnectionId = object.previousConnectionId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.counterpartyVersions = object.counterpartyVersions?.map(e => Version.fromPartial(e)) || []; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + message.proofConsensus = object.proofConsensus ?? new Uint8Array(); + message.consensusHeight = object.consensusHeight !== undefined && object.consensusHeight !== null ? Height.fromPartial(object.consensusHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenTryAmino): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.previous_connection_id !== undefined && object.previous_connection_id !== null) { + message.previousConnectionId = object.previous_connection_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + message.counterpartyVersions = object.counterparty_versions?.map(e => Version.fromAmino(e)) || []; + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenTry): MsgConnectionOpenTryAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.previous_connection_id = message.previousConnectionId === "" ? undefined : message.previousConnectionId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + obj.delay_period = message.delayPeriod !== BigInt(0) ? message.delayPeriod.toString() : undefined; + if (message.counterpartyVersions) { + obj.counterparty_versions = message.counterpartyVersions.map(e => e ? Version.toAmino(e) : undefined); + } else { + obj.counterparty_versions = message.counterpartyVersions; + } + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; + obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenTryAminoMsg): MsgConnectionOpenTry { + return MsgConnectionOpenTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTry", + value: MsgConnectionOpenTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryProtoMsg): MsgConnectionOpenTry { + return MsgConnectionOpenTry.decode(message.value); + }, + toProto(message: MsgConnectionOpenTry): Uint8Array { + return MsgConnectionOpenTry.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenTryResponse(): MsgConnectionOpenTryResponse { + return {}; +} +export const MsgConnectionOpenTryResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + encode(_: MsgConnectionOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenTryResponseAmino): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenTryResponseAminoMsg): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryResponseProtoMsg): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenTryResponse): Uint8Array { + return MsgConnectionOpenTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { + return { + connectionId: "", + counterpartyConnectionId: "", + version: undefined, + clientState: undefined, + proofHeight: Height.fromPartial({}), + proofTry: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgConnectionOpenAck = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + encode(message: MsgConnectionOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.counterpartyConnectionId !== "") { + writer.uint32(18).string(message.counterpartyConnectionId); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(34).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.proofTry.length !== 0) { + writer.uint32(50).bytes(message.proofTry); + } + if (message.proofClient.length !== 0) { + writer.uint32(58).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(66).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(82).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.counterpartyConnectionId = reader.string(); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.proofTry = reader.bytes(); + break; + case 7: + message.proofClient = reader.bytes(); + break; + case 8: + message.proofConsensus = reader.bytes(); + break; + case 9: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 10: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck(); + message.connectionId = object.connectionId ?? ""; + message.counterpartyConnectionId = object.counterpartyConnectionId ?? ""; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + message.proofConsensus = object.proofConsensus ?? new Uint8Array(); + message.consensusHeight = object.consensusHeight !== undefined && object.consensusHeight !== null ? Height.fromPartial(object.consensusHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenAckAmino): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.counterparty_connection_id !== undefined && object.counterparty_connection_id !== null) { + message.counterpartyConnectionId = object.counterparty_connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenAck): MsgConnectionOpenAckAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.counterparty_connection_id = message.counterpartyConnectionId === "" ? undefined : message.counterpartyConnectionId; + obj.version = message.version ? Version.toAmino(message.version) : undefined; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; + obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenAckAminoMsg): MsgConnectionOpenAck { + return MsgConnectionOpenAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAck", + value: MsgConnectionOpenAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckProtoMsg): MsgConnectionOpenAck { + return MsgConnectionOpenAck.decode(message.value); + }, + toProto(message: MsgConnectionOpenAck): Uint8Array { + return MsgConnectionOpenAck.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenAckResponse(): MsgConnectionOpenAckResponse { + return {}; +} +export const MsgConnectionOpenAckResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + encode(_: MsgConnectionOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenAckResponseAmino): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenAckResponseAminoMsg): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckResponseProtoMsg): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenAckResponse): Uint8Array { + return MsgConnectionOpenAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { + return { + connectionId: "", + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgConnectionOpenConfirm = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + encode(message: MsgConnectionOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.proofAck.length !== 0) { + writer.uint32(18).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.proofAck = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + message.connectionId = object.connectionId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenConfirmAmino): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmAminoMsg): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmProtoMsg): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.decode(message.value); + }, + toProto(message: MsgConnectionOpenConfirm): Uint8Array { + return MsgConnectionOpenConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenConfirmResponse(): MsgConnectionOpenConfirmResponse { + return {}; +} +export const MsgConnectionOpenConfirmResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + encode(_: MsgConnectionOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenConfirmResponseAmino): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmResponseAminoMsg): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmResponseProtoMsg): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.decode(message.value); + }, + toProto(message: MsgConnectionOpenConfirmResponse): Uint8Array { + return MsgConnectionOpenConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/lightclients/localhost/v1/localhost.ts b/dydxjs/packages/dydxjs/src/ibc/lightclients/localhost/v1/localhost.ts new file mode 100644 index 00000000..b31eb2af --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/lightclients/localhost/v1/localhost.ts @@ -0,0 +1,120 @@ +//@ts-nocheck +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * ClientState defines a loopback (localhost) client. It requires (read-only) + * access to keys outside the client prefix. + */ +export interface ClientState { + /** self chain ID */ + chainId: string; + /** self latest block height */ + height: Height; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.localhost.v1.ClientState"; + value: Uint8Array; +} +/** + * ClientState defines a loopback (localhost) client. It requires (read-only) + * access to keys outside the client prefix. + */ +export interface ClientStateAmino { + /** self chain ID */ + chain_id?: string; + /** self latest block height */ + height?: HeightAmino; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState defines a loopback (localhost) client. It requires (read-only) + * access to keys outside the client prefix. + */ +export interface ClientStateSDKType { + chain_id: string; + height: HeightSDKType; +} +function createBaseClientState(): ClientState { + return { + chainId: "", + height: Height.fromPartial({}) + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.localhost.v1.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.chainId = object.chainId ?? ""; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.height = message.height ? Height.toAmino(message.height) : {}; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.localhost.v1.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/lightclients/solomachine/v1/solomachine.ts b/dydxjs/packages/dydxjs/src/ibc/lightclients/solomachine/v1/solomachine.ts new file mode 100644 index 00000000..747759d1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/lightclients/solomachine/v1/solomachine.ts @@ -0,0 +1,2089 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType } from "../../../core/connection/v1/connection"; +import { Channel, ChannelAmino, ChannelSDKType } from "../../../core/channel/v1/channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * DataType defines the type of solo machine proof being created. This is done + * to preserve uniqueness of different data sign byte encodings. + */ +export enum DataType { + /** DATA_TYPE_UNINITIALIZED_UNSPECIFIED - Default State */ + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0, + /** DATA_TYPE_CLIENT_STATE - Data type for client state verification */ + DATA_TYPE_CLIENT_STATE = 1, + /** DATA_TYPE_CONSENSUS_STATE - Data type for consensus state verification */ + DATA_TYPE_CONSENSUS_STATE = 2, + /** DATA_TYPE_CONNECTION_STATE - Data type for connection state verification */ + DATA_TYPE_CONNECTION_STATE = 3, + /** DATA_TYPE_CHANNEL_STATE - Data type for channel state verification */ + DATA_TYPE_CHANNEL_STATE = 4, + /** DATA_TYPE_PACKET_COMMITMENT - Data type for packet commitment verification */ + DATA_TYPE_PACKET_COMMITMENT = 5, + /** DATA_TYPE_PACKET_ACKNOWLEDGEMENT - Data type for packet acknowledgement verification */ + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6, + /** DATA_TYPE_PACKET_RECEIPT_ABSENCE - Data type for packet receipt absence verification */ + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7, + /** DATA_TYPE_NEXT_SEQUENCE_RECV - Data type for next sequence recv verification */ + DATA_TYPE_NEXT_SEQUENCE_RECV = 8, + /** DATA_TYPE_HEADER - Data type for header verification */ + DATA_TYPE_HEADER = 9, + UNRECOGNIZED = -1, +} +export const DataTypeSDKType = DataType; +export const DataTypeAmino = DataType; +export function dataTypeFromJSON(object: any): DataType { + switch (object) { + case 0: + case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": + return DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "DATA_TYPE_CLIENT_STATE": + return DataType.DATA_TYPE_CLIENT_STATE; + case 2: + case "DATA_TYPE_CONSENSUS_STATE": + return DataType.DATA_TYPE_CONSENSUS_STATE; + case 3: + case "DATA_TYPE_CONNECTION_STATE": + return DataType.DATA_TYPE_CONNECTION_STATE; + case 4: + case "DATA_TYPE_CHANNEL_STATE": + return DataType.DATA_TYPE_CHANNEL_STATE; + case 5: + case "DATA_TYPE_PACKET_COMMITMENT": + return DataType.DATA_TYPE_PACKET_COMMITMENT; + case 6: + case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": + return DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT; + case 7: + case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": + return DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE; + case 8: + case "DATA_TYPE_NEXT_SEQUENCE_RECV": + return DataType.DATA_TYPE_NEXT_SEQUENCE_RECV; + case 9: + case "DATA_TYPE_HEADER": + return DataType.DATA_TYPE_HEADER; + case -1: + case "UNRECOGNIZED": + default: + return DataType.UNRECOGNIZED; + } +} +export function dataTypeToJSON(object: DataType): string { + switch (object) { + case DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED: + return "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"; + case DataType.DATA_TYPE_CLIENT_STATE: + return "DATA_TYPE_CLIENT_STATE"; + case DataType.DATA_TYPE_CONSENSUS_STATE: + return "DATA_TYPE_CONSENSUS_STATE"; + case DataType.DATA_TYPE_CONNECTION_STATE: + return "DATA_TYPE_CONNECTION_STATE"; + case DataType.DATA_TYPE_CHANNEL_STATE: + return "DATA_TYPE_CHANNEL_STATE"; + case DataType.DATA_TYPE_PACKET_COMMITMENT: + return "DATA_TYPE_PACKET_COMMITMENT"; + case DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT: + return "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"; + case DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE: + return "DATA_TYPE_PACKET_RECEIPT_ABSENCE"; + case DataType.DATA_TYPE_NEXT_SEQUENCE_RECV: + return "DATA_TYPE_NEXT_SEQUENCE_RECV"; + case DataType.DATA_TYPE_HEADER: + return "DATA_TYPE_HEADER"; + case DataType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientState { + /** latest sequence of the client state */ + sequence: bigint; + /** frozen sequence of the solo machine */ + frozenSequence: bigint; + consensusState?: ConsensusState; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allowUpdateAfterProposal: boolean; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientState"; + value: Uint8Array; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateAmino { + /** latest sequence of the client state */ + sequence?: string; + /** frozen sequence of the solo machine */ + frozen_sequence?: string; + consensus_state?: ConsensusStateAmino; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allow_update_after_proposal?: boolean; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateSDKType { + sequence: bigint; + frozen_sequence: bigint; + consensus_state?: ConsensusStateSDKType; + allow_update_after_proposal: boolean; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusState { + /** public key of the solo machine */ + publicKey?: Any; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier: string; + timestamp: bigint; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusState"; + value: Uint8Array; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateAmino { + /** public key of the solo machine */ + public_key?: AnyAmino; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier?: string; + timestamp?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateSDKType { + public_key?: AnySDKType; + diversifier: string; + timestamp: bigint; +} +/** Header defines a solo machine consensus header */ +export interface Header { + /** sequence to update solo machine public key at */ + sequence: bigint; + timestamp: bigint; + signature: Uint8Array; + newPublicKey?: Any; + newDiversifier: string; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.Header"; + value: Uint8Array; +} +/** Header defines a solo machine consensus header */ +export interface HeaderAmino { + /** sequence to update solo machine public key at */ + sequence?: string; + timestamp?: string; + signature?: string; + new_public_key?: AnyAmino; + new_diversifier?: string; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** Header defines a solo machine consensus header */ +export interface HeaderSDKType { + sequence: bigint; + timestamp: bigint; + signature: Uint8Array; + new_public_key?: AnySDKType; + new_diversifier: string; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface Misbehaviour { + clientId: string; + sequence: bigint; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourAmino { + client_id?: string; + sequence?: string; + signature_one?: SignatureAndDataAmino; + signature_two?: SignatureAndDataAmino; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourSDKType { + client_id: string; + sequence: bigint; + signature_one?: SignatureAndDataSDKType; + signature_two?: SignatureAndDataSDKType; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndData { + signature: Uint8Array; + dataType: DataType; + data: Uint8Array; + timestamp: bigint; +} +export interface SignatureAndDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.SignatureAndData"; + value: Uint8Array; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataAmino { + signature?: string; + data_type?: DataType; + data?: string; + timestamp?: string; +} +export interface SignatureAndDataAminoMsg { + type: "cosmos-sdk/SignatureAndData"; + value: SignatureAndDataAmino; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataSDKType { + signature: Uint8Array; + data_type: DataType; + data: Uint8Array; + timestamp: bigint; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureData { + signatureData: Uint8Array; + timestamp: bigint; +} +export interface TimestampedSignatureDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.TimestampedSignatureData"; + value: Uint8Array; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataAmino { + signature_data?: string; + timestamp?: string; +} +export interface TimestampedSignatureDataAminoMsg { + type: "cosmos-sdk/TimestampedSignatureData"; + value: TimestampedSignatureDataAmino; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataSDKType { + signature_data: Uint8Array; + timestamp: bigint; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytes { + sequence: bigint; + timestamp: bigint; + diversifier: string; + /** type of the data used */ + dataType: DataType; + /** marshaled data */ + data: Uint8Array; +} +export interface SignBytesProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.SignBytes"; + value: Uint8Array; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesAmino { + sequence?: string; + timestamp?: string; + diversifier?: string; + /** type of the data used */ + data_type?: DataType; + /** marshaled data */ + data?: string; +} +export interface SignBytesAminoMsg { + type: "cosmos-sdk/SignBytes"; + value: SignBytesAmino; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesSDKType { + sequence: bigint; + timestamp: bigint; + diversifier: string; + data_type: DataType; + data: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderData { + /** header public key */ + newPubKey?: Any; + /** header diversifier */ + newDiversifier: string; +} +export interface HeaderDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.HeaderData"; + value: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataAmino { + /** header public key */ + new_pub_key?: AnyAmino; + /** header diversifier */ + new_diversifier?: string; +} +export interface HeaderDataAminoMsg { + type: "cosmos-sdk/HeaderData"; + value: HeaderDataAmino; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataSDKType { + new_pub_key?: AnySDKType; + new_diversifier: string; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateData { + path: Uint8Array; + clientState?: Any; +} +export interface ClientStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientStateData"; + value: Uint8Array; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataAmino { + path?: string; + client_state?: AnyAmino; +} +export interface ClientStateDataAminoMsg { + type: "cosmos-sdk/ClientStateData"; + value: ClientStateDataAmino; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataSDKType { + path: Uint8Array; + client_state?: AnySDKType; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateData { + path: Uint8Array; + consensusState?: Any; +} +export interface ConsensusStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusStateData"; + value: Uint8Array; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataAmino { + path?: string; + consensus_state?: AnyAmino; +} +export interface ConsensusStateDataAminoMsg { + type: "cosmos-sdk/ConsensusStateData"; + value: ConsensusStateDataAmino; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataSDKType { + path: Uint8Array; + consensus_state?: AnySDKType; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateData { + path: Uint8Array; + connection?: ConnectionEnd; +} +export interface ConnectionStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ConnectionStateData"; + value: Uint8Array; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataAmino { + path?: string; + connection?: ConnectionEndAmino; +} +export interface ConnectionStateDataAminoMsg { + type: "cosmos-sdk/ConnectionStateData"; + value: ConnectionStateDataAmino; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataSDKType { + path: Uint8Array; + connection?: ConnectionEndSDKType; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateData { + path: Uint8Array; + channel?: Channel; +} +export interface ChannelStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.ChannelStateData"; + value: Uint8Array; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataAmino { + path?: string; + channel?: ChannelAmino; +} +export interface ChannelStateDataAminoMsg { + type: "cosmos-sdk/ChannelStateData"; + value: ChannelStateDataAmino; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataSDKType { + path: Uint8Array; + channel?: ChannelSDKType; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentData { + path: Uint8Array; + commitment: Uint8Array; +} +export interface PacketCommitmentDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketCommitmentData"; + value: Uint8Array; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataAmino { + path?: string; + commitment?: string; +} +export interface PacketCommitmentDataAminoMsg { + type: "cosmos-sdk/PacketCommitmentData"; + value: PacketCommitmentDataAmino; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataSDKType { + path: Uint8Array; + commitment: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementData { + path: Uint8Array; + acknowledgement: Uint8Array; +} +export interface PacketAcknowledgementDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData"; + value: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataAmino { + path?: string; + acknowledgement?: string; +} +export interface PacketAcknowledgementDataAminoMsg { + type: "cosmos-sdk/PacketAcknowledgementData"; + value: PacketAcknowledgementDataAmino; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataSDKType { + path: Uint8Array; + acknowledgement: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceData { + path: Uint8Array; +} +export interface PacketReceiptAbsenceDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData"; + value: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataAmino { + path?: string; +} +export interface PacketReceiptAbsenceDataAminoMsg { + type: "cosmos-sdk/PacketReceiptAbsenceData"; + value: PacketReceiptAbsenceDataAmino; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataSDKType { + path: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvData { + path: Uint8Array; + nextSeqRecv: bigint; +} +export interface NextSequenceRecvDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v1.NextSequenceRecvData"; + value: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataAmino { + path?: string; + next_seq_recv?: string; +} +export interface NextSequenceRecvDataAminoMsg { + type: "cosmos-sdk/NextSequenceRecvData"; + value: NextSequenceRecvDataAmino; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataSDKType { + path: Uint8Array; + next_seq_recv: bigint; +} +function createBaseClientState(): ClientState { + return { + sequence: BigInt(0), + frozenSequence: BigInt(0), + consensusState: undefined, + allowUpdateAfterProposal: false + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.frozenSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.frozenSequence); + } + if (message.consensusState !== undefined) { + ConsensusState.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.allowUpdateAfterProposal === true) { + writer.uint32(32).bool(message.allowUpdateAfterProposal); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.frozenSequence = reader.uint64(); + break; + case 3: + message.consensusState = ConsensusState.decode(reader, reader.uint32()); + break; + case 4: + message.allowUpdateAfterProposal = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.frozenSequence = object.frozenSequence !== undefined && object.frozenSequence !== null ? BigInt(object.frozenSequence.toString()) : BigInt(0); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? ConsensusState.fromPartial(object.consensusState) : undefined; + message.allowUpdateAfterProposal = object.allowUpdateAfterProposal ?? false; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.frozen_sequence !== undefined && object.frozen_sequence !== null) { + message.frozenSequence = BigInt(object.frozen_sequence); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + if (object.allow_update_after_proposal !== undefined && object.allow_update_after_proposal !== null) { + message.allowUpdateAfterProposal = object.allow_update_after_proposal; + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.frozen_sequence = message.frozenSequence !== BigInt(0) ? message.frozenSequence.toString() : undefined; + obj.consensus_state = message.consensusState ? ConsensusState.toAmino(message.consensusState) : undefined; + obj.allow_update_after_proposal = message.allowUpdateAfterProposal === false ? undefined : message.allowUpdateAfterProposal; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusState(): ConsensusState { + return { + publicKey: undefined, + diversifier: "", + timestamp: BigInt(0) + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusState", + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.diversifier !== "") { + writer.uint32(18).string(message.diversifier); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.diversifier = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.diversifier = object.diversifier ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: ConsensusState): ConsensusStateAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.diversifier = message.diversifier === "" ? undefined : message.diversifier; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState { + return ConsensusState.decode(message.value); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +function createBaseHeader(): Header { + return { + sequence: BigInt(0), + timestamp: BigInt(0), + signature: new Uint8Array(), + newPublicKey: undefined, + newDiversifier: "" + }; +} +export const Header = { + typeUrl: "/ibc.lightclients.solomachine.v1.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.signature.length !== 0) { + writer.uint32(26).bytes(message.signature); + } + if (message.newPublicKey !== undefined) { + Any.encode(message.newPublicKey, writer.uint32(34).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(42).string(message.newDiversifier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.signature = reader.bytes(); + break; + case 4: + message.newPublicKey = Any.decode(reader, reader.uint32()); + break; + case 5: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial
): Header { + const message = createBaseHeader(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.signature = object.signature ?? new Uint8Array(); + message.newPublicKey = object.newPublicKey !== undefined && object.newPublicKey !== null ? Any.fromPartial(object.newPublicKey) : undefined; + message.newDiversifier = object.newDiversifier ?? ""; + return message; + }, + fromAmino(object: HeaderAmino): Header { + const message = createBaseHeader(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.new_public_key !== undefined && object.new_public_key !== null) { + message.newPublicKey = Any.fromAmino(object.new_public_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined; + obj.new_diversifier = message.newDiversifier === "" ? undefined : message.newDiversifier; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + toAminoMsg(message: Header): HeaderAminoMsg { + return { + type: "cosmos-sdk/Header", + value: Header.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.Header", + value: Header.encode(message).finish() + }; + } +}; +function createBaseMisbehaviour(): Misbehaviour { + return { + clientId: "", + sequence: BigInt(0), + signatureOne: undefined, + signatureTwo: undefined + }; +} +export const Misbehaviour = { + typeUrl: "/ibc.lightclients.solomachine.v1.Misbehaviour", + encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(16).uint64(message.sequence); + } + if (message.signatureOne !== undefined) { + SignatureAndData.encode(message.signatureOne, writer.uint32(26).fork()).ldelim(); + } + if (message.signatureTwo !== undefined) { + SignatureAndData.encode(message.signatureTwo, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.sequence = reader.uint64(); + break; + case 3: + message.signatureOne = SignatureAndData.decode(reader, reader.uint32()); + break; + case 4: + message.signatureTwo = SignatureAndData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Misbehaviour { + const message = createBaseMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.signatureOne = object.signatureOne !== undefined && object.signatureOne !== null ? SignatureAndData.fromPartial(object.signatureOne) : undefined; + message.signatureTwo = object.signatureTwo !== undefined && object.signatureTwo !== null ? SignatureAndData.fromPartial(object.signatureTwo) : undefined; + return message; + }, + fromAmino(object: MisbehaviourAmino): Misbehaviour { + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.signature_one !== undefined && object.signature_one !== null) { + message.signatureOne = SignatureAndData.fromAmino(object.signature_one); + } + if (object.signature_two !== undefined && object.signature_two !== null) { + message.signatureTwo = SignatureAndData.fromAmino(object.signature_two); + } + return message; + }, + toAmino(message: Misbehaviour): MisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.signature_one = message.signatureOne ? SignatureAndData.toAmino(message.signatureOne) : undefined; + obj.signature_two = message.signatureTwo ? SignatureAndData.toAmino(message.signatureTwo) : undefined; + return obj; + }, + fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour { + return Misbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: Misbehaviour): MisbehaviourAminoMsg { + return { + type: "cosmos-sdk/Misbehaviour", + value: Misbehaviour.toAmino(message) + }; + }, + fromProtoMsg(message: MisbehaviourProtoMsg): Misbehaviour { + return Misbehaviour.decode(message.value); + }, + toProto(message: Misbehaviour): Uint8Array { + return Misbehaviour.encode(message).finish(); + }, + toProtoMsg(message: Misbehaviour): MisbehaviourProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.Misbehaviour", + value: Misbehaviour.encode(message).finish() + }; + } +}; +function createBaseSignatureAndData(): SignatureAndData { + return { + signature: new Uint8Array(), + dataType: 0, + data: new Uint8Array(), + timestamp: BigInt(0) + }; +} +export const SignatureAndData = { + typeUrl: "/ibc.lightclients.solomachine.v1.SignatureAndData", + encode(message: SignatureAndData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signature.length !== 0) { + writer.uint32(10).bytes(message.signature); + } + if (message.dataType !== 0) { + writer.uint32(16).int32(message.dataType); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(32).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureAndData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureAndData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signature = reader.bytes(); + break; + case 2: + message.dataType = reader.int32() as any; + break; + case 3: + message.data = reader.bytes(); + break; + case 4: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureAndData { + const message = createBaseSignatureAndData(); + message.signature = object.signature ?? new Uint8Array(); + message.dataType = object.dataType ?? 0; + message.data = object.data ?? new Uint8Array(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignatureAndDataAmino): SignatureAndData { + const message = createBaseSignatureAndData(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = object.data_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SignatureAndData): SignatureAndDataAmino { + const obj: any = {}; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.data_type = message.dataType === 0 ? undefined : message.dataType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignatureAndDataAminoMsg): SignatureAndData { + return SignatureAndData.fromAmino(object.value); + }, + toAminoMsg(message: SignatureAndData): SignatureAndDataAminoMsg { + return { + type: "cosmos-sdk/SignatureAndData", + value: SignatureAndData.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureAndDataProtoMsg): SignatureAndData { + return SignatureAndData.decode(message.value); + }, + toProto(message: SignatureAndData): Uint8Array { + return SignatureAndData.encode(message).finish(); + }, + toProtoMsg(message: SignatureAndData): SignatureAndDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.SignatureAndData", + value: SignatureAndData.encode(message).finish() + }; + } +}; +function createBaseTimestampedSignatureData(): TimestampedSignatureData { + return { + signatureData: new Uint8Array(), + timestamp: BigInt(0) + }; +} +export const TimestampedSignatureData = { + typeUrl: "/ibc.lightclients.solomachine.v1.TimestampedSignatureData", + encode(message: TimestampedSignatureData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signatureData.length !== 0) { + writer.uint32(10).bytes(message.signatureData); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TimestampedSignatureData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestampedSignatureData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatureData = reader.bytes(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TimestampedSignatureData { + const message = createBaseTimestampedSignatureData(); + message.signatureData = object.signatureData ?? new Uint8Array(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TimestampedSignatureDataAmino): TimestampedSignatureData { + const message = createBaseTimestampedSignatureData(); + if (object.signature_data !== undefined && object.signature_data !== null) { + message.signatureData = bytesFromBase64(object.signature_data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: TimestampedSignatureData): TimestampedSignatureDataAmino { + const obj: any = {}; + obj.signature_data = message.signatureData ? base64FromBytes(message.signatureData) : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TimestampedSignatureDataAminoMsg): TimestampedSignatureData { + return TimestampedSignatureData.fromAmino(object.value); + }, + toAminoMsg(message: TimestampedSignatureData): TimestampedSignatureDataAminoMsg { + return { + type: "cosmos-sdk/TimestampedSignatureData", + value: TimestampedSignatureData.toAmino(message) + }; + }, + fromProtoMsg(message: TimestampedSignatureDataProtoMsg): TimestampedSignatureData { + return TimestampedSignatureData.decode(message.value); + }, + toProto(message: TimestampedSignatureData): Uint8Array { + return TimestampedSignatureData.encode(message).finish(); + }, + toProtoMsg(message: TimestampedSignatureData): TimestampedSignatureDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.TimestampedSignatureData", + value: TimestampedSignatureData.encode(message).finish() + }; + } +}; +function createBaseSignBytes(): SignBytes { + return { + sequence: BigInt(0), + timestamp: BigInt(0), + diversifier: "", + dataType: 0, + data: new Uint8Array() + }; +} +export const SignBytes = { + typeUrl: "/ibc.lightclients.solomachine.v1.SignBytes", + encode(message: SignBytes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.diversifier !== "") { + writer.uint32(26).string(message.diversifier); + } + if (message.dataType !== 0) { + writer.uint32(32).int32(message.dataType); + } + if (message.data.length !== 0) { + writer.uint32(42).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignBytes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignBytes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.diversifier = reader.string(); + break; + case 4: + message.dataType = reader.int32() as any; + break; + case 5: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignBytes { + const message = createBaseSignBytes(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.diversifier = object.diversifier ?? ""; + message.dataType = object.dataType ?? 0; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignBytesAmino): SignBytes { + const message = createBaseSignBytes(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = object.data_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: SignBytes): SignBytesAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + obj.diversifier = message.diversifier === "" ? undefined : message.diversifier; + obj.data_type = message.dataType === 0 ? undefined : message.dataType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: SignBytesAminoMsg): SignBytes { + return SignBytes.fromAmino(object.value); + }, + toAminoMsg(message: SignBytes): SignBytesAminoMsg { + return { + type: "cosmos-sdk/SignBytes", + value: SignBytes.toAmino(message) + }; + }, + fromProtoMsg(message: SignBytesProtoMsg): SignBytes { + return SignBytes.decode(message.value); + }, + toProto(message: SignBytes): Uint8Array { + return SignBytes.encode(message).finish(); + }, + toProtoMsg(message: SignBytes): SignBytesProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.SignBytes", + value: SignBytes.encode(message).finish() + }; + } +}; +function createBaseHeaderData(): HeaderData { + return { + newPubKey: undefined, + newDiversifier: "" + }; +} +export const HeaderData = { + typeUrl: "/ibc.lightclients.solomachine.v1.HeaderData", + encode(message: HeaderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newPubKey !== undefined) { + Any.encode(message.newPubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(18).string(message.newDiversifier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HeaderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newPubKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HeaderData { + const message = createBaseHeaderData(); + message.newPubKey = object.newPubKey !== undefined && object.newPubKey !== null ? Any.fromPartial(object.newPubKey) : undefined; + message.newDiversifier = object.newDiversifier ?? ""; + return message; + }, + fromAmino(object: HeaderDataAmino): HeaderData { + const message = createBaseHeaderData(); + if (object.new_pub_key !== undefined && object.new_pub_key !== null) { + message.newPubKey = Any.fromAmino(object.new_pub_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; + }, + toAmino(message: HeaderData): HeaderDataAmino { + const obj: any = {}; + obj.new_pub_key = message.newPubKey ? Any.toAmino(message.newPubKey) : undefined; + obj.new_diversifier = message.newDiversifier === "" ? undefined : message.newDiversifier; + return obj; + }, + fromAminoMsg(object: HeaderDataAminoMsg): HeaderData { + return HeaderData.fromAmino(object.value); + }, + toAminoMsg(message: HeaderData): HeaderDataAminoMsg { + return { + type: "cosmos-sdk/HeaderData", + value: HeaderData.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderDataProtoMsg): HeaderData { + return HeaderData.decode(message.value); + }, + toProto(message: HeaderData): Uint8Array { + return HeaderData.encode(message).finish(); + }, + toProtoMsg(message: HeaderData): HeaderDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.HeaderData", + value: HeaderData.encode(message).finish() + }; + } +}; +function createBaseClientStateData(): ClientStateData { + return { + path: new Uint8Array(), + clientState: undefined + }; +} +export const ClientStateData = { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientStateData", + encode(message: ClientStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientStateData { + const message = createBaseClientStateData(); + message.path = object.path ?? new Uint8Array(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + return message; + }, + fromAmino(object: ClientStateDataAmino): ClientStateData { + const message = createBaseClientStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; + }, + toAmino(message: ClientStateData): ClientStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + return obj; + }, + fromAminoMsg(object: ClientStateDataAminoMsg): ClientStateData { + return ClientStateData.fromAmino(object.value); + }, + toAminoMsg(message: ClientStateData): ClientStateDataAminoMsg { + return { + type: "cosmos-sdk/ClientStateData", + value: ClientStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateDataProtoMsg): ClientStateData { + return ClientStateData.decode(message.value); + }, + toProto(message: ClientStateData): Uint8Array { + return ClientStateData.encode(message).finish(); + }, + toProtoMsg(message: ClientStateData): ClientStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.ClientStateData", + value: ClientStateData.encode(message).finish() + }; + } +}; +function createBaseConsensusStateData(): ConsensusStateData { + return { + path: new Uint8Array(), + consensusState: undefined + }; +} +export const ConsensusStateData = { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusStateData", + encode(message: ConsensusStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusStateData { + const message = createBaseConsensusStateData(); + message.path = object.path ?? new Uint8Array(); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + return message; + }, + fromAmino(object: ConsensusStateDataAmino): ConsensusStateData { + const message = createBaseConsensusStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ConsensusStateData): ConsensusStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateDataAminoMsg): ConsensusStateData { + return ConsensusStateData.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusStateData): ConsensusStateDataAminoMsg { + return { + type: "cosmos-sdk/ConsensusStateData", + value: ConsensusStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateDataProtoMsg): ConsensusStateData { + return ConsensusStateData.decode(message.value); + }, + toProto(message: ConsensusStateData): Uint8Array { + return ConsensusStateData.encode(message).finish(); + }, + toProtoMsg(message: ConsensusStateData): ConsensusStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusStateData", + value: ConsensusStateData.encode(message).finish() + }; + } +}; +function createBaseConnectionStateData(): ConnectionStateData { + return { + path: new Uint8Array(), + connection: undefined + }; +} +export const ConnectionStateData = { + typeUrl: "/ibc.lightclients.solomachine.v1.ConnectionStateData", + encode(message: ConnectionStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.connection = ConnectionEnd.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConnectionStateData { + const message = createBaseConnectionStateData(); + message.path = object.path ?? new Uint8Array(); + message.connection = object.connection !== undefined && object.connection !== null ? ConnectionEnd.fromPartial(object.connection) : undefined; + return message; + }, + fromAmino(object: ConnectionStateDataAmino): ConnectionStateData { + const message = createBaseConnectionStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + return message; + }, + toAmino(message: ConnectionStateData): ConnectionStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection) : undefined; + return obj; + }, + fromAminoMsg(object: ConnectionStateDataAminoMsg): ConnectionStateData { + return ConnectionStateData.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionStateData): ConnectionStateDataAminoMsg { + return { + type: "cosmos-sdk/ConnectionStateData", + value: ConnectionStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionStateDataProtoMsg): ConnectionStateData { + return ConnectionStateData.decode(message.value); + }, + toProto(message: ConnectionStateData): Uint8Array { + return ConnectionStateData.encode(message).finish(); + }, + toProtoMsg(message: ConnectionStateData): ConnectionStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.ConnectionStateData", + value: ConnectionStateData.encode(message).finish() + }; + } +}; +function createBaseChannelStateData(): ChannelStateData { + return { + path: new Uint8Array(), + channel: undefined + }; +} +export const ChannelStateData = { + typeUrl: "/ibc.lightclients.solomachine.v1.ChannelStateData", + encode(message: ChannelStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ChannelStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChannelStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ChannelStateData { + const message = createBaseChannelStateData(); + message.path = object.path ?? new Uint8Array(); + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + return message; + }, + fromAmino(object: ChannelStateDataAmino): ChannelStateData { + const message = createBaseChannelStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + return message; + }, + toAmino(message: ChannelStateData): ChannelStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + return obj; + }, + fromAminoMsg(object: ChannelStateDataAminoMsg): ChannelStateData { + return ChannelStateData.fromAmino(object.value); + }, + toAminoMsg(message: ChannelStateData): ChannelStateDataAminoMsg { + return { + type: "cosmos-sdk/ChannelStateData", + value: ChannelStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ChannelStateDataProtoMsg): ChannelStateData { + return ChannelStateData.decode(message.value); + }, + toProto(message: ChannelStateData): Uint8Array { + return ChannelStateData.encode(message).finish(); + }, + toProtoMsg(message: ChannelStateData): ChannelStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.ChannelStateData", + value: ChannelStateData.encode(message).finish() + }; + } +}; +function createBasePacketCommitmentData(): PacketCommitmentData { + return { + path: new Uint8Array(), + commitment: new Uint8Array() + }; +} +export const PacketCommitmentData = { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketCommitmentData", + encode(message: PacketCommitmentData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.commitment.length !== 0) { + writer.uint32(18).bytes(message.commitment); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketCommitmentData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketCommitmentData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.commitment = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketCommitmentData { + const message = createBasePacketCommitmentData(); + message.path = object.path ?? new Uint8Array(); + message.commitment = object.commitment ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketCommitmentDataAmino): PacketCommitmentData { + const message = createBasePacketCommitmentData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + return message; + }, + toAmino(message: PacketCommitmentData): PacketCommitmentDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.commitment = message.commitment ? base64FromBytes(message.commitment) : undefined; + return obj; + }, + fromAminoMsg(object: PacketCommitmentDataAminoMsg): PacketCommitmentData { + return PacketCommitmentData.fromAmino(object.value); + }, + toAminoMsg(message: PacketCommitmentData): PacketCommitmentDataAminoMsg { + return { + type: "cosmos-sdk/PacketCommitmentData", + value: PacketCommitmentData.toAmino(message) + }; + }, + fromProtoMsg(message: PacketCommitmentDataProtoMsg): PacketCommitmentData { + return PacketCommitmentData.decode(message.value); + }, + toProto(message: PacketCommitmentData): Uint8Array { + return PacketCommitmentData.encode(message).finish(); + }, + toProtoMsg(message: PacketCommitmentData): PacketCommitmentDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketCommitmentData", + value: PacketCommitmentData.encode(message).finish() + }; + } +}; +function createBasePacketAcknowledgementData(): PacketAcknowledgementData { + return { + path: new Uint8Array(), + acknowledgement: new Uint8Array() + }; +} +export const PacketAcknowledgementData = { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData", + encode(message: PacketAcknowledgementData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketAcknowledgementData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketAcknowledgementData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketAcknowledgementData { + const message = createBasePacketAcknowledgementData(); + message.path = object.path ?? new Uint8Array(); + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketAcknowledgementDataAmino): PacketAcknowledgementData { + const message = createBasePacketAcknowledgementData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + return message; + }, + toAmino(message: PacketAcknowledgementData): PacketAcknowledgementDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + return obj; + }, + fromAminoMsg(object: PacketAcknowledgementDataAminoMsg): PacketAcknowledgementData { + return PacketAcknowledgementData.fromAmino(object.value); + }, + toAminoMsg(message: PacketAcknowledgementData): PacketAcknowledgementDataAminoMsg { + return { + type: "cosmos-sdk/PacketAcknowledgementData", + value: PacketAcknowledgementData.toAmino(message) + }; + }, + fromProtoMsg(message: PacketAcknowledgementDataProtoMsg): PacketAcknowledgementData { + return PacketAcknowledgementData.decode(message.value); + }, + toProto(message: PacketAcknowledgementData): Uint8Array { + return PacketAcknowledgementData.encode(message).finish(); + }, + toProtoMsg(message: PacketAcknowledgementData): PacketAcknowledgementDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData", + value: PacketAcknowledgementData.encode(message).finish() + }; + } +}; +function createBasePacketReceiptAbsenceData(): PacketReceiptAbsenceData { + return { + path: new Uint8Array() + }; +} +export const PacketReceiptAbsenceData = { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData", + encode(message: PacketReceiptAbsenceData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketReceiptAbsenceData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketReceiptAbsenceData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketReceiptAbsenceData { + const message = createBasePacketReceiptAbsenceData(); + message.path = object.path ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketReceiptAbsenceDataAmino): PacketReceiptAbsenceData { + const message = createBasePacketReceiptAbsenceData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + return message; + }, + toAmino(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + return obj; + }, + fromAminoMsg(object: PacketReceiptAbsenceDataAminoMsg): PacketReceiptAbsenceData { + return PacketReceiptAbsenceData.fromAmino(object.value); + }, + toAminoMsg(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataAminoMsg { + return { + type: "cosmos-sdk/PacketReceiptAbsenceData", + value: PacketReceiptAbsenceData.toAmino(message) + }; + }, + fromProtoMsg(message: PacketReceiptAbsenceDataProtoMsg): PacketReceiptAbsenceData { + return PacketReceiptAbsenceData.decode(message.value); + }, + toProto(message: PacketReceiptAbsenceData): Uint8Array { + return PacketReceiptAbsenceData.encode(message).finish(); + }, + toProtoMsg(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData", + value: PacketReceiptAbsenceData.encode(message).finish() + }; + } +}; +function createBaseNextSequenceRecvData(): NextSequenceRecvData { + return { + path: new Uint8Array(), + nextSeqRecv: BigInt(0) + }; +} +export const NextSequenceRecvData = { + typeUrl: "/ibc.lightclients.solomachine.v1.NextSequenceRecvData", + encode(message: NextSequenceRecvData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.nextSeqRecv !== BigInt(0)) { + writer.uint32(16).uint64(message.nextSeqRecv); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NextSequenceRecvData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextSequenceRecvData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.nextSeqRecv = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NextSequenceRecvData { + const message = createBaseNextSequenceRecvData(); + message.path = object.path ?? new Uint8Array(); + message.nextSeqRecv = object.nextSeqRecv !== undefined && object.nextSeqRecv !== null ? BigInt(object.nextSeqRecv.toString()) : BigInt(0); + return message; + }, + fromAmino(object: NextSequenceRecvDataAmino): NextSequenceRecvData { + const message = createBaseNextSequenceRecvData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.next_seq_recv !== undefined && object.next_seq_recv !== null) { + message.nextSeqRecv = BigInt(object.next_seq_recv); + } + return message; + }, + toAmino(message: NextSequenceRecvData): NextSequenceRecvDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.next_seq_recv = message.nextSeqRecv !== BigInt(0) ? message.nextSeqRecv.toString() : undefined; + return obj; + }, + fromAminoMsg(object: NextSequenceRecvDataAminoMsg): NextSequenceRecvData { + return NextSequenceRecvData.fromAmino(object.value); + }, + toAminoMsg(message: NextSequenceRecvData): NextSequenceRecvDataAminoMsg { + return { + type: "cosmos-sdk/NextSequenceRecvData", + value: NextSequenceRecvData.toAmino(message) + }; + }, + fromProtoMsg(message: NextSequenceRecvDataProtoMsg): NextSequenceRecvData { + return NextSequenceRecvData.decode(message.value); + }, + toProto(message: NextSequenceRecvData): Uint8Array { + return NextSequenceRecvData.encode(message).finish(); + }, + toProtoMsg(message: NextSequenceRecvData): NextSequenceRecvDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v1.NextSequenceRecvData", + value: NextSequenceRecvData.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/lightclients/solomachine/v2/solomachine.ts b/dydxjs/packages/dydxjs/src/ibc/lightclients/solomachine/v2/solomachine.ts new file mode 100644 index 00000000..628d8979 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/lightclients/solomachine/v2/solomachine.ts @@ -0,0 +1,2089 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType } from "../../../core/connection/v1/connection"; +import { Channel, ChannelAmino, ChannelSDKType } from "../../../core/channel/v1/channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * DataType defines the type of solo machine proof being created. This is done + * to preserve uniqueness of different data sign byte encodings. + */ +export enum DataType { + /** DATA_TYPE_UNINITIALIZED_UNSPECIFIED - Default State */ + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0, + /** DATA_TYPE_CLIENT_STATE - Data type for client state verification */ + DATA_TYPE_CLIENT_STATE = 1, + /** DATA_TYPE_CONSENSUS_STATE - Data type for consensus state verification */ + DATA_TYPE_CONSENSUS_STATE = 2, + /** DATA_TYPE_CONNECTION_STATE - Data type for connection state verification */ + DATA_TYPE_CONNECTION_STATE = 3, + /** DATA_TYPE_CHANNEL_STATE - Data type for channel state verification */ + DATA_TYPE_CHANNEL_STATE = 4, + /** DATA_TYPE_PACKET_COMMITMENT - Data type for packet commitment verification */ + DATA_TYPE_PACKET_COMMITMENT = 5, + /** DATA_TYPE_PACKET_ACKNOWLEDGEMENT - Data type for packet acknowledgement verification */ + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6, + /** DATA_TYPE_PACKET_RECEIPT_ABSENCE - Data type for packet receipt absence verification */ + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7, + /** DATA_TYPE_NEXT_SEQUENCE_RECV - Data type for next sequence recv verification */ + DATA_TYPE_NEXT_SEQUENCE_RECV = 8, + /** DATA_TYPE_HEADER - Data type for header verification */ + DATA_TYPE_HEADER = 9, + UNRECOGNIZED = -1, +} +export const DataTypeSDKType = DataType; +export const DataTypeAmino = DataType; +export function dataTypeFromJSON(object: any): DataType { + switch (object) { + case 0: + case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": + return DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "DATA_TYPE_CLIENT_STATE": + return DataType.DATA_TYPE_CLIENT_STATE; + case 2: + case "DATA_TYPE_CONSENSUS_STATE": + return DataType.DATA_TYPE_CONSENSUS_STATE; + case 3: + case "DATA_TYPE_CONNECTION_STATE": + return DataType.DATA_TYPE_CONNECTION_STATE; + case 4: + case "DATA_TYPE_CHANNEL_STATE": + return DataType.DATA_TYPE_CHANNEL_STATE; + case 5: + case "DATA_TYPE_PACKET_COMMITMENT": + return DataType.DATA_TYPE_PACKET_COMMITMENT; + case 6: + case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": + return DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT; + case 7: + case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": + return DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE; + case 8: + case "DATA_TYPE_NEXT_SEQUENCE_RECV": + return DataType.DATA_TYPE_NEXT_SEQUENCE_RECV; + case 9: + case "DATA_TYPE_HEADER": + return DataType.DATA_TYPE_HEADER; + case -1: + case "UNRECOGNIZED": + default: + return DataType.UNRECOGNIZED; + } +} +export function dataTypeToJSON(object: DataType): string { + switch (object) { + case DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED: + return "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"; + case DataType.DATA_TYPE_CLIENT_STATE: + return "DATA_TYPE_CLIENT_STATE"; + case DataType.DATA_TYPE_CONSENSUS_STATE: + return "DATA_TYPE_CONSENSUS_STATE"; + case DataType.DATA_TYPE_CONNECTION_STATE: + return "DATA_TYPE_CONNECTION_STATE"; + case DataType.DATA_TYPE_CHANNEL_STATE: + return "DATA_TYPE_CHANNEL_STATE"; + case DataType.DATA_TYPE_PACKET_COMMITMENT: + return "DATA_TYPE_PACKET_COMMITMENT"; + case DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT: + return "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"; + case DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE: + return "DATA_TYPE_PACKET_RECEIPT_ABSENCE"; + case DataType.DATA_TYPE_NEXT_SEQUENCE_RECV: + return "DATA_TYPE_NEXT_SEQUENCE_RECV"; + case DataType.DATA_TYPE_HEADER: + return "DATA_TYPE_HEADER"; + case DataType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientState { + /** latest sequence of the client state */ + sequence: bigint; + /** frozen sequence of the solo machine */ + isFrozen: boolean; + consensusState?: ConsensusState; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allowUpdateAfterProposal: boolean; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientState"; + value: Uint8Array; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateAmino { + /** latest sequence of the client state */ + sequence?: string; + /** frozen sequence of the solo machine */ + is_frozen?: boolean; + consensus_state?: ConsensusStateAmino; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allow_update_after_proposal?: boolean; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateSDKType { + sequence: bigint; + is_frozen: boolean; + consensus_state?: ConsensusStateSDKType; + allow_update_after_proposal: boolean; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusState { + /** public key of the solo machine */ + publicKey?: Any; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier: string; + timestamp: bigint; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusState"; + value: Uint8Array; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateAmino { + /** public key of the solo machine */ + public_key?: AnyAmino; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier?: string; + timestamp?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateSDKType { + public_key?: AnySDKType; + diversifier: string; + timestamp: bigint; +} +/** Header defines a solo machine consensus header */ +export interface Header { + /** sequence to update solo machine public key at */ + sequence: bigint; + timestamp: bigint; + signature: Uint8Array; + newPublicKey?: Any; + newDiversifier: string; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.Header"; + value: Uint8Array; +} +/** Header defines a solo machine consensus header */ +export interface HeaderAmino { + /** sequence to update solo machine public key at */ + sequence?: string; + timestamp?: string; + signature?: string; + new_public_key?: AnyAmino; + new_diversifier?: string; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** Header defines a solo machine consensus header */ +export interface HeaderSDKType { + sequence: bigint; + timestamp: bigint; + signature: Uint8Array; + new_public_key?: AnySDKType; + new_diversifier: string; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface Misbehaviour { + clientId: string; + sequence: bigint; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourAmino { + client_id?: string; + sequence?: string; + signature_one?: SignatureAndDataAmino; + signature_two?: SignatureAndDataAmino; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourSDKType { + client_id: string; + sequence: bigint; + signature_one?: SignatureAndDataSDKType; + signature_two?: SignatureAndDataSDKType; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndData { + signature: Uint8Array; + dataType: DataType; + data: Uint8Array; + timestamp: bigint; +} +export interface SignatureAndDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.SignatureAndData"; + value: Uint8Array; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataAmino { + signature?: string; + data_type?: DataType; + data?: string; + timestamp?: string; +} +export interface SignatureAndDataAminoMsg { + type: "cosmos-sdk/SignatureAndData"; + value: SignatureAndDataAmino; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataSDKType { + signature: Uint8Array; + data_type: DataType; + data: Uint8Array; + timestamp: bigint; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureData { + signatureData: Uint8Array; + timestamp: bigint; +} +export interface TimestampedSignatureDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.TimestampedSignatureData"; + value: Uint8Array; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataAmino { + signature_data?: string; + timestamp?: string; +} +export interface TimestampedSignatureDataAminoMsg { + type: "cosmos-sdk/TimestampedSignatureData"; + value: TimestampedSignatureDataAmino; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataSDKType { + signature_data: Uint8Array; + timestamp: bigint; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytes { + sequence: bigint; + timestamp: bigint; + diversifier: string; + /** type of the data used */ + dataType: DataType; + /** marshaled data */ + data: Uint8Array; +} +export interface SignBytesProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.SignBytes"; + value: Uint8Array; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesAmino { + sequence?: string; + timestamp?: string; + diversifier?: string; + /** type of the data used */ + data_type?: DataType; + /** marshaled data */ + data?: string; +} +export interface SignBytesAminoMsg { + type: "cosmos-sdk/SignBytes"; + value: SignBytesAmino; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesSDKType { + sequence: bigint; + timestamp: bigint; + diversifier: string; + data_type: DataType; + data: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderData { + /** header public key */ + newPubKey?: Any; + /** header diversifier */ + newDiversifier: string; +} +export interface HeaderDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.HeaderData"; + value: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataAmino { + /** header public key */ + new_pub_key?: AnyAmino; + /** header diversifier */ + new_diversifier?: string; +} +export interface HeaderDataAminoMsg { + type: "cosmos-sdk/HeaderData"; + value: HeaderDataAmino; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataSDKType { + new_pub_key?: AnySDKType; + new_diversifier: string; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateData { + path: Uint8Array; + clientState?: Any; +} +export interface ClientStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientStateData"; + value: Uint8Array; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataAmino { + path?: string; + client_state?: AnyAmino; +} +export interface ClientStateDataAminoMsg { + type: "cosmos-sdk/ClientStateData"; + value: ClientStateDataAmino; +} +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateDataSDKType { + path: Uint8Array; + client_state?: AnySDKType; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateData { + path: Uint8Array; + consensusState?: Any; +} +export interface ConsensusStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusStateData"; + value: Uint8Array; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataAmino { + path?: string; + consensus_state?: AnyAmino; +} +export interface ConsensusStateDataAminoMsg { + type: "cosmos-sdk/ConsensusStateData"; + value: ConsensusStateDataAmino; +} +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateDataSDKType { + path: Uint8Array; + consensus_state?: AnySDKType; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateData { + path: Uint8Array; + connection?: ConnectionEnd; +} +export interface ConnectionStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ConnectionStateData"; + value: Uint8Array; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataAmino { + path?: string; + connection?: ConnectionEndAmino; +} +export interface ConnectionStateDataAminoMsg { + type: "cosmos-sdk/ConnectionStateData"; + value: ConnectionStateDataAmino; +} +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateDataSDKType { + path: Uint8Array; + connection?: ConnectionEndSDKType; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateData { + path: Uint8Array; + channel?: Channel; +} +export interface ChannelStateDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.ChannelStateData"; + value: Uint8Array; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataAmino { + path?: string; + channel?: ChannelAmino; +} +export interface ChannelStateDataAminoMsg { + type: "cosmos-sdk/ChannelStateData"; + value: ChannelStateDataAmino; +} +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateDataSDKType { + path: Uint8Array; + channel?: ChannelSDKType; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentData { + path: Uint8Array; + commitment: Uint8Array; +} +export interface PacketCommitmentDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketCommitmentData"; + value: Uint8Array; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataAmino { + path?: string; + commitment?: string; +} +export interface PacketCommitmentDataAminoMsg { + type: "cosmos-sdk/PacketCommitmentData"; + value: PacketCommitmentDataAmino; +} +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentDataSDKType { + path: Uint8Array; + commitment: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementData { + path: Uint8Array; + acknowledgement: Uint8Array; +} +export interface PacketAcknowledgementDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData"; + value: Uint8Array; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataAmino { + path?: string; + acknowledgement?: string; +} +export interface PacketAcknowledgementDataAminoMsg { + type: "cosmos-sdk/PacketAcknowledgementData"; + value: PacketAcknowledgementDataAmino; +} +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementDataSDKType { + path: Uint8Array; + acknowledgement: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceData { + path: Uint8Array; +} +export interface PacketReceiptAbsenceDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData"; + value: Uint8Array; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataAmino { + path?: string; +} +export interface PacketReceiptAbsenceDataAminoMsg { + type: "cosmos-sdk/PacketReceiptAbsenceData"; + value: PacketReceiptAbsenceDataAmino; +} +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceDataSDKType { + path: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvData { + path: Uint8Array; + nextSeqRecv: bigint; +} +export interface NextSequenceRecvDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v2.NextSequenceRecvData"; + value: Uint8Array; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataAmino { + path?: string; + next_seq_recv?: string; +} +export interface NextSequenceRecvDataAminoMsg { + type: "cosmos-sdk/NextSequenceRecvData"; + value: NextSequenceRecvDataAmino; +} +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvDataSDKType { + path: Uint8Array; + next_seq_recv: bigint; +} +function createBaseClientState(): ClientState { + return { + sequence: BigInt(0), + isFrozen: false, + consensusState: undefined, + allowUpdateAfterProposal: false + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.isFrozen === true) { + writer.uint32(16).bool(message.isFrozen); + } + if (message.consensusState !== undefined) { + ConsensusState.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.allowUpdateAfterProposal === true) { + writer.uint32(32).bool(message.allowUpdateAfterProposal); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.isFrozen = reader.bool(); + break; + case 3: + message.consensusState = ConsensusState.decode(reader, reader.uint32()); + break; + case 4: + message.allowUpdateAfterProposal = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.isFrozen = object.isFrozen ?? false; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? ConsensusState.fromPartial(object.consensusState) : undefined; + message.allowUpdateAfterProposal = object.allowUpdateAfterProposal ?? false; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.is_frozen !== undefined && object.is_frozen !== null) { + message.isFrozen = object.is_frozen; + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + if (object.allow_update_after_proposal !== undefined && object.allow_update_after_proposal !== null) { + message.allowUpdateAfterProposal = object.allow_update_after_proposal; + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.is_frozen = message.isFrozen === false ? undefined : message.isFrozen; + obj.consensus_state = message.consensusState ? ConsensusState.toAmino(message.consensusState) : undefined; + obj.allow_update_after_proposal = message.allowUpdateAfterProposal === false ? undefined : message.allowUpdateAfterProposal; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusState(): ConsensusState { + return { + publicKey: undefined, + diversifier: "", + timestamp: BigInt(0) + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusState", + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.diversifier !== "") { + writer.uint32(18).string(message.diversifier); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.diversifier = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.diversifier = object.diversifier ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: ConsensusState): ConsensusStateAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.diversifier = message.diversifier === "" ? undefined : message.diversifier; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState { + return ConsensusState.decode(message.value); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +function createBaseHeader(): Header { + return { + sequence: BigInt(0), + timestamp: BigInt(0), + signature: new Uint8Array(), + newPublicKey: undefined, + newDiversifier: "" + }; +} +export const Header = { + typeUrl: "/ibc.lightclients.solomachine.v2.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.signature.length !== 0) { + writer.uint32(26).bytes(message.signature); + } + if (message.newPublicKey !== undefined) { + Any.encode(message.newPublicKey, writer.uint32(34).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(42).string(message.newDiversifier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.signature = reader.bytes(); + break; + case 4: + message.newPublicKey = Any.decode(reader, reader.uint32()); + break; + case 5: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial
): Header { + const message = createBaseHeader(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.signature = object.signature ?? new Uint8Array(); + message.newPublicKey = object.newPublicKey !== undefined && object.newPublicKey !== null ? Any.fromPartial(object.newPublicKey) : undefined; + message.newDiversifier = object.newDiversifier ?? ""; + return message; + }, + fromAmino(object: HeaderAmino): Header { + const message = createBaseHeader(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.new_public_key !== undefined && object.new_public_key !== null) { + message.newPublicKey = Any.fromAmino(object.new_public_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined; + obj.new_diversifier = message.newDiversifier === "" ? undefined : message.newDiversifier; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + toAminoMsg(message: Header): HeaderAminoMsg { + return { + type: "cosmos-sdk/Header", + value: Header.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.Header", + value: Header.encode(message).finish() + }; + } +}; +function createBaseMisbehaviour(): Misbehaviour { + return { + clientId: "", + sequence: BigInt(0), + signatureOne: undefined, + signatureTwo: undefined + }; +} +export const Misbehaviour = { + typeUrl: "/ibc.lightclients.solomachine.v2.Misbehaviour", + encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(16).uint64(message.sequence); + } + if (message.signatureOne !== undefined) { + SignatureAndData.encode(message.signatureOne, writer.uint32(26).fork()).ldelim(); + } + if (message.signatureTwo !== undefined) { + SignatureAndData.encode(message.signatureTwo, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.sequence = reader.uint64(); + break; + case 3: + message.signatureOne = SignatureAndData.decode(reader, reader.uint32()); + break; + case 4: + message.signatureTwo = SignatureAndData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Misbehaviour { + const message = createBaseMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.signatureOne = object.signatureOne !== undefined && object.signatureOne !== null ? SignatureAndData.fromPartial(object.signatureOne) : undefined; + message.signatureTwo = object.signatureTwo !== undefined && object.signatureTwo !== null ? SignatureAndData.fromPartial(object.signatureTwo) : undefined; + return message; + }, + fromAmino(object: MisbehaviourAmino): Misbehaviour { + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.signature_one !== undefined && object.signature_one !== null) { + message.signatureOne = SignatureAndData.fromAmino(object.signature_one); + } + if (object.signature_two !== undefined && object.signature_two !== null) { + message.signatureTwo = SignatureAndData.fromAmino(object.signature_two); + } + return message; + }, + toAmino(message: Misbehaviour): MisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.signature_one = message.signatureOne ? SignatureAndData.toAmino(message.signatureOne) : undefined; + obj.signature_two = message.signatureTwo ? SignatureAndData.toAmino(message.signatureTwo) : undefined; + return obj; + }, + fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour { + return Misbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: Misbehaviour): MisbehaviourAminoMsg { + return { + type: "cosmos-sdk/Misbehaviour", + value: Misbehaviour.toAmino(message) + }; + }, + fromProtoMsg(message: MisbehaviourProtoMsg): Misbehaviour { + return Misbehaviour.decode(message.value); + }, + toProto(message: Misbehaviour): Uint8Array { + return Misbehaviour.encode(message).finish(); + }, + toProtoMsg(message: Misbehaviour): MisbehaviourProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.Misbehaviour", + value: Misbehaviour.encode(message).finish() + }; + } +}; +function createBaseSignatureAndData(): SignatureAndData { + return { + signature: new Uint8Array(), + dataType: 0, + data: new Uint8Array(), + timestamp: BigInt(0) + }; +} +export const SignatureAndData = { + typeUrl: "/ibc.lightclients.solomachine.v2.SignatureAndData", + encode(message: SignatureAndData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signature.length !== 0) { + writer.uint32(10).bytes(message.signature); + } + if (message.dataType !== 0) { + writer.uint32(16).int32(message.dataType); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(32).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureAndData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureAndData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signature = reader.bytes(); + break; + case 2: + message.dataType = reader.int32() as any; + break; + case 3: + message.data = reader.bytes(); + break; + case 4: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureAndData { + const message = createBaseSignatureAndData(); + message.signature = object.signature ?? new Uint8Array(); + message.dataType = object.dataType ?? 0; + message.data = object.data ?? new Uint8Array(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignatureAndDataAmino): SignatureAndData { + const message = createBaseSignatureAndData(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = object.data_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SignatureAndData): SignatureAndDataAmino { + const obj: any = {}; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.data_type = message.dataType === 0 ? undefined : message.dataType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignatureAndDataAminoMsg): SignatureAndData { + return SignatureAndData.fromAmino(object.value); + }, + toAminoMsg(message: SignatureAndData): SignatureAndDataAminoMsg { + return { + type: "cosmos-sdk/SignatureAndData", + value: SignatureAndData.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureAndDataProtoMsg): SignatureAndData { + return SignatureAndData.decode(message.value); + }, + toProto(message: SignatureAndData): Uint8Array { + return SignatureAndData.encode(message).finish(); + }, + toProtoMsg(message: SignatureAndData): SignatureAndDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.SignatureAndData", + value: SignatureAndData.encode(message).finish() + }; + } +}; +function createBaseTimestampedSignatureData(): TimestampedSignatureData { + return { + signatureData: new Uint8Array(), + timestamp: BigInt(0) + }; +} +export const TimestampedSignatureData = { + typeUrl: "/ibc.lightclients.solomachine.v2.TimestampedSignatureData", + encode(message: TimestampedSignatureData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signatureData.length !== 0) { + writer.uint32(10).bytes(message.signatureData); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TimestampedSignatureData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestampedSignatureData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatureData = reader.bytes(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TimestampedSignatureData { + const message = createBaseTimestampedSignatureData(); + message.signatureData = object.signatureData ?? new Uint8Array(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TimestampedSignatureDataAmino): TimestampedSignatureData { + const message = createBaseTimestampedSignatureData(); + if (object.signature_data !== undefined && object.signature_data !== null) { + message.signatureData = bytesFromBase64(object.signature_data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: TimestampedSignatureData): TimestampedSignatureDataAmino { + const obj: any = {}; + obj.signature_data = message.signatureData ? base64FromBytes(message.signatureData) : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TimestampedSignatureDataAminoMsg): TimestampedSignatureData { + return TimestampedSignatureData.fromAmino(object.value); + }, + toAminoMsg(message: TimestampedSignatureData): TimestampedSignatureDataAminoMsg { + return { + type: "cosmos-sdk/TimestampedSignatureData", + value: TimestampedSignatureData.toAmino(message) + }; + }, + fromProtoMsg(message: TimestampedSignatureDataProtoMsg): TimestampedSignatureData { + return TimestampedSignatureData.decode(message.value); + }, + toProto(message: TimestampedSignatureData): Uint8Array { + return TimestampedSignatureData.encode(message).finish(); + }, + toProtoMsg(message: TimestampedSignatureData): TimestampedSignatureDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.TimestampedSignatureData", + value: TimestampedSignatureData.encode(message).finish() + }; + } +}; +function createBaseSignBytes(): SignBytes { + return { + sequence: BigInt(0), + timestamp: BigInt(0), + diversifier: "", + dataType: 0, + data: new Uint8Array() + }; +} +export const SignBytes = { + typeUrl: "/ibc.lightclients.solomachine.v2.SignBytes", + encode(message: SignBytes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.diversifier !== "") { + writer.uint32(26).string(message.diversifier); + } + if (message.dataType !== 0) { + writer.uint32(32).int32(message.dataType); + } + if (message.data.length !== 0) { + writer.uint32(42).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignBytes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignBytes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.diversifier = reader.string(); + break; + case 4: + message.dataType = reader.int32() as any; + break; + case 5: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignBytes { + const message = createBaseSignBytes(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.diversifier = object.diversifier ?? ""; + message.dataType = object.dataType ?? 0; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignBytesAmino): SignBytes { + const message = createBaseSignBytes(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = object.data_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: SignBytes): SignBytesAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + obj.diversifier = message.diversifier === "" ? undefined : message.diversifier; + obj.data_type = message.dataType === 0 ? undefined : message.dataType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: SignBytesAminoMsg): SignBytes { + return SignBytes.fromAmino(object.value); + }, + toAminoMsg(message: SignBytes): SignBytesAminoMsg { + return { + type: "cosmos-sdk/SignBytes", + value: SignBytes.toAmino(message) + }; + }, + fromProtoMsg(message: SignBytesProtoMsg): SignBytes { + return SignBytes.decode(message.value); + }, + toProto(message: SignBytes): Uint8Array { + return SignBytes.encode(message).finish(); + }, + toProtoMsg(message: SignBytes): SignBytesProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.SignBytes", + value: SignBytes.encode(message).finish() + }; + } +}; +function createBaseHeaderData(): HeaderData { + return { + newPubKey: undefined, + newDiversifier: "" + }; +} +export const HeaderData = { + typeUrl: "/ibc.lightclients.solomachine.v2.HeaderData", + encode(message: HeaderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newPubKey !== undefined) { + Any.encode(message.newPubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(18).string(message.newDiversifier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HeaderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newPubKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HeaderData { + const message = createBaseHeaderData(); + message.newPubKey = object.newPubKey !== undefined && object.newPubKey !== null ? Any.fromPartial(object.newPubKey) : undefined; + message.newDiversifier = object.newDiversifier ?? ""; + return message; + }, + fromAmino(object: HeaderDataAmino): HeaderData { + const message = createBaseHeaderData(); + if (object.new_pub_key !== undefined && object.new_pub_key !== null) { + message.newPubKey = Any.fromAmino(object.new_pub_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; + }, + toAmino(message: HeaderData): HeaderDataAmino { + const obj: any = {}; + obj.new_pub_key = message.newPubKey ? Any.toAmino(message.newPubKey) : undefined; + obj.new_diversifier = message.newDiversifier === "" ? undefined : message.newDiversifier; + return obj; + }, + fromAminoMsg(object: HeaderDataAminoMsg): HeaderData { + return HeaderData.fromAmino(object.value); + }, + toAminoMsg(message: HeaderData): HeaderDataAminoMsg { + return { + type: "cosmos-sdk/HeaderData", + value: HeaderData.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderDataProtoMsg): HeaderData { + return HeaderData.decode(message.value); + }, + toProto(message: HeaderData): Uint8Array { + return HeaderData.encode(message).finish(); + }, + toProtoMsg(message: HeaderData): HeaderDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.HeaderData", + value: HeaderData.encode(message).finish() + }; + } +}; +function createBaseClientStateData(): ClientStateData { + return { + path: new Uint8Array(), + clientState: undefined + }; +} +export const ClientStateData = { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientStateData", + encode(message: ClientStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientStateData { + const message = createBaseClientStateData(); + message.path = object.path ?? new Uint8Array(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + return message; + }, + fromAmino(object: ClientStateDataAmino): ClientStateData { + const message = createBaseClientStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; + }, + toAmino(message: ClientStateData): ClientStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + return obj; + }, + fromAminoMsg(object: ClientStateDataAminoMsg): ClientStateData { + return ClientStateData.fromAmino(object.value); + }, + toAminoMsg(message: ClientStateData): ClientStateDataAminoMsg { + return { + type: "cosmos-sdk/ClientStateData", + value: ClientStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateDataProtoMsg): ClientStateData { + return ClientStateData.decode(message.value); + }, + toProto(message: ClientStateData): Uint8Array { + return ClientStateData.encode(message).finish(); + }, + toProtoMsg(message: ClientStateData): ClientStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.ClientStateData", + value: ClientStateData.encode(message).finish() + }; + } +}; +function createBaseConsensusStateData(): ConsensusStateData { + return { + path: new Uint8Array(), + consensusState: undefined + }; +} +export const ConsensusStateData = { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusStateData", + encode(message: ConsensusStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusStateData { + const message = createBaseConsensusStateData(); + message.path = object.path ?? new Uint8Array(); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + return message; + }, + fromAmino(object: ConsensusStateDataAmino): ConsensusStateData { + const message = createBaseConsensusStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ConsensusStateData): ConsensusStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateDataAminoMsg): ConsensusStateData { + return ConsensusStateData.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusStateData): ConsensusStateDataAminoMsg { + return { + type: "cosmos-sdk/ConsensusStateData", + value: ConsensusStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateDataProtoMsg): ConsensusStateData { + return ConsensusStateData.decode(message.value); + }, + toProto(message: ConsensusStateData): Uint8Array { + return ConsensusStateData.encode(message).finish(); + }, + toProtoMsg(message: ConsensusStateData): ConsensusStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusStateData", + value: ConsensusStateData.encode(message).finish() + }; + } +}; +function createBaseConnectionStateData(): ConnectionStateData { + return { + path: new Uint8Array(), + connection: undefined + }; +} +export const ConnectionStateData = { + typeUrl: "/ibc.lightclients.solomachine.v2.ConnectionStateData", + encode(message: ConnectionStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.connection = ConnectionEnd.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConnectionStateData { + const message = createBaseConnectionStateData(); + message.path = object.path ?? new Uint8Array(); + message.connection = object.connection !== undefined && object.connection !== null ? ConnectionEnd.fromPartial(object.connection) : undefined; + return message; + }, + fromAmino(object: ConnectionStateDataAmino): ConnectionStateData { + const message = createBaseConnectionStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + return message; + }, + toAmino(message: ConnectionStateData): ConnectionStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection) : undefined; + return obj; + }, + fromAminoMsg(object: ConnectionStateDataAminoMsg): ConnectionStateData { + return ConnectionStateData.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionStateData): ConnectionStateDataAminoMsg { + return { + type: "cosmos-sdk/ConnectionStateData", + value: ConnectionStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ConnectionStateDataProtoMsg): ConnectionStateData { + return ConnectionStateData.decode(message.value); + }, + toProto(message: ConnectionStateData): Uint8Array { + return ConnectionStateData.encode(message).finish(); + }, + toProtoMsg(message: ConnectionStateData): ConnectionStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.ConnectionStateData", + value: ConnectionStateData.encode(message).finish() + }; + } +}; +function createBaseChannelStateData(): ChannelStateData { + return { + path: new Uint8Array(), + channel: undefined + }; +} +export const ChannelStateData = { + typeUrl: "/ibc.lightclients.solomachine.v2.ChannelStateData", + encode(message: ChannelStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ChannelStateData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChannelStateData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ChannelStateData { + const message = createBaseChannelStateData(); + message.path = object.path ?? new Uint8Array(); + message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; + return message; + }, + fromAmino(object: ChannelStateDataAmino): ChannelStateData { + const message = createBaseChannelStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + return message; + }, + toAmino(message: ChannelStateData): ChannelStateDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; + return obj; + }, + fromAminoMsg(object: ChannelStateDataAminoMsg): ChannelStateData { + return ChannelStateData.fromAmino(object.value); + }, + toAminoMsg(message: ChannelStateData): ChannelStateDataAminoMsg { + return { + type: "cosmos-sdk/ChannelStateData", + value: ChannelStateData.toAmino(message) + }; + }, + fromProtoMsg(message: ChannelStateDataProtoMsg): ChannelStateData { + return ChannelStateData.decode(message.value); + }, + toProto(message: ChannelStateData): Uint8Array { + return ChannelStateData.encode(message).finish(); + }, + toProtoMsg(message: ChannelStateData): ChannelStateDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.ChannelStateData", + value: ChannelStateData.encode(message).finish() + }; + } +}; +function createBasePacketCommitmentData(): PacketCommitmentData { + return { + path: new Uint8Array(), + commitment: new Uint8Array() + }; +} +export const PacketCommitmentData = { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketCommitmentData", + encode(message: PacketCommitmentData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.commitment.length !== 0) { + writer.uint32(18).bytes(message.commitment); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketCommitmentData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketCommitmentData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.commitment = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketCommitmentData { + const message = createBasePacketCommitmentData(); + message.path = object.path ?? new Uint8Array(); + message.commitment = object.commitment ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketCommitmentDataAmino): PacketCommitmentData { + const message = createBasePacketCommitmentData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + return message; + }, + toAmino(message: PacketCommitmentData): PacketCommitmentDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.commitment = message.commitment ? base64FromBytes(message.commitment) : undefined; + return obj; + }, + fromAminoMsg(object: PacketCommitmentDataAminoMsg): PacketCommitmentData { + return PacketCommitmentData.fromAmino(object.value); + }, + toAminoMsg(message: PacketCommitmentData): PacketCommitmentDataAminoMsg { + return { + type: "cosmos-sdk/PacketCommitmentData", + value: PacketCommitmentData.toAmino(message) + }; + }, + fromProtoMsg(message: PacketCommitmentDataProtoMsg): PacketCommitmentData { + return PacketCommitmentData.decode(message.value); + }, + toProto(message: PacketCommitmentData): Uint8Array { + return PacketCommitmentData.encode(message).finish(); + }, + toProtoMsg(message: PacketCommitmentData): PacketCommitmentDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketCommitmentData", + value: PacketCommitmentData.encode(message).finish() + }; + } +}; +function createBasePacketAcknowledgementData(): PacketAcknowledgementData { + return { + path: new Uint8Array(), + acknowledgement: new Uint8Array() + }; +} +export const PacketAcknowledgementData = { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData", + encode(message: PacketAcknowledgementData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketAcknowledgementData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketAcknowledgementData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketAcknowledgementData { + const message = createBasePacketAcknowledgementData(); + message.path = object.path ?? new Uint8Array(); + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketAcknowledgementDataAmino): PacketAcknowledgementData { + const message = createBasePacketAcknowledgementData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + return message; + }, + toAmino(message: PacketAcknowledgementData): PacketAcknowledgementDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + return obj; + }, + fromAminoMsg(object: PacketAcknowledgementDataAminoMsg): PacketAcknowledgementData { + return PacketAcknowledgementData.fromAmino(object.value); + }, + toAminoMsg(message: PacketAcknowledgementData): PacketAcknowledgementDataAminoMsg { + return { + type: "cosmos-sdk/PacketAcknowledgementData", + value: PacketAcknowledgementData.toAmino(message) + }; + }, + fromProtoMsg(message: PacketAcknowledgementDataProtoMsg): PacketAcknowledgementData { + return PacketAcknowledgementData.decode(message.value); + }, + toProto(message: PacketAcknowledgementData): Uint8Array { + return PacketAcknowledgementData.encode(message).finish(); + }, + toProtoMsg(message: PacketAcknowledgementData): PacketAcknowledgementDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData", + value: PacketAcknowledgementData.encode(message).finish() + }; + } +}; +function createBasePacketReceiptAbsenceData(): PacketReceiptAbsenceData { + return { + path: new Uint8Array() + }; +} +export const PacketReceiptAbsenceData = { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData", + encode(message: PacketReceiptAbsenceData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketReceiptAbsenceData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketReceiptAbsenceData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PacketReceiptAbsenceData { + const message = createBasePacketReceiptAbsenceData(); + message.path = object.path ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketReceiptAbsenceDataAmino): PacketReceiptAbsenceData { + const message = createBasePacketReceiptAbsenceData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + return message; + }, + toAmino(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + return obj; + }, + fromAminoMsg(object: PacketReceiptAbsenceDataAminoMsg): PacketReceiptAbsenceData { + return PacketReceiptAbsenceData.fromAmino(object.value); + }, + toAminoMsg(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataAminoMsg { + return { + type: "cosmos-sdk/PacketReceiptAbsenceData", + value: PacketReceiptAbsenceData.toAmino(message) + }; + }, + fromProtoMsg(message: PacketReceiptAbsenceDataProtoMsg): PacketReceiptAbsenceData { + return PacketReceiptAbsenceData.decode(message.value); + }, + toProto(message: PacketReceiptAbsenceData): Uint8Array { + return PacketReceiptAbsenceData.encode(message).finish(); + }, + toProtoMsg(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData", + value: PacketReceiptAbsenceData.encode(message).finish() + }; + } +}; +function createBaseNextSequenceRecvData(): NextSequenceRecvData { + return { + path: new Uint8Array(), + nextSeqRecv: BigInt(0) + }; +} +export const NextSequenceRecvData = { + typeUrl: "/ibc.lightclients.solomachine.v2.NextSequenceRecvData", + encode(message: NextSequenceRecvData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.nextSeqRecv !== BigInt(0)) { + writer.uint32(16).uint64(message.nextSeqRecv); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NextSequenceRecvData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextSequenceRecvData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.nextSeqRecv = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NextSequenceRecvData { + const message = createBaseNextSequenceRecvData(); + message.path = object.path ?? new Uint8Array(); + message.nextSeqRecv = object.nextSeqRecv !== undefined && object.nextSeqRecv !== null ? BigInt(object.nextSeqRecv.toString()) : BigInt(0); + return message; + }, + fromAmino(object: NextSequenceRecvDataAmino): NextSequenceRecvData { + const message = createBaseNextSequenceRecvData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.next_seq_recv !== undefined && object.next_seq_recv !== null) { + message.nextSeqRecv = BigInt(object.next_seq_recv); + } + return message; + }, + toAmino(message: NextSequenceRecvData): NextSequenceRecvDataAmino { + const obj: any = {}; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.next_seq_recv = message.nextSeqRecv !== BigInt(0) ? message.nextSeqRecv.toString() : undefined; + return obj; + }, + fromAminoMsg(object: NextSequenceRecvDataAminoMsg): NextSequenceRecvData { + return NextSequenceRecvData.fromAmino(object.value); + }, + toAminoMsg(message: NextSequenceRecvData): NextSequenceRecvDataAminoMsg { + return { + type: "cosmos-sdk/NextSequenceRecvData", + value: NextSequenceRecvData.toAmino(message) + }; + }, + fromProtoMsg(message: NextSequenceRecvDataProtoMsg): NextSequenceRecvData { + return NextSequenceRecvData.decode(message.value); + }, + toProto(message: NextSequenceRecvData): Uint8Array { + return NextSequenceRecvData.encode(message).finish(); + }, + toProtoMsg(message: NextSequenceRecvData): NextSequenceRecvDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v2.NextSequenceRecvData", + value: NextSequenceRecvData.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/lightclients/tendermint/v1/tendermint.ts b/dydxjs/packages/dydxjs/src/ibc/lightclients/tendermint/v1/tendermint.ts new file mode 100644 index 00000000..db8db5a1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/lightclients/tendermint/v1/tendermint.ts @@ -0,0 +1,857 @@ +//@ts-nocheck +import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { ProofSpec, ProofSpecAmino, ProofSpecSDKType } from "../../../../confio/proofs"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { MerkleRoot, MerkleRootAmino, MerkleRootSDKType } from "../../../core/commitment/v1/commitment"; +import { SignedHeader, SignedHeaderAmino, SignedHeaderSDKType } from "../../../../tendermint/types/types"; +import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "../../../../tendermint/types/validator"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientState { + chainId: string; + trustLevel: Fraction; + /** + * duration of the period since the LastestTimestamp during which the + * submitted headers are valid for upgrade + */ + trustingPeriod: Duration; + /** duration of the staking unbonding period */ + unbondingPeriod: Duration; + /** defines how much new (untrusted) header's Time can drift into the future. */ + maxClockDrift: Duration; + /** Block height when the client was frozen due to a misbehaviour */ + frozenHeight: Height; + /** Latest height the client was updated to */ + latestHeight: Height; + /** Proof specifications used in verifying counterparty state */ + proofSpecs: ProofSpec[]; + /** + * Path at which next upgraded client will be committed. + * Each element corresponds to the key for a single CommitmentProof in the + * chained proof. NOTE: ClientState must stored under + * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + * the default upgrade module, upgrade_path should be []string{"upgrade", + * "upgradedIBCState"}` + */ + upgradePath: string[]; + /** + * This flag, when set to true, will allow governance to recover a client + * which has expired + */ + allowUpdateAfterExpiry: boolean; + /** + * This flag, when set to true, will allow governance to unfreeze a client + * whose chain has experienced a misbehaviour event + */ + allowUpdateAfterMisbehaviour: boolean; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.ClientState"; + value: Uint8Array; +} +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientStateAmino { + chain_id?: string; + trust_level?: FractionAmino; + /** + * duration of the period since the LastestTimestamp during which the + * submitted headers are valid for upgrade + */ + trusting_period?: DurationAmino; + /** duration of the staking unbonding period */ + unbonding_period?: DurationAmino; + /** defines how much new (untrusted) header's Time can drift into the future. */ + max_clock_drift?: DurationAmino; + /** Block height when the client was frozen due to a misbehaviour */ + frozen_height?: HeightAmino; + /** Latest height the client was updated to */ + latest_height?: HeightAmino; + /** Proof specifications used in verifying counterparty state */ + proof_specs?: ProofSpecAmino[]; + /** + * Path at which next upgraded client will be committed. + * Each element corresponds to the key for a single CommitmentProof in the + * chained proof. NOTE: ClientState must stored under + * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + * the default upgrade module, upgrade_path should be []string{"upgrade", + * "upgradedIBCState"}` + */ + upgrade_path?: string[]; + /** + * This flag, when set to true, will allow governance to recover a client + * which has expired + */ + allow_update_after_expiry?: boolean; + /** + * This flag, when set to true, will allow governance to unfreeze a client + * whose chain has experienced a misbehaviour event + */ + allow_update_after_misbehaviour?: boolean; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientStateSDKType { + chain_id: string; + trust_level: FractionSDKType; + trusting_period: DurationSDKType; + unbonding_period: DurationSDKType; + max_clock_drift: DurationSDKType; + frozen_height: HeightSDKType; + latest_height: HeightSDKType; + proof_specs: ProofSpecSDKType[]; + upgrade_path: string[]; + allow_update_after_expiry: boolean; + allow_update_after_misbehaviour: boolean; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusState { + /** + * timestamp that corresponds to the block height in which the ConsensusState + * was stored. + */ + timestamp: Date; + /** commitment root (i.e app hash) */ + root: MerkleRoot; + nextValidatorsHash: Uint8Array; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState"; + value: Uint8Array; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusStateAmino { + /** + * timestamp that corresponds to the block height in which the ConsensusState + * was stored. + */ + timestamp?: string; + /** commitment root (i.e app hash) */ + root?: MerkleRootAmino; + next_validators_hash?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusStateSDKType { + timestamp: Date; + root: MerkleRootSDKType; + next_validators_hash: Uint8Array; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface Misbehaviour { + clientId: string; + header1?: Header; + header2?: Header; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface MisbehaviourAmino { + client_id?: string; + header_1?: HeaderAmino; + header_2?: HeaderAmino; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface MisbehaviourSDKType { + client_id: string; + header_1?: HeaderSDKType; + header_2?: HeaderSDKType; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface Header { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; + trustedHeight: Height; + trustedValidators?: ValidatorSet; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Header"; + value: Uint8Array; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface HeaderAmino { + signed_header?: SignedHeaderAmino; + validator_set?: ValidatorSetAmino; + trusted_height?: HeightAmino; + trusted_validators?: ValidatorSetAmino; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface HeaderSDKType { + signed_header?: SignedHeaderSDKType; + validator_set?: ValidatorSetSDKType; + trusted_height: HeightSDKType; + trusted_validators?: ValidatorSetSDKType; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface Fraction { + numerator: bigint; + denominator: bigint; +} +export interface FractionProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Fraction"; + value: Uint8Array; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface FractionAmino { + numerator?: string; + denominator?: string; +} +export interface FractionAminoMsg { + type: "cosmos-sdk/Fraction"; + value: FractionAmino; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface FractionSDKType { + numerator: bigint; + denominator: bigint; +} +function createBaseClientState(): ClientState { + return { + chainId: "", + trustLevel: Fraction.fromPartial({}), + trustingPeriod: Duration.fromPartial({}), + unbondingPeriod: Duration.fromPartial({}), + maxClockDrift: Duration.fromPartial({}), + frozenHeight: Height.fromPartial({}), + latestHeight: Height.fromPartial({}), + proofSpecs: [], + upgradePath: [], + allowUpdateAfterExpiry: false, + allowUpdateAfterMisbehaviour: false + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.tendermint.v1.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.trustLevel !== undefined) { + Fraction.encode(message.trustLevel, writer.uint32(18).fork()).ldelim(); + } + if (message.trustingPeriod !== undefined) { + Duration.encode(message.trustingPeriod, writer.uint32(26).fork()).ldelim(); + } + if (message.unbondingPeriod !== undefined) { + Duration.encode(message.unbondingPeriod, writer.uint32(34).fork()).ldelim(); + } + if (message.maxClockDrift !== undefined) { + Duration.encode(message.maxClockDrift, writer.uint32(42).fork()).ldelim(); + } + if (message.frozenHeight !== undefined) { + Height.encode(message.frozenHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.latestHeight !== undefined) { + Height.encode(message.latestHeight, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.proofSpecs) { + ProofSpec.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.upgradePath) { + writer.uint32(74).string(v!); + } + if (message.allowUpdateAfterExpiry === true) { + writer.uint32(80).bool(message.allowUpdateAfterExpiry); + } + if (message.allowUpdateAfterMisbehaviour === true) { + writer.uint32(88).bool(message.allowUpdateAfterMisbehaviour); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.trustLevel = Fraction.decode(reader, reader.uint32()); + break; + case 3: + message.trustingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.unbondingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 5: + message.maxClockDrift = Duration.decode(reader, reader.uint32()); + break; + case 6: + message.frozenHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.latestHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofSpecs.push(ProofSpec.decode(reader, reader.uint32())); + break; + case 9: + message.upgradePath.push(reader.string()); + break; + case 10: + message.allowUpdateAfterExpiry = reader.bool(); + break; + case 11: + message.allowUpdateAfterMisbehaviour = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.chainId = object.chainId ?? ""; + message.trustLevel = object.trustLevel !== undefined && object.trustLevel !== null ? Fraction.fromPartial(object.trustLevel) : undefined; + message.trustingPeriod = object.trustingPeriod !== undefined && object.trustingPeriod !== null ? Duration.fromPartial(object.trustingPeriod) : undefined; + message.unbondingPeriod = object.unbondingPeriod !== undefined && object.unbondingPeriod !== null ? Duration.fromPartial(object.unbondingPeriod) : undefined; + message.maxClockDrift = object.maxClockDrift !== undefined && object.maxClockDrift !== null ? Duration.fromPartial(object.maxClockDrift) : undefined; + message.frozenHeight = object.frozenHeight !== undefined && object.frozenHeight !== null ? Height.fromPartial(object.frozenHeight) : undefined; + message.latestHeight = object.latestHeight !== undefined && object.latestHeight !== null ? Height.fromPartial(object.latestHeight) : undefined; + message.proofSpecs = object.proofSpecs?.map(e => ProofSpec.fromPartial(e)) || []; + message.upgradePath = object.upgradePath?.map(e => e) || []; + message.allowUpdateAfterExpiry = object.allowUpdateAfterExpiry ?? false; + message.allowUpdateAfterMisbehaviour = object.allowUpdateAfterMisbehaviour ?? false; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.trust_level !== undefined && object.trust_level !== null) { + message.trustLevel = Fraction.fromAmino(object.trust_level); + } + if (object.trusting_period !== undefined && object.trusting_period !== null) { + message.trustingPeriod = Duration.fromAmino(object.trusting_period); + } + if (object.unbonding_period !== undefined && object.unbonding_period !== null) { + message.unbondingPeriod = Duration.fromAmino(object.unbonding_period); + } + if (object.max_clock_drift !== undefined && object.max_clock_drift !== null) { + message.maxClockDrift = Duration.fromAmino(object.max_clock_drift); + } + if (object.frozen_height !== undefined && object.frozen_height !== null) { + message.frozenHeight = Height.fromAmino(object.frozen_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + message.proofSpecs = object.proof_specs?.map(e => ProofSpec.fromAmino(e)) || []; + message.upgradePath = object.upgrade_path?.map(e => e) || []; + if (object.allow_update_after_expiry !== undefined && object.allow_update_after_expiry !== null) { + message.allowUpdateAfterExpiry = object.allow_update_after_expiry; + } + if (object.allow_update_after_misbehaviour !== undefined && object.allow_update_after_misbehaviour !== null) { + message.allowUpdateAfterMisbehaviour = object.allow_update_after_misbehaviour; + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.trust_level = message.trustLevel ? Fraction.toAmino(message.trustLevel) : undefined; + obj.trusting_period = message.trustingPeriod ? Duration.toAmino(message.trustingPeriod) : undefined; + obj.unbonding_period = message.unbondingPeriod ? Duration.toAmino(message.unbondingPeriod) : undefined; + obj.max_clock_drift = message.maxClockDrift ? Duration.toAmino(message.maxClockDrift) : undefined; + obj.frozen_height = message.frozenHeight ? Height.toAmino(message.frozenHeight) : {}; + obj.latest_height = message.latestHeight ? Height.toAmino(message.latestHeight) : {}; + if (message.proofSpecs) { + obj.proof_specs = message.proofSpecs.map(e => e ? ProofSpec.toAmino(e) : undefined); + } else { + obj.proof_specs = message.proofSpecs; + } + if (message.upgradePath) { + obj.upgrade_path = message.upgradePath.map(e => e); + } else { + obj.upgrade_path = message.upgradePath; + } + obj.allow_update_after_expiry = message.allowUpdateAfterExpiry === false ? undefined : message.allowUpdateAfterExpiry; + obj.allow_update_after_misbehaviour = message.allowUpdateAfterMisbehaviour === false ? undefined : message.allowUpdateAfterMisbehaviour; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusState(): ConsensusState { + return { + timestamp: new Date(), + root: MerkleRoot.fromPartial({}), + nextValidatorsHash: new Uint8Array() + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState", + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim(); + } + if (message.root !== undefined) { + MerkleRoot.encode(message.root, writer.uint32(18).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(26).bytes(message.nextValidatorsHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.root = MerkleRoot.decode(reader, reader.uint32()); + break; + case 3: + message.nextValidatorsHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.timestamp = object.timestamp ?? undefined; + message.root = object.root !== undefined && object.root !== null ? MerkleRoot.fromPartial(object.root) : undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.root !== undefined && object.root !== null) { + message.root = MerkleRoot.fromAmino(object.root); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + return message; + }, + toAmino(message: ConsensusState): ConsensusStateAmino { + const obj: any = {}; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState { + return ConsensusState.decode(message.value); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +function createBaseMisbehaviour(): Misbehaviour { + return { + clientId: "", + header1: undefined, + header2: undefined + }; +} +export const Misbehaviour = { + typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour", + encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.header1 !== undefined) { + Header.encode(message.header1, writer.uint32(18).fork()).ldelim(); + } + if (message.header2 !== undefined) { + Header.encode(message.header2, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header1 = Header.decode(reader, reader.uint32()); + break; + case 3: + message.header2 = Header.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Misbehaviour { + const message = createBaseMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.header1 = object.header1 !== undefined && object.header1 !== null ? Header.fromPartial(object.header1) : undefined; + message.header2 = object.header2 !== undefined && object.header2 !== null ? Header.fromPartial(object.header2) : undefined; + return message; + }, + fromAmino(object: MisbehaviourAmino): Misbehaviour { + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.header_1 !== undefined && object.header_1 !== null) { + message.header1 = Header.fromAmino(object.header_1); + } + if (object.header_2 !== undefined && object.header_2 !== null) { + message.header2 = Header.fromAmino(object.header_2); + } + return message; + }, + toAmino(message: Misbehaviour): MisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.header_1 = message.header1 ? Header.toAmino(message.header1) : undefined; + obj.header_2 = message.header2 ? Header.toAmino(message.header2) : undefined; + return obj; + }, + fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour { + return Misbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: Misbehaviour): MisbehaviourAminoMsg { + return { + type: "cosmos-sdk/Misbehaviour", + value: Misbehaviour.toAmino(message) + }; + }, + fromProtoMsg(message: MisbehaviourProtoMsg): Misbehaviour { + return Misbehaviour.decode(message.value); + }, + toProto(message: Misbehaviour): Uint8Array { + return Misbehaviour.encode(message).finish(); + }, + toProtoMsg(message: Misbehaviour): MisbehaviourProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour", + value: Misbehaviour.encode(message).finish() + }; + } +}; +function createBaseHeader(): Header { + return { + signedHeader: undefined, + validatorSet: undefined, + trustedHeight: Height.fromPartial({}), + trustedValidators: undefined + }; +} +export const Header = { + typeUrl: "/ibc.lightclients.tendermint.v1.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + if (message.trustedHeight !== undefined) { + Height.encode(message.trustedHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.trustedValidators !== undefined) { + ValidatorSet.encode(message.trustedValidators, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); + break; + case 3: + message.trustedHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.trustedValidators = ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial
): Header { + const message = createBaseHeader(); + message.signedHeader = object.signedHeader !== undefined && object.signedHeader !== null ? SignedHeader.fromPartial(object.signedHeader) : undefined; + message.validatorSet = object.validatorSet !== undefined && object.validatorSet !== null ? ValidatorSet.fromPartial(object.validatorSet) : undefined; + message.trustedHeight = object.trustedHeight !== undefined && object.trustedHeight !== null ? Height.fromPartial(object.trustedHeight) : undefined; + message.trustedValidators = object.trustedValidators !== undefined && object.trustedValidators !== null ? ValidatorSet.fromPartial(object.trustedValidators) : undefined; + return message; + }, + fromAmino(object: HeaderAmino): Header { + const message = createBaseHeader(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + if (object.trusted_height !== undefined && object.trusted_height !== null) { + message.trustedHeight = Height.fromAmino(object.trusted_height); + } + if (object.trusted_validators !== undefined && object.trusted_validators !== null) { + message.trustedValidators = ValidatorSet.fromAmino(object.trusted_validators); + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.signed_header = message.signedHeader ? SignedHeader.toAmino(message.signedHeader) : undefined; + obj.validator_set = message.validatorSet ? ValidatorSet.toAmino(message.validatorSet) : undefined; + obj.trusted_height = message.trustedHeight ? Height.toAmino(message.trustedHeight) : {}; + obj.trusted_validators = message.trustedValidators ? ValidatorSet.toAmino(message.trustedValidators) : undefined; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + toAminoMsg(message: Header): HeaderAminoMsg { + return { + type: "cosmos-sdk/Header", + value: Header.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.Header", + value: Header.encode(message).finish() + }; + } +}; +function createBaseFraction(): Fraction { + return { + numerator: BigInt(0), + denominator: BigInt(0) + }; +} +export const Fraction = { + typeUrl: "/ibc.lightclients.tendermint.v1.Fraction", + encode(message: Fraction, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.numerator !== BigInt(0)) { + writer.uint32(8).uint64(message.numerator); + } + if (message.denominator !== BigInt(0)) { + writer.uint32(16).uint64(message.denominator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Fraction { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFraction(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numerator = reader.uint64(); + break; + case 2: + message.denominator = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Fraction { + const message = createBaseFraction(); + message.numerator = object.numerator !== undefined && object.numerator !== null ? BigInt(object.numerator.toString()) : BigInt(0); + message.denominator = object.denominator !== undefined && object.denominator !== null ? BigInt(object.denominator.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FractionAmino): Fraction { + const message = createBaseFraction(); + if (object.numerator !== undefined && object.numerator !== null) { + message.numerator = BigInt(object.numerator); + } + if (object.denominator !== undefined && object.denominator !== null) { + message.denominator = BigInt(object.denominator); + } + return message; + }, + toAmino(message: Fraction): FractionAmino { + const obj: any = {}; + obj.numerator = message.numerator !== BigInt(0) ? message.numerator.toString() : undefined; + obj.denominator = message.denominator !== BigInt(0) ? message.denominator.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FractionAminoMsg): Fraction { + return Fraction.fromAmino(object.value); + }, + toAminoMsg(message: Fraction): FractionAminoMsg { + return { + type: "cosmos-sdk/Fraction", + value: Fraction.toAmino(message) + }; + }, + fromProtoMsg(message: FractionProtoMsg): Fraction { + return Fraction.decode(message.value); + }, + toProto(message: Fraction): Uint8Array { + return Fraction.encode(message).finish(); + }, + toProtoMsg(message: Fraction): FractionProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.Fraction", + value: Fraction.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/rpc.query.ts b/dydxjs/packages/dydxjs/src/ibc/rpc.query.ts new file mode 100644 index 00000000..b21567fa --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/rpc.query.ts @@ -0,0 +1,70 @@ +//@ts-nocheck +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + group: { + v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + ibc: { + applications: { + transfer: { + v1: (await import("./applications/transfer/v1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + core: { + channel: { + v1: (await import("./core/channel/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + client: { + v1: (await import("./core/client/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + connection: { + v1: (await import("./core/connection/v1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ibc/rpc.tx.ts b/dydxjs/packages/dydxjs/src/ibc/rpc.tx.ts new file mode 100644 index 00000000..a0f8f1c7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ibc/rpc.tx.ts @@ -0,0 +1,56 @@ +//@ts-nocheck +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + group: { + v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + vesting: { + v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + ibc: { + applications: { + transfer: { + v1: new (await import("./applications/transfer/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + core: { + channel: { + v1: new (await import("./core/channel/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + client: { + v1: new (await import("./core/client/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + connection: { + v1: new (await import("./core/connection/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } + } +}); \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/ics23/bundle.ts b/dydxjs/packages/dydxjs/src/ics23/bundle.ts new file mode 100644 index 00000000..b6873c51 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/ics23/bundle.ts @@ -0,0 +1,5 @@ +//@ts-nocheck +import * as _1 from "../confio/proofs"; +export const ics23 = { + ..._1 +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/index.ts b/dydxjs/packages/dydxjs/src/index.ts new file mode 100644 index 00000000..2e4bc260 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/index.ts @@ -0,0 +1,26 @@ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or npm scripts command that is used to regenerate this bundle. + */ + +export * from "./amino/bundle"; +export * from "./ics23/bundle"; +export * from "./cosmos_proto/bundle"; +export * from "./cosmos/bundle"; +export * from "./cosmos/client"; +export * from "./cosmwasm/bundle"; +export * from "./cosmwasm/client"; +export * from "./dydxprotocol/bundle"; +export * from "./dydxprotocol/client"; +export * from "./gogoproto/bundle"; +export * from "./google/bundle"; +export * from "./ibc/bundle"; +export * from "./ibc/client"; +export * from "./slinky/bundle"; +export * from "./slinky/client"; +export * from "./tendermint/bundle"; +export * from "./varint"; +export * from "./utf8"; +export * from "./binary"; diff --git a/dydxjs/packages/dydxjs/src/slinky/abci/v1/vote_extensions.ts b/dydxjs/packages/dydxjs/src/slinky/abci/v1/vote_extensions.ts new file mode 100644 index 00000000..f86ac2dc --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/abci/v1/vote_extensions.ts @@ -0,0 +1,213 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export interface OracleVoteExtension_PricesEntry { + key: bigint; + value: Uint8Array; +} +export interface OracleVoteExtension_PricesEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface OracleVoteExtension_PricesEntryAmino { + key?: string; + value?: string; +} +export interface OracleVoteExtension_PricesEntryAminoMsg { + type: string; + value: OracleVoteExtension_PricesEntryAmino; +} +export interface OracleVoteExtension_PricesEntrySDKType { + key: bigint; + value: Uint8Array; +} +/** OracleVoteExtension defines the vote extension structure for oracle prices. */ +export interface OracleVoteExtension { + /** + * Prices defines a map of id(CurrencyPair) -> price.Bytes() . i.e. 1 -> + * 0x123.. (bytes). Notice the `id` function is determined by the + * `CurrencyPairIDStrategy` used in the VoteExtensionHandler. + */ + prices: { + [key: bigint]: Uint8Array; + }; +} +export interface OracleVoteExtensionProtoMsg { + typeUrl: "/slinky.abci.v1.OracleVoteExtension"; + value: Uint8Array; +} +/** OracleVoteExtension defines the vote extension structure for oracle prices. */ +export interface OracleVoteExtensionAmino { + /** + * Prices defines a map of id(CurrencyPair) -> price.Bytes() . i.e. 1 -> + * 0x123.. (bytes). Notice the `id` function is determined by the + * `CurrencyPairIDStrategy` used in the VoteExtensionHandler. + */ + prices?: { + [key: string]: string; + }; +} +export interface OracleVoteExtensionAminoMsg { + type: "/slinky.abci.v1.OracleVoteExtension"; + value: OracleVoteExtensionAmino; +} +/** OracleVoteExtension defines the vote extension structure for oracle prices. */ +export interface OracleVoteExtensionSDKType { + prices: { + [key: bigint]: Uint8Array; + }; +} +function createBaseOracleVoteExtension_PricesEntry(): OracleVoteExtension_PricesEntry { + return { + key: BigInt(0), + value: new Uint8Array() + }; +} +export const OracleVoteExtension_PricesEntry = { + encode(message: OracleVoteExtension_PricesEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== BigInt(0)) { + writer.uint32(8).uint64(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleVoteExtension_PricesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleVoteExtension_PricesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.uint64(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OracleVoteExtension_PricesEntry { + const message = createBaseOracleVoteExtension_PricesEntry(); + message.key = object.key !== undefined && object.key !== null ? BigInt(object.key.toString()) : BigInt(0); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: OracleVoteExtension_PricesEntryAmino): OracleVoteExtension_PricesEntry { + const message = createBaseOracleVoteExtension_PricesEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = BigInt(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: OracleVoteExtension_PricesEntry): OracleVoteExtension_PricesEntryAmino { + const obj: any = {}; + obj.key = message.key !== BigInt(0) ? message.key.toString() : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: OracleVoteExtension_PricesEntryAminoMsg): OracleVoteExtension_PricesEntry { + return OracleVoteExtension_PricesEntry.fromAmino(object.value); + }, + fromProtoMsg(message: OracleVoteExtension_PricesEntryProtoMsg): OracleVoteExtension_PricesEntry { + return OracleVoteExtension_PricesEntry.decode(message.value); + }, + toProto(message: OracleVoteExtension_PricesEntry): Uint8Array { + return OracleVoteExtension_PricesEntry.encode(message).finish(); + } +}; +function createBaseOracleVoteExtension(): OracleVoteExtension { + return { + prices: {} + }; +} +export const OracleVoteExtension = { + typeUrl: "/slinky.abci.v1.OracleVoteExtension", + encode(message: OracleVoteExtension, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.prices).forEach(([key, value]) => { + OracleVoteExtension_PricesEntry.encode({ + key: key as any, + value + }, writer.uint32(10).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): OracleVoteExtension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOracleVoteExtension(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = OracleVoteExtension_PricesEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.prices[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OracleVoteExtension { + const message = createBaseOracleVoteExtension(); + message.prices = Object.entries(object.prices ?? {}).reduce<{ + [key: bigint]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[Number(key)] = bytes.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: OracleVoteExtensionAmino): OracleVoteExtension { + const message = createBaseOracleVoteExtension(); + message.prices = Object.entries(object.prices ?? {}).reduce<{ + [key: bigint]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[Number(key)] = bytes.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: OracleVoteExtension): OracleVoteExtensionAmino { + const obj: any = {}; + obj.prices = {}; + if (message.prices) { + Object.entries(message.prices).forEach(([k, v]) => { + obj.prices[k] = bytes.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: OracleVoteExtensionAminoMsg): OracleVoteExtension { + return OracleVoteExtension.fromAmino(object.value); + }, + fromProtoMsg(message: OracleVoteExtensionProtoMsg): OracleVoteExtension { + return OracleVoteExtension.decode(message.value); + }, + toProto(message: OracleVoteExtension): Uint8Array { + return OracleVoteExtension.encode(message).finish(); + }, + toProtoMsg(message: OracleVoteExtension): OracleVoteExtensionProtoMsg { + return { + typeUrl: "/slinky.abci.v1.OracleVoteExtension", + value: OracleVoteExtension.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/alerts.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/alerts.ts new file mode 100644 index 00000000..3dca0248 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/alerts.ts @@ -0,0 +1,952 @@ +//@ts-nocheck +import { CurrencyPair, CurrencyPairAmino, CurrencyPairSDKType } from "../../types/v1/currency_pair"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * Alert defines the basic meta-data necessary for the alerts module to resolve + * a claim that the price of a CurrencyPair on-chain is deviating from the price + * off-chain. + */ +export interface Alert { + /** height represents the height for which the alert is filed. */ + height: bigint; + /** + * signer is the signer of this alert, this is the address that will receive + * the reward in the case of a positive conclusion, or whose bond will get + * slashed in the event of a negative conclusion. + */ + signer: string; + /** + * currency_pair is the currency-pair that this claim asserts is deviating + * from the price off-chain. + */ + currencyPair: CurrencyPair; +} +export interface AlertProtoMsg { + typeUrl: "/slinky.alerts.v1.Alert"; + value: Uint8Array; +} +/** + * Alert defines the basic meta-data necessary for the alerts module to resolve + * a claim that the price of a CurrencyPair on-chain is deviating from the price + * off-chain. + */ +export interface AlertAmino { + /** height represents the height for which the alert is filed. */ + height?: string; + /** + * signer is the signer of this alert, this is the address that will receive + * the reward in the case of a positive conclusion, or whose bond will get + * slashed in the event of a negative conclusion. + */ + signer?: string; + /** + * currency_pair is the currency-pair that this claim asserts is deviating + * from the price off-chain. + */ + currency_pair?: CurrencyPairAmino; +} +export interface AlertAminoMsg { + type: "slinky/x/alerts/Alert"; + value: AlertAmino; +} +/** + * Alert defines the basic meta-data necessary for the alerts module to resolve + * a claim that the price of a CurrencyPair on-chain is deviating from the price + * off-chain. + */ +export interface AlertSDKType { + height: bigint; + signer: string; + currency_pair: CurrencyPairSDKType; +} +/** + * AlertStatus contains the module specific state for an alert: Has the alert + * been concluded? What height was the alert submitted, what height should the + * alert be purged? + */ +export interface AlertStatus { + /** ConclusionStatus determines whether the alert has been concluded. */ + conclusionStatus: bigint; + /** SubmissionHeight is the height that the alert was submitted in. */ + submissionHeight: bigint; + /** + * SubmissionTimestamp is the block-timestamp of the block that the alert was + * submitted in (as a UTC value in Unix time). + */ + submissionTimestamp: bigint; + /** PurgeHeight is the height at which the alert should be purged. */ + purgeHeight: bigint; +} +export interface AlertStatusProtoMsg { + typeUrl: "/slinky.alerts.v1.AlertStatus"; + value: Uint8Array; +} +/** + * AlertStatus contains the module specific state for an alert: Has the alert + * been concluded? What height was the alert submitted, what height should the + * alert be purged? + */ +export interface AlertStatusAmino { + /** ConclusionStatus determines whether the alert has been concluded. */ + conclusion_status?: string; + /** SubmissionHeight is the height that the alert was submitted in. */ + submission_height?: string; + /** + * SubmissionTimestamp is the block-timestamp of the block that the alert was + * submitted in (as a UTC value in Unix time). + */ + submission_timestamp?: string; + /** PurgeHeight is the height at which the alert should be purged. */ + purge_height?: string; +} +export interface AlertStatusAminoMsg { + type: "slinky/x/alerts/AlertStatus"; + value: AlertStatusAmino; +} +/** + * AlertStatus contains the module specific state for an alert: Has the alert + * been concluded? What height was the alert submitted, what height should the + * alert be purged? + */ +export interface AlertStatusSDKType { + conclusion_status: bigint; + submission_height: bigint; + submission_timestamp: bigint; + purge_height: bigint; +} +/** + * AlertWithStatus represents a wrapper around the Alert and AlertStatus + * objects, this is so that the module specific information about Alerts can be + * packaged together. + */ +export interface AlertWithStatus { + /** alert is the alert that this status corresponds to. */ + alert: Alert; + /** status is the status of the alert. */ + status: AlertStatus; +} +export interface AlertWithStatusProtoMsg { + typeUrl: "/slinky.alerts.v1.AlertWithStatus"; + value: Uint8Array; +} +/** + * AlertWithStatus represents a wrapper around the Alert and AlertStatus + * objects, this is so that the module specific information about Alerts can be + * packaged together. + */ +export interface AlertWithStatusAmino { + /** alert is the alert that this status corresponds to. */ + alert?: AlertAmino; + /** status is the status of the alert. */ + status?: AlertStatusAmino; +} +export interface AlertWithStatusAminoMsg { + type: "slinky/x/alerts/AlertWithStatus"; + value: AlertWithStatusAmino; +} +/** + * AlertWithStatus represents a wrapper around the Alert and AlertStatus + * objects, this is so that the module specific information about Alerts can be + * packaged together. + */ +export interface AlertWithStatusSDKType { + alert: AlertSDKType; + status: AlertStatusSDKType; +} +/** Signature is a container for a signer address mapped to a signature. */ +export interface Signature { + signer: string; + signature: Uint8Array; +} +export interface SignatureProtoMsg { + typeUrl: "/slinky.alerts.v1.Signature"; + value: Uint8Array; +} +/** Signature is a container for a signer address mapped to a signature. */ +export interface SignatureAmino { + signer?: string; + signature?: string; +} +export interface SignatureAminoMsg { + type: "/slinky.alerts.v1.Signature"; + value: SignatureAmino; +} +/** Signature is a container for a signer address mapped to a signature. */ +export interface SignatureSDKType { + signer: string; + signature: Uint8Array; +} +/** + * MultiSigConcluson defines a conclusion that is accompanied by a set of + * signatures. The signature is defined over the alert UID, status, OracleData, + * and PriceBound. The signatures are used to verify that the conclusion is + * valid. + */ +export interface MultiSigConclusion { + $typeUrl?: "/slinky.alerts.v1.MultiSigConclusion"; + /** alert is the alert that this conclusion corresponds to. */ + alert: Alert; + /** + * signatures is a map of signer -> signature. Where the signature is over + * Alert.UID, PriceBound, the marshalled ExtendedCommitInfo, and status. + */ + signatures: Signature[]; + /** + * price-bound is the price bound of the currency-pair off-chain for the + * designated time-range. + */ + priceBound: PriceBound; + /** status is the status of the conclusion. */ + status: boolean; + /** + * CurrencyPairID is the ID of the currency-pair that this conclusion + * corresponds to. + */ + currencyPairID: bigint; +} +export interface MultiSigConclusionProtoMsg { + typeUrl: "/slinky.alerts.v1.MultiSigConclusion"; + value: Uint8Array; +} +/** + * MultiSigConcluson defines a conclusion that is accompanied by a set of + * signatures. The signature is defined over the alert UID, status, OracleData, + * and PriceBound. The signatures are used to verify that the conclusion is + * valid. + */ +export interface MultiSigConclusionAmino { + /** alert is the alert that this conclusion corresponds to. */ + alert?: AlertAmino; + /** + * signatures is a map of signer -> signature. Where the signature is over + * Alert.UID, PriceBound, the marshalled ExtendedCommitInfo, and status. + */ + signatures?: SignatureAmino[]; + /** + * price-bound is the price bound of the currency-pair off-chain for the + * designated time-range. + */ + price_bound?: PriceBoundAmino; + /** status is the status of the conclusion. */ + status?: boolean; + /** + * CurrencyPairID is the ID of the currency-pair that this conclusion + * corresponds to. + */ + currency_pair_i_d?: string; +} +export interface MultiSigConclusionAminoMsg { + type: "slinky/x/alerts/Conclusion"; + value: MultiSigConclusionAmino; +} +/** + * MultiSigConcluson defines a conclusion that is accompanied by a set of + * signatures. The signature is defined over the alert UID, status, OracleData, + * and PriceBound. The signatures are used to verify that the conclusion is + * valid. + */ +export interface MultiSigConclusionSDKType { + $typeUrl?: "/slinky.alerts.v1.MultiSigConclusion"; + alert: AlertSDKType; + signatures: SignatureSDKType[]; + price_bound: PriceBoundSDKType; + status: boolean; + currency_pair_i_d: bigint; +} +/** + * MultiSigConclusionVerificationParams defines the parameters necessary to + * verify a MultiSigConclusion. It contains a map between signer and public key. + * Notice, the public-key (value) are the base-64 encoded bytes of the public + * key. And the signer (key) is the bech32 encoded address of the signer. + * Notice, all public keys must be secp256 keys. + */ +export interface MultiSigConclusionVerificationParams { + $typeUrl?: "/slinky.alerts.v1.MultiSigConclusionVerificationParams"; + /** signers is a map of signer -> public key. */ + signers: Any[]; +} +export interface MultiSigConclusionVerificationParamsProtoMsg { + typeUrl: "/slinky.alerts.v1.MultiSigConclusionVerificationParams"; + value: Uint8Array; +} +/** + * MultiSigConclusionVerificationParams defines the parameters necessary to + * verify a MultiSigConclusion. It contains a map between signer and public key. + * Notice, the public-key (value) are the base-64 encoded bytes of the public + * key. And the signer (key) is the bech32 encoded address of the signer. + * Notice, all public keys must be secp256 keys. + */ +export interface MultiSigConclusionVerificationParamsAmino { + /** signers is a map of signer -> public key. */ + signers?: AnyAmino[]; +} +export interface MultiSigConclusionVerificationParamsAminoMsg { + type: "slinky/x/alerts/ConclusionVerificationParams"; + value: MultiSigConclusionVerificationParamsAmino; +} +/** + * MultiSigConclusionVerificationParams defines the parameters necessary to + * verify a MultiSigConclusion. It contains a map between signer and public key. + * Notice, the public-key (value) are the base-64 encoded bytes of the public + * key. And the signer (key) is the bech32 encoded address of the signer. + * Notice, all public keys must be secp256 keys. + */ +export interface MultiSigConclusionVerificationParamsSDKType { + $typeUrl?: "/slinky.alerts.v1.MultiSigConclusionVerificationParams"; + signers: AnySDKType[]; +} +/** + * PriceBound represents the bounds of the price of a currency-pair off chain + * for a designated time-range + */ +export interface PriceBound { + high: string; + low: string; +} +export interface PriceBoundProtoMsg { + typeUrl: "/slinky.alerts.v1.PriceBound"; + value: Uint8Array; +} +/** + * PriceBound represents the bounds of the price of a currency-pair off chain + * for a designated time-range + */ +export interface PriceBoundAmino { + high?: string; + low?: string; +} +export interface PriceBoundAminoMsg { + type: "/slinky.alerts.v1.PriceBound"; + value: PriceBoundAmino; +} +/** + * PriceBound represents the bounds of the price of a currency-pair off chain + * for a designated time-range + */ +export interface PriceBoundSDKType { + high: string; + low: string; +} +function createBaseAlert(): Alert { + return { + height: BigInt(0), + signer: "", + currencyPair: CurrencyPair.fromPartial({}) + }; +} +export const Alert = { + typeUrl: "/slinky.alerts.v1.Alert", + encode(message: Alert, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).uint64(message.height); + } + if (message.signer !== "") { + writer.uint32(18).string(message.signer); + } + if (message.currencyPair !== undefined) { + CurrencyPair.encode(message.currencyPair, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Alert { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAlert(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.signer = reader.string(); + break; + case 3: + message.currencyPair = CurrencyPair.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Alert { + const message = createBaseAlert(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + message.currencyPair = object.currencyPair !== undefined && object.currencyPair !== null ? CurrencyPair.fromPartial(object.currencyPair) : undefined; + return message; + }, + fromAmino(object: AlertAmino): Alert { + const message = createBaseAlert(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.currency_pair !== undefined && object.currency_pair !== null) { + message.currencyPair = CurrencyPair.fromAmino(object.currency_pair); + } + return message; + }, + toAmino(message: Alert): AlertAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.currency_pair = message.currencyPair ? CurrencyPair.toAmino(message.currencyPair) : undefined; + return obj; + }, + fromAminoMsg(object: AlertAminoMsg): Alert { + return Alert.fromAmino(object.value); + }, + toAminoMsg(message: Alert): AlertAminoMsg { + return { + type: "slinky/x/alerts/Alert", + value: Alert.toAmino(message) + }; + }, + fromProtoMsg(message: AlertProtoMsg): Alert { + return Alert.decode(message.value); + }, + toProto(message: Alert): Uint8Array { + return Alert.encode(message).finish(); + }, + toProtoMsg(message: Alert): AlertProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.Alert", + value: Alert.encode(message).finish() + }; + } +}; +function createBaseAlertStatus(): AlertStatus { + return { + conclusionStatus: BigInt(0), + submissionHeight: BigInt(0), + submissionTimestamp: BigInt(0), + purgeHeight: BigInt(0) + }; +} +export const AlertStatus = { + typeUrl: "/slinky.alerts.v1.AlertStatus", + encode(message: AlertStatus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.conclusionStatus !== BigInt(0)) { + writer.uint32(8).uint64(message.conclusionStatus); + } + if (message.submissionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.submissionHeight); + } + if (message.submissionTimestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.submissionTimestamp); + } + if (message.purgeHeight !== BigInt(0)) { + writer.uint32(32).uint64(message.purgeHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AlertStatus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAlertStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conclusionStatus = reader.uint64(); + break; + case 2: + message.submissionHeight = reader.uint64(); + break; + case 3: + message.submissionTimestamp = reader.uint64(); + break; + case 4: + message.purgeHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AlertStatus { + const message = createBaseAlertStatus(); + message.conclusionStatus = object.conclusionStatus !== undefined && object.conclusionStatus !== null ? BigInt(object.conclusionStatus.toString()) : BigInt(0); + message.submissionHeight = object.submissionHeight !== undefined && object.submissionHeight !== null ? BigInt(object.submissionHeight.toString()) : BigInt(0); + message.submissionTimestamp = object.submissionTimestamp !== undefined && object.submissionTimestamp !== null ? BigInt(object.submissionTimestamp.toString()) : BigInt(0); + message.purgeHeight = object.purgeHeight !== undefined && object.purgeHeight !== null ? BigInt(object.purgeHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AlertStatusAmino): AlertStatus { + const message = createBaseAlertStatus(); + if (object.conclusion_status !== undefined && object.conclusion_status !== null) { + message.conclusionStatus = BigInt(object.conclusion_status); + } + if (object.submission_height !== undefined && object.submission_height !== null) { + message.submissionHeight = BigInt(object.submission_height); + } + if (object.submission_timestamp !== undefined && object.submission_timestamp !== null) { + message.submissionTimestamp = BigInt(object.submission_timestamp); + } + if (object.purge_height !== undefined && object.purge_height !== null) { + message.purgeHeight = BigInt(object.purge_height); + } + return message; + }, + toAmino(message: AlertStatus): AlertStatusAmino { + const obj: any = {}; + obj.conclusion_status = message.conclusionStatus !== BigInt(0) ? message.conclusionStatus.toString() : undefined; + obj.submission_height = message.submissionHeight !== BigInt(0) ? message.submissionHeight.toString() : undefined; + obj.submission_timestamp = message.submissionTimestamp !== BigInt(0) ? message.submissionTimestamp.toString() : undefined; + obj.purge_height = message.purgeHeight !== BigInt(0) ? message.purgeHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AlertStatusAminoMsg): AlertStatus { + return AlertStatus.fromAmino(object.value); + }, + toAminoMsg(message: AlertStatus): AlertStatusAminoMsg { + return { + type: "slinky/x/alerts/AlertStatus", + value: AlertStatus.toAmino(message) + }; + }, + fromProtoMsg(message: AlertStatusProtoMsg): AlertStatus { + return AlertStatus.decode(message.value); + }, + toProto(message: AlertStatus): Uint8Array { + return AlertStatus.encode(message).finish(); + }, + toProtoMsg(message: AlertStatus): AlertStatusProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.AlertStatus", + value: AlertStatus.encode(message).finish() + }; + } +}; +function createBaseAlertWithStatus(): AlertWithStatus { + return { + alert: Alert.fromPartial({}), + status: AlertStatus.fromPartial({}) + }; +} +export const AlertWithStatus = { + typeUrl: "/slinky.alerts.v1.AlertWithStatus", + encode(message: AlertWithStatus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.alert !== undefined) { + Alert.encode(message.alert, writer.uint32(10).fork()).ldelim(); + } + if (message.status !== undefined) { + AlertStatus.encode(message.status, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AlertWithStatus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAlertWithStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alert = Alert.decode(reader, reader.uint32()); + break; + case 2: + message.status = AlertStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AlertWithStatus { + const message = createBaseAlertWithStatus(); + message.alert = object.alert !== undefined && object.alert !== null ? Alert.fromPartial(object.alert) : undefined; + message.status = object.status !== undefined && object.status !== null ? AlertStatus.fromPartial(object.status) : undefined; + return message; + }, + fromAmino(object: AlertWithStatusAmino): AlertWithStatus { + const message = createBaseAlertWithStatus(); + if (object.alert !== undefined && object.alert !== null) { + message.alert = Alert.fromAmino(object.alert); + } + if (object.status !== undefined && object.status !== null) { + message.status = AlertStatus.fromAmino(object.status); + } + return message; + }, + toAmino(message: AlertWithStatus): AlertWithStatusAmino { + const obj: any = {}; + obj.alert = message.alert ? Alert.toAmino(message.alert) : undefined; + obj.status = message.status ? AlertStatus.toAmino(message.status) : undefined; + return obj; + }, + fromAminoMsg(object: AlertWithStatusAminoMsg): AlertWithStatus { + return AlertWithStatus.fromAmino(object.value); + }, + toAminoMsg(message: AlertWithStatus): AlertWithStatusAminoMsg { + return { + type: "slinky/x/alerts/AlertWithStatus", + value: AlertWithStatus.toAmino(message) + }; + }, + fromProtoMsg(message: AlertWithStatusProtoMsg): AlertWithStatus { + return AlertWithStatus.decode(message.value); + }, + toProto(message: AlertWithStatus): Uint8Array { + return AlertWithStatus.encode(message).finish(); + }, + toProtoMsg(message: AlertWithStatus): AlertWithStatusProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.AlertWithStatus", + value: AlertWithStatus.encode(message).finish() + }; + } +}; +function createBaseSignature(): Signature { + return { + signer: "", + signature: new Uint8Array() + }; +} +export const Signature = { + typeUrl: "/slinky.alerts.v1.Signature", + encode(message: Signature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.signature.length !== 0) { + writer.uint32(18).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Signature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignature(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Signature { + const message = createBaseSignature(); + message.signer = object.signer ?? ""; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignatureAmino): Signature { + const message = createBaseSignature(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: Signature): SignatureAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: SignatureAminoMsg): Signature { + return Signature.fromAmino(object.value); + }, + fromProtoMsg(message: SignatureProtoMsg): Signature { + return Signature.decode(message.value); + }, + toProto(message: Signature): Uint8Array { + return Signature.encode(message).finish(); + }, + toProtoMsg(message: Signature): SignatureProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.Signature", + value: Signature.encode(message).finish() + }; + } +}; +function createBaseMultiSigConclusion(): MultiSigConclusion { + return { + $typeUrl: "/slinky.alerts.v1.MultiSigConclusion", + alert: Alert.fromPartial({}), + signatures: [], + priceBound: PriceBound.fromPartial({}), + status: false, + currencyPairID: BigInt(0) + }; +} +export const MultiSigConclusion = { + typeUrl: "/slinky.alerts.v1.MultiSigConclusion", + encode(message: MultiSigConclusion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.alert !== undefined) { + Alert.encode(message.alert, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signatures) { + Signature.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.priceBound !== undefined) { + PriceBound.encode(message.priceBound, writer.uint32(34).fork()).ldelim(); + } + if (message.status === true) { + writer.uint32(40).bool(message.status); + } + if (message.currencyPairID !== BigInt(0)) { + writer.uint32(48).uint64(message.currencyPairID); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MultiSigConclusion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMultiSigConclusion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alert = Alert.decode(reader, reader.uint32()); + break; + case 3: + message.signatures.push(Signature.decode(reader, reader.uint32())); + break; + case 4: + message.priceBound = PriceBound.decode(reader, reader.uint32()); + break; + case 5: + message.status = reader.bool(); + break; + case 6: + message.currencyPairID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MultiSigConclusion { + const message = createBaseMultiSigConclusion(); + message.alert = object.alert !== undefined && object.alert !== null ? Alert.fromPartial(object.alert) : undefined; + message.signatures = object.signatures?.map(e => Signature.fromPartial(e)) || []; + message.priceBound = object.priceBound !== undefined && object.priceBound !== null ? PriceBound.fromPartial(object.priceBound) : undefined; + message.status = object.status ?? false; + message.currencyPairID = object.currencyPairID !== undefined && object.currencyPairID !== null ? BigInt(object.currencyPairID.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MultiSigConclusionAmino): MultiSigConclusion { + const message = createBaseMultiSigConclusion(); + if (object.alert !== undefined && object.alert !== null) { + message.alert = Alert.fromAmino(object.alert); + } + message.signatures = object.signatures?.map(e => Signature.fromAmino(e)) || []; + if (object.price_bound !== undefined && object.price_bound !== null) { + message.priceBound = PriceBound.fromAmino(object.price_bound); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.currency_pair_i_d !== undefined && object.currency_pair_i_d !== null) { + message.currencyPairID = BigInt(object.currency_pair_i_d); + } + return message; + }, + toAmino(message: MultiSigConclusion): MultiSigConclusionAmino { + const obj: any = {}; + obj.alert = message.alert ? Alert.toAmino(message.alert) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? Signature.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + obj.price_bound = message.priceBound ? PriceBound.toAmino(message.priceBound) : undefined; + obj.status = message.status === false ? undefined : message.status; + obj.currency_pair_i_d = message.currencyPairID !== BigInt(0) ? message.currencyPairID.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MultiSigConclusionAminoMsg): MultiSigConclusion { + return MultiSigConclusion.fromAmino(object.value); + }, + toAminoMsg(message: MultiSigConclusion): MultiSigConclusionAminoMsg { + return { + type: "slinky/x/alerts/Conclusion", + value: MultiSigConclusion.toAmino(message) + }; + }, + fromProtoMsg(message: MultiSigConclusionProtoMsg): MultiSigConclusion { + return MultiSigConclusion.decode(message.value); + }, + toProto(message: MultiSigConclusion): Uint8Array { + return MultiSigConclusion.encode(message).finish(); + }, + toProtoMsg(message: MultiSigConclusion): MultiSigConclusionProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MultiSigConclusion", + value: MultiSigConclusion.encode(message).finish() + }; + } +}; +function createBaseMultiSigConclusionVerificationParams(): MultiSigConclusionVerificationParams { + return { + $typeUrl: "/slinky.alerts.v1.MultiSigConclusionVerificationParams", + signers: [] + }; +} +export const MultiSigConclusionVerificationParams = { + typeUrl: "/slinky.alerts.v1.MultiSigConclusionVerificationParams", + encode(message: MultiSigConclusionVerificationParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.signers) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MultiSigConclusionVerificationParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMultiSigConclusionVerificationParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signers.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MultiSigConclusionVerificationParams { + const message = createBaseMultiSigConclusionVerificationParams(); + message.signers = object.signers?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MultiSigConclusionVerificationParamsAmino): MultiSigConclusionVerificationParams { + const message = createBaseMultiSigConclusionVerificationParams(); + message.signers = object.signers?.map(e => Any.fromAmino(e)) || []; + return message; + }, + toAmino(message: MultiSigConclusionVerificationParams): MultiSigConclusionVerificationParamsAmino { + const obj: any = {}; + if (message.signers) { + obj.signers = message.signers.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.signers = message.signers; + } + return obj; + }, + fromAminoMsg(object: MultiSigConclusionVerificationParamsAminoMsg): MultiSigConclusionVerificationParams { + return MultiSigConclusionVerificationParams.fromAmino(object.value); + }, + toAminoMsg(message: MultiSigConclusionVerificationParams): MultiSigConclusionVerificationParamsAminoMsg { + return { + type: "slinky/x/alerts/ConclusionVerificationParams", + value: MultiSigConclusionVerificationParams.toAmino(message) + }; + }, + fromProtoMsg(message: MultiSigConclusionVerificationParamsProtoMsg): MultiSigConclusionVerificationParams { + return MultiSigConclusionVerificationParams.decode(message.value); + }, + toProto(message: MultiSigConclusionVerificationParams): Uint8Array { + return MultiSigConclusionVerificationParams.encode(message).finish(); + }, + toProtoMsg(message: MultiSigConclusionVerificationParams): MultiSigConclusionVerificationParamsProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MultiSigConclusionVerificationParams", + value: MultiSigConclusionVerificationParams.encode(message).finish() + }; + } +}; +function createBasePriceBound(): PriceBound { + return { + high: "", + low: "" + }; +} +export const PriceBound = { + typeUrl: "/slinky.alerts.v1.PriceBound", + encode(message: PriceBound, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.high !== "") { + writer.uint32(10).string(message.high); + } + if (message.low !== "") { + writer.uint32(18).string(message.low); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceBound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceBound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.high = reader.string(); + break; + case 2: + message.low = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PriceBound { + const message = createBasePriceBound(); + message.high = object.high ?? ""; + message.low = object.low ?? ""; + return message; + }, + fromAmino(object: PriceBoundAmino): PriceBound { + const message = createBasePriceBound(); + if (object.high !== undefined && object.high !== null) { + message.high = object.high; + } + if (object.low !== undefined && object.low !== null) { + message.low = object.low; + } + return message; + }, + toAmino(message: PriceBound): PriceBoundAmino { + const obj: any = {}; + obj.high = message.high === "" ? undefined : message.high; + obj.low = message.low === "" ? undefined : message.low; + return obj; + }, + fromAminoMsg(object: PriceBoundAminoMsg): PriceBound { + return PriceBound.fromAmino(object.value); + }, + fromProtoMsg(message: PriceBoundProtoMsg): PriceBound { + return PriceBound.decode(message.value); + }, + toProto(message: PriceBound): Uint8Array { + return PriceBound.encode(message).finish(); + }, + toProtoMsg(message: PriceBound): PriceBoundProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.PriceBound", + value: PriceBound.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/genesis.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/genesis.ts new file mode 100644 index 00000000..cacfef1c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/genesis.ts @@ -0,0 +1,545 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { AlertWithStatus, AlertWithStatusAmino, AlertWithStatusSDKType, MultiSigConclusionVerificationParams, MultiSigConclusionVerificationParamsProtoMsg, MultiSigConclusionVerificationParamsSDKType } from "./alerts"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * AlertParams is the set of parameters for the x/Alerts module's Alerting. It + * defines whether or not Alerts can be submitted, and if so, the minimum + * bond amount required to submit an Alert. + */ +export interface AlertParams { + /** + * Enabled is a boolean defining whether or not Alerts can be submitted + * to the module + */ + enabled: boolean; + /** + * BondAmount is the minimum amount of bond required to submit an + * Alert + */ + bondAmount: Coin; + /** + * MaxBlockAge defines the maximum age of an Alert before it is pruned, notice + * this is defined wrt. the height that the Alert references, i.e Alerts are + * only relevant until Alert.Height + MaxBlockAge is reached. + */ + maxBlockAge: bigint; +} +export interface AlertParamsProtoMsg { + typeUrl: "/slinky.alerts.v1.AlertParams"; + value: Uint8Array; +} +/** + * AlertParams is the set of parameters for the x/Alerts module's Alerting. It + * defines whether or not Alerts can be submitted, and if so, the minimum + * bond amount required to submit an Alert. + */ +export interface AlertParamsAmino { + /** + * Enabled is a boolean defining whether or not Alerts can be submitted + * to the module + */ + enabled?: boolean; + /** + * BondAmount is the minimum amount of bond required to submit an + * Alert + */ + bond_amount: CoinAmino; + /** + * MaxBlockAge defines the maximum age of an Alert before it is pruned, notice + * this is defined wrt. the height that the Alert references, i.e Alerts are + * only relevant until Alert.Height + MaxBlockAge is reached. + */ + max_block_age?: string; +} +export interface AlertParamsAminoMsg { + type: "/slinky.alerts.v1.AlertParams"; + value: AlertParamsAmino; +} +/** + * AlertParams is the set of parameters for the x/Alerts module's Alerting. It + * defines whether or not Alerts can be submitted, and if so, the minimum + * bond amount required to submit an Alert. + */ +export interface AlertParamsSDKType { + enabled: boolean; + bond_amount: CoinSDKType; + max_block_age: bigint; +} +/** PruningParams defines the criterion for pruning Alerts from the state. */ +export interface PruningParams { + /** Enabled defines whether Alerts are to be pruned */ + enabled: boolean; + /** + * BlocksToPrune defines the number of blocks until an Alert will be pruned + * from state, notice this is defined wrt. the current block height, i.e + * Alerts will be stored in state until current_height + BlocksToPrune is + * reached. + */ + blocksToPrune: bigint; +} +export interface PruningParamsProtoMsg { + typeUrl: "/slinky.alerts.v1.PruningParams"; + value: Uint8Array; +} +/** PruningParams defines the criterion for pruning Alerts from the state. */ +export interface PruningParamsAmino { + /** Enabled defines whether Alerts are to be pruned */ + enabled?: boolean; + /** + * BlocksToPrune defines the number of blocks until an Alert will be pruned + * from state, notice this is defined wrt. the current block height, i.e + * Alerts will be stored in state until current_height + BlocksToPrune is + * reached. + */ + blocks_to_prune?: string; +} +export interface PruningParamsAminoMsg { + type: "/slinky.alerts.v1.PruningParams"; + value: PruningParamsAmino; +} +/** PruningParams defines the criterion for pruning Alerts from the state. */ +export interface PruningParamsSDKType { + enabled: boolean; + blocks_to_prune: bigint; +} +/** Params is the set of parameters for the x/Alerts module. */ +export interface Params { + /** AlertParams is the set of parameters for the x/Alerts module's Alerting. */ + alertParams: AlertParams; + /** + * ConclusionVerificationParams is the set of parameters for the x/Alerts + * module's conclusion verification. + */ + conclusionVerificationParams?: MultiSigConclusionVerificationParams | Any | undefined; + /** PruningParams is the set of parameters for the x/Alerts module's pruning. */ + pruningParams: PruningParams; +} +export interface ParamsProtoMsg { + typeUrl: "/slinky.alerts.v1.Params"; + value: Uint8Array; +} +export type ParamsEncoded = Omit & { + /** + * ConclusionVerificationParams is the set of parameters for the x/Alerts + * module's conclusion verification. + */ + conclusionVerificationParams?: MultiSigConclusionVerificationParamsProtoMsg | AnyProtoMsg | undefined; +}; +/** Params is the set of parameters for the x/Alerts module. */ +export interface ParamsAmino { + /** AlertParams is the set of parameters for the x/Alerts module's Alerting. */ + alert_params?: AlertParamsAmino; + /** + * ConclusionVerificationParams is the set of parameters for the x/Alerts + * module's conclusion verification. + */ + conclusion_verification_params?: AnyAmino; + /** PruningParams is the set of parameters for the x/Alerts module's pruning. */ + pruning_params?: PruningParamsAmino; +} +export interface ParamsAminoMsg { + type: "/slinky.alerts.v1.Params"; + value: ParamsAmino; +} +/** Params is the set of parameters for the x/Alerts module. */ +export interface ParamsSDKType { + alert_params: AlertParamsSDKType; + conclusion_verification_params?: MultiSigConclusionVerificationParamsSDKType | AnySDKType | undefined; + pruning_params: PruningParamsSDKType; +} +/** + * GenesisState is the state that must be provided at genesis. It contains + * params for the module, and the set initial Alerts. + */ +export interface GenesisState { + /** Params is the set of x/Alerts parameters */ + params: Params; + /** Alerts is the set of Alerts that have been submitted to the module */ + alerts: AlertWithStatus[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/slinky.alerts.v1.GenesisState"; + value: Uint8Array; +} +/** + * GenesisState is the state that must be provided at genesis. It contains + * params for the module, and the set initial Alerts. + */ +export interface GenesisStateAmino { + /** Params is the set of x/Alerts parameters */ + params?: ParamsAmino; + /** Alerts is the set of Alerts that have been submitted to the module */ + alerts?: AlertWithStatusAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/slinky.alerts.v1.GenesisState"; + value: GenesisStateAmino; +} +/** + * GenesisState is the state that must be provided at genesis. It contains + * params for the module, and the set initial Alerts. + */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + alerts: AlertWithStatusSDKType[]; +} +function createBaseAlertParams(): AlertParams { + return { + enabled: false, + bondAmount: Coin.fromPartial({}), + maxBlockAge: BigInt(0) + }; +} +export const AlertParams = { + typeUrl: "/slinky.alerts.v1.AlertParams", + encode(message: AlertParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.bondAmount !== undefined) { + Coin.encode(message.bondAmount, writer.uint32(18).fork()).ldelim(); + } + if (message.maxBlockAge !== BigInt(0)) { + writer.uint32(24).uint64(message.maxBlockAge); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AlertParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAlertParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.bondAmount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.maxBlockAge = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AlertParams { + const message = createBaseAlertParams(); + message.enabled = object.enabled ?? false; + message.bondAmount = object.bondAmount !== undefined && object.bondAmount !== null ? Coin.fromPartial(object.bondAmount) : undefined; + message.maxBlockAge = object.maxBlockAge !== undefined && object.maxBlockAge !== null ? BigInt(object.maxBlockAge.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AlertParamsAmino): AlertParams { + const message = createBaseAlertParams(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.bond_amount !== undefined && object.bond_amount !== null) { + message.bondAmount = Coin.fromAmino(object.bond_amount); + } + if (object.max_block_age !== undefined && object.max_block_age !== null) { + message.maxBlockAge = BigInt(object.max_block_age); + } + return message; + }, + toAmino(message: AlertParams): AlertParamsAmino { + const obj: any = {}; + obj.enabled = message.enabled === false ? undefined : message.enabled; + obj.bond_amount = message.bondAmount ? Coin.toAmino(message.bondAmount) : Coin.toAmino(Coin.fromPartial({})); + obj.max_block_age = message.maxBlockAge !== BigInt(0) ? message.maxBlockAge.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AlertParamsAminoMsg): AlertParams { + return AlertParams.fromAmino(object.value); + }, + fromProtoMsg(message: AlertParamsProtoMsg): AlertParams { + return AlertParams.decode(message.value); + }, + toProto(message: AlertParams): Uint8Array { + return AlertParams.encode(message).finish(); + }, + toProtoMsg(message: AlertParams): AlertParamsProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.AlertParams", + value: AlertParams.encode(message).finish() + }; + } +}; +function createBasePruningParams(): PruningParams { + return { + enabled: false, + blocksToPrune: BigInt(0) + }; +} +export const PruningParams = { + typeUrl: "/slinky.alerts.v1.PruningParams", + encode(message: PruningParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.blocksToPrune !== BigInt(0)) { + writer.uint32(16).uint64(message.blocksToPrune); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PruningParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePruningParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.blocksToPrune = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PruningParams { + const message = createBasePruningParams(); + message.enabled = object.enabled ?? false; + message.blocksToPrune = object.blocksToPrune !== undefined && object.blocksToPrune !== null ? BigInt(object.blocksToPrune.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PruningParamsAmino): PruningParams { + const message = createBasePruningParams(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.blocks_to_prune !== undefined && object.blocks_to_prune !== null) { + message.blocksToPrune = BigInt(object.blocks_to_prune); + } + return message; + }, + toAmino(message: PruningParams): PruningParamsAmino { + const obj: any = {}; + obj.enabled = message.enabled === false ? undefined : message.enabled; + obj.blocks_to_prune = message.blocksToPrune !== BigInt(0) ? message.blocksToPrune.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PruningParamsAminoMsg): PruningParams { + return PruningParams.fromAmino(object.value); + }, + fromProtoMsg(message: PruningParamsProtoMsg): PruningParams { + return PruningParams.decode(message.value); + }, + toProto(message: PruningParams): Uint8Array { + return PruningParams.encode(message).finish(); + }, + toProtoMsg(message: PruningParams): PruningParamsProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.PruningParams", + value: PruningParams.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + alertParams: AlertParams.fromPartial({}), + conclusionVerificationParams: undefined, + pruningParams: PruningParams.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/slinky.alerts.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.alertParams !== undefined) { + AlertParams.encode(message.alertParams, writer.uint32(10).fork()).ldelim(); + } + if (message.conclusionVerificationParams !== undefined) { + Any.encode(message.conclusionVerificationParams as Any, writer.uint32(18).fork()).ldelim(); + } + if (message.pruningParams !== undefined) { + PruningParams.encode(message.pruningParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alertParams = AlertParams.decode(reader, reader.uint32()); + break; + case 2: + message.conclusionVerificationParams = Slinky_alertsv1ConclusionVerificationParams_InterfaceDecoder(reader) as Any; + break; + case 3: + message.pruningParams = PruningParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.alertParams = object.alertParams !== undefined && object.alertParams !== null ? AlertParams.fromPartial(object.alertParams) : undefined; + message.conclusionVerificationParams = object.conclusionVerificationParams !== undefined && object.conclusionVerificationParams !== null ? Any.fromPartial(object.conclusionVerificationParams) : undefined; + message.pruningParams = object.pruningParams !== undefined && object.pruningParams !== null ? PruningParams.fromPartial(object.pruningParams) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.alert_params !== undefined && object.alert_params !== null) { + message.alertParams = AlertParams.fromAmino(object.alert_params); + } + if (object.conclusion_verification_params !== undefined && object.conclusion_verification_params !== null) { + message.conclusionVerificationParams = Slinky_alertsv1ConclusionVerificationParams_FromAmino(object.conclusion_verification_params); + } + if (object.pruning_params !== undefined && object.pruning_params !== null) { + message.pruningParams = PruningParams.fromAmino(object.pruning_params); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.alert_params = message.alertParams ? AlertParams.toAmino(message.alertParams) : undefined; + obj.conclusion_verification_params = message.conclusionVerificationParams ? Slinky_alertsv1ConclusionVerificationParams_ToAmino(message.conclusionVerificationParams as Any) : undefined; + obj.pruning_params = message.pruningParams ? PruningParams.toAmino(message.pruningParams) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + alerts: [] + }; +} +export const GenesisState = { + typeUrl: "/slinky.alerts.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.alerts) { + AlertWithStatus.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.alerts.push(AlertWithStatus.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.alerts = object.alerts?.map(e => AlertWithStatus.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.alerts = object.alerts?.map(e => AlertWithStatus.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.alerts) { + obj.alerts = message.alerts.map(e => e ? AlertWithStatus.toAmino(e) : undefined); + } else { + obj.alerts = message.alerts; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +export const Slinky_alertsv1ConclusionVerificationParams_InterfaceDecoder = (input: BinaryReader | Uint8Array): MultiSigConclusionVerificationParams | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/slinky.alerts.v1.MultiSigConclusionVerificationParams": + return MultiSigConclusionVerificationParams.decode(data.value); + default: + return data; + } +}; +export const Slinky_alertsv1ConclusionVerificationParams_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "slinky/x/alerts/ConclusionVerificationParams": + return Any.fromPartial({ + typeUrl: "/slinky.alerts.v1.MultiSigConclusionVerificationParams", + value: MultiSigConclusionVerificationParams.encode(MultiSigConclusionVerificationParams.fromPartial(MultiSigConclusionVerificationParams.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Slinky_alertsv1ConclusionVerificationParams_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/slinky.alerts.v1.MultiSigConclusionVerificationParams": + return { + type: "slinky/x/alerts/ConclusionVerificationParams", + value: MultiSigConclusionVerificationParams.toAmino(MultiSigConclusionVerificationParams.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/query.rpc.Query.ts new file mode 100644 index 00000000..57bcbfef --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/query.rpc.Query.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { AlertsRequest, AlertsResponse, ParamsRequest, ParamsResponse } from "./query"; +/** Query is the query service for the x/alerts module. */ +export interface Query { + /** + * Alerts gets all alerts in state under the given status. If no status is + * given, all Alerts are returned + */ + alerts(request: AlertsRequest): Promise; + params(request?: ParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.alerts = this.alerts.bind(this); + this.params = this.params.bind(this); + } + alerts(request: AlertsRequest): Promise { + const data = AlertsRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.alerts.v1.Query", "Alerts", data); + return promise.then(data => AlertsResponse.decode(new BinaryReader(data))); + } + params(request: ParamsRequest = {}): Promise { + const data = ParamsRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.alerts.v1.Query", "Params", data); + return promise.then(data => ParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + alerts(request: AlertsRequest): Promise { + return queryService.alerts(request); + }, + params(request?: ParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/query.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/query.ts new file mode 100644 index 00000000..4b988b1e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/query.ts @@ -0,0 +1,391 @@ +//@ts-nocheck +import { Alert, AlertAmino, AlertSDKType } from "./alerts"; +import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * AlertStatus is the type for the status of an Alert, it can be Unconcluded or + * Concluded. + */ +export enum AlertStatusID { + CONCLUSION_STATUS_UNSPECIFIED = 0, + CONCLUSION_STATUS_UNCONCLUDED = 1, + CONCLUSION_STATUS_CONCLUDED = 2, + UNRECOGNIZED = -1, +} +export const AlertStatusIDSDKType = AlertStatusID; +export const AlertStatusIDAmino = AlertStatusID; +export function alertStatusIDFromJSON(object: any): AlertStatusID { + switch (object) { + case 0: + case "CONCLUSION_STATUS_UNSPECIFIED": + return AlertStatusID.CONCLUSION_STATUS_UNSPECIFIED; + case 1: + case "CONCLUSION_STATUS_UNCONCLUDED": + return AlertStatusID.CONCLUSION_STATUS_UNCONCLUDED; + case 2: + case "CONCLUSION_STATUS_CONCLUDED": + return AlertStatusID.CONCLUSION_STATUS_CONCLUDED; + case -1: + case "UNRECOGNIZED": + default: + return AlertStatusID.UNRECOGNIZED; + } +} +export function alertStatusIDToJSON(object: AlertStatusID): string { + switch (object) { + case AlertStatusID.CONCLUSION_STATUS_UNSPECIFIED: + return "CONCLUSION_STATUS_UNSPECIFIED"; + case AlertStatusID.CONCLUSION_STATUS_UNCONCLUDED: + return "CONCLUSION_STATUS_UNCONCLUDED"; + case AlertStatusID.CONCLUSION_STATUS_CONCLUDED: + return "CONCLUSION_STATUS_CONCLUDED"; + case AlertStatusID.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * AlertsRequest is the request type for the Query.Alerts RPC method, the status + * field indicates whether the request should return only Unconcluded / + * Concluded Alerts, or all Alerts. + */ +export interface AlertsRequest { + status: AlertStatusID; +} +export interface AlertsRequestProtoMsg { + typeUrl: "/slinky.alerts.v1.AlertsRequest"; + value: Uint8Array; +} +/** + * AlertsRequest is the request type for the Query.Alerts RPC method, the status + * field indicates whether the request should return only Unconcluded / + * Concluded Alerts, or all Alerts. + */ +export interface AlertsRequestAmino { + status?: AlertStatusID; +} +export interface AlertsRequestAminoMsg { + type: "/slinky.alerts.v1.AlertsRequest"; + value: AlertsRequestAmino; +} +/** + * AlertsRequest is the request type for the Query.Alerts RPC method, the status + * field indicates whether the request should return only Unconcluded / + * Concluded Alerts, or all Alerts. + */ +export interface AlertsRequestSDKType { + status: AlertStatusID; +} +/** + * AlertsResponse is the response type for the Query.Alerts RPC method, it + * contains the list of Alerts that are being tracked by the alerts module. + */ +export interface AlertsResponse { + alerts: Alert[]; +} +export interface AlertsResponseProtoMsg { + typeUrl: "/slinky.alerts.v1.AlertsResponse"; + value: Uint8Array; +} +/** + * AlertsResponse is the response type for the Query.Alerts RPC method, it + * contains the list of Alerts that are being tracked by the alerts module. + */ +export interface AlertsResponseAmino { + alerts?: AlertAmino[]; +} +export interface AlertsResponseAminoMsg { + type: "/slinky.alerts.v1.AlertsResponse"; + value: AlertsResponseAmino; +} +/** + * AlertsResponse is the response type for the Query.Alerts RPC method, it + * contains the list of Alerts that are being tracked by the alerts module. + */ +export interface AlertsResponseSDKType { + alerts: AlertSDKType[]; +} +/** ParamsRequest is the request type for the Query.Params RPC method. */ +export interface ParamsRequest {} +export interface ParamsRequestProtoMsg { + typeUrl: "/slinky.alerts.v1.ParamsRequest"; + value: Uint8Array; +} +/** ParamsRequest is the request type for the Query.Params RPC method. */ +export interface ParamsRequestAmino {} +export interface ParamsRequestAminoMsg { + type: "/slinky.alerts.v1.ParamsRequest"; + value: ParamsRequestAmino; +} +/** ParamsRequest is the request type for the Query.Params RPC method. */ +export interface ParamsRequestSDKType {} +/** + * ParamsResponse is the response type for the Query.Params RPC method, it + * contains the Params of the module. + */ +export interface ParamsResponse { + params: Params; +} +export interface ParamsResponseProtoMsg { + typeUrl: "/slinky.alerts.v1.ParamsResponse"; + value: Uint8Array; +} +/** + * ParamsResponse is the response type for the Query.Params RPC method, it + * contains the Params of the module. + */ +export interface ParamsResponseAmino { + params?: ParamsAmino; +} +export interface ParamsResponseAminoMsg { + type: "/slinky.alerts.v1.ParamsResponse"; + value: ParamsResponseAmino; +} +/** + * ParamsResponse is the response type for the Query.Params RPC method, it + * contains the Params of the module. + */ +export interface ParamsResponseSDKType { + params: ParamsSDKType; +} +function createBaseAlertsRequest(): AlertsRequest { + return { + status: 0 + }; +} +export const AlertsRequest = { + typeUrl: "/slinky.alerts.v1.AlertsRequest", + encode(message: AlertsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AlertsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAlertsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AlertsRequest { + const message = createBaseAlertsRequest(); + message.status = object.status ?? 0; + return message; + }, + fromAmino(object: AlertsRequestAmino): AlertsRequest { + const message = createBaseAlertsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: AlertsRequest): AlertsRequestAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: AlertsRequestAminoMsg): AlertsRequest { + return AlertsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: AlertsRequestProtoMsg): AlertsRequest { + return AlertsRequest.decode(message.value); + }, + toProto(message: AlertsRequest): Uint8Array { + return AlertsRequest.encode(message).finish(); + }, + toProtoMsg(message: AlertsRequest): AlertsRequestProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.AlertsRequest", + value: AlertsRequest.encode(message).finish() + }; + } +}; +function createBaseAlertsResponse(): AlertsResponse { + return { + alerts: [] + }; +} +export const AlertsResponse = { + typeUrl: "/slinky.alerts.v1.AlertsResponse", + encode(message: AlertsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.alerts) { + Alert.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AlertsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAlertsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alerts.push(Alert.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AlertsResponse { + const message = createBaseAlertsResponse(); + message.alerts = object.alerts?.map(e => Alert.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AlertsResponseAmino): AlertsResponse { + const message = createBaseAlertsResponse(); + message.alerts = object.alerts?.map(e => Alert.fromAmino(e)) || []; + return message; + }, + toAmino(message: AlertsResponse): AlertsResponseAmino { + const obj: any = {}; + if (message.alerts) { + obj.alerts = message.alerts.map(e => e ? Alert.toAmino(e) : undefined); + } else { + obj.alerts = message.alerts; + } + return obj; + }, + fromAminoMsg(object: AlertsResponseAminoMsg): AlertsResponse { + return AlertsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: AlertsResponseProtoMsg): AlertsResponse { + return AlertsResponse.decode(message.value); + }, + toProto(message: AlertsResponse): Uint8Array { + return AlertsResponse.encode(message).finish(); + }, + toProtoMsg(message: AlertsResponse): AlertsResponseProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.AlertsResponse", + value: AlertsResponse.encode(message).finish() + }; + } +}; +function createBaseParamsRequest(): ParamsRequest { + return {}; +} +export const ParamsRequest = { + typeUrl: "/slinky.alerts.v1.ParamsRequest", + encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + fromAmino(_: ParamsRequestAmino): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + toAmino(_: ParamsRequest): ParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsRequestAminoMsg): ParamsRequest { + return ParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsRequestProtoMsg): ParamsRequest { + return ParamsRequest.decode(message.value); + }, + toProto(message: ParamsRequest): Uint8Array { + return ParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: ParamsRequest): ParamsRequestProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.ParamsRequest", + value: ParamsRequest.encode(message).finish() + }; + } +}; +function createBaseParamsResponse(): ParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const ParamsResponse = { + typeUrl: "/slinky.alerts.v1.ParamsResponse", + encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParamsResponse { + const message = createBaseParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: ParamsResponseAmino): ParamsResponse { + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: ParamsResponse): ParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsResponseAminoMsg): ParamsResponse { + return ParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsResponseProtoMsg): ParamsResponse { + return ParamsResponse.decode(message.value); + }, + toProto(message: ParamsResponse): Uint8Array { + return ParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: ParamsResponse): ParamsResponseProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.ParamsResponse", + value: ParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/strategies.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/strategies.ts new file mode 100644 index 00000000..a21f40ab --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/strategies.ts @@ -0,0 +1,149 @@ +//@ts-nocheck +import { Validator, ValidatorAmino, ValidatorSDKType } from "../../../tendermint/abci/types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * ValidatorAlertIncentive defines the incentive strategy to be executed for a + * validator that has been confirmed to have at fault for an x/alerts alert. + * This strategy is expected to slash half of the validator's stake. + */ +export interface ValidatorAlertIncentive { + $typeUrl?: "/slinky.alerts.v1.ValidatorAlertIncentive"; + /** The validator that has been confirmed to have been at fault for an alert. */ + validator: Validator; + /** + * AlertSigner is the signer of the alert referenced by the conclusion that + * created this incentive. + */ + alertSigner: string; + /** AlertHeight is the height at which the infraction occurred */ + alertHeight: bigint; +} +export interface ValidatorAlertIncentiveProtoMsg { + typeUrl: "/slinky.alerts.v1.ValidatorAlertIncentive"; + value: Uint8Array; +} +/** + * ValidatorAlertIncentive defines the incentive strategy to be executed for a + * validator that has been confirmed to have at fault for an x/alerts alert. + * This strategy is expected to slash half of the validator's stake. + */ +export interface ValidatorAlertIncentiveAmino { + /** The validator that has been confirmed to have been at fault for an alert. */ + validator?: ValidatorAmino; + /** + * AlertSigner is the signer of the alert referenced by the conclusion that + * created this incentive. + */ + alert_signer?: string; + /** AlertHeight is the height at which the infraction occurred */ + alert_height?: string; +} +export interface ValidatorAlertIncentiveAminoMsg { + type: "slinky/x/alerts/ValidatorAlertIncentive"; + value: ValidatorAlertIncentiveAmino; +} +/** + * ValidatorAlertIncentive defines the incentive strategy to be executed for a + * validator that has been confirmed to have at fault for an x/alerts alert. + * This strategy is expected to slash half of the validator's stake. + */ +export interface ValidatorAlertIncentiveSDKType { + $typeUrl?: "/slinky.alerts.v1.ValidatorAlertIncentive"; + validator: ValidatorSDKType; + alert_signer: string; + alert_height: bigint; +} +function createBaseValidatorAlertIncentive(): ValidatorAlertIncentive { + return { + $typeUrl: "/slinky.alerts.v1.ValidatorAlertIncentive", + validator: Validator.fromPartial({}), + alertSigner: "", + alertHeight: BigInt(0) + }; +} +export const ValidatorAlertIncentive = { + typeUrl: "/slinky.alerts.v1.ValidatorAlertIncentive", + encode(message: ValidatorAlertIncentive, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.alertSigner !== "") { + writer.uint32(18).string(message.alertSigner); + } + if (message.alertHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.alertHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAlertIncentive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorAlertIncentive(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.alertSigner = reader.string(); + break; + case 3: + message.alertHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorAlertIncentive { + const message = createBaseValidatorAlertIncentive(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.alertSigner = object.alertSigner ?? ""; + message.alertHeight = object.alertHeight !== undefined && object.alertHeight !== null ? BigInt(object.alertHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorAlertIncentiveAmino): ValidatorAlertIncentive { + const message = createBaseValidatorAlertIncentive(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.alert_signer !== undefined && object.alert_signer !== null) { + message.alertSigner = object.alert_signer; + } + if (object.alert_height !== undefined && object.alert_height !== null) { + message.alertHeight = BigInt(object.alert_height); + } + return message; + }, + toAmino(message: ValidatorAlertIncentive): ValidatorAlertIncentiveAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.alert_signer = message.alertSigner === "" ? undefined : message.alertSigner; + obj.alert_height = message.alertHeight !== BigInt(0) ? message.alertHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAlertIncentiveAminoMsg): ValidatorAlertIncentive { + return ValidatorAlertIncentive.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorAlertIncentive): ValidatorAlertIncentiveAminoMsg { + return { + type: "slinky/x/alerts/ValidatorAlertIncentive", + value: ValidatorAlertIncentive.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorAlertIncentiveProtoMsg): ValidatorAlertIncentive { + return ValidatorAlertIncentive.decode(message.value); + }, + toProto(message: ValidatorAlertIncentive): Uint8Array { + return ValidatorAlertIncentive.encode(message).finish(); + }, + toProtoMsg(message: ValidatorAlertIncentive): ValidatorAlertIncentiveProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.ValidatorAlertIncentive", + value: ValidatorAlertIncentive.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.amino.ts new file mode 100644 index 00000000..ab1a7ee0 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgAlert, MsgConclusion, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/slinky.alerts.v1.MsgAlert": { + aminoType: "slinky/x/alerts/MsgAlert", + toAmino: MsgAlert.toAmino, + fromAmino: MsgAlert.fromAmino + }, + "/slinky.alerts.v1.MsgConclusion": { + aminoType: "slinky/x/alerts/MsgConclusion", + toAmino: MsgConclusion.toAmino, + fromAmino: MsgConclusion.fromAmino + }, + "/slinky.alerts.v1.MsgUpdateParams": { + aminoType: "slinky/x/alerts/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.registry.ts new file mode 100644 index 00000000..9ebf1789 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAlert, MsgConclusion, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/slinky.alerts.v1.MsgAlert", MsgAlert], ["/slinky.alerts.v1.MsgConclusion", MsgConclusion], ["/slinky.alerts.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + alert(value: MsgAlert) { + return { + typeUrl: "/slinky.alerts.v1.MsgAlert", + value: MsgAlert.encode(value).finish() + }; + }, + conclusion(value: MsgConclusion) { + return { + typeUrl: "/slinky.alerts.v1.MsgConclusion", + value: MsgConclusion.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/slinky.alerts.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + alert(value: MsgAlert) { + return { + typeUrl: "/slinky.alerts.v1.MsgAlert", + value + }; + }, + conclusion(value: MsgConclusion) { + return { + typeUrl: "/slinky.alerts.v1.MsgConclusion", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/slinky.alerts.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + alert(value: MsgAlert) { + return { + typeUrl: "/slinky.alerts.v1.MsgAlert", + value: MsgAlert.fromPartial(value) + }; + }, + conclusion(value: MsgConclusion) { + return { + typeUrl: "/slinky.alerts.v1.MsgConclusion", + value: MsgConclusion.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/slinky.alerts.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..f258c331 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.rpc.msg.ts @@ -0,0 +1,51 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgAlert, MsgAlertResponse, MsgConclusion, MsgConclusionResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg is the message service for the x/alerts module. */ +export interface Msg { + /** + * Alert creates a new alert. On alert creation (if valid), the alert will be + * saved to state, and its bond will be escrowed until a corresponding + * Conclusion is filed to close the alert. + */ + alert(request: MsgAlert): Promise; + /** + * Conclusion closes an alert. On alert conclusion (if valid), the alert will + * be marked as Concluded, the bond for the alert will either be burned or + * returned, and a set of incentives will be issued to the validators deemed + * malicious by the conclusion. + */ + conclusion(request: MsgConclusion): Promise; + /** + * UpdateParams updates the parameters of the alerts module. Specifically, the + * only address that is capable of submitting this Msg is the + * module-authority, in general, the x/gov module-account. The process for + * executing this message will be via governance proposal + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.alert = this.alert.bind(this); + this.conclusion = this.conclusion.bind(this); + this.updateParams = this.updateParams.bind(this); + } + alert(request: MsgAlert): Promise { + const data = MsgAlert.encode(request).finish(); + const promise = this.rpc.request("slinky.alerts.v1.Msg", "Alert", data); + return promise.then(data => MsgAlertResponse.decode(new BinaryReader(data))); + } + conclusion(request: MsgConclusion): Promise { + const data = MsgConclusion.encode(request).finish(); + const promise = this.rpc.request("slinky.alerts.v1.Msg", "Conclusion", data); + return promise.then(data => MsgConclusionResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("slinky.alerts.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.ts b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.ts new file mode 100644 index 00000000..4a0a7b47 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/alerts/v1/tx.ts @@ -0,0 +1,557 @@ +//@ts-nocheck +import { Alert, AlertAmino, AlertSDKType, MultiSigConclusion, MultiSigConclusionProtoMsg, MultiSigConclusionSDKType } from "./alerts"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgAlert defines a message to create an alert. */ +export interface MsgAlert { + /** alert is the alert to be filed */ + alert: Alert; +} +export interface MsgAlertProtoMsg { + typeUrl: "/slinky.alerts.v1.MsgAlert"; + value: Uint8Array; +} +/** MsgAlert defines a message to create an alert. */ +export interface MsgAlertAmino { + /** alert is the alert to be filed */ + alert?: AlertAmino; +} +export interface MsgAlertAminoMsg { + type: "slinky/x/alerts/MsgAlert"; + value: MsgAlertAmino; +} +/** MsgAlert defines a message to create an alert. */ +export interface MsgAlertSDKType { + alert: AlertSDKType; +} +export interface MsgAlertResponse {} +export interface MsgAlertResponseProtoMsg { + typeUrl: "/slinky.alerts.v1.MsgAlertResponse"; + value: Uint8Array; +} +export interface MsgAlertResponseAmino {} +export interface MsgAlertResponseAminoMsg { + type: "/slinky.alerts.v1.MsgAlertResponse"; + value: MsgAlertResponseAmino; +} +export interface MsgAlertResponseSDKType {} +/** + * MsgConclusion defines a message carrying a Conclusion made by the SecondTier, + * which will be used to close an alert. And trigger any ramifications of the + * conclusion. + */ +export interface MsgConclusion { + /** + * signer is the signer of this transaction (notice, this may not always be a + * node from the SecondTier) + */ + signer: string; + /** conclusion is the conclusion to be filed */ + conclusion?: MultiSigConclusion | Any | undefined; +} +export interface MsgConclusionProtoMsg { + typeUrl: "/slinky.alerts.v1.MsgConclusion"; + value: Uint8Array; +} +export type MsgConclusionEncoded = Omit & { + /** conclusion is the conclusion to be filed */conclusion?: MultiSigConclusionProtoMsg | AnyProtoMsg | undefined; +}; +/** + * MsgConclusion defines a message carrying a Conclusion made by the SecondTier, + * which will be used to close an alert. And trigger any ramifications of the + * conclusion. + */ +export interface MsgConclusionAmino { + /** + * signer is the signer of this transaction (notice, this may not always be a + * node from the SecondTier) + */ + signer?: string; + /** conclusion is the conclusion to be filed */ + conclusion?: AnyAmino; +} +export interface MsgConclusionAminoMsg { + type: "slinky/x/alerts/MsgConclusion"; + value: MsgConclusionAmino; +} +/** + * MsgConclusion defines a message carrying a Conclusion made by the SecondTier, + * which will be used to close an alert. And trigger any ramifications of the + * conclusion. + */ +export interface MsgConclusionSDKType { + signer: string; + conclusion?: MultiSigConclusionSDKType | AnySDKType | undefined; +} +export interface MsgConclusionResponse {} +export interface MsgConclusionResponseProtoMsg { + typeUrl: "/slinky.alerts.v1.MsgConclusionResponse"; + value: Uint8Array; +} +export interface MsgConclusionResponseAmino {} +export interface MsgConclusionResponseAminoMsg { + type: "/slinky.alerts.v1.MsgConclusionResponse"; + value: MsgConclusionResponseAmino; +} +export interface MsgConclusionResponseSDKType {} +/** + * MsgUpdateParams defines the message type expected by the UpdateParams rpc. It + * contains an authority address, and the new Params for the x/alerts module. + */ +export interface MsgUpdateParams { + /** authority is the address of the authority that is submitting the update */ + authority: string; + /** params is the new set of parameters for the x/alerts module */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/slinky.alerts.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams defines the message type expected by the UpdateParams rpc. It + * contains an authority address, and the new Params for the x/alerts module. + */ +export interface MsgUpdateParamsAmino { + /** authority is the address of the authority that is submitting the update */ + authority?: string; + /** params is the new set of parameters for the x/alerts module */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "slinky/x/alerts/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams defines the message type expected by the UpdateParams rpc. It + * contains an authority address, and the new Params for the x/alerts module. + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/slinky.alerts.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/slinky.alerts.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgAlert(): MsgAlert { + return { + alert: Alert.fromPartial({}) + }; +} +export const MsgAlert = { + typeUrl: "/slinky.alerts.v1.MsgAlert", + encode(message: MsgAlert, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.alert !== undefined) { + Alert.encode(message.alert, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAlert { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAlert(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alert = Alert.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAlert { + const message = createBaseMsgAlert(); + message.alert = object.alert !== undefined && object.alert !== null ? Alert.fromPartial(object.alert) : undefined; + return message; + }, + fromAmino(object: MsgAlertAmino): MsgAlert { + const message = createBaseMsgAlert(); + if (object.alert !== undefined && object.alert !== null) { + message.alert = Alert.fromAmino(object.alert); + } + return message; + }, + toAmino(message: MsgAlert): MsgAlertAmino { + const obj: any = {}; + obj.alert = message.alert ? Alert.toAmino(message.alert) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAlertAminoMsg): MsgAlert { + return MsgAlert.fromAmino(object.value); + }, + toAminoMsg(message: MsgAlert): MsgAlertAminoMsg { + return { + type: "slinky/x/alerts/MsgAlert", + value: MsgAlert.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAlertProtoMsg): MsgAlert { + return MsgAlert.decode(message.value); + }, + toProto(message: MsgAlert): Uint8Array { + return MsgAlert.encode(message).finish(); + }, + toProtoMsg(message: MsgAlert): MsgAlertProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MsgAlert", + value: MsgAlert.encode(message).finish() + }; + } +}; +function createBaseMsgAlertResponse(): MsgAlertResponse { + return {}; +} +export const MsgAlertResponse = { + typeUrl: "/slinky.alerts.v1.MsgAlertResponse", + encode(_: MsgAlertResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAlertResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAlertResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAlertResponse { + const message = createBaseMsgAlertResponse(); + return message; + }, + fromAmino(_: MsgAlertResponseAmino): MsgAlertResponse { + const message = createBaseMsgAlertResponse(); + return message; + }, + toAmino(_: MsgAlertResponse): MsgAlertResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAlertResponseAminoMsg): MsgAlertResponse { + return MsgAlertResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAlertResponseProtoMsg): MsgAlertResponse { + return MsgAlertResponse.decode(message.value); + }, + toProto(message: MsgAlertResponse): Uint8Array { + return MsgAlertResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAlertResponse): MsgAlertResponseProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MsgAlertResponse", + value: MsgAlertResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConclusion(): MsgConclusion { + return { + signer: "", + conclusion: undefined + }; +} +export const MsgConclusion = { + typeUrl: "/slinky.alerts.v1.MsgConclusion", + encode(message: MsgConclusion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.conclusion !== undefined) { + Any.encode(message.conclusion as Any, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConclusion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConclusion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.conclusion = Slinky_alertsv1Conclusion_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConclusion { + const message = createBaseMsgConclusion(); + message.signer = object.signer ?? ""; + message.conclusion = object.conclusion !== undefined && object.conclusion !== null ? Any.fromPartial(object.conclusion) : undefined; + return message; + }, + fromAmino(object: MsgConclusionAmino): MsgConclusion { + const message = createBaseMsgConclusion(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.conclusion !== undefined && object.conclusion !== null) { + message.conclusion = Slinky_alertsv1Conclusion_FromAmino(object.conclusion); + } + return message; + }, + toAmino(message: MsgConclusion): MsgConclusionAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.conclusion = message.conclusion ? Slinky_alertsv1Conclusion_ToAmino(message.conclusion as Any) : undefined; + return obj; + }, + fromAminoMsg(object: MsgConclusionAminoMsg): MsgConclusion { + return MsgConclusion.fromAmino(object.value); + }, + toAminoMsg(message: MsgConclusion): MsgConclusionAminoMsg { + return { + type: "slinky/x/alerts/MsgConclusion", + value: MsgConclusion.toAmino(message) + }; + }, + fromProtoMsg(message: MsgConclusionProtoMsg): MsgConclusion { + return MsgConclusion.decode(message.value); + }, + toProto(message: MsgConclusion): Uint8Array { + return MsgConclusion.encode(message).finish(); + }, + toProtoMsg(message: MsgConclusion): MsgConclusionProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MsgConclusion", + value: MsgConclusion.encode(message).finish() + }; + } +}; +function createBaseMsgConclusionResponse(): MsgConclusionResponse { + return {}; +} +export const MsgConclusionResponse = { + typeUrl: "/slinky.alerts.v1.MsgConclusionResponse", + encode(_: MsgConclusionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgConclusionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConclusionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConclusionResponse { + const message = createBaseMsgConclusionResponse(); + return message; + }, + fromAmino(_: MsgConclusionResponseAmino): MsgConclusionResponse { + const message = createBaseMsgConclusionResponse(); + return message; + }, + toAmino(_: MsgConclusionResponse): MsgConclusionResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConclusionResponseAminoMsg): MsgConclusionResponse { + return MsgConclusionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgConclusionResponseProtoMsg): MsgConclusionResponse { + return MsgConclusionResponse.decode(message.value); + }, + toProto(message: MsgConclusionResponse): Uint8Array { + return MsgConclusionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConclusionResponse): MsgConclusionResponseProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MsgConclusionResponse", + value: MsgConclusionResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/slinky.alerts.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "slinky/x/alerts/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/slinky.alerts.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/slinky.alerts.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +export const Slinky_alertsv1Conclusion_InterfaceDecoder = (input: BinaryReader | Uint8Array): MultiSigConclusion | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/slinky.alerts.v1.MultiSigConclusion": + return MultiSigConclusion.decode(data.value); + default: + return data; + } +}; +export const Slinky_alertsv1Conclusion_FromAmino = (content: AnyAmino): Any => { + switch (content.type) { + case "slinky/x/alerts/Conclusion": + return Any.fromPartial({ + typeUrl: "/slinky.alerts.v1.MultiSigConclusion", + value: MultiSigConclusion.encode(MultiSigConclusion.fromPartial(MultiSigConclusion.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Slinky_alertsv1Conclusion_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/slinky.alerts.v1.MultiSigConclusion": + return { + type: "slinky/x/alerts/Conclusion", + value: MultiSigConclusion.toAmino(MultiSigConclusion.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/bundle.ts b/dydxjs/packages/dydxjs/src/slinky/bundle.ts new file mode 100644 index 00000000..6357532d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/bundle.ts @@ -0,0 +1,151 @@ +//@ts-nocheck +import * as _217 from "./abci/v1/vote_extensions"; +import * as _218 from "./alerts/module/v1/module"; +import * as _219 from "./alerts/v1/alerts"; +import * as _220 from "./alerts/v1/genesis"; +import * as _221 from "./alerts/v1/query"; +import * as _222 from "./alerts/v1/strategies"; +import * as _223 from "./alerts/v1/tx"; +import * as _224 from "./incentives/module/v1/module"; +import * as _225 from "./incentives/v1/examples/badprice"; +import * as _226 from "./incentives/v1/examples/goodprice"; +import * as _227 from "./incentives/v1/genesis"; +import * as _228 from "./incentives/v1/query"; +import * as _229 from "./marketmap/module/v1/module"; +import * as _230 from "./marketmap/v1/genesis"; +import * as _231 from "./marketmap/v1/market"; +import * as _232 from "./marketmap/v1/params"; +import * as _233 from "./marketmap/v1/query"; +import * as _234 from "./marketmap/v1/tx"; +import * as _235 from "./oracle/module/v1/module"; +import * as _236 from "./oracle/v1/genesis"; +import * as _237 from "./oracle/v1/query"; +import * as _238 from "./oracle/v1/tx"; +import * as _239 from "./service/v1/oracle"; +import * as _240 from "./sla/module/v1/module"; +import * as _241 from "./sla/v1/genesis"; +import * as _242 from "./sla/v1/query"; +import * as _243 from "./sla/v1/tx"; +import * as _244 from "./types/v1/currency_pair"; +import * as _390 from "./alerts/v1/tx.amino"; +import * as _391 from "./marketmap/v1/tx.amino"; +import * as _392 from "./oracle/v1/tx.amino"; +import * as _393 from "./sla/v1/tx.amino"; +import * as _394 from "./alerts/v1/tx.registry"; +import * as _395 from "./marketmap/v1/tx.registry"; +import * as _396 from "./oracle/v1/tx.registry"; +import * as _397 from "./sla/v1/tx.registry"; +import * as _398 from "./alerts/v1/query.rpc.Query"; +import * as _399 from "./incentives/v1/query.rpc.Query"; +import * as _400 from "./marketmap/v1/query.rpc.Query"; +import * as _401 from "./oracle/v1/query.rpc.Query"; +import * as _402 from "./sla/v1/query.rpc.Query"; +import * as _403 from "./alerts/v1/tx.rpc.msg"; +import * as _404 from "./marketmap/v1/tx.rpc.msg"; +import * as _405 from "./oracle/v1/tx.rpc.msg"; +import * as _406 from "./sla/v1/tx.rpc.msg"; +import * as _415 from "./rpc.query"; +import * as _416 from "./rpc.tx"; +export namespace slinky { + export namespace abci { + export const v1 = { + ..._217 + }; + } + export namespace alerts { + export namespace module { + export const v1 = { + ..._218 + }; + } + export const v1 = { + ..._219, + ..._220, + ..._221, + ..._222, + ..._223, + ..._390, + ..._394, + ..._398, + ..._403 + }; + } + export namespace incentives { + export namespace module { + export const v1 = { + ..._224 + }; + } + export const v1 = { + ..._225, + ..._226, + ..._227, + ..._228, + ..._399 + }; + } + export namespace marketmap { + export namespace module { + export const v1 = { + ..._229 + }; + } + export const v1 = { + ..._230, + ..._231, + ..._232, + ..._233, + ..._234, + ..._391, + ..._395, + ..._400, + ..._404 + }; + } + export namespace oracle { + export namespace module { + export const v1 = { + ..._235 + }; + } + export const v1 = { + ..._236, + ..._237, + ..._238, + ..._392, + ..._396, + ..._401, + ..._405 + }; + } + export namespace service { + export const v1 = { + ..._239 + }; + } + export namespace sla { + export namespace module { + export const v1 = { + ..._240 + }; + } + export const v1 = { + ..._241, + ..._242, + ..._243, + ..._393, + ..._397, + ..._402, + ..._406 + }; + } + export namespace types { + export const v1 = { + ..._244 + }; + } + export const ClientFactory = { + ..._415, + ..._416 + }; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/client.ts b/dydxjs/packages/dydxjs/src/slinky/client.ts new file mode 100644 index 00000000..a0e96333 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/client.ts @@ -0,0 +1,55 @@ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as slinkyAlertsV1TxRegistry from "./alerts/v1/tx.registry"; +import * as slinkyMarketmapV1TxRegistry from "./marketmap/v1/tx.registry"; +import * as slinkyOracleV1TxRegistry from "./oracle/v1/tx.registry"; +import * as slinkySlaV1TxRegistry from "./sla/v1/tx.registry"; +import * as slinkyAlertsV1TxAmino from "./alerts/v1/tx.amino"; +import * as slinkyMarketmapV1TxAmino from "./marketmap/v1/tx.amino"; +import * as slinkyOracleV1TxAmino from "./oracle/v1/tx.amino"; +import * as slinkySlaV1TxAmino from "./sla/v1/tx.amino"; +export const slinkyAminoConverters = { + ...slinkyAlertsV1TxAmino.AminoConverter, + ...slinkyMarketmapV1TxAmino.AminoConverter, + ...slinkyOracleV1TxAmino.AminoConverter, + ...slinkySlaV1TxAmino.AminoConverter +}; +export const slinkyProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...slinkyAlertsV1TxRegistry.registry, ...slinkyMarketmapV1TxRegistry.registry, ...slinkyOracleV1TxRegistry.registry, ...slinkySlaV1TxRegistry.registry]; +export const getSigningSlinkyClientOptions = ({ + defaultTypes = defaultRegistryTypes +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...slinkyProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...slinkyAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningSlinkyClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningSlinkyClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/incentives/v1/examples/badprice.ts b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/examples/badprice.ts new file mode 100644 index 00000000..8aa877b1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/examples/badprice.ts @@ -0,0 +1,131 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * BadPriceIncentive is a message that contains the information about a bad + * price that was submitted by a validator. + * + * NOTE: This is an example of a bad price incentive. It is not used in + * production. + */ +export interface BadPriceIncentive { + $typeUrl?: "/slinky.incentives.v1.BadPriceIncentive"; + /** Validator is the address of the validator that submitted the bad price. */ + validator: string; + /** Amount is the amount to slash. */ + amount: string; +} +export interface BadPriceIncentiveProtoMsg { + typeUrl: "/slinky.incentives.v1.BadPriceIncentive"; + value: Uint8Array; +} +/** + * BadPriceIncentive is a message that contains the information about a bad + * price that was submitted by a validator. + * + * NOTE: This is an example of a bad price incentive. It is not used in + * production. + */ +export interface BadPriceIncentiveAmino { + /** Validator is the address of the validator that submitted the bad price. */ + validator?: string; + /** Amount is the amount to slash. */ + amount?: string; +} +export interface BadPriceIncentiveAminoMsg { + type: "slinky/oracle/BadPriceIncentive"; + value: BadPriceIncentiveAmino; +} +/** + * BadPriceIncentive is a message that contains the information about a bad + * price that was submitted by a validator. + * + * NOTE: This is an example of a bad price incentive. It is not used in + * production. + */ +export interface BadPriceIncentiveSDKType { + $typeUrl?: "/slinky.incentives.v1.BadPriceIncentive"; + validator: string; + amount: string; +} +function createBaseBadPriceIncentive(): BadPriceIncentive { + return { + $typeUrl: "/slinky.incentives.v1.BadPriceIncentive", + validator: "", + amount: "" + }; +} +export const BadPriceIncentive = { + typeUrl: "/slinky.incentives.v1.BadPriceIncentive", + encode(message: BadPriceIncentive, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== "") { + writer.uint32(10).string(message.validator); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BadPriceIncentive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBadPriceIncentive(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BadPriceIncentive { + const message = createBaseBadPriceIncentive(); + message.validator = object.validator ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: BadPriceIncentiveAmino): BadPriceIncentive { + const message = createBaseBadPriceIncentive(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = object.validator; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: BadPriceIncentive): BadPriceIncentiveAmino { + const obj: any = {}; + obj.validator = message.validator === "" ? undefined : message.validator; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: BadPriceIncentiveAminoMsg): BadPriceIncentive { + return BadPriceIncentive.fromAmino(object.value); + }, + toAminoMsg(message: BadPriceIncentive): BadPriceIncentiveAminoMsg { + return { + type: "slinky/oracle/BadPriceIncentive", + value: BadPriceIncentive.toAmino(message) + }; + }, + fromProtoMsg(message: BadPriceIncentiveProtoMsg): BadPriceIncentive { + return BadPriceIncentive.decode(message.value); + }, + toProto(message: BadPriceIncentive): Uint8Array { + return BadPriceIncentive.encode(message).finish(); + }, + toProtoMsg(message: BadPriceIncentive): BadPriceIncentiveProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.BadPriceIncentive", + value: BadPriceIncentive.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/incentives/v1/examples/goodprice.ts b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/examples/goodprice.ts new file mode 100644 index 00000000..7d915499 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/examples/goodprice.ts @@ -0,0 +1,131 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * GoodPriceIncentive is a message that contains the information about a good + * price that was submitted by a validator. + * + * NOTE: This is an example of a good price incentive. It is not used in + * production. + */ +export interface GoodPriceIncentive { + $typeUrl?: "/slinky.incentives.v1.GoodPriceIncentive"; + /** Validator is the address of the validator that submitted the good price. */ + validator: string; + /** Amount is the amount to reward. */ + amount: string; +} +export interface GoodPriceIncentiveProtoMsg { + typeUrl: "/slinky.incentives.v1.GoodPriceIncentive"; + value: Uint8Array; +} +/** + * GoodPriceIncentive is a message that contains the information about a good + * price that was submitted by a validator. + * + * NOTE: This is an example of a good price incentive. It is not used in + * production. + */ +export interface GoodPriceIncentiveAmino { + /** Validator is the address of the validator that submitted the good price. */ + validator?: string; + /** Amount is the amount to reward. */ + amount?: string; +} +export interface GoodPriceIncentiveAminoMsg { + type: "slinky/oracle/BadPriceIncentive"; + value: GoodPriceIncentiveAmino; +} +/** + * GoodPriceIncentive is a message that contains the information about a good + * price that was submitted by a validator. + * + * NOTE: This is an example of a good price incentive. It is not used in + * production. + */ +export interface GoodPriceIncentiveSDKType { + $typeUrl?: "/slinky.incentives.v1.GoodPriceIncentive"; + validator: string; + amount: string; +} +function createBaseGoodPriceIncentive(): GoodPriceIncentive { + return { + $typeUrl: "/slinky.incentives.v1.GoodPriceIncentive", + validator: "", + amount: "" + }; +} +export const GoodPriceIncentive = { + typeUrl: "/slinky.incentives.v1.GoodPriceIncentive", + encode(message: GoodPriceIncentive, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== "") { + writer.uint32(10).string(message.validator); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GoodPriceIncentive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGoodPriceIncentive(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GoodPriceIncentive { + const message = createBaseGoodPriceIncentive(); + message.validator = object.validator ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: GoodPriceIncentiveAmino): GoodPriceIncentive { + const message = createBaseGoodPriceIncentive(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = object.validator; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: GoodPriceIncentive): GoodPriceIncentiveAmino { + const obj: any = {}; + obj.validator = message.validator === "" ? undefined : message.validator; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: GoodPriceIncentiveAminoMsg): GoodPriceIncentive { + return GoodPriceIncentive.fromAmino(object.value); + }, + toAminoMsg(message: GoodPriceIncentive): GoodPriceIncentiveAminoMsg { + return { + type: "slinky/oracle/BadPriceIncentive", + value: GoodPriceIncentive.toAmino(message) + }; + }, + fromProtoMsg(message: GoodPriceIncentiveProtoMsg): GoodPriceIncentive { + return GoodPriceIncentive.decode(message.value); + }, + toProto(message: GoodPriceIncentive): Uint8Array { + return GoodPriceIncentive.encode(message).finish(); + }, + toProtoMsg(message: GoodPriceIncentive): GoodPriceIncentiveProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.GoodPriceIncentive", + value: GoodPriceIncentive.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/incentives/v1/genesis.ts b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/genesis.ts new file mode 100644 index 00000000..0609228f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/genesis.ts @@ -0,0 +1,217 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** GenesisState is the genesis-state for the x/incentives module. */ +export interface GenesisState { + /** + * Registry is a list of incentives by type. The registry defined here + * should be a subset of the incentive types defined in the incentive + * module (keeper). + */ + registry: IncentivesByType[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/slinky.incentives.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState is the genesis-state for the x/incentives module. */ +export interface GenesisStateAmino { + /** + * Registry is a list of incentives by type. The registry defined here + * should be a subset of the incentive types defined in the incentive + * module (keeper). + */ + registry?: IncentivesByTypeAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/slinky.incentives.v1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState is the genesis-state for the x/incentives module. */ +export interface GenesisStateSDKType { + registry: IncentivesByTypeSDKType[]; +} +/** + * IncentivesByType encapsulates a list of incentives by type. Each of the + * entries here must correspond to the same incentive type defined here. + */ +export interface IncentivesByType { + /** + * IncentiveType is the incentive type i.e. (BadPriceIncentiveType, + * GoodPriceIncentiveType). + */ + incentiveType: string; + /** Entries is a list of incentive bytes. */ + entries: Uint8Array[]; +} +export interface IncentivesByTypeProtoMsg { + typeUrl: "/slinky.incentives.v1.IncentivesByType"; + value: Uint8Array; +} +/** + * IncentivesByType encapsulates a list of incentives by type. Each of the + * entries here must correspond to the same incentive type defined here. + */ +export interface IncentivesByTypeAmino { + /** + * IncentiveType is the incentive type i.e. (BadPriceIncentiveType, + * GoodPriceIncentiveType). + */ + incentive_type?: string; + /** Entries is a list of incentive bytes. */ + entries?: string[]; +} +export interface IncentivesByTypeAminoMsg { + type: "/slinky.incentives.v1.IncentivesByType"; + value: IncentivesByTypeAmino; +} +/** + * IncentivesByType encapsulates a list of incentives by type. Each of the + * entries here must correspond to the same incentive type defined here. + */ +export interface IncentivesByTypeSDKType { + incentive_type: string; + entries: Uint8Array[]; +} +function createBaseGenesisState(): GenesisState { + return { + registry: [] + }; +} +export const GenesisState = { + typeUrl: "/slinky.incentives.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.registry) { + IncentivesByType.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.registry.push(IncentivesByType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.registry = object.registry?.map(e => IncentivesByType.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.registry = object.registry?.map(e => IncentivesByType.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.registry) { + obj.registry = message.registry.map(e => e ? IncentivesByType.toAmino(e) : undefined); + } else { + obj.registry = message.registry; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseIncentivesByType(): IncentivesByType { + return { + incentiveType: "", + entries: [] + }; +} +export const IncentivesByType = { + typeUrl: "/slinky.incentives.v1.IncentivesByType", + encode(message: IncentivesByType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.incentiveType !== "") { + writer.uint32(10).string(message.incentiveType); + } + for (const v of message.entries) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IncentivesByType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIncentivesByType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.incentiveType = reader.string(); + break; + case 2: + message.entries.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IncentivesByType { + const message = createBaseIncentivesByType(); + message.incentiveType = object.incentiveType ?? ""; + message.entries = object.entries?.map(e => e) || []; + return message; + }, + fromAmino(object: IncentivesByTypeAmino): IncentivesByType { + const message = createBaseIncentivesByType(); + if (object.incentive_type !== undefined && object.incentive_type !== null) { + message.incentiveType = object.incentive_type; + } + message.entries = object.entries?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: IncentivesByType): IncentivesByTypeAmino { + const obj: any = {}; + obj.incentive_type = message.incentiveType === "" ? undefined : message.incentiveType; + if (message.entries) { + obj.entries = message.entries.map(e => base64FromBytes(e)); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: IncentivesByTypeAminoMsg): IncentivesByType { + return IncentivesByType.fromAmino(object.value); + }, + fromProtoMsg(message: IncentivesByTypeProtoMsg): IncentivesByType { + return IncentivesByType.decode(message.value); + }, + toProto(message: IncentivesByType): Uint8Array { + return IncentivesByType.encode(message).finish(); + }, + toProtoMsg(message: IncentivesByType): IncentivesByTypeProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.IncentivesByType", + value: IncentivesByType.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/incentives/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/query.rpc.Query.ts new file mode 100644 index 00000000..6c17125c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/query.rpc.Query.ts @@ -0,0 +1,45 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { GetIncentivesByTypeRequest, GetIncentivesByTypeResponse, GetAllIncentivesRequest, GetAllIncentivesResponse } from "./query"; +/** Query is the query service for the x/incentives module. */ +export interface Query { + /** + * GetIncentivesByType returns all incentives of a given type. If the type is + * not registered with the module, an error is returned. + */ + getIncentivesByType(request: GetIncentivesByTypeRequest): Promise; + /** GetAllIncentives returns all incentives. */ + getAllIncentives(request?: GetAllIncentivesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.getIncentivesByType = this.getIncentivesByType.bind(this); + this.getAllIncentives = this.getAllIncentives.bind(this); + } + getIncentivesByType(request: GetIncentivesByTypeRequest): Promise { + const data = GetIncentivesByTypeRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.incentives.v1.Query", "GetIncentivesByType", data); + return promise.then(data => GetIncentivesByTypeResponse.decode(new BinaryReader(data))); + } + getAllIncentives(request: GetAllIncentivesRequest = {}): Promise { + const data = GetAllIncentivesRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.incentives.v1.Query", "GetAllIncentives", data); + return promise.then(data => GetAllIncentivesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + getIncentivesByType(request: GetIncentivesByTypeRequest): Promise { + return queryService.getIncentivesByType(request); + }, + getAllIncentives(request?: GetAllIncentivesRequest): Promise { + return queryService.getAllIncentives(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/incentives/v1/query.ts b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/query.ts new file mode 100644 index 00000000..13b34b8d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/incentives/v1/query.ts @@ -0,0 +1,369 @@ +//@ts-nocheck +import { IncentivesByType, IncentivesByTypeAmino, IncentivesByTypeSDKType } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * GetIncentivesByTypeRequest is the request type for the + * Query/GetIncentivesByType RPC method. + */ +export interface GetIncentivesByTypeRequest { + /** + * IncentiveType is the incentive type i.e. (BadPriceIncentiveType, + * GoodPriceIncentiveType). + */ + incentiveType: string; +} +export interface GetIncentivesByTypeRequestProtoMsg { + typeUrl: "/slinky.incentives.v1.GetIncentivesByTypeRequest"; + value: Uint8Array; +} +/** + * GetIncentivesByTypeRequest is the request type for the + * Query/GetIncentivesByType RPC method. + */ +export interface GetIncentivesByTypeRequestAmino { + /** + * IncentiveType is the incentive type i.e. (BadPriceIncentiveType, + * GoodPriceIncentiveType). + */ + incentive_type?: string; +} +export interface GetIncentivesByTypeRequestAminoMsg { + type: "/slinky.incentives.v1.GetIncentivesByTypeRequest"; + value: GetIncentivesByTypeRequestAmino; +} +/** + * GetIncentivesByTypeRequest is the request type for the + * Query/GetIncentivesByType RPC method. + */ +export interface GetIncentivesByTypeRequestSDKType { + incentive_type: string; +} +/** + * GetIncentivesByTypeResponse is the response type for the + * Query/GetIncentivesByType RPC method. + */ +export interface GetIncentivesByTypeResponse { + /** Entries is the list of incentives of the given type. */ + entries: Uint8Array[]; +} +export interface GetIncentivesByTypeResponseProtoMsg { + typeUrl: "/slinky.incentives.v1.GetIncentivesByTypeResponse"; + value: Uint8Array; +} +/** + * GetIncentivesByTypeResponse is the response type for the + * Query/GetIncentivesByType RPC method. + */ +export interface GetIncentivesByTypeResponseAmino { + /** Entries is the list of incentives of the given type. */ + entries?: string[]; +} +export interface GetIncentivesByTypeResponseAminoMsg { + type: "/slinky.incentives.v1.GetIncentivesByTypeResponse"; + value: GetIncentivesByTypeResponseAmino; +} +/** + * GetIncentivesByTypeResponse is the response type for the + * Query/GetIncentivesByType RPC method. + */ +export interface GetIncentivesByTypeResponseSDKType { + entries: Uint8Array[]; +} +/** + * GetAllIncentivesRequest is the request type for the Query/GetAllIncentives + * RPC method. + */ +export interface GetAllIncentivesRequest {} +export interface GetAllIncentivesRequestProtoMsg { + typeUrl: "/slinky.incentives.v1.GetAllIncentivesRequest"; + value: Uint8Array; +} +/** + * GetAllIncentivesRequest is the request type for the Query/GetAllIncentives + * RPC method. + */ +export interface GetAllIncentivesRequestAmino {} +export interface GetAllIncentivesRequestAminoMsg { + type: "/slinky.incentives.v1.GetAllIncentivesRequest"; + value: GetAllIncentivesRequestAmino; +} +/** + * GetAllIncentivesRequest is the request type for the Query/GetAllIncentives + * RPC method. + */ +export interface GetAllIncentivesRequestSDKType {} +/** + * GetAllIncentivesResponse is the response type for the Query/GetAllIncentives + * RPC method. + */ +export interface GetAllIncentivesResponse { + /** Registry is the list of all incentives, grouped by type. */ + registry: IncentivesByType[]; +} +export interface GetAllIncentivesResponseProtoMsg { + typeUrl: "/slinky.incentives.v1.GetAllIncentivesResponse"; + value: Uint8Array; +} +/** + * GetAllIncentivesResponse is the response type for the Query/GetAllIncentives + * RPC method. + */ +export interface GetAllIncentivesResponseAmino { + /** Registry is the list of all incentives, grouped by type. */ + registry?: IncentivesByTypeAmino[]; +} +export interface GetAllIncentivesResponseAminoMsg { + type: "/slinky.incentives.v1.GetAllIncentivesResponse"; + value: GetAllIncentivesResponseAmino; +} +/** + * GetAllIncentivesResponse is the response type for the Query/GetAllIncentives + * RPC method. + */ +export interface GetAllIncentivesResponseSDKType { + registry: IncentivesByTypeSDKType[]; +} +function createBaseGetIncentivesByTypeRequest(): GetIncentivesByTypeRequest { + return { + incentiveType: "" + }; +} +export const GetIncentivesByTypeRequest = { + typeUrl: "/slinky.incentives.v1.GetIncentivesByTypeRequest", + encode(message: GetIncentivesByTypeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.incentiveType !== "") { + writer.uint32(10).string(message.incentiveType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetIncentivesByTypeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetIncentivesByTypeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.incentiveType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetIncentivesByTypeRequest { + const message = createBaseGetIncentivesByTypeRequest(); + message.incentiveType = object.incentiveType ?? ""; + return message; + }, + fromAmino(object: GetIncentivesByTypeRequestAmino): GetIncentivesByTypeRequest { + const message = createBaseGetIncentivesByTypeRequest(); + if (object.incentive_type !== undefined && object.incentive_type !== null) { + message.incentiveType = object.incentive_type; + } + return message; + }, + toAmino(message: GetIncentivesByTypeRequest): GetIncentivesByTypeRequestAmino { + const obj: any = {}; + obj.incentive_type = message.incentiveType === "" ? undefined : message.incentiveType; + return obj; + }, + fromAminoMsg(object: GetIncentivesByTypeRequestAminoMsg): GetIncentivesByTypeRequest { + return GetIncentivesByTypeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetIncentivesByTypeRequestProtoMsg): GetIncentivesByTypeRequest { + return GetIncentivesByTypeRequest.decode(message.value); + }, + toProto(message: GetIncentivesByTypeRequest): Uint8Array { + return GetIncentivesByTypeRequest.encode(message).finish(); + }, + toProtoMsg(message: GetIncentivesByTypeRequest): GetIncentivesByTypeRequestProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.GetIncentivesByTypeRequest", + value: GetIncentivesByTypeRequest.encode(message).finish() + }; + } +}; +function createBaseGetIncentivesByTypeResponse(): GetIncentivesByTypeResponse { + return { + entries: [] + }; +} +export const GetIncentivesByTypeResponse = { + typeUrl: "/slinky.incentives.v1.GetIncentivesByTypeResponse", + encode(message: GetIncentivesByTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetIncentivesByTypeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetIncentivesByTypeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetIncentivesByTypeResponse { + const message = createBaseGetIncentivesByTypeResponse(); + message.entries = object.entries?.map(e => e) || []; + return message; + }, + fromAmino(object: GetIncentivesByTypeResponseAmino): GetIncentivesByTypeResponse { + const message = createBaseGetIncentivesByTypeResponse(); + message.entries = object.entries?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: GetIncentivesByTypeResponse): GetIncentivesByTypeResponseAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => base64FromBytes(e)); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: GetIncentivesByTypeResponseAminoMsg): GetIncentivesByTypeResponse { + return GetIncentivesByTypeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetIncentivesByTypeResponseProtoMsg): GetIncentivesByTypeResponse { + return GetIncentivesByTypeResponse.decode(message.value); + }, + toProto(message: GetIncentivesByTypeResponse): Uint8Array { + return GetIncentivesByTypeResponse.encode(message).finish(); + }, + toProtoMsg(message: GetIncentivesByTypeResponse): GetIncentivesByTypeResponseProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.GetIncentivesByTypeResponse", + value: GetIncentivesByTypeResponse.encode(message).finish() + }; + } +}; +function createBaseGetAllIncentivesRequest(): GetAllIncentivesRequest { + return {}; +} +export const GetAllIncentivesRequest = { + typeUrl: "/slinky.incentives.v1.GetAllIncentivesRequest", + encode(_: GetAllIncentivesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAllIncentivesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAllIncentivesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetAllIncentivesRequest { + const message = createBaseGetAllIncentivesRequest(); + return message; + }, + fromAmino(_: GetAllIncentivesRequestAmino): GetAllIncentivesRequest { + const message = createBaseGetAllIncentivesRequest(); + return message; + }, + toAmino(_: GetAllIncentivesRequest): GetAllIncentivesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetAllIncentivesRequestAminoMsg): GetAllIncentivesRequest { + return GetAllIncentivesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetAllIncentivesRequestProtoMsg): GetAllIncentivesRequest { + return GetAllIncentivesRequest.decode(message.value); + }, + toProto(message: GetAllIncentivesRequest): Uint8Array { + return GetAllIncentivesRequest.encode(message).finish(); + }, + toProtoMsg(message: GetAllIncentivesRequest): GetAllIncentivesRequestProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.GetAllIncentivesRequest", + value: GetAllIncentivesRequest.encode(message).finish() + }; + } +}; +function createBaseGetAllIncentivesResponse(): GetAllIncentivesResponse { + return { + registry: [] + }; +} +export const GetAllIncentivesResponse = { + typeUrl: "/slinky.incentives.v1.GetAllIncentivesResponse", + encode(message: GetAllIncentivesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.registry) { + IncentivesByType.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAllIncentivesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAllIncentivesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.registry.push(IncentivesByType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAllIncentivesResponse { + const message = createBaseGetAllIncentivesResponse(); + message.registry = object.registry?.map(e => IncentivesByType.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetAllIncentivesResponseAmino): GetAllIncentivesResponse { + const message = createBaseGetAllIncentivesResponse(); + message.registry = object.registry?.map(e => IncentivesByType.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetAllIncentivesResponse): GetAllIncentivesResponseAmino { + const obj: any = {}; + if (message.registry) { + obj.registry = message.registry.map(e => e ? IncentivesByType.toAmino(e) : undefined); + } else { + obj.registry = message.registry; + } + return obj; + }, + fromAminoMsg(object: GetAllIncentivesResponseAminoMsg): GetAllIncentivesResponse { + return GetAllIncentivesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetAllIncentivesResponseProtoMsg): GetAllIncentivesResponse { + return GetAllIncentivesResponse.decode(message.value); + }, + toProto(message: GetAllIncentivesResponse): Uint8Array { + return GetAllIncentivesResponse.encode(message).finish(); + }, + toProtoMsg(message: GetAllIncentivesResponse): GetAllIncentivesResponseProtoMsg { + return { + typeUrl: "/slinky.incentives.v1.GetAllIncentivesResponse", + value: GetAllIncentivesResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/genesis.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/genesis.ts new file mode 100644 index 00000000..5bfc2845 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/genesis.ts @@ -0,0 +1,137 @@ +//@ts-nocheck +import { MarketMap, MarketMapAmino, MarketMapSDKType } from "./market"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the x/marketmap module's genesis state. */ +export interface GenesisState { + /** + * MarketMap defines the global set of market configurations for all providers + * and markets. + */ + marketMap: MarketMap; + /** + * LastUpdated is the last block height that the market map was updated. + * This field can be used as an optimization for clients checking if there + * is a new update to the map. + */ + lastUpdated: bigint; + /** Params are the parameters for the x/marketmap module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/slinky.marketmap.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the x/marketmap module's genesis state. */ +export interface GenesisStateAmino { + /** + * MarketMap defines the global set of market configurations for all providers + * and markets. + */ + market_map?: MarketMapAmino; + /** + * LastUpdated is the last block height that the market map was updated. + * This field can be used as an optimization for clients checking if there + * is a new update to the map. + */ + last_updated?: string; + /** Params are the parameters for the x/marketmap module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/slinky.marketmap.v1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the x/marketmap module's genesis state. */ +export interface GenesisStateSDKType { + market_map: MarketMapSDKType; + last_updated: bigint; + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + marketMap: MarketMap.fromPartial({}), + lastUpdated: BigInt(0), + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/slinky.marketmap.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketMap !== undefined) { + MarketMap.encode(message.marketMap, writer.uint32(10).fork()).ldelim(); + } + if (message.lastUpdated !== BigInt(0)) { + writer.uint32(16).uint64(message.lastUpdated); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketMap = MarketMap.decode(reader, reader.uint32()); + break; + case 2: + message.lastUpdated = reader.uint64(); + break; + case 3: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.marketMap = object.marketMap !== undefined && object.marketMap !== null ? MarketMap.fromPartial(object.marketMap) : undefined; + message.lastUpdated = object.lastUpdated !== undefined && object.lastUpdated !== null ? BigInt(object.lastUpdated.toString()) : BigInt(0); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.market_map !== undefined && object.market_map !== null) { + message.marketMap = MarketMap.fromAmino(object.market_map); + } + if (object.last_updated !== undefined && object.last_updated !== null) { + message.lastUpdated = BigInt(object.last_updated); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.market_map = message.marketMap ? MarketMap.toAmino(message.marketMap) : undefined; + obj.last_updated = message.lastUpdated !== BigInt(0) ? message.lastUpdated.toString() : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/market.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/market.ts new file mode 100644 index 00000000..1b246d66 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/market.ts @@ -0,0 +1,698 @@ +//@ts-nocheck +import { CurrencyPair, CurrencyPairAmino, CurrencyPairSDKType } from "../../types/v1/currency_pair"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Market encapsulates a Ticker and its provider-specific configuration. */ +export interface Market { + /** + * Ticker represents a price feed for a given asset pair i.e. BTC/USD. The + * price feed is scaled to a number of decimal places and has a minimum number + * of providers required to consider the ticker valid. + */ + ticker: Ticker; + /** ProviderConfigs is the list of provider-specific configs for this Market. */ + providerConfigs: ProviderConfig[]; +} +export interface MarketProtoMsg { + typeUrl: "/slinky.marketmap.v1.Market"; + value: Uint8Array; +} +/** Market encapsulates a Ticker and its provider-specific configuration. */ +export interface MarketAmino { + /** + * Ticker represents a price feed for a given asset pair i.e. BTC/USD. The + * price feed is scaled to a number of decimal places and has a minimum number + * of providers required to consider the ticker valid. + */ + ticker?: TickerAmino; + /** ProviderConfigs is the list of provider-specific configs for this Market. */ + provider_configs?: ProviderConfigAmino[]; +} +export interface MarketAminoMsg { + type: "/slinky.marketmap.v1.Market"; + value: MarketAmino; +} +/** Market encapsulates a Ticker and its provider-specific configuration. */ +export interface MarketSDKType { + ticker: TickerSDKType; + provider_configs: ProviderConfigSDKType[]; +} +/** + * Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price + * feed is scaled to a number of decimal places and has a minimum number of + * providers required to consider the ticker valid. + */ +export interface Ticker { + /** CurrencyPair is the currency pair for this ticker. */ + currencyPair: CurrencyPair; + /** + * Decimals is the number of decimal places for the ticker. The number of + * decimal places is used to convert the price to a human-readable format. + */ + decimals: bigint; + /** + * MinProviderCount is the minimum number of providers required to consider + * the ticker valid. + */ + minProviderCount: bigint; + /** + * Enabled is the flag that denotes if the Ticker is enabled for price + * fetching by an oracle. + */ + enabled: boolean; + /** + * MetadataJSON is a string of JSON that encodes any extra configuration + * for the given ticker. + */ + metadataJSON: string; +} +export interface TickerProtoMsg { + typeUrl: "/slinky.marketmap.v1.Ticker"; + value: Uint8Array; +} +/** + * Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price + * feed is scaled to a number of decimal places and has a minimum number of + * providers required to consider the ticker valid. + */ +export interface TickerAmino { + /** CurrencyPair is the currency pair for this ticker. */ + currency_pair?: CurrencyPairAmino; + /** + * Decimals is the number of decimal places for the ticker. The number of + * decimal places is used to convert the price to a human-readable format. + */ + decimals?: string; + /** + * MinProviderCount is the minimum number of providers required to consider + * the ticker valid. + */ + min_provider_count?: string; + /** + * Enabled is the flag that denotes if the Ticker is enabled for price + * fetching by an oracle. + */ + enabled?: boolean; + /** + * MetadataJSON is a string of JSON that encodes any extra configuration + * for the given ticker. + */ + metadata_JSON?: string; +} +export interface TickerAminoMsg { + type: "/slinky.marketmap.v1.Ticker"; + value: TickerAmino; +} +/** + * Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price + * feed is scaled to a number of decimal places and has a minimum number of + * providers required to consider the ticker valid. + */ +export interface TickerSDKType { + currency_pair: CurrencyPairSDKType; + decimals: bigint; + min_provider_count: bigint; + enabled: boolean; + metadata_JSON: string; +} +export interface ProviderConfig { + /** + * Name corresponds to the name of the provider for which the configuration is + * being set. + */ + name: string; + /** + * OffChainTicker is the off-chain representation of the ticker i.e. BTC/USD. + * The off-chain ticker is unique to a given provider and is used to fetch the + * price of the ticker from the provider. + */ + offChainTicker: string; + /** + * NormalizeByPair is the currency pair for this ticker to be normalized by. + * For example, if the desired Ticker is BTC/USD, this market could be reached + * using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is + * optional and nullable. + */ + normalizeByPair?: CurrencyPair; + /** + * Invert is a boolean indicating if the BASE and QUOTE of the market should + * be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE + */ + invert: boolean; + /** + * MetadataJSON is a string of JSON that encodes any extra configuration + * for the given provider config. + */ + metadataJSON: string; +} +export interface ProviderConfigProtoMsg { + typeUrl: "/slinky.marketmap.v1.ProviderConfig"; + value: Uint8Array; +} +export interface ProviderConfigAmino { + /** + * Name corresponds to the name of the provider for which the configuration is + * being set. + */ + name?: string; + /** + * OffChainTicker is the off-chain representation of the ticker i.e. BTC/USD. + * The off-chain ticker is unique to a given provider and is used to fetch the + * price of the ticker from the provider. + */ + off_chain_ticker?: string; + /** + * NormalizeByPair is the currency pair for this ticker to be normalized by. + * For example, if the desired Ticker is BTC/USD, this market could be reached + * using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is + * optional and nullable. + */ + normalize_by_pair?: CurrencyPairAmino; + /** + * Invert is a boolean indicating if the BASE and QUOTE of the market should + * be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE + */ + invert?: boolean; + /** + * MetadataJSON is a string of JSON that encodes any extra configuration + * for the given provider config. + */ + metadata_JSON?: string; +} +export interface ProviderConfigAminoMsg { + type: "/slinky.marketmap.v1.ProviderConfig"; + value: ProviderConfigAmino; +} +export interface ProviderConfigSDKType { + name: string; + off_chain_ticker: string; + normalize_by_pair?: CurrencyPairSDKType; + invert: boolean; + metadata_JSON: string; +} +export interface MarketMap_MarketsEntry { + key: string; + value?: Market; +} +export interface MarketMap_MarketsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface MarketMap_MarketsEntryAmino { + key?: string; + value?: MarketAmino; +} +export interface MarketMap_MarketsEntryAminoMsg { + type: string; + value: MarketMap_MarketsEntryAmino; +} +export interface MarketMap_MarketsEntrySDKType { + key: string; + value?: MarketSDKType; +} +/** MarketMap maps ticker strings to their Markets. */ +export interface MarketMap { + /** + * Markets is the full list of tickers and their associated configurations + * to be stored on-chain. + */ + markets: { + [key: string]: Market; + }; +} +export interface MarketMapProtoMsg { + typeUrl: "/slinky.marketmap.v1.MarketMap"; + value: Uint8Array; +} +/** MarketMap maps ticker strings to their Markets. */ +export interface MarketMapAmino { + /** + * Markets is the full list of tickers and their associated configurations + * to be stored on-chain. + */ + markets?: { + [key: string]: MarketAmino; + }; +} +export interface MarketMapAminoMsg { + type: "/slinky.marketmap.v1.MarketMap"; + value: MarketMapAmino; +} +/** MarketMap maps ticker strings to their Markets. */ +export interface MarketMapSDKType { + markets: { + [key: string]: MarketSDKType; + }; +} +function createBaseMarket(): Market { + return { + ticker: Ticker.fromPartial({}), + providerConfigs: [] + }; +} +export const Market = { + typeUrl: "/slinky.marketmap.v1.Market", + encode(message: Market, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ticker !== undefined) { + Ticker.encode(message.ticker, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.providerConfigs) { + ProviderConfig.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Market { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = Ticker.decode(reader, reader.uint32()); + break; + case 2: + message.providerConfigs.push(ProviderConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Market { + const message = createBaseMarket(); + message.ticker = object.ticker !== undefined && object.ticker !== null ? Ticker.fromPartial(object.ticker) : undefined; + message.providerConfigs = object.providerConfigs?.map(e => ProviderConfig.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MarketAmino): Market { + const message = createBaseMarket(); + if (object.ticker !== undefined && object.ticker !== null) { + message.ticker = Ticker.fromAmino(object.ticker); + } + message.providerConfigs = object.provider_configs?.map(e => ProviderConfig.fromAmino(e)) || []; + return message; + }, + toAmino(message: Market): MarketAmino { + const obj: any = {}; + obj.ticker = message.ticker ? Ticker.toAmino(message.ticker) : undefined; + if (message.providerConfigs) { + obj.provider_configs = message.providerConfigs.map(e => e ? ProviderConfig.toAmino(e) : undefined); + } else { + obj.provider_configs = message.providerConfigs; + } + return obj; + }, + fromAminoMsg(object: MarketAminoMsg): Market { + return Market.fromAmino(object.value); + }, + fromProtoMsg(message: MarketProtoMsg): Market { + return Market.decode(message.value); + }, + toProto(message: Market): Uint8Array { + return Market.encode(message).finish(); + }, + toProtoMsg(message: Market): MarketProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.Market", + value: Market.encode(message).finish() + }; + } +}; +function createBaseTicker(): Ticker { + return { + currencyPair: CurrencyPair.fromPartial({}), + decimals: BigInt(0), + minProviderCount: BigInt(0), + enabled: false, + metadataJSON: "" + }; +} +export const Ticker = { + typeUrl: "/slinky.marketmap.v1.Ticker", + encode(message: Ticker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.currencyPair !== undefined) { + CurrencyPair.encode(message.currencyPair, writer.uint32(10).fork()).ldelim(); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(16).uint64(message.decimals); + } + if (message.minProviderCount !== BigInt(0)) { + writer.uint32(24).uint64(message.minProviderCount); + } + if (message.enabled === true) { + writer.uint32(112).bool(message.enabled); + } + if (message.metadataJSON !== "") { + writer.uint32(122).string(message.metadataJSON); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Ticker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTicker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyPair = CurrencyPair.decode(reader, reader.uint32()); + break; + case 2: + message.decimals = reader.uint64(); + break; + case 3: + message.minProviderCount = reader.uint64(); + break; + case 14: + message.enabled = reader.bool(); + break; + case 15: + message.metadataJSON = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Ticker { + const message = createBaseTicker(); + message.currencyPair = object.currencyPair !== undefined && object.currencyPair !== null ? CurrencyPair.fromPartial(object.currencyPair) : undefined; + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + message.minProviderCount = object.minProviderCount !== undefined && object.minProviderCount !== null ? BigInt(object.minProviderCount.toString()) : BigInt(0); + message.enabled = object.enabled ?? false; + message.metadataJSON = object.metadataJSON ?? ""; + return message; + }, + fromAmino(object: TickerAmino): Ticker { + const message = createBaseTicker(); + if (object.currency_pair !== undefined && object.currency_pair !== null) { + message.currencyPair = CurrencyPair.fromAmino(object.currency_pair); + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + if (object.min_provider_count !== undefined && object.min_provider_count !== null) { + message.minProviderCount = BigInt(object.min_provider_count); + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.metadata_JSON !== undefined && object.metadata_JSON !== null) { + message.metadataJSON = object.metadata_JSON; + } + return message; + }, + toAmino(message: Ticker): TickerAmino { + const obj: any = {}; + obj.currency_pair = message.currencyPair ? CurrencyPair.toAmino(message.currencyPair) : undefined; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals.toString() : undefined; + obj.min_provider_count = message.minProviderCount !== BigInt(0) ? message.minProviderCount.toString() : undefined; + obj.enabled = message.enabled === false ? undefined : message.enabled; + obj.metadata_JSON = message.metadataJSON === "" ? undefined : message.metadataJSON; + return obj; + }, + fromAminoMsg(object: TickerAminoMsg): Ticker { + return Ticker.fromAmino(object.value); + }, + fromProtoMsg(message: TickerProtoMsg): Ticker { + return Ticker.decode(message.value); + }, + toProto(message: Ticker): Uint8Array { + return Ticker.encode(message).finish(); + }, + toProtoMsg(message: Ticker): TickerProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.Ticker", + value: Ticker.encode(message).finish() + }; + } +}; +function createBaseProviderConfig(): ProviderConfig { + return { + name: "", + offChainTicker: "", + normalizeByPair: undefined, + invert: false, + metadataJSON: "" + }; +} +export const ProviderConfig = { + typeUrl: "/slinky.marketmap.v1.ProviderConfig", + encode(message: ProviderConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.offChainTicker !== "") { + writer.uint32(18).string(message.offChainTicker); + } + if (message.normalizeByPair !== undefined) { + CurrencyPair.encode(message.normalizeByPair, writer.uint32(26).fork()).ldelim(); + } + if (message.invert === true) { + writer.uint32(32).bool(message.invert); + } + if (message.metadataJSON !== "") { + writer.uint32(122).string(message.metadataJSON); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProviderConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.offChainTicker = reader.string(); + break; + case 3: + message.normalizeByPair = CurrencyPair.decode(reader, reader.uint32()); + break; + case 4: + message.invert = reader.bool(); + break; + case 15: + message.metadataJSON = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProviderConfig { + const message = createBaseProviderConfig(); + message.name = object.name ?? ""; + message.offChainTicker = object.offChainTicker ?? ""; + message.normalizeByPair = object.normalizeByPair !== undefined && object.normalizeByPair !== null ? CurrencyPair.fromPartial(object.normalizeByPair) : undefined; + message.invert = object.invert ?? false; + message.metadataJSON = object.metadataJSON ?? ""; + return message; + }, + fromAmino(object: ProviderConfigAmino): ProviderConfig { + const message = createBaseProviderConfig(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.off_chain_ticker !== undefined && object.off_chain_ticker !== null) { + message.offChainTicker = object.off_chain_ticker; + } + if (object.normalize_by_pair !== undefined && object.normalize_by_pair !== null) { + message.normalizeByPair = CurrencyPair.fromAmino(object.normalize_by_pair); + } + if (object.invert !== undefined && object.invert !== null) { + message.invert = object.invert; + } + if (object.metadata_JSON !== undefined && object.metadata_JSON !== null) { + message.metadataJSON = object.metadata_JSON; + } + return message; + }, + toAmino(message: ProviderConfig): ProviderConfigAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.off_chain_ticker = message.offChainTicker === "" ? undefined : message.offChainTicker; + obj.normalize_by_pair = message.normalizeByPair ? CurrencyPair.toAmino(message.normalizeByPair) : undefined; + obj.invert = message.invert === false ? undefined : message.invert; + obj.metadata_JSON = message.metadataJSON === "" ? undefined : message.metadataJSON; + return obj; + }, + fromAminoMsg(object: ProviderConfigAminoMsg): ProviderConfig { + return ProviderConfig.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderConfigProtoMsg): ProviderConfig { + return ProviderConfig.decode(message.value); + }, + toProto(message: ProviderConfig): Uint8Array { + return ProviderConfig.encode(message).finish(); + }, + toProtoMsg(message: ProviderConfig): ProviderConfigProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.ProviderConfig", + value: ProviderConfig.encode(message).finish() + }; + } +}; +function createBaseMarketMap_MarketsEntry(): MarketMap_MarketsEntry { + return { + key: "", + value: undefined + }; +} +export const MarketMap_MarketsEntry = { + encode(message: MarketMap_MarketsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Market.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketMap_MarketsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketMap_MarketsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = Market.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketMap_MarketsEntry { + const message = createBaseMarketMap_MarketsEntry(); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? Market.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: MarketMap_MarketsEntryAmino): MarketMap_MarketsEntry { + const message = createBaseMarketMap_MarketsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = Market.fromAmino(object.value); + } + return message; + }, + toAmino(message: MarketMap_MarketsEntry): MarketMap_MarketsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? Market.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: MarketMap_MarketsEntryAminoMsg): MarketMap_MarketsEntry { + return MarketMap_MarketsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: MarketMap_MarketsEntryProtoMsg): MarketMap_MarketsEntry { + return MarketMap_MarketsEntry.decode(message.value); + }, + toProto(message: MarketMap_MarketsEntry): Uint8Array { + return MarketMap_MarketsEntry.encode(message).finish(); + } +}; +function createBaseMarketMap(): MarketMap { + return { + markets: {} + }; +} +export const MarketMap = { + typeUrl: "/slinky.marketmap.v1.MarketMap", + encode(message: MarketMap, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.markets).forEach(([key, value]) => { + MarketMap_MarketsEntry.encode({ + key: key as any, + value + }, writer.uint32(10).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketMap { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketMap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = MarketMap_MarketsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.markets[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketMap { + const message = createBaseMarketMap(); + message.markets = Object.entries(object.markets ?? {}).reduce<{ + [key: string]: Market; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Market.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: MarketMapAmino): MarketMap { + const message = createBaseMarketMap(); + message.markets = Object.entries(object.markets ?? {}).reduce<{ + [key: string]: Market; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Market.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: MarketMap): MarketMapAmino { + const obj: any = {}; + obj.markets = {}; + if (message.markets) { + Object.entries(message.markets).forEach(([k, v]) => { + obj.markets[k] = Market.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: MarketMapAminoMsg): MarketMap { + return MarketMap.fromAmino(object.value); + }, + fromProtoMsg(message: MarketMapProtoMsg): MarketMap { + return MarketMap.decode(message.value); + }, + toProto(message: MarketMap): Uint8Array { + return MarketMap.encode(message).finish(); + }, + toProtoMsg(message: MarketMap): MarketMapProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MarketMap", + value: MarketMap.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/params.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/params.ts new file mode 100644 index 00000000..d6c35da8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/params.ts @@ -0,0 +1,118 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the x/marketmap module. */ +export interface Params { + /** + * MarketAuthorities is the list of authority accounts that are able to + * control updating the marketmap. + */ + marketAuthorities: string[]; + /** + * Admin is an address that can remove addresses from the MarketAuthorities + * list. Only governance can add to the MarketAuthorities or change the Admin. + */ + admin: string; +} +export interface ParamsProtoMsg { + typeUrl: "/slinky.marketmap.v1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the x/marketmap module. */ +export interface ParamsAmino { + /** + * MarketAuthorities is the list of authority accounts that are able to + * control updating the marketmap. + */ + market_authorities?: string[]; + /** + * Admin is an address that can remove addresses from the MarketAuthorities + * list. Only governance can add to the MarketAuthorities or change the Admin. + */ + admin?: string; +} +export interface ParamsAminoMsg { + type: "/slinky.marketmap.v1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the x/marketmap module. */ +export interface ParamsSDKType { + market_authorities: string[]; + admin: string; +} +function createBaseParams(): Params { + return { + marketAuthorities: [], + admin: "" + }; +} +export const Params = { + typeUrl: "/slinky.marketmap.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.marketAuthorities) { + writer.uint32(10).string(v!); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketAuthorities.push(reader.string()); + break; + case 2: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.marketAuthorities = object.marketAuthorities?.map(e => e) || []; + message.admin = object.admin ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.marketAuthorities = object.market_authorities?.map(e => e) || []; + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.marketAuthorities) { + obj.market_authorities = message.marketAuthorities.map(e => e); + } else { + obj.market_authorities = message.marketAuthorities; + } + obj.admin = message.admin === "" ? undefined : message.admin; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/query.rpc.Query.ts new file mode 100644 index 00000000..2d8dab17 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/query.rpc.Query.ts @@ -0,0 +1,70 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { MarketMapRequest, MarketMapResponse, MarketRequest, MarketResponse, LastUpdatedRequest, LastUpdatedResponse, ParamsRequest, ParamsResponse } from "./query"; +/** Query is the query service for the x/marketmap module. */ +export interface Query { + /** + * MarketMap returns the full market map stored in the x/marketmap + * module. + */ + marketMap(request?: MarketMapRequest): Promise; + /** + * Market returns a market stored in the x/marketmap + * module. + */ + market(request: MarketRequest): Promise; + /** LastUpdated returns the last height the market map was updated at. */ + lastUpdated(request?: LastUpdatedRequest): Promise; + /** Params returns the current x/marketmap module parameters. */ + params(request?: ParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.marketMap = this.marketMap.bind(this); + this.market = this.market.bind(this); + this.lastUpdated = this.lastUpdated.bind(this); + this.params = this.params.bind(this); + } + marketMap(request: MarketMapRequest = {}): Promise { + const data = MarketMapRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Query", "MarketMap", data); + return promise.then(data => MarketMapResponse.decode(new BinaryReader(data))); + } + market(request: MarketRequest): Promise { + const data = MarketRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Query", "Market", data); + return promise.then(data => MarketResponse.decode(new BinaryReader(data))); + } + lastUpdated(request: LastUpdatedRequest = {}): Promise { + const data = LastUpdatedRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Query", "LastUpdated", data); + return promise.then(data => LastUpdatedResponse.decode(new BinaryReader(data))); + } + params(request: ParamsRequest = {}): Promise { + const data = ParamsRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Query", "Params", data); + return promise.then(data => ParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + marketMap(request?: MarketMapRequest): Promise { + return queryService.marketMap(request); + }, + market(request: MarketRequest): Promise { + return queryService.market(request); + }, + lastUpdated(request?: LastUpdatedRequest): Promise { + return queryService.lastUpdated(request); + }, + params(request?: ParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/query.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/query.ts new file mode 100644 index 00000000..7c8c8b51 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/query.ts @@ -0,0 +1,708 @@ +//@ts-nocheck +import { CurrencyPair, CurrencyPairAmino, CurrencyPairSDKType } from "../../types/v1/currency_pair"; +import { MarketMap, MarketMapAmino, MarketMapSDKType, Market, MarketAmino, MarketSDKType } from "./market"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MarketMapRequest is the query request for the MarketMap query. + * It takes no arguments. + */ +export interface MarketMapRequest {} +export interface MarketMapRequestProtoMsg { + typeUrl: "/slinky.marketmap.v1.MarketMapRequest"; + value: Uint8Array; +} +/** + * MarketMapRequest is the query request for the MarketMap query. + * It takes no arguments. + */ +export interface MarketMapRequestAmino {} +export interface MarketMapRequestAminoMsg { + type: "/slinky.marketmap.v1.MarketMapRequest"; + value: MarketMapRequestAmino; +} +/** + * MarketMapRequest is the query request for the MarketMap query. + * It takes no arguments. + */ +export interface MarketMapRequestSDKType {} +/** MarketMapResponse is the query response for the MarketMap query. */ +export interface MarketMapResponse { + /** + * MarketMap defines the global set of market configurations for all providers + * and markets. + */ + marketMap: MarketMap; + /** + * LastUpdated is the last block height that the market map was updated. + * This field can be used as an optimization for clients checking if there + * is a new update to the map. + */ + lastUpdated: bigint; + /** ChainId is the chain identifier for the market map. */ + chainId: string; +} +export interface MarketMapResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.MarketMapResponse"; + value: Uint8Array; +} +/** MarketMapResponse is the query response for the MarketMap query. */ +export interface MarketMapResponseAmino { + /** + * MarketMap defines the global set of market configurations for all providers + * and markets. + */ + market_map?: MarketMapAmino; + /** + * LastUpdated is the last block height that the market map was updated. + * This field can be used as an optimization for clients checking if there + * is a new update to the map. + */ + last_updated?: string; + /** ChainId is the chain identifier for the market map. */ + chain_id?: string; +} +export interface MarketMapResponseAminoMsg { + type: "/slinky.marketmap.v1.MarketMapResponse"; + value: MarketMapResponseAmino; +} +/** MarketMapResponse is the query response for the MarketMap query. */ +export interface MarketMapResponseSDKType { + market_map: MarketMapSDKType; + last_updated: bigint; + chain_id: string; +} +/** + * MarketRequest is the query request for the Market query. + * It takes the currency pair of the market as an argument. + */ +export interface MarketRequest { + /** + * CurrencyPair is the currency pair associated with the market being + * requested. + */ + currencyPair: CurrencyPair; +} +export interface MarketRequestProtoMsg { + typeUrl: "/slinky.marketmap.v1.MarketRequest"; + value: Uint8Array; +} +/** + * MarketRequest is the query request for the Market query. + * It takes the currency pair of the market as an argument. + */ +export interface MarketRequestAmino { + /** + * CurrencyPair is the currency pair associated with the market being + * requested. + */ + currency_pair?: CurrencyPairAmino; +} +export interface MarketRequestAminoMsg { + type: "/slinky.marketmap.v1.MarketRequest"; + value: MarketRequestAmino; +} +/** + * MarketRequest is the query request for the Market query. + * It takes the currency pair of the market as an argument. + */ +export interface MarketRequestSDKType { + currency_pair: CurrencyPairSDKType; +} +/** MarketResponse is the query response for the Market query. */ +export interface MarketResponse { + /** Market is the configuration of a single market to be price-fetched for. */ + market: Market; +} +export interface MarketResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.MarketResponse"; + value: Uint8Array; +} +/** MarketResponse is the query response for the Market query. */ +export interface MarketResponseAmino { + /** Market is the configuration of a single market to be price-fetched for. */ + market?: MarketAmino; +} +export interface MarketResponseAminoMsg { + type: "/slinky.marketmap.v1.MarketResponse"; + value: MarketResponseAmino; +} +/** MarketResponse is the query response for the Market query. */ +export interface MarketResponseSDKType { + market: MarketSDKType; +} +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequest {} +export interface ParamsRequestProtoMsg { + typeUrl: "/slinky.marketmap.v1.ParamsRequest"; + value: Uint8Array; +} +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestAmino {} +export interface ParamsRequestAminoMsg { + type: "/slinky.marketmap.v1.ParamsRequest"; + value: ParamsRequestAmino; +} +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestSDKType {} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponse { + params: Params; +} +export interface ParamsResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.ParamsResponse"; + value: Uint8Array; +} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseAmino { + params?: ParamsAmino; +} +export interface ParamsResponseAminoMsg { + type: "/slinky.marketmap.v1.ParamsResponse"; + value: ParamsResponseAmino; +} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseSDKType { + params: ParamsSDKType; +} +/** + * LastUpdatedRequest is the request type for the Query/LastUpdated RPC + * method. + */ +export interface LastUpdatedRequest {} +export interface LastUpdatedRequestProtoMsg { + typeUrl: "/slinky.marketmap.v1.LastUpdatedRequest"; + value: Uint8Array; +} +/** + * LastUpdatedRequest is the request type for the Query/LastUpdated RPC + * method. + */ +export interface LastUpdatedRequestAmino {} +export interface LastUpdatedRequestAminoMsg { + type: "/slinky.marketmap.v1.LastUpdatedRequest"; + value: LastUpdatedRequestAmino; +} +/** + * LastUpdatedRequest is the request type for the Query/LastUpdated RPC + * method. + */ +export interface LastUpdatedRequestSDKType {} +/** + * LastUpdatedResponse is the response type for the Query/LastUpdated RPC + * method. + */ +export interface LastUpdatedResponse { + lastUpdated: bigint; +} +export interface LastUpdatedResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.LastUpdatedResponse"; + value: Uint8Array; +} +/** + * LastUpdatedResponse is the response type for the Query/LastUpdated RPC + * method. + */ +export interface LastUpdatedResponseAmino { + last_updated?: string; +} +export interface LastUpdatedResponseAminoMsg { + type: "/slinky.marketmap.v1.LastUpdatedResponse"; + value: LastUpdatedResponseAmino; +} +/** + * LastUpdatedResponse is the response type for the Query/LastUpdated RPC + * method. + */ +export interface LastUpdatedResponseSDKType { + last_updated: bigint; +} +function createBaseMarketMapRequest(): MarketMapRequest { + return {}; +} +export const MarketMapRequest = { + typeUrl: "/slinky.marketmap.v1.MarketMapRequest", + encode(_: MarketMapRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketMapRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketMapRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MarketMapRequest { + const message = createBaseMarketMapRequest(); + return message; + }, + fromAmino(_: MarketMapRequestAmino): MarketMapRequest { + const message = createBaseMarketMapRequest(); + return message; + }, + toAmino(_: MarketMapRequest): MarketMapRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MarketMapRequestAminoMsg): MarketMapRequest { + return MarketMapRequest.fromAmino(object.value); + }, + fromProtoMsg(message: MarketMapRequestProtoMsg): MarketMapRequest { + return MarketMapRequest.decode(message.value); + }, + toProto(message: MarketMapRequest): Uint8Array { + return MarketMapRequest.encode(message).finish(); + }, + toProtoMsg(message: MarketMapRequest): MarketMapRequestProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MarketMapRequest", + value: MarketMapRequest.encode(message).finish() + }; + } +}; +function createBaseMarketMapResponse(): MarketMapResponse { + return { + marketMap: MarketMap.fromPartial({}), + lastUpdated: BigInt(0), + chainId: "" + }; +} +export const MarketMapResponse = { + typeUrl: "/slinky.marketmap.v1.MarketMapResponse", + encode(message: MarketMapResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketMap !== undefined) { + MarketMap.encode(message.marketMap, writer.uint32(10).fork()).ldelim(); + } + if (message.lastUpdated !== BigInt(0)) { + writer.uint32(16).uint64(message.lastUpdated); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketMapResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketMapResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketMap = MarketMap.decode(reader, reader.uint32()); + break; + case 2: + message.lastUpdated = reader.uint64(); + break; + case 3: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketMapResponse { + const message = createBaseMarketMapResponse(); + message.marketMap = object.marketMap !== undefined && object.marketMap !== null ? MarketMap.fromPartial(object.marketMap) : undefined; + message.lastUpdated = object.lastUpdated !== undefined && object.lastUpdated !== null ? BigInt(object.lastUpdated.toString()) : BigInt(0); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: MarketMapResponseAmino): MarketMapResponse { + const message = createBaseMarketMapResponse(); + if (object.market_map !== undefined && object.market_map !== null) { + message.marketMap = MarketMap.fromAmino(object.market_map); + } + if (object.last_updated !== undefined && object.last_updated !== null) { + message.lastUpdated = BigInt(object.last_updated); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: MarketMapResponse): MarketMapResponseAmino { + const obj: any = {}; + obj.market_map = message.marketMap ? MarketMap.toAmino(message.marketMap) : undefined; + obj.last_updated = message.lastUpdated !== BigInt(0) ? message.lastUpdated.toString() : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + return obj; + }, + fromAminoMsg(object: MarketMapResponseAminoMsg): MarketMapResponse { + return MarketMapResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MarketMapResponseProtoMsg): MarketMapResponse { + return MarketMapResponse.decode(message.value); + }, + toProto(message: MarketMapResponse): Uint8Array { + return MarketMapResponse.encode(message).finish(); + }, + toProtoMsg(message: MarketMapResponse): MarketMapResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MarketMapResponse", + value: MarketMapResponse.encode(message).finish() + }; + } +}; +function createBaseMarketRequest(): MarketRequest { + return { + currencyPair: CurrencyPair.fromPartial({}) + }; +} +export const MarketRequest = { + typeUrl: "/slinky.marketmap.v1.MarketRequest", + encode(message: MarketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.currencyPair !== undefined) { + CurrencyPair.encode(message.currencyPair, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyPair = CurrencyPair.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketRequest { + const message = createBaseMarketRequest(); + message.currencyPair = object.currencyPair !== undefined && object.currencyPair !== null ? CurrencyPair.fromPartial(object.currencyPair) : undefined; + return message; + }, + fromAmino(object: MarketRequestAmino): MarketRequest { + const message = createBaseMarketRequest(); + if (object.currency_pair !== undefined && object.currency_pair !== null) { + message.currencyPair = CurrencyPair.fromAmino(object.currency_pair); + } + return message; + }, + toAmino(message: MarketRequest): MarketRequestAmino { + const obj: any = {}; + obj.currency_pair = message.currencyPair ? CurrencyPair.toAmino(message.currencyPair) : undefined; + return obj; + }, + fromAminoMsg(object: MarketRequestAminoMsg): MarketRequest { + return MarketRequest.fromAmino(object.value); + }, + fromProtoMsg(message: MarketRequestProtoMsg): MarketRequest { + return MarketRequest.decode(message.value); + }, + toProto(message: MarketRequest): Uint8Array { + return MarketRequest.encode(message).finish(); + }, + toProtoMsg(message: MarketRequest): MarketRequestProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MarketRequest", + value: MarketRequest.encode(message).finish() + }; + } +}; +function createBaseMarketResponse(): MarketResponse { + return { + market: Market.fromPartial({}) + }; +} +export const MarketResponse = { + typeUrl: "/slinky.marketmap.v1.MarketResponse", + encode(message: MarketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.market !== undefined) { + Market.encode(message.market, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MarketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.market = Market.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MarketResponse { + const message = createBaseMarketResponse(); + message.market = object.market !== undefined && object.market !== null ? Market.fromPartial(object.market) : undefined; + return message; + }, + fromAmino(object: MarketResponseAmino): MarketResponse { + const message = createBaseMarketResponse(); + if (object.market !== undefined && object.market !== null) { + message.market = Market.fromAmino(object.market); + } + return message; + }, + toAmino(message: MarketResponse): MarketResponseAmino { + const obj: any = {}; + obj.market = message.market ? Market.toAmino(message.market) : undefined; + return obj; + }, + fromAminoMsg(object: MarketResponseAminoMsg): MarketResponse { + return MarketResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MarketResponseProtoMsg): MarketResponse { + return MarketResponse.decode(message.value); + }, + toProto(message: MarketResponse): Uint8Array { + return MarketResponse.encode(message).finish(); + }, + toProtoMsg(message: MarketResponse): MarketResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MarketResponse", + value: MarketResponse.encode(message).finish() + }; + } +}; +function createBaseParamsRequest(): ParamsRequest { + return {}; +} +export const ParamsRequest = { + typeUrl: "/slinky.marketmap.v1.ParamsRequest", + encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + fromAmino(_: ParamsRequestAmino): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + toAmino(_: ParamsRequest): ParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsRequestAminoMsg): ParamsRequest { + return ParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsRequestProtoMsg): ParamsRequest { + return ParamsRequest.decode(message.value); + }, + toProto(message: ParamsRequest): Uint8Array { + return ParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: ParamsRequest): ParamsRequestProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.ParamsRequest", + value: ParamsRequest.encode(message).finish() + }; + } +}; +function createBaseParamsResponse(): ParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const ParamsResponse = { + typeUrl: "/slinky.marketmap.v1.ParamsResponse", + encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParamsResponse { + const message = createBaseParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: ParamsResponseAmino): ParamsResponse { + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: ParamsResponse): ParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsResponseAminoMsg): ParamsResponse { + return ParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsResponseProtoMsg): ParamsResponse { + return ParamsResponse.decode(message.value); + }, + toProto(message: ParamsResponse): Uint8Array { + return ParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: ParamsResponse): ParamsResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.ParamsResponse", + value: ParamsResponse.encode(message).finish() + }; + } +}; +function createBaseLastUpdatedRequest(): LastUpdatedRequest { + return {}; +} +export const LastUpdatedRequest = { + typeUrl: "/slinky.marketmap.v1.LastUpdatedRequest", + encode(_: LastUpdatedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastUpdatedRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastUpdatedRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): LastUpdatedRequest { + const message = createBaseLastUpdatedRequest(); + return message; + }, + fromAmino(_: LastUpdatedRequestAmino): LastUpdatedRequest { + const message = createBaseLastUpdatedRequest(); + return message; + }, + toAmino(_: LastUpdatedRequest): LastUpdatedRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: LastUpdatedRequestAminoMsg): LastUpdatedRequest { + return LastUpdatedRequest.fromAmino(object.value); + }, + fromProtoMsg(message: LastUpdatedRequestProtoMsg): LastUpdatedRequest { + return LastUpdatedRequest.decode(message.value); + }, + toProto(message: LastUpdatedRequest): Uint8Array { + return LastUpdatedRequest.encode(message).finish(); + }, + toProtoMsg(message: LastUpdatedRequest): LastUpdatedRequestProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.LastUpdatedRequest", + value: LastUpdatedRequest.encode(message).finish() + }; + } +}; +function createBaseLastUpdatedResponse(): LastUpdatedResponse { + return { + lastUpdated: BigInt(0) + }; +} +export const LastUpdatedResponse = { + typeUrl: "/slinky.marketmap.v1.LastUpdatedResponse", + encode(message: LastUpdatedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastUpdated !== BigInt(0)) { + writer.uint32(8).uint64(message.lastUpdated); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastUpdatedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastUpdatedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastUpdated = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LastUpdatedResponse { + const message = createBaseLastUpdatedResponse(); + message.lastUpdated = object.lastUpdated !== undefined && object.lastUpdated !== null ? BigInt(object.lastUpdated.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastUpdatedResponseAmino): LastUpdatedResponse { + const message = createBaseLastUpdatedResponse(); + if (object.last_updated !== undefined && object.last_updated !== null) { + message.lastUpdated = BigInt(object.last_updated); + } + return message; + }, + toAmino(message: LastUpdatedResponse): LastUpdatedResponseAmino { + const obj: any = {}; + obj.last_updated = message.lastUpdated !== BigInt(0) ? message.lastUpdated.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastUpdatedResponseAminoMsg): LastUpdatedResponse { + return LastUpdatedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: LastUpdatedResponseProtoMsg): LastUpdatedResponse { + return LastUpdatedResponse.decode(message.value); + }, + toProto(message: LastUpdatedResponse): Uint8Array { + return LastUpdatedResponse.encode(message).finish(); + }, + toProtoMsg(message: LastUpdatedResponse): LastUpdatedResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.LastUpdatedResponse", + value: LastUpdatedResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.amino.ts new file mode 100644 index 00000000..6507784d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.amino.ts @@ -0,0 +1,29 @@ +//@ts-nocheck +import { MsgCreateMarkets, MsgUpdateMarkets, MsgParams, MsgRemoveMarketAuthorities, MsgUpsertMarkets } from "./tx"; +export const AminoConverter = { + "/slinky.marketmap.v1.MsgCreateMarkets": { + aminoType: "slinky/x/marketmap/MsgCreateMarkets", + toAmino: MsgCreateMarkets.toAmino, + fromAmino: MsgCreateMarkets.fromAmino + }, + "/slinky.marketmap.v1.MsgUpdateMarkets": { + aminoType: "slinky/x/marketmap/MsgUpdateMarkets", + toAmino: MsgUpdateMarkets.toAmino, + fromAmino: MsgUpdateMarkets.fromAmino + }, + "/slinky.marketmap.v1.MsgParams": { + aminoType: "/slinky.marketmap.v1.MsgParams", + toAmino: MsgParams.toAmino, + fromAmino: MsgParams.fromAmino + }, + "/slinky.marketmap.v1.MsgRemoveMarketAuthorities": { + aminoType: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", + toAmino: MsgRemoveMarketAuthorities.toAmino, + fromAmino: MsgRemoveMarketAuthorities.fromAmino + }, + "/slinky.marketmap.v1.MsgUpsertMarkets": { + aminoType: "slinky/x/marketmap/MsgUpsertMarkets", + toAmino: MsgUpsertMarkets.toAmino, + fromAmino: MsgUpsertMarkets.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.registry.ts new file mode 100644 index 00000000..8cc06559 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.registry.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateMarkets, MsgUpdateMarkets, MsgParams, MsgRemoveMarketAuthorities, MsgUpsertMarkets } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/slinky.marketmap.v1.MsgCreateMarkets", MsgCreateMarkets], ["/slinky.marketmap.v1.MsgUpdateMarkets", MsgUpdateMarkets], ["/slinky.marketmap.v1.MsgParams", MsgParams], ["/slinky.marketmap.v1.MsgRemoveMarketAuthorities", MsgRemoveMarketAuthorities], ["/slinky.marketmap.v1.MsgUpsertMarkets", MsgUpsertMarkets]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createMarkets(value: MsgCreateMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarkets", + value: MsgCreateMarkets.encode(value).finish() + }; + }, + updateMarkets(value: MsgUpdateMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarkets", + value: MsgUpdateMarkets.encode(value).finish() + }; + }, + updateParams(value: MsgParams) { + return { + typeUrl: "/slinky.marketmap.v1.MsgParams", + value: MsgParams.encode(value).finish() + }; + }, + removeMarketAuthorities(value: MsgRemoveMarketAuthorities) { + return { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", + value: MsgRemoveMarketAuthorities.encode(value).finish() + }; + }, + upsertMarkets(value: MsgUpsertMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarkets", + value: MsgUpsertMarkets.encode(value).finish() + }; + } + }, + withTypeUrl: { + createMarkets(value: MsgCreateMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarkets", + value + }; + }, + updateMarkets(value: MsgUpdateMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarkets", + value + }; + }, + updateParams(value: MsgParams) { + return { + typeUrl: "/slinky.marketmap.v1.MsgParams", + value + }; + }, + removeMarketAuthorities(value: MsgRemoveMarketAuthorities) { + return { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", + value + }; + }, + upsertMarkets(value: MsgUpsertMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarkets", + value + }; + } + }, + fromPartial: { + createMarkets(value: MsgCreateMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarkets", + value: MsgCreateMarkets.fromPartial(value) + }; + }, + updateMarkets(value: MsgUpdateMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarkets", + value: MsgUpdateMarkets.fromPartial(value) + }; + }, + updateParams(value: MsgParams) { + return { + typeUrl: "/slinky.marketmap.v1.MsgParams", + value: MsgParams.fromPartial(value) + }; + }, + removeMarketAuthorities(value: MsgRemoveMarketAuthorities) { + return { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", + value: MsgRemoveMarketAuthorities.fromPartial(value) + }; + }, + upsertMarkets(value: MsgUpsertMarkets) { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarkets", + value: MsgUpsertMarkets.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..4ff1d51e --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.rpc.msg.ts @@ -0,0 +1,63 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateMarkets, MsgCreateMarketsResponse, MsgUpdateMarkets, MsgUpdateMarketsResponse, MsgParams, MsgParamsResponse, MsgRemoveMarketAuthorities, MsgRemoveMarketAuthoritiesResponse, MsgUpsertMarkets, MsgUpsertMarketsResponse } from "./tx"; +/** Msg is the message service for the x/marketmap module. */ +export interface Msg { + /** CreateMarkets creates markets from the given message. */ + createMarkets(request: MsgCreateMarkets): Promise; + /** UpdateMarkets updates markets from the given message. */ + updateMarkets(request: MsgUpdateMarkets): Promise; + /** + * UpdateParams defines a method for updating the x/marketmap module + * parameters. + */ + updateParams(request: MsgParams): Promise; + /** + * RemoveMarketAuthorities defines a method for removing market authorities + * from the x/marketmap module. the signer must be the admin. + */ + removeMarketAuthorities(request: MsgRemoveMarketAuthorities): Promise; + /** + * UpsertMarkets wraps both Create / Update markets into a single message. + * Specifically if a market does not exist it will be created, otherwise it + * will be updated. The response will be a map between ticker -> updated. + */ + upsertMarkets(request: MsgUpsertMarkets): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createMarkets = this.createMarkets.bind(this); + this.updateMarkets = this.updateMarkets.bind(this); + this.updateParams = this.updateParams.bind(this); + this.removeMarketAuthorities = this.removeMarketAuthorities.bind(this); + this.upsertMarkets = this.upsertMarkets.bind(this); + } + createMarkets(request: MsgCreateMarkets): Promise { + const data = MsgCreateMarkets.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Msg", "CreateMarkets", data); + return promise.then(data => MsgCreateMarketsResponse.decode(new BinaryReader(data))); + } + updateMarkets(request: MsgUpdateMarkets): Promise { + const data = MsgUpdateMarkets.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Msg", "UpdateMarkets", data); + return promise.then(data => MsgUpdateMarketsResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgParams): Promise { + const data = MsgParams.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgParamsResponse.decode(new BinaryReader(data))); + } + removeMarketAuthorities(request: MsgRemoveMarketAuthorities): Promise { + const data = MsgRemoveMarketAuthorities.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Msg", "RemoveMarketAuthorities", data); + return promise.then(data => MsgRemoveMarketAuthoritiesResponse.decode(new BinaryReader(data))); + } + upsertMarkets(request: MsgUpsertMarkets): Promise { + const data = MsgUpsertMarkets.encode(request).finish(); + const promise = this.rpc.request("slinky.marketmap.v1.Msg", "UpsertMarkets", data); + return promise.then(data => MsgUpsertMarketsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.ts b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.ts new file mode 100644 index 00000000..901ae94b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/marketmap/v1/tx.ts @@ -0,0 +1,1123 @@ +//@ts-nocheck +import { Market, MarketAmino, MarketSDKType } from "./market"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgUpsertMarkets defines a message carrying a payload for performing market + * upserts (update or create if does not exist) in the x/marketmap module. + */ +export interface MsgUpsertMarkets { + /** + * Authority is the signer of this transaction. This authority must be + * authorized by the module to execute the message. + */ + authority: string; + /** + * CreateMarkets is the list of all markets to be created for the given + * transaction. + */ + markets: Market[]; +} +export interface MsgUpsertMarketsProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarkets"; + value: Uint8Array; +} +/** + * MsgUpsertMarkets defines a message carrying a payload for performing market + * upserts (update or create if does not exist) in the x/marketmap module. + */ +export interface MsgUpsertMarketsAmino { + /** + * Authority is the signer of this transaction. This authority must be + * authorized by the module to execute the message. + */ + authority?: string; + /** + * CreateMarkets is the list of all markets to be created for the given + * transaction. + */ + markets?: MarketAmino[]; +} +export interface MsgUpsertMarketsAminoMsg { + type: "slinky/x/marketmap/MsgUpsertMarkets"; + value: MsgUpsertMarketsAmino; +} +/** + * MsgUpsertMarkets defines a message carrying a payload for performing market + * upserts (update or create if does not exist) in the x/marketmap module. + */ +export interface MsgUpsertMarketsSDKType { + authority: string; + markets: MarketSDKType[]; +} +export interface MsgUpsertMarketsResponse_MarketUpdatesEntry { + key: string; + value: boolean; +} +export interface MsgUpsertMarketsResponse_MarketUpdatesEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface MsgUpsertMarketsResponse_MarketUpdatesEntryAmino { + key?: string; + value?: boolean; +} +export interface MsgUpsertMarketsResponse_MarketUpdatesEntryAminoMsg { + type: string; + value: MsgUpsertMarketsResponse_MarketUpdatesEntryAmino; +} +export interface MsgUpsertMarketsResponse_MarketUpdatesEntrySDKType { + key: string; + value: boolean; +} +/** + * MsgUpsertMarketsResponse is the response from the UpsertMarkets API in the + * x/marketmap module. + */ +export interface MsgUpsertMarketsResponse { + /** + * UpdatedMarkets is a map between the ticker and whether the market was + * updated. + * Deprecated: This field will be empty in all responses. + */ + /** @deprecated */ + marketUpdates: { + [key: string]: boolean; + }; +} +export interface MsgUpsertMarketsResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarketsResponse"; + value: Uint8Array; +} +/** + * MsgUpsertMarketsResponse is the response from the UpsertMarkets API in the + * x/marketmap module. + */ +export interface MsgUpsertMarketsResponseAmino { + /** + * UpdatedMarkets is a map between the ticker and whether the market was + * updated. + * Deprecated: This field will be empty in all responses. + */ + /** @deprecated */ + market_updates?: { + [key: string]: boolean; + }; +} +export interface MsgUpsertMarketsResponseAminoMsg { + type: "/slinky.marketmap.v1.MsgUpsertMarketsResponse"; + value: MsgUpsertMarketsResponseAmino; +} +/** + * MsgUpsertMarketsResponse is the response from the UpsertMarkets API in the + * x/marketmap module. + */ +export interface MsgUpsertMarketsResponseSDKType { + /** @deprecated */ + market_updates: { + [key: string]: boolean; + }; +} +/** + * MsgCreateMarkets defines a message carrying a payload for creating markets in + * the x/marketmap module. + */ +export interface MsgCreateMarkets { + /** + * Authority is the signer of this transaction. This authority must be + * authorized by the module to execute the message. + */ + authority: string; + /** + * CreateMarkets is the list of all markets to be created for the given + * transaction. + */ + createMarkets: Market[]; +} +export interface MsgCreateMarketsProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarkets"; + value: Uint8Array; +} +/** + * MsgCreateMarkets defines a message carrying a payload for creating markets in + * the x/marketmap module. + */ +export interface MsgCreateMarketsAmino { + /** + * Authority is the signer of this transaction. This authority must be + * authorized by the module to execute the message. + */ + authority?: string; + /** + * CreateMarkets is the list of all markets to be created for the given + * transaction. + */ + create_markets?: MarketAmino[]; +} +export interface MsgCreateMarketsAminoMsg { + type: "slinky/x/marketmap/MsgCreateMarkets"; + value: MsgCreateMarketsAmino; +} +/** + * MsgCreateMarkets defines a message carrying a payload for creating markets in + * the x/marketmap module. + */ +export interface MsgCreateMarketsSDKType { + authority: string; + create_markets: MarketSDKType[]; +} +/** MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. */ +export interface MsgCreateMarketsResponse {} +export interface MsgCreateMarketsResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarketsResponse"; + value: Uint8Array; +} +/** MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. */ +export interface MsgCreateMarketsResponseAmino {} +export interface MsgCreateMarketsResponseAminoMsg { + type: "/slinky.marketmap.v1.MsgCreateMarketsResponse"; + value: MsgCreateMarketsResponseAmino; +} +/** MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. */ +export interface MsgCreateMarketsResponseSDKType {} +/** + * MsgUpdateMarkets defines a message carrying a payload for updating the + * x/marketmap module. + */ +export interface MsgUpdateMarkets { + /** + * Authority is the signer of this transaction. This authority must be + * authorized by the module to execute the message. + */ + authority: string; + /** + * UpdateMarkets is the list of all markets to be updated for the given + * transaction. + */ + updateMarkets: Market[]; +} +export interface MsgUpdateMarketsProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarkets"; + value: Uint8Array; +} +/** + * MsgUpdateMarkets defines a message carrying a payload for updating the + * x/marketmap module. + */ +export interface MsgUpdateMarketsAmino { + /** + * Authority is the signer of this transaction. This authority must be + * authorized by the module to execute the message. + */ + authority?: string; + /** + * UpdateMarkets is the list of all markets to be updated for the given + * transaction. + */ + update_markets?: MarketAmino[]; +} +export interface MsgUpdateMarketsAminoMsg { + type: "slinky/x/marketmap/MsgUpdateMarkets"; + value: MsgUpdateMarketsAmino; +} +/** + * MsgUpdateMarkets defines a message carrying a payload for updating the + * x/marketmap module. + */ +export interface MsgUpdateMarketsSDKType { + authority: string; + update_markets: MarketSDKType[]; +} +/** MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. */ +export interface MsgUpdateMarketsResponse {} +export interface MsgUpdateMarketsResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarketsResponse"; + value: Uint8Array; +} +/** MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. */ +export interface MsgUpdateMarketsResponseAmino {} +export interface MsgUpdateMarketsResponseAminoMsg { + type: "/slinky.marketmap.v1.MsgUpdateMarketsResponse"; + value: MsgUpdateMarketsResponseAmino; +} +/** MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. */ +export interface MsgUpdateMarketsResponseSDKType {} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the x/marketmap module. + */ +export interface MsgParams { + /** Params defines the new parameters for the x/marketmap module. */ + params: Params; + /** + * Authority defines the authority that is updating the x/marketmap module + * parameters. + */ + authority: string; +} +export interface MsgParamsProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgParams"; + value: Uint8Array; +} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the x/marketmap module. + */ +export interface MsgParamsAmino { + /** Params defines the new parameters for the x/marketmap module. */ + params?: ParamsAmino; + /** + * Authority defines the authority that is updating the x/marketmap module + * parameters. + */ + authority?: string; +} +export interface MsgParamsAminoMsg { + type: "/slinky.marketmap.v1.MsgParams"; + value: MsgParamsAmino; +} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the x/marketmap module. + */ +export interface MsgParamsSDKType { + params: ParamsSDKType; + authority: string; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponse {} +export interface MsgParamsResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgParamsResponse"; + value: Uint8Array; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponseAmino {} +export interface MsgParamsResponseAminoMsg { + type: "/slinky.marketmap.v1.MsgParamsResponse"; + value: MsgParamsResponseAmino; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponseSDKType {} +/** + * MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse + * request type. It contains the new addresses to remove from the list of + * authorities + */ +export interface MsgRemoveMarketAuthorities { + /** RemoveAddresses is the list of addresses to remove. */ + removeAddresses: string[]; + /** + * Admin defines the authority that is the x/marketmap + * Admin account. This account is set in the module parameters. + */ + admin: string; +} +export interface MsgRemoveMarketAuthoritiesProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities"; + value: Uint8Array; +} +/** + * MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse + * request type. It contains the new addresses to remove from the list of + * authorities + */ +export interface MsgRemoveMarketAuthoritiesAmino { + /** RemoveAddresses is the list of addresses to remove. */ + remove_addresses?: string[]; + /** + * Admin defines the authority that is the x/marketmap + * Admin account. This account is set in the module parameters. + */ + admin?: string; +} +export interface MsgRemoveMarketAuthoritiesAminoMsg { + type: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities"; + value: MsgRemoveMarketAuthoritiesAmino; +} +/** + * MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse + * request type. It contains the new addresses to remove from the list of + * authorities + */ +export interface MsgRemoveMarketAuthoritiesSDKType { + remove_addresses: string[]; + admin: string; +} +/** + * MsgRemoveMarketAuthoritiesResponse defines the + * Msg/RemoveMarketAuthoritiesResponse response type. + */ +export interface MsgRemoveMarketAuthoritiesResponse {} +export interface MsgRemoveMarketAuthoritiesResponseProtoMsg { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse"; + value: Uint8Array; +} +/** + * MsgRemoveMarketAuthoritiesResponse defines the + * Msg/RemoveMarketAuthoritiesResponse response type. + */ +export interface MsgRemoveMarketAuthoritiesResponseAmino {} +export interface MsgRemoveMarketAuthoritiesResponseAminoMsg { + type: "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse"; + value: MsgRemoveMarketAuthoritiesResponseAmino; +} +/** + * MsgRemoveMarketAuthoritiesResponse defines the + * Msg/RemoveMarketAuthoritiesResponse response type. + */ +export interface MsgRemoveMarketAuthoritiesResponseSDKType {} +function createBaseMsgUpsertMarkets(): MsgUpsertMarkets { + return { + authority: "", + markets: [] + }; +} +export const MsgUpsertMarkets = { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarkets", + encode(message: MsgUpsertMarkets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.markets) { + Market.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpsertMarkets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpsertMarkets(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.markets.push(Market.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpsertMarkets { + const message = createBaseMsgUpsertMarkets(); + message.authority = object.authority ?? ""; + message.markets = object.markets?.map(e => Market.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpsertMarketsAmino): MsgUpsertMarkets { + const message = createBaseMsgUpsertMarkets(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.markets = object.markets?.map(e => Market.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpsertMarkets): MsgUpsertMarketsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.markets) { + obj.markets = message.markets.map(e => e ? Market.toAmino(e) : undefined); + } else { + obj.markets = message.markets; + } + return obj; + }, + fromAminoMsg(object: MsgUpsertMarketsAminoMsg): MsgUpsertMarkets { + return MsgUpsertMarkets.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpsertMarkets): MsgUpsertMarketsAminoMsg { + return { + type: "slinky/x/marketmap/MsgUpsertMarkets", + value: MsgUpsertMarkets.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpsertMarketsProtoMsg): MsgUpsertMarkets { + return MsgUpsertMarkets.decode(message.value); + }, + toProto(message: MsgUpsertMarkets): Uint8Array { + return MsgUpsertMarkets.encode(message).finish(); + }, + toProtoMsg(message: MsgUpsertMarkets): MsgUpsertMarketsProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarkets", + value: MsgUpsertMarkets.encode(message).finish() + }; + } +}; +function createBaseMsgUpsertMarketsResponse_MarketUpdatesEntry(): MsgUpsertMarketsResponse_MarketUpdatesEntry { + return { + key: "", + value: false + }; +} +export const MsgUpsertMarketsResponse_MarketUpdatesEntry = { + encode(message: MsgUpsertMarketsResponse_MarketUpdatesEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value === true) { + writer.uint32(16).bool(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpsertMarketsResponse_MarketUpdatesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpsertMarketsResponse_MarketUpdatesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpsertMarketsResponse_MarketUpdatesEntry { + const message = createBaseMsgUpsertMarketsResponse_MarketUpdatesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? false; + return message; + }, + fromAmino(object: MsgUpsertMarketsResponse_MarketUpdatesEntryAmino): MsgUpsertMarketsResponse_MarketUpdatesEntry { + const message = createBaseMsgUpsertMarketsResponse_MarketUpdatesEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: MsgUpsertMarketsResponse_MarketUpdatesEntry): MsgUpsertMarketsResponse_MarketUpdatesEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === false ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: MsgUpsertMarketsResponse_MarketUpdatesEntryAminoMsg): MsgUpsertMarketsResponse_MarketUpdatesEntry { + return MsgUpsertMarketsResponse_MarketUpdatesEntry.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpsertMarketsResponse_MarketUpdatesEntryProtoMsg): MsgUpsertMarketsResponse_MarketUpdatesEntry { + return MsgUpsertMarketsResponse_MarketUpdatesEntry.decode(message.value); + }, + toProto(message: MsgUpsertMarketsResponse_MarketUpdatesEntry): Uint8Array { + return MsgUpsertMarketsResponse_MarketUpdatesEntry.encode(message).finish(); + } +}; +function createBaseMsgUpsertMarketsResponse(): MsgUpsertMarketsResponse { + return { + marketUpdates: {} + }; +} +export const MsgUpsertMarketsResponse = { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarketsResponse", + encode(message: MsgUpsertMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.marketUpdates).forEach(([key, value]) => { + MsgUpsertMarketsResponse_MarketUpdatesEntry.encode({ + key: key as any, + value + }, writer.uint32(8).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpsertMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpsertMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = MsgUpsertMarketsResponse_MarketUpdatesEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.marketUpdates[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpsertMarketsResponse { + const message = createBaseMsgUpsertMarketsResponse(); + message.marketUpdates = Object.entries(object.marketUpdates ?? {}).reduce<{ + [key: string]: bool; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bool.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: MsgUpsertMarketsResponseAmino): MsgUpsertMarketsResponse { + const message = createBaseMsgUpsertMarketsResponse(); + message.marketUpdates = Object.entries(object.market_updates ?? {}).reduce<{ + [key: string]: bool; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bool.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: MsgUpsertMarketsResponse): MsgUpsertMarketsResponseAmino { + const obj: any = {}; + obj.market_updates = {}; + if (message.marketUpdates) { + Object.entries(message.marketUpdates).forEach(([k, v]) => { + obj.market_updates[k] = bool.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: MsgUpsertMarketsResponseAminoMsg): MsgUpsertMarketsResponse { + return MsgUpsertMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpsertMarketsResponseProtoMsg): MsgUpsertMarketsResponse { + return MsgUpsertMarketsResponse.decode(message.value); + }, + toProto(message: MsgUpsertMarketsResponse): Uint8Array { + return MsgUpsertMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpsertMarketsResponse): MsgUpsertMarketsResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpsertMarketsResponse", + value: MsgUpsertMarketsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreateMarkets(): MsgCreateMarkets { + return { + authority: "", + createMarkets: [] + }; +} +export const MsgCreateMarkets = { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarkets", + encode(message: MsgCreateMarkets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.createMarkets) { + Market.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateMarkets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateMarkets(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.createMarkets.push(Market.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateMarkets { + const message = createBaseMsgCreateMarkets(); + message.authority = object.authority ?? ""; + message.createMarkets = object.createMarkets?.map(e => Market.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCreateMarketsAmino): MsgCreateMarkets { + const message = createBaseMsgCreateMarkets(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.createMarkets = object.create_markets?.map(e => Market.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCreateMarkets): MsgCreateMarketsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.createMarkets) { + obj.create_markets = message.createMarkets.map(e => e ? Market.toAmino(e) : undefined); + } else { + obj.create_markets = message.createMarkets; + } + return obj; + }, + fromAminoMsg(object: MsgCreateMarketsAminoMsg): MsgCreateMarkets { + return MsgCreateMarkets.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateMarkets): MsgCreateMarketsAminoMsg { + return { + type: "slinky/x/marketmap/MsgCreateMarkets", + value: MsgCreateMarkets.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateMarketsProtoMsg): MsgCreateMarkets { + return MsgCreateMarkets.decode(message.value); + }, + toProto(message: MsgCreateMarkets): Uint8Array { + return MsgCreateMarkets.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateMarkets): MsgCreateMarketsProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarkets", + value: MsgCreateMarkets.encode(message).finish() + }; + } +}; +function createBaseMsgCreateMarketsResponse(): MsgCreateMarketsResponse { + return {}; +} +export const MsgCreateMarketsResponse = { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarketsResponse", + encode(_: MsgCreateMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateMarketsResponse { + const message = createBaseMsgCreateMarketsResponse(); + return message; + }, + fromAmino(_: MsgCreateMarketsResponseAmino): MsgCreateMarketsResponse { + const message = createBaseMsgCreateMarketsResponse(); + return message; + }, + toAmino(_: MsgCreateMarketsResponse): MsgCreateMarketsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateMarketsResponseAminoMsg): MsgCreateMarketsResponse { + return MsgCreateMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateMarketsResponseProtoMsg): MsgCreateMarketsResponse { + return MsgCreateMarketsResponse.decode(message.value); + }, + toProto(message: MsgCreateMarketsResponse): Uint8Array { + return MsgCreateMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateMarketsResponse): MsgCreateMarketsResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgCreateMarketsResponse", + value: MsgCreateMarketsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateMarkets(): MsgUpdateMarkets { + return { + authority: "", + updateMarkets: [] + }; +} +export const MsgUpdateMarkets = { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarkets", + encode(message: MsgUpdateMarkets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.updateMarkets) { + Market.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarkets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarkets(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.updateMarkets.push(Market.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateMarkets { + const message = createBaseMsgUpdateMarkets(); + message.authority = object.authority ?? ""; + message.updateMarkets = object.updateMarkets?.map(e => Market.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateMarketsAmino): MsgUpdateMarkets { + const message = createBaseMsgUpdateMarkets(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.updateMarkets = object.update_markets?.map(e => Market.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateMarkets): MsgUpdateMarketsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.updateMarkets) { + obj.update_markets = message.updateMarkets.map(e => e ? Market.toAmino(e) : undefined); + } else { + obj.update_markets = message.updateMarkets; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateMarketsAminoMsg): MsgUpdateMarkets { + return MsgUpdateMarkets.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateMarkets): MsgUpdateMarketsAminoMsg { + return { + type: "slinky/x/marketmap/MsgUpdateMarkets", + value: MsgUpdateMarkets.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateMarketsProtoMsg): MsgUpdateMarkets { + return MsgUpdateMarkets.decode(message.value); + }, + toProto(message: MsgUpdateMarkets): Uint8Array { + return MsgUpdateMarkets.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateMarkets): MsgUpdateMarketsProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarkets", + value: MsgUpdateMarkets.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateMarketsResponse(): MsgUpdateMarketsResponse { + return {}; +} +export const MsgUpdateMarketsResponse = { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarketsResponse", + encode(_: MsgUpdateMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateMarketsResponse { + const message = createBaseMsgUpdateMarketsResponse(); + return message; + }, + fromAmino(_: MsgUpdateMarketsResponseAmino): MsgUpdateMarketsResponse { + const message = createBaseMsgUpdateMarketsResponse(); + return message; + }, + toAmino(_: MsgUpdateMarketsResponse): MsgUpdateMarketsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateMarketsResponseAminoMsg): MsgUpdateMarketsResponse { + return MsgUpdateMarketsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateMarketsResponseProtoMsg): MsgUpdateMarketsResponse { + return MsgUpdateMarketsResponse.decode(message.value); + }, + toProto(message: MsgUpdateMarketsResponse): Uint8Array { + return MsgUpdateMarketsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateMarketsResponse): MsgUpdateMarketsResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgUpdateMarketsResponse", + value: MsgUpdateMarketsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgParams(): MsgParams { + return { + params: Params.fromPartial({}), + authority: "" + }; +} +export const MsgParams = { + typeUrl: "/slinky.marketmap.v1.MsgParams", + encode(message: MsgParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgParams { + const message = createBaseMsgParams(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgParamsAmino): MsgParams { + const message = createBaseMsgParams(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgParams): MsgParamsAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgParamsAminoMsg): MsgParams { + return MsgParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgParamsProtoMsg): MsgParams { + return MsgParams.decode(message.value); + }, + toProto(message: MsgParams): Uint8Array { + return MsgParams.encode(message).finish(); + }, + toProtoMsg(message: MsgParams): MsgParamsProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgParams", + value: MsgParams.encode(message).finish() + }; + } +}; +function createBaseMsgParamsResponse(): MsgParamsResponse { + return {}; +} +export const MsgParamsResponse = { + typeUrl: "/slinky.marketmap.v1.MsgParamsResponse", + encode(_: MsgParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgParamsResponse { + const message = createBaseMsgParamsResponse(); + return message; + }, + fromAmino(_: MsgParamsResponseAmino): MsgParamsResponse { + const message = createBaseMsgParamsResponse(); + return message; + }, + toAmino(_: MsgParamsResponse): MsgParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgParamsResponseAminoMsg): MsgParamsResponse { + return MsgParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgParamsResponseProtoMsg): MsgParamsResponse { + return MsgParamsResponse.decode(message.value); + }, + toProto(message: MsgParamsResponse): Uint8Array { + return MsgParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgParamsResponse): MsgParamsResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgParamsResponse", + value: MsgParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveMarketAuthorities(): MsgRemoveMarketAuthorities { + return { + removeAddresses: [], + admin: "" + }; +} +export const MsgRemoveMarketAuthorities = { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", + encode(message: MsgRemoveMarketAuthorities, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.removeAddresses) { + writer.uint32(10).string(v!); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveMarketAuthorities { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveMarketAuthorities(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.removeAddresses.push(reader.string()); + break; + case 2: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveMarketAuthorities { + const message = createBaseMsgRemoveMarketAuthorities(); + message.removeAddresses = object.removeAddresses?.map(e => e) || []; + message.admin = object.admin ?? ""; + return message; + }, + fromAmino(object: MsgRemoveMarketAuthoritiesAmino): MsgRemoveMarketAuthorities { + const message = createBaseMsgRemoveMarketAuthorities(); + message.removeAddresses = object.remove_addresses?.map(e => e) || []; + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: MsgRemoveMarketAuthorities): MsgRemoveMarketAuthoritiesAmino { + const obj: any = {}; + if (message.removeAddresses) { + obj.remove_addresses = message.removeAddresses.map(e => e); + } else { + obj.remove_addresses = message.removeAddresses; + } + obj.admin = message.admin === "" ? undefined : message.admin; + return obj; + }, + fromAminoMsg(object: MsgRemoveMarketAuthoritiesAminoMsg): MsgRemoveMarketAuthorities { + return MsgRemoveMarketAuthorities.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRemoveMarketAuthoritiesProtoMsg): MsgRemoveMarketAuthorities { + return MsgRemoveMarketAuthorities.decode(message.value); + }, + toProto(message: MsgRemoveMarketAuthorities): Uint8Array { + return MsgRemoveMarketAuthorities.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveMarketAuthorities): MsgRemoveMarketAuthoritiesProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", + value: MsgRemoveMarketAuthorities.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveMarketAuthoritiesResponse(): MsgRemoveMarketAuthoritiesResponse { + return {}; +} +export const MsgRemoveMarketAuthoritiesResponse = { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse", + encode(_: MsgRemoveMarketAuthoritiesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveMarketAuthoritiesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveMarketAuthoritiesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRemoveMarketAuthoritiesResponse { + const message = createBaseMsgRemoveMarketAuthoritiesResponse(); + return message; + }, + fromAmino(_: MsgRemoveMarketAuthoritiesResponseAmino): MsgRemoveMarketAuthoritiesResponse { + const message = createBaseMsgRemoveMarketAuthoritiesResponse(); + return message; + }, + toAmino(_: MsgRemoveMarketAuthoritiesResponse): MsgRemoveMarketAuthoritiesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveMarketAuthoritiesResponseAminoMsg): MsgRemoveMarketAuthoritiesResponse { + return MsgRemoveMarketAuthoritiesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRemoveMarketAuthoritiesResponseProtoMsg): MsgRemoveMarketAuthoritiesResponse { + return MsgRemoveMarketAuthoritiesResponse.decode(message.value); + }, + toProto(message: MsgRemoveMarketAuthoritiesResponse): Uint8Array { + return MsgRemoveMarketAuthoritiesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveMarketAuthoritiesResponse): MsgRemoveMarketAuthoritiesResponseProtoMsg { + return { + typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse", + value: MsgRemoveMarketAuthoritiesResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/oracle/v1/genesis.ts b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/genesis.ts new file mode 100644 index 00000000..b16bffbe --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/genesis.ts @@ -0,0 +1,551 @@ +//@ts-nocheck +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { CurrencyPair, CurrencyPairAmino, CurrencyPairSDKType } from "../../types/v1/currency_pair"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** + * QuotePrice is the representation of the aggregated prices for a CurrencyPair, + * where price represents the price of Base in terms of Quote + */ +export interface QuotePrice { + price: string; + /** + * BlockTimestamp tracks the block height associated with this price update. + * We include block timestamp alongside the price to ensure that smart + * contracts and applications are not utilizing stale oracle prices + */ + blockTimestamp: Date; + /** BlockHeight is height of block mentioned above */ + blockHeight: bigint; +} +export interface QuotePriceProtoMsg { + typeUrl: "/slinky.oracle.v1.QuotePrice"; + value: Uint8Array; +} +/** + * QuotePrice is the representation of the aggregated prices for a CurrencyPair, + * where price represents the price of Base in terms of Quote + */ +export interface QuotePriceAmino { + price?: string; + /** + * BlockTimestamp tracks the block height associated with this price update. + * We include block timestamp alongside the price to ensure that smart + * contracts and applications are not utilizing stale oracle prices + */ + block_timestamp?: string; + /** BlockHeight is height of block mentioned above */ + block_height?: string; +} +export interface QuotePriceAminoMsg { + type: "/slinky.oracle.v1.QuotePrice"; + value: QuotePriceAmino; +} +/** + * QuotePrice is the representation of the aggregated prices for a CurrencyPair, + * where price represents the price of Base in terms of Quote + */ +export interface QuotePriceSDKType { + price: string; + block_timestamp: Date; + block_height: bigint; +} +/** + * CurrencyPairState represents the stateful information tracked by the x/oracle + * module per-currency-pair. + */ +export interface CurrencyPairState { + /** + * QuotePrice is the latest price for a currency-pair, notice this value can + * be null in the case that no price exists for the currency-pair + */ + price?: QuotePrice; + /** Nonce is the number of updates this currency-pair has received */ + nonce: bigint; + /** ID is the ID of the CurrencyPair */ + id: bigint; +} +export interface CurrencyPairStateProtoMsg { + typeUrl: "/slinky.oracle.v1.CurrencyPairState"; + value: Uint8Array; +} +/** + * CurrencyPairState represents the stateful information tracked by the x/oracle + * module per-currency-pair. + */ +export interface CurrencyPairStateAmino { + /** + * QuotePrice is the latest price for a currency-pair, notice this value can + * be null in the case that no price exists for the currency-pair + */ + price?: QuotePriceAmino; + /** Nonce is the number of updates this currency-pair has received */ + nonce?: string; + /** ID is the ID of the CurrencyPair */ + id?: string; +} +export interface CurrencyPairStateAminoMsg { + type: "/slinky.oracle.v1.CurrencyPairState"; + value: CurrencyPairStateAmino; +} +/** + * CurrencyPairState represents the stateful information tracked by the x/oracle + * module per-currency-pair. + */ +export interface CurrencyPairStateSDKType { + price?: QuotePriceSDKType; + nonce: bigint; + id: bigint; +} +/** + * CurrencyPairGenesis is the information necessary for initialization of a + * CurrencyPair. + */ +export interface CurrencyPairGenesis { + /** The CurrencyPair to be added to module state */ + currencyPair: CurrencyPair; + /** + * A genesis price if one exists (note this will be empty, unless it results + * from forking the state of this module) + */ + currencyPairPrice?: QuotePrice; + /** + * nonce is the nonce (number of updates) for the CP (same case as above, + * likely 0 unless it results from fork of module) + */ + nonce: bigint; + /** id is the ID of the CurrencyPair */ + id: bigint; +} +export interface CurrencyPairGenesisProtoMsg { + typeUrl: "/slinky.oracle.v1.CurrencyPairGenesis"; + value: Uint8Array; +} +/** + * CurrencyPairGenesis is the information necessary for initialization of a + * CurrencyPair. + */ +export interface CurrencyPairGenesisAmino { + /** The CurrencyPair to be added to module state */ + currency_pair?: CurrencyPairAmino; + /** + * A genesis price if one exists (note this will be empty, unless it results + * from forking the state of this module) + */ + currency_pair_price?: QuotePriceAmino; + /** + * nonce is the nonce (number of updates) for the CP (same case as above, + * likely 0 unless it results from fork of module) + */ + nonce?: string; + /** id is the ID of the CurrencyPair */ + id?: string; +} +export interface CurrencyPairGenesisAminoMsg { + type: "/slinky.oracle.v1.CurrencyPairGenesis"; + value: CurrencyPairGenesisAmino; +} +/** + * CurrencyPairGenesis is the information necessary for initialization of a + * CurrencyPair. + */ +export interface CurrencyPairGenesisSDKType { + currency_pair: CurrencyPairSDKType; + currency_pair_price?: QuotePriceSDKType; + nonce: bigint; + id: bigint; +} +/** + * GenesisState is the genesis-state for the x/oracle module, it takes a set of + * predefined CurrencyPairGeneses + */ +export interface GenesisState { + /** + * CurrencyPairGenesis is the set of CurrencyPairGeneses for the module. I.e + * the starting set of CurrencyPairs for the module + information regarding + * their latest update. + */ + currencyPairGenesis: CurrencyPairGenesis[]; + /** NextID is the next ID to be used for a CurrencyPair */ + nextId: bigint; +} +export interface GenesisStateProtoMsg { + typeUrl: "/slinky.oracle.v1.GenesisState"; + value: Uint8Array; +} +/** + * GenesisState is the genesis-state for the x/oracle module, it takes a set of + * predefined CurrencyPairGeneses + */ +export interface GenesisStateAmino { + /** + * CurrencyPairGenesis is the set of CurrencyPairGeneses for the module. I.e + * the starting set of CurrencyPairs for the module + information regarding + * their latest update. + */ + currency_pair_genesis?: CurrencyPairGenesisAmino[]; + /** NextID is the next ID to be used for a CurrencyPair */ + next_id?: string; +} +export interface GenesisStateAminoMsg { + type: "/slinky.oracle.v1.GenesisState"; + value: GenesisStateAmino; +} +/** + * GenesisState is the genesis-state for the x/oracle module, it takes a set of + * predefined CurrencyPairGeneses + */ +export interface GenesisStateSDKType { + currency_pair_genesis: CurrencyPairGenesisSDKType[]; + next_id: bigint; +} +function createBaseQuotePrice(): QuotePrice { + return { + price: "", + blockTimestamp: new Date(), + blockHeight: BigInt(0) + }; +} +export const QuotePrice = { + typeUrl: "/slinky.oracle.v1.QuotePrice", + encode(message: QuotePrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== "") { + writer.uint32(10).string(message.price); + } + if (message.blockTimestamp !== undefined) { + Timestamp.encode(toTimestamp(message.blockTimestamp), writer.uint32(18).fork()).ldelim(); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.blockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuotePrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuotePrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = reader.string(); + break; + case 2: + message.blockTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.blockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuotePrice { + const message = createBaseQuotePrice(); + message.price = object.price ?? ""; + message.blockTimestamp = object.blockTimestamp ?? undefined; + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QuotePriceAmino): QuotePrice { + const message = createBaseQuotePrice(); + if (object.price !== undefined && object.price !== null) { + message.price = object.price; + } + if (object.block_timestamp !== undefined && object.block_timestamp !== null) { + message.blockTimestamp = fromTimestamp(Timestamp.fromAmino(object.block_timestamp)); + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + return message; + }, + toAmino(message: QuotePrice): QuotePriceAmino { + const obj: any = {}; + obj.price = message.price === "" ? undefined : message.price; + obj.block_timestamp = message.blockTimestamp ? Timestamp.toAmino(toTimestamp(message.blockTimestamp)) : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QuotePriceAminoMsg): QuotePrice { + return QuotePrice.fromAmino(object.value); + }, + fromProtoMsg(message: QuotePriceProtoMsg): QuotePrice { + return QuotePrice.decode(message.value); + }, + toProto(message: QuotePrice): Uint8Array { + return QuotePrice.encode(message).finish(); + }, + toProtoMsg(message: QuotePrice): QuotePriceProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.QuotePrice", + value: QuotePrice.encode(message).finish() + }; + } +}; +function createBaseCurrencyPairState(): CurrencyPairState { + return { + price: undefined, + nonce: BigInt(0), + id: BigInt(0) + }; +} +export const CurrencyPairState = { + typeUrl: "/slinky.oracle.v1.CurrencyPairState", + encode(message: CurrencyPairState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== undefined) { + QuotePrice.encode(message.price, writer.uint32(10).fork()).ldelim(); + } + if (message.nonce !== BigInt(0)) { + writer.uint32(16).uint64(message.nonce); + } + if (message.id !== BigInt(0)) { + writer.uint32(24).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CurrencyPairState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCurrencyPairState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = QuotePrice.decode(reader, reader.uint32()); + break; + case 2: + message.nonce = reader.uint64(); + break; + case 3: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CurrencyPairState { + const message = createBaseCurrencyPairState(); + message.price = object.price !== undefined && object.price !== null ? QuotePrice.fromPartial(object.price) : undefined; + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CurrencyPairStateAmino): CurrencyPairState { + const message = createBaseCurrencyPairState(); + if (object.price !== undefined && object.price !== null) { + message.price = QuotePrice.fromAmino(object.price); + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: CurrencyPairState): CurrencyPairStateAmino { + const obj: any = {}; + obj.price = message.price ? QuotePrice.toAmino(message.price) : undefined; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CurrencyPairStateAminoMsg): CurrencyPairState { + return CurrencyPairState.fromAmino(object.value); + }, + fromProtoMsg(message: CurrencyPairStateProtoMsg): CurrencyPairState { + return CurrencyPairState.decode(message.value); + }, + toProto(message: CurrencyPairState): Uint8Array { + return CurrencyPairState.encode(message).finish(); + }, + toProtoMsg(message: CurrencyPairState): CurrencyPairStateProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.CurrencyPairState", + value: CurrencyPairState.encode(message).finish() + }; + } +}; +function createBaseCurrencyPairGenesis(): CurrencyPairGenesis { + return { + currencyPair: CurrencyPair.fromPartial({}), + currencyPairPrice: undefined, + nonce: BigInt(0), + id: BigInt(0) + }; +} +export const CurrencyPairGenesis = { + typeUrl: "/slinky.oracle.v1.CurrencyPairGenesis", + encode(message: CurrencyPairGenesis, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.currencyPair !== undefined) { + CurrencyPair.encode(message.currencyPair, writer.uint32(10).fork()).ldelim(); + } + if (message.currencyPairPrice !== undefined) { + QuotePrice.encode(message.currencyPairPrice, writer.uint32(18).fork()).ldelim(); + } + if (message.nonce !== BigInt(0)) { + writer.uint32(24).uint64(message.nonce); + } + if (message.id !== BigInt(0)) { + writer.uint32(32).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CurrencyPairGenesis { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCurrencyPairGenesis(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyPair = CurrencyPair.decode(reader, reader.uint32()); + break; + case 2: + message.currencyPairPrice = QuotePrice.decode(reader, reader.uint32()); + break; + case 3: + message.nonce = reader.uint64(); + break; + case 4: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CurrencyPairGenesis { + const message = createBaseCurrencyPairGenesis(); + message.currencyPair = object.currencyPair !== undefined && object.currencyPair !== null ? CurrencyPair.fromPartial(object.currencyPair) : undefined; + message.currencyPairPrice = object.currencyPairPrice !== undefined && object.currencyPairPrice !== null ? QuotePrice.fromPartial(object.currencyPairPrice) : undefined; + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CurrencyPairGenesisAmino): CurrencyPairGenesis { + const message = createBaseCurrencyPairGenesis(); + if (object.currency_pair !== undefined && object.currency_pair !== null) { + message.currencyPair = CurrencyPair.fromAmino(object.currency_pair); + } + if (object.currency_pair_price !== undefined && object.currency_pair_price !== null) { + message.currencyPairPrice = QuotePrice.fromAmino(object.currency_pair_price); + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: CurrencyPairGenesis): CurrencyPairGenesisAmino { + const obj: any = {}; + obj.currency_pair = message.currencyPair ? CurrencyPair.toAmino(message.currencyPair) : undefined; + obj.currency_pair_price = message.currencyPairPrice ? QuotePrice.toAmino(message.currencyPairPrice) : undefined; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CurrencyPairGenesisAminoMsg): CurrencyPairGenesis { + return CurrencyPairGenesis.fromAmino(object.value); + }, + fromProtoMsg(message: CurrencyPairGenesisProtoMsg): CurrencyPairGenesis { + return CurrencyPairGenesis.decode(message.value); + }, + toProto(message: CurrencyPairGenesis): Uint8Array { + return CurrencyPairGenesis.encode(message).finish(); + }, + toProtoMsg(message: CurrencyPairGenesis): CurrencyPairGenesisProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.CurrencyPairGenesis", + value: CurrencyPairGenesis.encode(message).finish() + }; + } +}; +function createBaseGenesisState(): GenesisState { + return { + currencyPairGenesis: [], + nextId: BigInt(0) + }; +} +export const GenesisState = { + typeUrl: "/slinky.oracle.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.currencyPairGenesis) { + CurrencyPairGenesis.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextId !== BigInt(0)) { + writer.uint32(16).uint64(message.nextId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyPairGenesis.push(CurrencyPairGenesis.decode(reader, reader.uint32())); + break; + case 2: + message.nextId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.currencyPairGenesis = object.currencyPairGenesis?.map(e => CurrencyPairGenesis.fromPartial(e)) || []; + message.nextId = object.nextId !== undefined && object.nextId !== null ? BigInt(object.nextId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.currencyPairGenesis = object.currency_pair_genesis?.map(e => CurrencyPairGenesis.fromAmino(e)) || []; + if (object.next_id !== undefined && object.next_id !== null) { + message.nextId = BigInt(object.next_id); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.currencyPairGenesis) { + obj.currency_pair_genesis = message.currencyPairGenesis.map(e => e ? CurrencyPairGenesis.toAmino(e) : undefined); + } else { + obj.currency_pair_genesis = message.currencyPairGenesis; + } + obj.next_id = message.nextId !== BigInt(0) ? message.nextId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/oracle/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/query.rpc.Query.ts new file mode 100644 index 00000000..0b06b40d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/query.rpc.Query.ts @@ -0,0 +1,70 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { GetAllCurrencyPairsRequest, GetAllCurrencyPairsResponse, GetPriceRequest, GetPriceResponse, GetPricesRequest, GetPricesResponse, GetCurrencyPairMappingRequest, GetCurrencyPairMappingResponse } from "./query"; +/** Query is the query service for the x/oracle module. */ +export interface Query { + /** Get all the currency pairs the x/oracle module is tracking price-data for. */ + getAllCurrencyPairs(request?: GetAllCurrencyPairsRequest): Promise; + /** + * Given a CurrencyPair (or its identifier) return the latest QuotePrice for + * that CurrencyPair. + */ + getPrice(request: GetPriceRequest): Promise; + getPrices(request: GetPricesRequest): Promise; + /** + * Get the mapping of currency pair ID -> currency pair. This is useful for + * indexers that have access to the ID of a currency pair, but no way to get + * the underlying currency pair from it. + */ + getCurrencyPairMapping(request?: GetCurrencyPairMappingRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.getAllCurrencyPairs = this.getAllCurrencyPairs.bind(this); + this.getPrice = this.getPrice.bind(this); + this.getPrices = this.getPrices.bind(this); + this.getCurrencyPairMapping = this.getCurrencyPairMapping.bind(this); + } + getAllCurrencyPairs(request: GetAllCurrencyPairsRequest = {}): Promise { + const data = GetAllCurrencyPairsRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.oracle.v1.Query", "GetAllCurrencyPairs", data); + return promise.then(data => GetAllCurrencyPairsResponse.decode(new BinaryReader(data))); + } + getPrice(request: GetPriceRequest): Promise { + const data = GetPriceRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.oracle.v1.Query", "GetPrice", data); + return promise.then(data => GetPriceResponse.decode(new BinaryReader(data))); + } + getPrices(request: GetPricesRequest): Promise { + const data = GetPricesRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.oracle.v1.Query", "GetPrices", data); + return promise.then(data => GetPricesResponse.decode(new BinaryReader(data))); + } + getCurrencyPairMapping(request: GetCurrencyPairMappingRequest = {}): Promise { + const data = GetCurrencyPairMappingRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.oracle.v1.Query", "GetCurrencyPairMapping", data); + return promise.then(data => GetCurrencyPairMappingResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + getAllCurrencyPairs(request?: GetAllCurrencyPairsRequest): Promise { + return queryService.getAllCurrencyPairs(request); + }, + getPrice(request: GetPriceRequest): Promise { + return queryService.getPrice(request); + }, + getPrices(request: GetPricesRequest): Promise { + return queryService.getPrices(request); + }, + getCurrencyPairMapping(request?: GetCurrencyPairMappingRequest): Promise { + return queryService.getCurrencyPairMapping(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/oracle/v1/query.ts b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/query.ts new file mode 100644 index 00000000..c89bd703 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/query.ts @@ -0,0 +1,872 @@ +//@ts-nocheck +import { CurrencyPair, CurrencyPairAmino, CurrencyPairSDKType } from "../../types/v1/currency_pair"; +import { QuotePrice, QuotePriceAmino, QuotePriceSDKType } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface GetAllCurrencyPairsRequest {} +export interface GetAllCurrencyPairsRequestProtoMsg { + typeUrl: "/slinky.oracle.v1.GetAllCurrencyPairsRequest"; + value: Uint8Array; +} +export interface GetAllCurrencyPairsRequestAmino {} +export interface GetAllCurrencyPairsRequestAminoMsg { + type: "/slinky.oracle.v1.GetAllCurrencyPairsRequest"; + value: GetAllCurrencyPairsRequestAmino; +} +export interface GetAllCurrencyPairsRequestSDKType {} +/** + * GetAllCurrencyPairsResponse returns all CurrencyPairs that the module is + * currently tracking. + */ +export interface GetAllCurrencyPairsResponse { + currencyPairs: CurrencyPair[]; +} +export interface GetAllCurrencyPairsResponseProtoMsg { + typeUrl: "/slinky.oracle.v1.GetAllCurrencyPairsResponse"; + value: Uint8Array; +} +/** + * GetAllCurrencyPairsResponse returns all CurrencyPairs that the module is + * currently tracking. + */ +export interface GetAllCurrencyPairsResponseAmino { + currency_pairs?: CurrencyPairAmino[]; +} +export interface GetAllCurrencyPairsResponseAminoMsg { + type: "/slinky.oracle.v1.GetAllCurrencyPairsResponse"; + value: GetAllCurrencyPairsResponseAmino; +} +/** + * GetAllCurrencyPairsResponse returns all CurrencyPairs that the module is + * currently tracking. + */ +export interface GetAllCurrencyPairsResponseSDKType { + currency_pairs: CurrencyPairSDKType[]; +} +/** + * GetPriceRequest either takes a CurrencyPair, or an identifier for the + * CurrencyPair in the format base/quote. + */ +export interface GetPriceRequest { + /** CurrencyPair represents the pair that the user wishes to query. */ + currencyPair: CurrencyPair; +} +export interface GetPriceRequestProtoMsg { + typeUrl: "/slinky.oracle.v1.GetPriceRequest"; + value: Uint8Array; +} +/** + * GetPriceRequest either takes a CurrencyPair, or an identifier for the + * CurrencyPair in the format base/quote. + */ +export interface GetPriceRequestAmino { + /** CurrencyPair represents the pair that the user wishes to query. */ + currency_pair?: CurrencyPairAmino; +} +export interface GetPriceRequestAminoMsg { + type: "/slinky.oracle.v1.GetPriceRequest"; + value: GetPriceRequestAmino; +} +/** + * GetPriceRequest either takes a CurrencyPair, or an identifier for the + * CurrencyPair in the format base/quote. + */ +export interface GetPriceRequestSDKType { + currency_pair: CurrencyPairSDKType; +} +/** + * GetPriceResponse is the response from the GetPrice grpc method exposed from + * the x/oracle query service. + */ +export interface GetPriceResponse { + /** + * QuotePrice represents the quote-price for the CurrencyPair given in + * GetPriceRequest (possibly nil if no update has been made) + */ + price?: QuotePrice; + /** nonce represents the nonce for the CurrencyPair if it exists in state */ + nonce: bigint; + /** + * decimals represents the number of decimals that the quote-price is + * represented in. For Pairs where ETHEREUM is the quote this will be 18, + * otherwise it will be 8. + */ + decimals: bigint; + /** ID represents the identifier for the CurrencyPair. */ + id: bigint; +} +export interface GetPriceResponseProtoMsg { + typeUrl: "/slinky.oracle.v1.GetPriceResponse"; + value: Uint8Array; +} +/** + * GetPriceResponse is the response from the GetPrice grpc method exposed from + * the x/oracle query service. + */ +export interface GetPriceResponseAmino { + /** + * QuotePrice represents the quote-price for the CurrencyPair given in + * GetPriceRequest (possibly nil if no update has been made) + */ + price?: QuotePriceAmino; + /** nonce represents the nonce for the CurrencyPair if it exists in state */ + nonce?: string; + /** + * decimals represents the number of decimals that the quote-price is + * represented in. For Pairs where ETHEREUM is the quote this will be 18, + * otherwise it will be 8. + */ + decimals?: string; + /** ID represents the identifier for the CurrencyPair. */ + id?: string; +} +export interface GetPriceResponseAminoMsg { + type: "/slinky.oracle.v1.GetPriceResponse"; + value: GetPriceResponseAmino; +} +/** + * GetPriceResponse is the response from the GetPrice grpc method exposed from + * the x/oracle query service. + */ +export interface GetPriceResponseSDKType { + price?: QuotePriceSDKType; + nonce: bigint; + decimals: bigint; + id: bigint; +} +/** + * GetPricesRequest takes an identifier for the CurrencyPair + * in the format base/quote. + */ +export interface GetPricesRequest { + currencyPairIds: string[]; +} +export interface GetPricesRequestProtoMsg { + typeUrl: "/slinky.oracle.v1.GetPricesRequest"; + value: Uint8Array; +} +/** + * GetPricesRequest takes an identifier for the CurrencyPair + * in the format base/quote. + */ +export interface GetPricesRequestAmino { + currency_pair_ids?: string[]; +} +export interface GetPricesRequestAminoMsg { + type: "/slinky.oracle.v1.GetPricesRequest"; + value: GetPricesRequestAmino; +} +/** + * GetPricesRequest takes an identifier for the CurrencyPair + * in the format base/quote. + */ +export interface GetPricesRequestSDKType { + currency_pair_ids: string[]; +} +/** + * GetPricesResponse is the response from the GetPrices grpc method exposed from + * the x/oracle query service. + */ +export interface GetPricesResponse { + prices: GetPriceResponse[]; +} +export interface GetPricesResponseProtoMsg { + typeUrl: "/slinky.oracle.v1.GetPricesResponse"; + value: Uint8Array; +} +/** + * GetPricesResponse is the response from the GetPrices grpc method exposed from + * the x/oracle query service. + */ +export interface GetPricesResponseAmino { + prices?: GetPriceResponseAmino[]; +} +export interface GetPricesResponseAminoMsg { + type: "/slinky.oracle.v1.GetPricesResponse"; + value: GetPricesResponseAmino; +} +/** + * GetPricesResponse is the response from the GetPrices grpc method exposed from + * the x/oracle query service. + */ +export interface GetPricesResponseSDKType { + prices: GetPriceResponseSDKType[]; +} +/** GetCurrencyPairMappingRequest is the GetCurrencyPairMapping request type. */ +export interface GetCurrencyPairMappingRequest {} +export interface GetCurrencyPairMappingRequestProtoMsg { + typeUrl: "/slinky.oracle.v1.GetCurrencyPairMappingRequest"; + value: Uint8Array; +} +/** GetCurrencyPairMappingRequest is the GetCurrencyPairMapping request type. */ +export interface GetCurrencyPairMappingRequestAmino {} +export interface GetCurrencyPairMappingRequestAminoMsg { + type: "/slinky.oracle.v1.GetCurrencyPairMappingRequest"; + value: GetCurrencyPairMappingRequestAmino; +} +/** GetCurrencyPairMappingRequest is the GetCurrencyPairMapping request type. */ +export interface GetCurrencyPairMappingRequestSDKType {} +export interface GetCurrencyPairMappingResponse_CurrencyPairMappingEntry { + key: bigint; + value?: CurrencyPair; +} +export interface GetCurrencyPairMappingResponse_CurrencyPairMappingEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GetCurrencyPairMappingResponse_CurrencyPairMappingEntryAmino { + key?: string; + value?: CurrencyPairAmino; +} +export interface GetCurrencyPairMappingResponse_CurrencyPairMappingEntryAminoMsg { + type: string; + value: GetCurrencyPairMappingResponse_CurrencyPairMappingEntryAmino; +} +export interface GetCurrencyPairMappingResponse_CurrencyPairMappingEntrySDKType { + key: bigint; + value?: CurrencyPairSDKType; +} +/** GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response type. */ +export interface GetCurrencyPairMappingResponse { + /** + * currency_pair_mapping is a mapping of the id representing the currency pair + * to the currency pair itself. + */ + currencyPairMapping: { + [key: bigint]: CurrencyPair; + }; +} +export interface GetCurrencyPairMappingResponseProtoMsg { + typeUrl: "/slinky.oracle.v1.GetCurrencyPairMappingResponse"; + value: Uint8Array; +} +/** GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response type. */ +export interface GetCurrencyPairMappingResponseAmino { + /** + * currency_pair_mapping is a mapping of the id representing the currency pair + * to the currency pair itself. + */ + currency_pair_mapping?: { + [key: string]: CurrencyPairAmino; + }; +} +export interface GetCurrencyPairMappingResponseAminoMsg { + type: "/slinky.oracle.v1.GetCurrencyPairMappingResponse"; + value: GetCurrencyPairMappingResponseAmino; +} +/** GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response type. */ +export interface GetCurrencyPairMappingResponseSDKType { + currency_pair_mapping: { + [key: bigint]: CurrencyPairSDKType; + }; +} +function createBaseGetAllCurrencyPairsRequest(): GetAllCurrencyPairsRequest { + return {}; +} +export const GetAllCurrencyPairsRequest = { + typeUrl: "/slinky.oracle.v1.GetAllCurrencyPairsRequest", + encode(_: GetAllCurrencyPairsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAllCurrencyPairsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAllCurrencyPairsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetAllCurrencyPairsRequest { + const message = createBaseGetAllCurrencyPairsRequest(); + return message; + }, + fromAmino(_: GetAllCurrencyPairsRequestAmino): GetAllCurrencyPairsRequest { + const message = createBaseGetAllCurrencyPairsRequest(); + return message; + }, + toAmino(_: GetAllCurrencyPairsRequest): GetAllCurrencyPairsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetAllCurrencyPairsRequestAminoMsg): GetAllCurrencyPairsRequest { + return GetAllCurrencyPairsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetAllCurrencyPairsRequestProtoMsg): GetAllCurrencyPairsRequest { + return GetAllCurrencyPairsRequest.decode(message.value); + }, + toProto(message: GetAllCurrencyPairsRequest): Uint8Array { + return GetAllCurrencyPairsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetAllCurrencyPairsRequest): GetAllCurrencyPairsRequestProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetAllCurrencyPairsRequest", + value: GetAllCurrencyPairsRequest.encode(message).finish() + }; + } +}; +function createBaseGetAllCurrencyPairsResponse(): GetAllCurrencyPairsResponse { + return { + currencyPairs: [] + }; +} +export const GetAllCurrencyPairsResponse = { + typeUrl: "/slinky.oracle.v1.GetAllCurrencyPairsResponse", + encode(message: GetAllCurrencyPairsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.currencyPairs) { + CurrencyPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAllCurrencyPairsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAllCurrencyPairsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyPairs.push(CurrencyPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAllCurrencyPairsResponse { + const message = createBaseGetAllCurrencyPairsResponse(); + message.currencyPairs = object.currencyPairs?.map(e => CurrencyPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetAllCurrencyPairsResponseAmino): GetAllCurrencyPairsResponse { + const message = createBaseGetAllCurrencyPairsResponse(); + message.currencyPairs = object.currency_pairs?.map(e => CurrencyPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetAllCurrencyPairsResponse): GetAllCurrencyPairsResponseAmino { + const obj: any = {}; + if (message.currencyPairs) { + obj.currency_pairs = message.currencyPairs.map(e => e ? CurrencyPair.toAmino(e) : undefined); + } else { + obj.currency_pairs = message.currencyPairs; + } + return obj; + }, + fromAminoMsg(object: GetAllCurrencyPairsResponseAminoMsg): GetAllCurrencyPairsResponse { + return GetAllCurrencyPairsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetAllCurrencyPairsResponseProtoMsg): GetAllCurrencyPairsResponse { + return GetAllCurrencyPairsResponse.decode(message.value); + }, + toProto(message: GetAllCurrencyPairsResponse): Uint8Array { + return GetAllCurrencyPairsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetAllCurrencyPairsResponse): GetAllCurrencyPairsResponseProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetAllCurrencyPairsResponse", + value: GetAllCurrencyPairsResponse.encode(message).finish() + }; + } +}; +function createBaseGetPriceRequest(): GetPriceRequest { + return { + currencyPair: CurrencyPair.fromPartial({}) + }; +} +export const GetPriceRequest = { + typeUrl: "/slinky.oracle.v1.GetPriceRequest", + encode(message: GetPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.currencyPair !== undefined) { + CurrencyPair.encode(message.currencyPair, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyPair = CurrencyPair.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetPriceRequest { + const message = createBaseGetPriceRequest(); + message.currencyPair = object.currencyPair !== undefined && object.currencyPair !== null ? CurrencyPair.fromPartial(object.currencyPair) : undefined; + return message; + }, + fromAmino(object: GetPriceRequestAmino): GetPriceRequest { + const message = createBaseGetPriceRequest(); + if (object.currency_pair !== undefined && object.currency_pair !== null) { + message.currencyPair = CurrencyPair.fromAmino(object.currency_pair); + } + return message; + }, + toAmino(message: GetPriceRequest): GetPriceRequestAmino { + const obj: any = {}; + obj.currency_pair = message.currencyPair ? CurrencyPair.toAmino(message.currencyPair) : undefined; + return obj; + }, + fromAminoMsg(object: GetPriceRequestAminoMsg): GetPriceRequest { + return GetPriceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetPriceRequestProtoMsg): GetPriceRequest { + return GetPriceRequest.decode(message.value); + }, + toProto(message: GetPriceRequest): Uint8Array { + return GetPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: GetPriceRequest): GetPriceRequestProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetPriceRequest", + value: GetPriceRequest.encode(message).finish() + }; + } +}; +function createBaseGetPriceResponse(): GetPriceResponse { + return { + price: undefined, + nonce: BigInt(0), + decimals: BigInt(0), + id: BigInt(0) + }; +} +export const GetPriceResponse = { + typeUrl: "/slinky.oracle.v1.GetPriceResponse", + encode(message: GetPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== undefined) { + QuotePrice.encode(message.price, writer.uint32(10).fork()).ldelim(); + } + if (message.nonce !== BigInt(0)) { + writer.uint32(16).uint64(message.nonce); + } + if (message.decimals !== BigInt(0)) { + writer.uint32(24).uint64(message.decimals); + } + if (message.id !== BigInt(0)) { + writer.uint32(32).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = QuotePrice.decode(reader, reader.uint32()); + break; + case 2: + message.nonce = reader.uint64(); + break; + case 3: + message.decimals = reader.uint64(); + break; + case 4: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetPriceResponse { + const message = createBaseGetPriceResponse(); + message.price = object.price !== undefined && object.price !== null ? QuotePrice.fromPartial(object.price) : undefined; + message.nonce = object.nonce !== undefined && object.nonce !== null ? BigInt(object.nonce.toString()) : BigInt(0); + message.decimals = object.decimals !== undefined && object.decimals !== null ? BigInt(object.decimals.toString()) : BigInt(0); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GetPriceResponseAmino): GetPriceResponse { + const message = createBaseGetPriceResponse(); + if (object.price !== undefined && object.price !== null) { + message.price = QuotePrice.fromAmino(object.price); + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = BigInt(object.nonce); + } + if (object.decimals !== undefined && object.decimals !== null) { + message.decimals = BigInt(object.decimals); + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: GetPriceResponse): GetPriceResponseAmino { + const obj: any = {}; + obj.price = message.price ? QuotePrice.toAmino(message.price) : undefined; + obj.nonce = message.nonce !== BigInt(0) ? message.nonce.toString() : undefined; + obj.decimals = message.decimals !== BigInt(0) ? message.decimals.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GetPriceResponseAminoMsg): GetPriceResponse { + return GetPriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetPriceResponseProtoMsg): GetPriceResponse { + return GetPriceResponse.decode(message.value); + }, + toProto(message: GetPriceResponse): Uint8Array { + return GetPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: GetPriceResponse): GetPriceResponseProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetPriceResponse", + value: GetPriceResponse.encode(message).finish() + }; + } +}; +function createBaseGetPricesRequest(): GetPricesRequest { + return { + currencyPairIds: [] + }; +} +export const GetPricesRequest = { + typeUrl: "/slinky.oracle.v1.GetPricesRequest", + encode(message: GetPricesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.currencyPairIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetPricesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyPairIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetPricesRequest { + const message = createBaseGetPricesRequest(); + message.currencyPairIds = object.currencyPairIds?.map(e => e) || []; + return message; + }, + fromAmino(object: GetPricesRequestAmino): GetPricesRequest { + const message = createBaseGetPricesRequest(); + message.currencyPairIds = object.currency_pair_ids?.map(e => e) || []; + return message; + }, + toAmino(message: GetPricesRequest): GetPricesRequestAmino { + const obj: any = {}; + if (message.currencyPairIds) { + obj.currency_pair_ids = message.currencyPairIds.map(e => e); + } else { + obj.currency_pair_ids = message.currencyPairIds; + } + return obj; + }, + fromAminoMsg(object: GetPricesRequestAminoMsg): GetPricesRequest { + return GetPricesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetPricesRequestProtoMsg): GetPricesRequest { + return GetPricesRequest.decode(message.value); + }, + toProto(message: GetPricesRequest): Uint8Array { + return GetPricesRequest.encode(message).finish(); + }, + toProtoMsg(message: GetPricesRequest): GetPricesRequestProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetPricesRequest", + value: GetPricesRequest.encode(message).finish() + }; + } +}; +function createBaseGetPricesResponse(): GetPricesResponse { + return { + prices: [] + }; +} +export const GetPricesResponse = { + typeUrl: "/slinky.oracle.v1.GetPricesResponse", + encode(message: GetPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.prices) { + GetPriceResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prices.push(GetPriceResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetPricesResponse { + const message = createBaseGetPricesResponse(); + message.prices = object.prices?.map(e => GetPriceResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetPricesResponseAmino): GetPricesResponse { + const message = createBaseGetPricesResponse(); + message.prices = object.prices?.map(e => GetPriceResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetPricesResponse): GetPricesResponseAmino { + const obj: any = {}; + if (message.prices) { + obj.prices = message.prices.map(e => e ? GetPriceResponse.toAmino(e) : undefined); + } else { + obj.prices = message.prices; + } + return obj; + }, + fromAminoMsg(object: GetPricesResponseAminoMsg): GetPricesResponse { + return GetPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetPricesResponseProtoMsg): GetPricesResponse { + return GetPricesResponse.decode(message.value); + }, + toProto(message: GetPricesResponse): Uint8Array { + return GetPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: GetPricesResponse): GetPricesResponseProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetPricesResponse", + value: GetPricesResponse.encode(message).finish() + }; + } +}; +function createBaseGetCurrencyPairMappingRequest(): GetCurrencyPairMappingRequest { + return {}; +} +export const GetCurrencyPairMappingRequest = { + typeUrl: "/slinky.oracle.v1.GetCurrencyPairMappingRequest", + encode(_: GetCurrencyPairMappingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetCurrencyPairMappingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetCurrencyPairMappingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetCurrencyPairMappingRequest { + const message = createBaseGetCurrencyPairMappingRequest(); + return message; + }, + fromAmino(_: GetCurrencyPairMappingRequestAmino): GetCurrencyPairMappingRequest { + const message = createBaseGetCurrencyPairMappingRequest(); + return message; + }, + toAmino(_: GetCurrencyPairMappingRequest): GetCurrencyPairMappingRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetCurrencyPairMappingRequestAminoMsg): GetCurrencyPairMappingRequest { + return GetCurrencyPairMappingRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetCurrencyPairMappingRequestProtoMsg): GetCurrencyPairMappingRequest { + return GetCurrencyPairMappingRequest.decode(message.value); + }, + toProto(message: GetCurrencyPairMappingRequest): Uint8Array { + return GetCurrencyPairMappingRequest.encode(message).finish(); + }, + toProtoMsg(message: GetCurrencyPairMappingRequest): GetCurrencyPairMappingRequestProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetCurrencyPairMappingRequest", + value: GetCurrencyPairMappingRequest.encode(message).finish() + }; + } +}; +function createBaseGetCurrencyPairMappingResponse_CurrencyPairMappingEntry(): GetCurrencyPairMappingResponse_CurrencyPairMappingEntry { + return { + key: BigInt(0), + value: undefined + }; +} +export const GetCurrencyPairMappingResponse_CurrencyPairMappingEntry = { + encode(message: GetCurrencyPairMappingResponse_CurrencyPairMappingEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== BigInt(0)) { + writer.uint32(8).uint64(message.key); + } + if (message.value !== undefined) { + CurrencyPair.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetCurrencyPairMappingResponse_CurrencyPairMappingEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetCurrencyPairMappingResponse_CurrencyPairMappingEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.uint64(); + break; + case 2: + message.value = CurrencyPair.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetCurrencyPairMappingResponse_CurrencyPairMappingEntry { + const message = createBaseGetCurrencyPairMappingResponse_CurrencyPairMappingEntry(); + message.key = object.key !== undefined && object.key !== null ? BigInt(object.key.toString()) : BigInt(0); + message.value = object.value !== undefined && object.value !== null ? CurrencyPair.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: GetCurrencyPairMappingResponse_CurrencyPairMappingEntryAmino): GetCurrencyPairMappingResponse_CurrencyPairMappingEntry { + const message = createBaseGetCurrencyPairMappingResponse_CurrencyPairMappingEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = BigInt(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = CurrencyPair.fromAmino(object.value); + } + return message; + }, + toAmino(message: GetCurrencyPairMappingResponse_CurrencyPairMappingEntry): GetCurrencyPairMappingResponse_CurrencyPairMappingEntryAmino { + const obj: any = {}; + obj.key = message.key !== BigInt(0) ? message.key.toString() : undefined; + obj.value = message.value ? CurrencyPair.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GetCurrencyPairMappingResponse_CurrencyPairMappingEntryAminoMsg): GetCurrencyPairMappingResponse_CurrencyPairMappingEntry { + return GetCurrencyPairMappingResponse_CurrencyPairMappingEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GetCurrencyPairMappingResponse_CurrencyPairMappingEntryProtoMsg): GetCurrencyPairMappingResponse_CurrencyPairMappingEntry { + return GetCurrencyPairMappingResponse_CurrencyPairMappingEntry.decode(message.value); + }, + toProto(message: GetCurrencyPairMappingResponse_CurrencyPairMappingEntry): Uint8Array { + return GetCurrencyPairMappingResponse_CurrencyPairMappingEntry.encode(message).finish(); + } +}; +function createBaseGetCurrencyPairMappingResponse(): GetCurrencyPairMappingResponse { + return { + currencyPairMapping: {} + }; +} +export const GetCurrencyPairMappingResponse = { + typeUrl: "/slinky.oracle.v1.GetCurrencyPairMappingResponse", + encode(message: GetCurrencyPairMappingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.currencyPairMapping).forEach(([key, value]) => { + GetCurrencyPairMappingResponse_CurrencyPairMappingEntry.encode({ + key: key as any, + value + }, writer.uint32(10).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetCurrencyPairMappingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetCurrencyPairMappingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = GetCurrencyPairMappingResponse_CurrencyPairMappingEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.currencyPairMapping[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetCurrencyPairMappingResponse { + const message = createBaseGetCurrencyPairMappingResponse(); + message.currencyPairMapping = Object.entries(object.currencyPairMapping ?? {}).reduce<{ + [key: bigint]: CurrencyPair; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[Number(key)] = CurrencyPair.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: GetCurrencyPairMappingResponseAmino): GetCurrencyPairMappingResponse { + const message = createBaseGetCurrencyPairMappingResponse(); + message.currencyPairMapping = Object.entries(object.currency_pair_mapping ?? {}).reduce<{ + [key: bigint]: CurrencyPair; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[Number(key)] = CurrencyPair.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: GetCurrencyPairMappingResponse): GetCurrencyPairMappingResponseAmino { + const obj: any = {}; + obj.currency_pair_mapping = {}; + if (message.currencyPairMapping) { + Object.entries(message.currencyPairMapping).forEach(([k, v]) => { + obj.currency_pair_mapping[k] = CurrencyPair.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: GetCurrencyPairMappingResponseAminoMsg): GetCurrencyPairMappingResponse { + return GetCurrencyPairMappingResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetCurrencyPairMappingResponseProtoMsg): GetCurrencyPairMappingResponse { + return GetCurrencyPairMappingResponse.decode(message.value); + }, + toProto(message: GetCurrencyPairMappingResponse): Uint8Array { + return GetCurrencyPairMappingResponse.encode(message).finish(); + }, + toProtoMsg(message: GetCurrencyPairMappingResponse): GetCurrencyPairMappingResponseProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.GetCurrencyPairMappingResponse", + value: GetCurrencyPairMappingResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.amino.ts new file mode 100644 index 00000000..79506b54 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgAddCurrencyPairs, MsgRemoveCurrencyPairs } from "./tx"; +export const AminoConverter = { + "/slinky.oracle.v1.MsgAddCurrencyPairs": { + aminoType: "slinky/x/oracle/MsgAddCurrencyPairs", + toAmino: MsgAddCurrencyPairs.toAmino, + fromAmino: MsgAddCurrencyPairs.fromAmino + }, + "/slinky.oracle.v1.MsgRemoveCurrencyPairs": { + aminoType: "slinky/x/oracle/MsgSetCurrencyPairs", + toAmino: MsgRemoveCurrencyPairs.toAmino, + fromAmino: MsgRemoveCurrencyPairs.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.registry.ts new file mode 100644 index 00000000..648d0c13 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAddCurrencyPairs, MsgRemoveCurrencyPairs } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/slinky.oracle.v1.MsgAddCurrencyPairs", MsgAddCurrencyPairs], ["/slinky.oracle.v1.MsgRemoveCurrencyPairs", MsgRemoveCurrencyPairs]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + addCurrencyPairs(value: MsgAddCurrencyPairs) { + return { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairs", + value: MsgAddCurrencyPairs.encode(value).finish() + }; + }, + removeCurrencyPairs(value: MsgRemoveCurrencyPairs) { + return { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairs", + value: MsgRemoveCurrencyPairs.encode(value).finish() + }; + } + }, + withTypeUrl: { + addCurrencyPairs(value: MsgAddCurrencyPairs) { + return { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairs", + value + }; + }, + removeCurrencyPairs(value: MsgRemoveCurrencyPairs) { + return { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairs", + value + }; + } + }, + fromPartial: { + addCurrencyPairs(value: MsgAddCurrencyPairs) { + return { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairs", + value: MsgAddCurrencyPairs.fromPartial(value) + }; + }, + removeCurrencyPairs(value: MsgRemoveCurrencyPairs) { + return { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairs", + value: MsgRemoveCurrencyPairs.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..c8df802d --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.rpc.msg.ts @@ -0,0 +1,37 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgAddCurrencyPairs, MsgAddCurrencyPairsResponse, MsgRemoveCurrencyPairs, MsgRemoveCurrencyPairsResponse } from "./tx"; +/** Msg is the message service for the x/oracle module. */ +export interface Msg { + /** + * AddCurrencyPairs will be used only by governance to update the set of + * available CurrencyPairs. Given a set of CurrencyPair objects, update + * the available currency pairs in the module . + */ + addCurrencyPairs(request: MsgAddCurrencyPairs): Promise; + /** + * RemoveCurrencyPairs will be used explicitly by governance to remove the + * given set of currency-pairs from the module's state. Thus these + * CurrencyPairs will no longer have price-data available from this module. + */ + removeCurrencyPairs(request: MsgRemoveCurrencyPairs): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.addCurrencyPairs = this.addCurrencyPairs.bind(this); + this.removeCurrencyPairs = this.removeCurrencyPairs.bind(this); + } + addCurrencyPairs(request: MsgAddCurrencyPairs): Promise { + const data = MsgAddCurrencyPairs.encode(request).finish(); + const promise = this.rpc.request("slinky.oracle.v1.Msg", "AddCurrencyPairs", data); + return promise.then(data => MsgAddCurrencyPairsResponse.decode(new BinaryReader(data))); + } + removeCurrencyPairs(request: MsgRemoveCurrencyPairs): Promise { + const data = MsgRemoveCurrencyPairs.encode(request).finish(); + const promise = this.rpc.request("slinky.oracle.v1.Msg", "RemoveCurrencyPairs", data); + return promise.then(data => MsgRemoveCurrencyPairsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.ts b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.ts new file mode 100644 index 00000000..b1b38b7f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/oracle/v1/tx.ts @@ -0,0 +1,402 @@ +//@ts-nocheck +import { CurrencyPair, CurrencyPairAmino, CurrencyPairSDKType } from "../../types/v1/currency_pair"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * Given an authority + a set of CurrencyPairs, the x/oracle module will + * check to see that the authority has permissions to update the set of + * CurrencyPairs tracked in the oracle, and add the given CurrencyPairs to be + * tracked in each VoteExtension + */ +export interface MsgAddCurrencyPairs { + /** + * authority is the address of the account that is authorized to update the + * x/oracle's CurrencyPairs + */ + authority: string; + /** + * set of CurrencyPairs to be added to the module (+ prices if they are to be + * set) + */ + currencyPairs: CurrencyPair[]; +} +export interface MsgAddCurrencyPairsProtoMsg { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairs"; + value: Uint8Array; +} +/** + * Given an authority + a set of CurrencyPairs, the x/oracle module will + * check to see that the authority has permissions to update the set of + * CurrencyPairs tracked in the oracle, and add the given CurrencyPairs to be + * tracked in each VoteExtension + */ +export interface MsgAddCurrencyPairsAmino { + /** + * authority is the address of the account that is authorized to update the + * x/oracle's CurrencyPairs + */ + authority?: string; + /** + * set of CurrencyPairs to be added to the module (+ prices if they are to be + * set) + */ + currency_pairs?: CurrencyPairAmino[]; +} +export interface MsgAddCurrencyPairsAminoMsg { + type: "slinky/x/oracle/MsgAddCurrencyPairs"; + value: MsgAddCurrencyPairsAmino; +} +/** + * Given an authority + a set of CurrencyPairs, the x/oracle module will + * check to see that the authority has permissions to update the set of + * CurrencyPairs tracked in the oracle, and add the given CurrencyPairs to be + * tracked in each VoteExtension + */ +export interface MsgAddCurrencyPairsSDKType { + authority: string; + currency_pairs: CurrencyPairSDKType[]; +} +export interface MsgAddCurrencyPairsResponse {} +export interface MsgAddCurrencyPairsResponseProtoMsg { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairsResponse"; + value: Uint8Array; +} +export interface MsgAddCurrencyPairsResponseAmino {} +export interface MsgAddCurrencyPairsResponseAminoMsg { + type: "/slinky.oracle.v1.MsgAddCurrencyPairsResponse"; + value: MsgAddCurrencyPairsResponseAmino; +} +export interface MsgAddCurrencyPairsResponseSDKType {} +/** + * Given an authority + a set of CurrencyPairIDs, the x/oracle module's message + * service will remove all of the CurrencyPairs identified by each + * CurrencyPairID in the request from state. Notice, if a given currency-pair + * does not exist in state, the module ignores that currency-pair and continues + * removing the rest. + */ +export interface MsgRemoveCurrencyPairs { + /** + * authority is the address of the account that is authorized to update the + * x/oracle's CurrencyPairs + */ + authority: string; + /** + * currency_pair_ids are the stringified representation of a currency-pairs + * (base/quote) to be removed from the module's state + */ + currencyPairIds: string[]; +} +export interface MsgRemoveCurrencyPairsProtoMsg { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairs"; + value: Uint8Array; +} +/** + * Given an authority + a set of CurrencyPairIDs, the x/oracle module's message + * service will remove all of the CurrencyPairs identified by each + * CurrencyPairID in the request from state. Notice, if a given currency-pair + * does not exist in state, the module ignores that currency-pair and continues + * removing the rest. + */ +export interface MsgRemoveCurrencyPairsAmino { + /** + * authority is the address of the account that is authorized to update the + * x/oracle's CurrencyPairs + */ + authority?: string; + /** + * currency_pair_ids are the stringified representation of a currency-pairs + * (base/quote) to be removed from the module's state + */ + currency_pair_ids?: string[]; +} +export interface MsgRemoveCurrencyPairsAminoMsg { + type: "slinky/x/oracle/MsgSetCurrencyPairs"; + value: MsgRemoveCurrencyPairsAmino; +} +/** + * Given an authority + a set of CurrencyPairIDs, the x/oracle module's message + * service will remove all of the CurrencyPairs identified by each + * CurrencyPairID in the request from state. Notice, if a given currency-pair + * does not exist in state, the module ignores that currency-pair and continues + * removing the rest. + */ +export interface MsgRemoveCurrencyPairsSDKType { + authority: string; + currency_pair_ids: string[]; +} +export interface MsgRemoveCurrencyPairsResponse {} +export interface MsgRemoveCurrencyPairsResponseProtoMsg { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairsResponse"; + value: Uint8Array; +} +export interface MsgRemoveCurrencyPairsResponseAmino {} +export interface MsgRemoveCurrencyPairsResponseAminoMsg { + type: "/slinky.oracle.v1.MsgRemoveCurrencyPairsResponse"; + value: MsgRemoveCurrencyPairsResponseAmino; +} +export interface MsgRemoveCurrencyPairsResponseSDKType {} +function createBaseMsgAddCurrencyPairs(): MsgAddCurrencyPairs { + return { + authority: "", + currencyPairs: [] + }; +} +export const MsgAddCurrencyPairs = { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairs", + encode(message: MsgAddCurrencyPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.currencyPairs) { + CurrencyPair.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCurrencyPairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddCurrencyPairs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.currencyPairs.push(CurrencyPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddCurrencyPairs { + const message = createBaseMsgAddCurrencyPairs(); + message.authority = object.authority ?? ""; + message.currencyPairs = object.currencyPairs?.map(e => CurrencyPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgAddCurrencyPairsAmino): MsgAddCurrencyPairs { + const message = createBaseMsgAddCurrencyPairs(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.currencyPairs = object.currency_pairs?.map(e => CurrencyPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgAddCurrencyPairs): MsgAddCurrencyPairsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.currencyPairs) { + obj.currency_pairs = message.currencyPairs.map(e => e ? CurrencyPair.toAmino(e) : undefined); + } else { + obj.currency_pairs = message.currencyPairs; + } + return obj; + }, + fromAminoMsg(object: MsgAddCurrencyPairsAminoMsg): MsgAddCurrencyPairs { + return MsgAddCurrencyPairs.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddCurrencyPairs): MsgAddCurrencyPairsAminoMsg { + return { + type: "slinky/x/oracle/MsgAddCurrencyPairs", + value: MsgAddCurrencyPairs.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAddCurrencyPairsProtoMsg): MsgAddCurrencyPairs { + return MsgAddCurrencyPairs.decode(message.value); + }, + toProto(message: MsgAddCurrencyPairs): Uint8Array { + return MsgAddCurrencyPairs.encode(message).finish(); + }, + toProtoMsg(message: MsgAddCurrencyPairs): MsgAddCurrencyPairsProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairs", + value: MsgAddCurrencyPairs.encode(message).finish() + }; + } +}; +function createBaseMsgAddCurrencyPairsResponse(): MsgAddCurrencyPairsResponse { + return {}; +} +export const MsgAddCurrencyPairsResponse = { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairsResponse", + encode(_: MsgAddCurrencyPairsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCurrencyPairsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddCurrencyPairsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAddCurrencyPairsResponse { + const message = createBaseMsgAddCurrencyPairsResponse(); + return message; + }, + fromAmino(_: MsgAddCurrencyPairsResponseAmino): MsgAddCurrencyPairsResponse { + const message = createBaseMsgAddCurrencyPairsResponse(); + return message; + }, + toAmino(_: MsgAddCurrencyPairsResponse): MsgAddCurrencyPairsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddCurrencyPairsResponseAminoMsg): MsgAddCurrencyPairsResponse { + return MsgAddCurrencyPairsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddCurrencyPairsResponseProtoMsg): MsgAddCurrencyPairsResponse { + return MsgAddCurrencyPairsResponse.decode(message.value); + }, + toProto(message: MsgAddCurrencyPairsResponse): Uint8Array { + return MsgAddCurrencyPairsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddCurrencyPairsResponse): MsgAddCurrencyPairsResponseProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.MsgAddCurrencyPairsResponse", + value: MsgAddCurrencyPairsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveCurrencyPairs(): MsgRemoveCurrencyPairs { + return { + authority: "", + currencyPairIds: [] + }; +} +export const MsgRemoveCurrencyPairs = { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairs", + encode(message: MsgRemoveCurrencyPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.currencyPairIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCurrencyPairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveCurrencyPairs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.currencyPairIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveCurrencyPairs { + const message = createBaseMsgRemoveCurrencyPairs(); + message.authority = object.authority ?? ""; + message.currencyPairIds = object.currencyPairIds?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgRemoveCurrencyPairsAmino): MsgRemoveCurrencyPairs { + const message = createBaseMsgRemoveCurrencyPairs(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.currencyPairIds = object.currency_pair_ids?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRemoveCurrencyPairs): MsgRemoveCurrencyPairsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.currencyPairIds) { + obj.currency_pair_ids = message.currencyPairIds.map(e => e); + } else { + obj.currency_pair_ids = message.currencyPairIds; + } + return obj; + }, + fromAminoMsg(object: MsgRemoveCurrencyPairsAminoMsg): MsgRemoveCurrencyPairs { + return MsgRemoveCurrencyPairs.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveCurrencyPairs): MsgRemoveCurrencyPairsAminoMsg { + return { + type: "slinky/x/oracle/MsgSetCurrencyPairs", + value: MsgRemoveCurrencyPairs.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveCurrencyPairsProtoMsg): MsgRemoveCurrencyPairs { + return MsgRemoveCurrencyPairs.decode(message.value); + }, + toProto(message: MsgRemoveCurrencyPairs): Uint8Array { + return MsgRemoveCurrencyPairs.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveCurrencyPairs): MsgRemoveCurrencyPairsProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairs", + value: MsgRemoveCurrencyPairs.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveCurrencyPairsResponse(): MsgRemoveCurrencyPairsResponse { + return {}; +} +export const MsgRemoveCurrencyPairsResponse = { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairsResponse", + encode(_: MsgRemoveCurrencyPairsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCurrencyPairsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveCurrencyPairsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRemoveCurrencyPairsResponse { + const message = createBaseMsgRemoveCurrencyPairsResponse(); + return message; + }, + fromAmino(_: MsgRemoveCurrencyPairsResponseAmino): MsgRemoveCurrencyPairsResponse { + const message = createBaseMsgRemoveCurrencyPairsResponse(); + return message; + }, + toAmino(_: MsgRemoveCurrencyPairsResponse): MsgRemoveCurrencyPairsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveCurrencyPairsResponseAminoMsg): MsgRemoveCurrencyPairsResponse { + return MsgRemoveCurrencyPairsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRemoveCurrencyPairsResponseProtoMsg): MsgRemoveCurrencyPairsResponse { + return MsgRemoveCurrencyPairsResponse.decode(message.value); + }, + toProto(message: MsgRemoveCurrencyPairsResponse): Uint8Array { + return MsgRemoveCurrencyPairsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveCurrencyPairsResponse): MsgRemoveCurrencyPairsResponseProtoMsg { + return { + typeUrl: "/slinky.oracle.v1.MsgRemoveCurrencyPairsResponse", + value: MsgRemoveCurrencyPairsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/rpc.query.ts b/dydxjs/packages/dydxjs/src/slinky/rpc.query.ts new file mode 100644 index 00000000..f95e87d6 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/rpc.query.ts @@ -0,0 +1,69 @@ +//@ts-nocheck +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + group: { + v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + slinky: { + alerts: { + v1: (await import("./alerts/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + incentives: { + v1: (await import("./incentives/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + marketmap: { + v1: (await import("./marketmap/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + oracle: { + v1: (await import("./oracle/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + sla: { + v1: (await import("./sla/v1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/rpc.tx.ts b/dydxjs/packages/dydxjs/src/slinky/rpc.tx.ts new file mode 100644 index 00000000..deac4b15 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/rpc.tx.ts @@ -0,0 +1,52 @@ +//@ts-nocheck +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + group: { + v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + vesting: { + v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + slinky: { + alerts: { + v1: new (await import("./alerts/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + marketmap: { + v1: new (await import("./marketmap/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + oracle: { + v1: new (await import("./oracle/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + sla: { + v1: new (await import("./sla/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/service/v1/oracle.ts b/dydxjs/packages/dydxjs/src/slinky/service/v1/oracle.ts new file mode 100644 index 00000000..798260eb --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/service/v1/oracle.ts @@ -0,0 +1,603 @@ +//@ts-nocheck +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { MarketMap, MarketMapAmino, MarketMapSDKType } from "../../marketmap/v1/market"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** QueryPricesRequest defines the request type for the the Prices method. */ +export interface QueryPricesRequest {} +export interface QueryPricesRequestProtoMsg { + typeUrl: "/slinky.service.v1.QueryPricesRequest"; + value: Uint8Array; +} +/** QueryPricesRequest defines the request type for the the Prices method. */ +export interface QueryPricesRequestAmino {} +export interface QueryPricesRequestAminoMsg { + type: "/slinky.service.v1.QueryPricesRequest"; + value: QueryPricesRequestAmino; +} +/** QueryPricesRequest defines the request type for the the Prices method. */ +export interface QueryPricesRequestSDKType {} +export interface QueryPricesResponse_PricesEntry { + key: string; + value: string; +} +export interface QueryPricesResponse_PricesEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface QueryPricesResponse_PricesEntryAmino { + key?: string; + value?: string; +} +export interface QueryPricesResponse_PricesEntryAminoMsg { + type: string; + value: QueryPricesResponse_PricesEntryAmino; +} +export interface QueryPricesResponse_PricesEntrySDKType { + key: string; + value: string; +} +/** QueryPricesResponse defines the response type for the Prices method. */ +export interface QueryPricesResponse { + /** Prices defines the list of prices. */ + prices: { + [key: string]: string; + }; + /** Timestamp defines the timestamp of the prices. */ + timestamp: Date; + /** Version defines the version of the oracle service that provided the prices. */ + version: string; +} +export interface QueryPricesResponseProtoMsg { + typeUrl: "/slinky.service.v1.QueryPricesResponse"; + value: Uint8Array; +} +/** QueryPricesResponse defines the response type for the Prices method. */ +export interface QueryPricesResponseAmino { + /** Prices defines the list of prices. */ + prices?: { + [key: string]: string; + }; + /** Timestamp defines the timestamp of the prices. */ + timestamp?: string; + /** Version defines the version of the oracle service that provided the prices. */ + version?: string; +} +export interface QueryPricesResponseAminoMsg { + type: "/slinky.service.v1.QueryPricesResponse"; + value: QueryPricesResponseAmino; +} +/** QueryPricesResponse defines the response type for the Prices method. */ +export interface QueryPricesResponseSDKType { + prices: { + [key: string]: string; + }; + timestamp: Date; + version: string; +} +/** QueryMarketMapRequest defines the request type for the MarketMap method. */ +export interface QueryMarketMapRequest {} +export interface QueryMarketMapRequestProtoMsg { + typeUrl: "/slinky.service.v1.QueryMarketMapRequest"; + value: Uint8Array; +} +/** QueryMarketMapRequest defines the request type for the MarketMap method. */ +export interface QueryMarketMapRequestAmino {} +export interface QueryMarketMapRequestAminoMsg { + type: "/slinky.service.v1.QueryMarketMapRequest"; + value: QueryMarketMapRequestAmino; +} +/** QueryMarketMapRequest defines the request type for the MarketMap method. */ +export interface QueryMarketMapRequestSDKType {} +/** QueryMarketMapResponse defines the response type for the MarketMap method. */ +export interface QueryMarketMapResponse { + /** MarketMap defines the current market map configuration. */ + marketMap?: MarketMap; +} +export interface QueryMarketMapResponseProtoMsg { + typeUrl: "/slinky.service.v1.QueryMarketMapResponse"; + value: Uint8Array; +} +/** QueryMarketMapResponse defines the response type for the MarketMap method. */ +export interface QueryMarketMapResponseAmino { + /** MarketMap defines the current market map configuration. */ + market_map?: MarketMapAmino; +} +export interface QueryMarketMapResponseAminoMsg { + type: "/slinky.service.v1.QueryMarketMapResponse"; + value: QueryMarketMapResponseAmino; +} +/** QueryMarketMapResponse defines the response type for the MarketMap method. */ +export interface QueryMarketMapResponseSDKType { + market_map?: MarketMapSDKType; +} +/** QueryVersionRequest defines the request type for the Version method. */ +export interface QueryVersionRequest {} +export interface QueryVersionRequestProtoMsg { + typeUrl: "/slinky.service.v1.QueryVersionRequest"; + value: Uint8Array; +} +/** QueryVersionRequest defines the request type for the Version method. */ +export interface QueryVersionRequestAmino {} +export interface QueryVersionRequestAminoMsg { + type: "/slinky.service.v1.QueryVersionRequest"; + value: QueryVersionRequestAmino; +} +/** QueryVersionRequest defines the request type for the Version method. */ +export interface QueryVersionRequestSDKType {} +/** QueryVersionResponse defines the response type for the Version method. */ +export interface QueryVersionResponse { + /** Version defines the current version of the oracle service. */ + version: string; +} +export interface QueryVersionResponseProtoMsg { + typeUrl: "/slinky.service.v1.QueryVersionResponse"; + value: Uint8Array; +} +/** QueryVersionResponse defines the response type for the Version method. */ +export interface QueryVersionResponseAmino { + /** Version defines the current version of the oracle service. */ + version?: string; +} +export interface QueryVersionResponseAminoMsg { + type: "/slinky.service.v1.QueryVersionResponse"; + value: QueryVersionResponseAmino; +} +/** QueryVersionResponse defines the response type for the Version method. */ +export interface QueryVersionResponseSDKType { + version: string; +} +function createBaseQueryPricesRequest(): QueryPricesRequest { + return {}; +} +export const QueryPricesRequest = { + typeUrl: "/slinky.service.v1.QueryPricesRequest", + encode(_: QueryPricesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPricesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryPricesRequest { + const message = createBaseQueryPricesRequest(); + return message; + }, + fromAmino(_: QueryPricesRequestAmino): QueryPricesRequest { + const message = createBaseQueryPricesRequest(); + return message; + }, + toAmino(_: QueryPricesRequest): QueryPricesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryPricesRequestAminoMsg): QueryPricesRequest { + return QueryPricesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPricesRequestProtoMsg): QueryPricesRequest { + return QueryPricesRequest.decode(message.value); + }, + toProto(message: QueryPricesRequest): Uint8Array { + return QueryPricesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPricesRequest): QueryPricesRequestProtoMsg { + return { + typeUrl: "/slinky.service.v1.QueryPricesRequest", + value: QueryPricesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPricesResponse_PricesEntry(): QueryPricesResponse_PricesEntry { + return { + key: "", + value: "" + }; +} +export const QueryPricesResponse_PricesEntry = { + encode(message: QueryPricesResponse_PricesEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPricesResponse_PricesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPricesResponse_PricesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPricesResponse_PricesEntry { + const message = createBaseQueryPricesResponse_PricesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: QueryPricesResponse_PricesEntryAmino): QueryPricesResponse_PricesEntry { + const message = createBaseQueryPricesResponse_PricesEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: QueryPricesResponse_PricesEntry): QueryPricesResponse_PricesEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: QueryPricesResponse_PricesEntryAminoMsg): QueryPricesResponse_PricesEntry { + return QueryPricesResponse_PricesEntry.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPricesResponse_PricesEntryProtoMsg): QueryPricesResponse_PricesEntry { + return QueryPricesResponse_PricesEntry.decode(message.value); + }, + toProto(message: QueryPricesResponse_PricesEntry): Uint8Array { + return QueryPricesResponse_PricesEntry.encode(message).finish(); + } +}; +function createBaseQueryPricesResponse(): QueryPricesResponse { + return { + prices: {}, + timestamp: new Date(), + version: "" + }; +} +export const QueryPricesResponse = { + typeUrl: "/slinky.service.v1.QueryPricesResponse", + encode(message: QueryPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.prices).forEach(([key, value]) => { + QueryPricesResponse_PricesEntry.encode({ + key: key as any, + value + }, writer.uint32(10).fork()).ldelim(); + }); + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim(); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = QueryPricesResponse_PricesEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.prices[entry1.key] = entry1.value; + } + break; + case 2: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPricesResponse { + const message = createBaseQueryPricesResponse(); + message.prices = Object.entries(object.prices ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.timestamp = object.timestamp ?? undefined; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: QueryPricesResponseAmino): QueryPricesResponse { + const message = createBaseQueryPricesResponse(); + message.prices = Object.entries(object.prices ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: QueryPricesResponse): QueryPricesResponseAmino { + const obj: any = {}; + obj.prices = {}; + if (message.prices) { + Object.entries(message.prices).forEach(([k, v]) => { + obj.prices[k] = v; + }); + } + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: QueryPricesResponseAminoMsg): QueryPricesResponse { + return QueryPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPricesResponseProtoMsg): QueryPricesResponse { + return QueryPricesResponse.decode(message.value); + }, + toProto(message: QueryPricesResponse): Uint8Array { + return QueryPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPricesResponse): QueryPricesResponseProtoMsg { + return { + typeUrl: "/slinky.service.v1.QueryPricesResponse", + value: QueryPricesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryMarketMapRequest(): QueryMarketMapRequest { + return {}; +} +export const QueryMarketMapRequest = { + typeUrl: "/slinky.service.v1.QueryMarketMapRequest", + encode(_: QueryMarketMapRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketMapRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketMapRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryMarketMapRequest { + const message = createBaseQueryMarketMapRequest(); + return message; + }, + fromAmino(_: QueryMarketMapRequestAmino): QueryMarketMapRequest { + const message = createBaseQueryMarketMapRequest(); + return message; + }, + toAmino(_: QueryMarketMapRequest): QueryMarketMapRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryMarketMapRequestAminoMsg): QueryMarketMapRequest { + return QueryMarketMapRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketMapRequestProtoMsg): QueryMarketMapRequest { + return QueryMarketMapRequest.decode(message.value); + }, + toProto(message: QueryMarketMapRequest): Uint8Array { + return QueryMarketMapRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketMapRequest): QueryMarketMapRequestProtoMsg { + return { + typeUrl: "/slinky.service.v1.QueryMarketMapRequest", + value: QueryMarketMapRequest.encode(message).finish() + }; + } +}; +function createBaseQueryMarketMapResponse(): QueryMarketMapResponse { + return { + marketMap: undefined + }; +} +export const QueryMarketMapResponse = { + typeUrl: "/slinky.service.v1.QueryMarketMapResponse", + encode(message: QueryMarketMapResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketMap !== undefined) { + MarketMap.encode(message.marketMap, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryMarketMapResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketMapResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketMap = MarketMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMarketMapResponse { + const message = createBaseQueryMarketMapResponse(); + message.marketMap = object.marketMap !== undefined && object.marketMap !== null ? MarketMap.fromPartial(object.marketMap) : undefined; + return message; + }, + fromAmino(object: QueryMarketMapResponseAmino): QueryMarketMapResponse { + const message = createBaseQueryMarketMapResponse(); + if (object.market_map !== undefined && object.market_map !== null) { + message.marketMap = MarketMap.fromAmino(object.market_map); + } + return message; + }, + toAmino(message: QueryMarketMapResponse): QueryMarketMapResponseAmino { + const obj: any = {}; + obj.market_map = message.marketMap ? MarketMap.toAmino(message.marketMap) : undefined; + return obj; + }, + fromAminoMsg(object: QueryMarketMapResponseAminoMsg): QueryMarketMapResponse { + return QueryMarketMapResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMarketMapResponseProtoMsg): QueryMarketMapResponse { + return QueryMarketMapResponse.decode(message.value); + }, + toProto(message: QueryMarketMapResponse): Uint8Array { + return QueryMarketMapResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMarketMapResponse): QueryMarketMapResponseProtoMsg { + return { + typeUrl: "/slinky.service.v1.QueryMarketMapResponse", + value: QueryMarketMapResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVersionRequest(): QueryVersionRequest { + return {}; +} +export const QueryVersionRequest = { + typeUrl: "/slinky.service.v1.QueryVersionRequest", + encode(_: QueryVersionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVersionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVersionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryVersionRequest { + const message = createBaseQueryVersionRequest(); + return message; + }, + fromAmino(_: QueryVersionRequestAmino): QueryVersionRequest { + const message = createBaseQueryVersionRequest(); + return message; + }, + toAmino(_: QueryVersionRequest): QueryVersionRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryVersionRequestAminoMsg): QueryVersionRequest { + return QueryVersionRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVersionRequestProtoMsg): QueryVersionRequest { + return QueryVersionRequest.decode(message.value); + }, + toProto(message: QueryVersionRequest): Uint8Array { + return QueryVersionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVersionRequest): QueryVersionRequestProtoMsg { + return { + typeUrl: "/slinky.service.v1.QueryVersionRequest", + value: QueryVersionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVersionResponse(): QueryVersionResponse { + return { + version: "" + }; +} +export const QueryVersionResponse = { + typeUrl: "/slinky.service.v1.QueryVersionResponse", + encode(message: QueryVersionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVersionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVersionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVersionResponse { + const message = createBaseQueryVersionResponse(); + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: QueryVersionResponseAmino): QueryVersionResponse { + const message = createBaseQueryVersionResponse(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: QueryVersionResponse): QueryVersionResponseAmino { + const obj: any = {}; + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: QueryVersionResponseAminoMsg): QueryVersionResponse { + return QueryVersionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVersionResponseProtoMsg): QueryVersionResponse { + return QueryVersionResponse.decode(message.value); + }, + toProto(message: QueryVersionResponse): Uint8Array { + return QueryVersionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVersionResponse): QueryVersionResponseProtoMsg { + return { + typeUrl: "/slinky.service.v1.QueryVersionResponse", + value: QueryVersionResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/sla/v1/genesis.ts b/dydxjs/packages/dydxjs/src/slinky/sla/v1/genesis.ts new file mode 100644 index 00000000..68aba0bd --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/sla/v1/genesis.ts @@ -0,0 +1,631 @@ +//@ts-nocheck +import { CurrencyPair, CurrencyPairAmino, CurrencyPairSDKType } from "../../types/v1/currency_pair"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** GenesisState defines the sla module's genesis state. */ +export interface GenesisState { + /** SLAs are the SLAs that are currently active. */ + slas: PriceFeedSLA[]; + /** PrceFeeds are the price feeds that are currently active. */ + priceFeeds: PriceFeed[]; + /** Params are the parameters for the sla module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/slinky.sla.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the sla module's genesis state. */ +export interface GenesisStateAmino { + /** SLAs are the SLAs that are currently active. */ + slas?: PriceFeedSLAAmino[]; + /** PrceFeeds are the price feeds that are currently active. */ + price_feeds?: PriceFeedAmino[]; + /** Params are the parameters for the sla module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/slinky.sla.v1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the sla module's genesis state. */ +export interface GenesisStateSDKType { + slas: PriceFeedSLASDKType[]; + price_feeds: PriceFeedSDKType[]; + params: ParamsSDKType; +} +/** Params defines the parameters for the sla module. */ +export interface Params { + /** Enabled is a flag to enable or disable the sla module. */ + enabled: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/slinky.sla.v1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the sla module. */ +export interface ParamsAmino { + /** Enabled is a flag to enable or disable the sla module. */ + enabled?: boolean; +} +export interface ParamsAminoMsg { + type: "/slinky.sla.v1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the sla module. */ +export interface ParamsSDKType { + enabled: boolean; +} +/** + * PriceFeedSLA defines the the desired SLA for a given set of price feeds. A + * price feed is defined to be a set of price prices for the same (currency + * pair, validator). + */ +export interface PriceFeedSLA { + /** + * MaximumViableWindow is the maximum time window that we are interested + * for the SLA. This is used to determine the moving window of blocks that + * we are interested in. + */ + maximumViableWindow: bigint; + /** + * ExpectedUptime is the expected uptime for the given validator and price + * feed. + */ + expectedUptime: string; + /** + * SlashConstant is the constant by which we will multiply the deviation from + * the expected uptime. + */ + slashConstant: string; + /** + * MinimumBlockUpdates is the minimum number of blocks that the + * validator had to have voted on in the maximum viable window + * in order to be considered for the SLA. + */ + minimumBlockUpdates: bigint; + /** Frequency is the frequency at which we will check the SLA. */ + frequency: bigint; + /** ID is the unique identifier for the SLA. */ + id: string; +} +export interface PriceFeedSLAProtoMsg { + typeUrl: "/slinky.sla.v1.PriceFeedSLA"; + value: Uint8Array; +} +/** + * PriceFeedSLA defines the the desired SLA for a given set of price feeds. A + * price feed is defined to be a set of price prices for the same (currency + * pair, validator). + */ +export interface PriceFeedSLAAmino { + /** + * MaximumViableWindow is the maximum time window that we are interested + * for the SLA. This is used to determine the moving window of blocks that + * we are interested in. + */ + maximum_viable_window?: string; + /** + * ExpectedUptime is the expected uptime for the given validator and price + * feed. + */ + expected_uptime?: string; + /** + * SlashConstant is the constant by which we will multiply the deviation from + * the expected uptime. + */ + slash_constant?: string; + /** + * MinimumBlockUpdates is the minimum number of blocks that the + * validator had to have voted on in the maximum viable window + * in order to be considered for the SLA. + */ + minimum_block_updates?: string; + /** Frequency is the frequency at which we will check the SLA. */ + frequency?: string; + /** ID is the unique identifier for the SLA. */ + id?: string; +} +export interface PriceFeedSLAAminoMsg { + type: "/slinky.sla.v1.PriceFeedSLA"; + value: PriceFeedSLAAmino; +} +/** + * PriceFeedSLA defines the the desired SLA for a given set of price feeds. A + * price feed is defined to be a set of price prices for the same (currency + * pair, validator). + */ +export interface PriceFeedSLASDKType { + maximum_viable_window: bigint; + expected_uptime: string; + slash_constant: string; + minimum_block_updates: bigint; + frequency: bigint; + id: string; +} +/** + * PriceFeed defines the object type that will be utilized to monitor how + * frequently validators are voting with price updates across the network. + */ +export interface PriceFeed { + /** UpdateMap represents the relevant moving window of price feed updates. */ + updateMap: Uint8Array; + /** + * InclusionMap represents the relevant moving window of blocks that the + * validator has voted on. + */ + inclusionMap: Uint8Array; + /** Index corresponds to the current index into the bitmap. */ + index: bigint; + /** Validator represents the validator that this SLA corresponds to. */ + validator: Uint8Array; + /** CurrencyPair represents the currency pair that this SLA corresponds to. */ + currencyPair: CurrencyPair; + /** + * MaximumViableWindow represents the maximum number of blocks that can be + * represented by the bit map. + */ + maximumViableWindow: bigint; + /** ID corresponds to the SLA ID that this price feed corresponds to. */ + id: string; +} +export interface PriceFeedProtoMsg { + typeUrl: "/slinky.sla.v1.PriceFeed"; + value: Uint8Array; +} +/** + * PriceFeed defines the object type that will be utilized to monitor how + * frequently validators are voting with price updates across the network. + */ +export interface PriceFeedAmino { + /** UpdateMap represents the relevant moving window of price feed updates. */ + update_map?: string; + /** + * InclusionMap represents the relevant moving window of blocks that the + * validator has voted on. + */ + inclusion_map?: string; + /** Index corresponds to the current index into the bitmap. */ + index?: string; + /** Validator represents the validator that this SLA corresponds to. */ + validator?: string; + /** CurrencyPair represents the currency pair that this SLA corresponds to. */ + currency_pair?: CurrencyPairAmino; + /** + * MaximumViableWindow represents the maximum number of blocks that can be + * represented by the bit map. + */ + maximum_viable_window?: string; + /** ID corresponds to the SLA ID that this price feed corresponds to. */ + id?: string; +} +export interface PriceFeedAminoMsg { + type: "/slinky.sla.v1.PriceFeed"; + value: PriceFeedAmino; +} +/** + * PriceFeed defines the object type that will be utilized to monitor how + * frequently validators are voting with price updates across the network. + */ +export interface PriceFeedSDKType { + update_map: Uint8Array; + inclusion_map: Uint8Array; + index: bigint; + validator: Uint8Array; + currency_pair: CurrencyPairSDKType; + maximum_viable_window: bigint; + id: string; +} +function createBaseGenesisState(): GenesisState { + return { + slas: [], + priceFeeds: [], + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/slinky.sla.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.slas) { + PriceFeedSLA.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.priceFeeds) { + PriceFeed.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.slas.push(PriceFeedSLA.decode(reader, reader.uint32())); + break; + case 2: + message.priceFeeds.push(PriceFeed.decode(reader, reader.uint32())); + break; + case 3: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.slas = object.slas?.map(e => PriceFeedSLA.fromPartial(e)) || []; + message.priceFeeds = object.priceFeeds?.map(e => PriceFeed.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.slas = object.slas?.map(e => PriceFeedSLA.fromAmino(e)) || []; + message.priceFeeds = object.price_feeds?.map(e => PriceFeed.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.slas) { + obj.slas = message.slas.map(e => e ? PriceFeedSLA.toAmino(e) : undefined); + } else { + obj.slas = message.slas; + } + if (message.priceFeeds) { + obj.price_feeds = message.priceFeeds.map(e => e ? PriceFeed.toAmino(e) : undefined); + } else { + obj.price_feeds = message.priceFeeds; + } + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/slinky.sla.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + enabled: false + }; +} +export const Params = { + typeUrl: "/slinky.sla.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.enabled = message.enabled === false ? undefined : message.enabled; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/slinky.sla.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBasePriceFeedSLA(): PriceFeedSLA { + return { + maximumViableWindow: BigInt(0), + expectedUptime: "", + slashConstant: "", + minimumBlockUpdates: BigInt(0), + frequency: BigInt(0), + id: "" + }; +} +export const PriceFeedSLA = { + typeUrl: "/slinky.sla.v1.PriceFeedSLA", + encode(message: PriceFeedSLA, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maximumViableWindow !== BigInt(0)) { + writer.uint32(8).uint64(message.maximumViableWindow); + } + if (message.expectedUptime !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.expectedUptime, 18).atomics); + } + if (message.slashConstant !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.slashConstant, 18).atomics); + } + if (message.minimumBlockUpdates !== BigInt(0)) { + writer.uint32(32).uint64(message.minimumBlockUpdates); + } + if (message.frequency !== BigInt(0)) { + writer.uint32(40).uint64(message.frequency); + } + if (message.id !== "") { + writer.uint32(50).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeedSLA { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeedSLA(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maximumViableWindow = reader.uint64(); + break; + case 2: + message.expectedUptime = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.slashConstant = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.minimumBlockUpdates = reader.uint64(); + break; + case 5: + message.frequency = reader.uint64(); + break; + case 6: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PriceFeedSLA { + const message = createBasePriceFeedSLA(); + message.maximumViableWindow = object.maximumViableWindow !== undefined && object.maximumViableWindow !== null ? BigInt(object.maximumViableWindow.toString()) : BigInt(0); + message.expectedUptime = object.expectedUptime ?? ""; + message.slashConstant = object.slashConstant ?? ""; + message.minimumBlockUpdates = object.minimumBlockUpdates !== undefined && object.minimumBlockUpdates !== null ? BigInt(object.minimumBlockUpdates.toString()) : BigInt(0); + message.frequency = object.frequency !== undefined && object.frequency !== null ? BigInt(object.frequency.toString()) : BigInt(0); + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: PriceFeedSLAAmino): PriceFeedSLA { + const message = createBasePriceFeedSLA(); + if (object.maximum_viable_window !== undefined && object.maximum_viable_window !== null) { + message.maximumViableWindow = BigInt(object.maximum_viable_window); + } + if (object.expected_uptime !== undefined && object.expected_uptime !== null) { + message.expectedUptime = object.expected_uptime; + } + if (object.slash_constant !== undefined && object.slash_constant !== null) { + message.slashConstant = object.slash_constant; + } + if (object.minimum_block_updates !== undefined && object.minimum_block_updates !== null) { + message.minimumBlockUpdates = BigInt(object.minimum_block_updates); + } + if (object.frequency !== undefined && object.frequency !== null) { + message.frequency = BigInt(object.frequency); + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: PriceFeedSLA): PriceFeedSLAAmino { + const obj: any = {}; + obj.maximum_viable_window = message.maximumViableWindow !== BigInt(0) ? message.maximumViableWindow.toString() : undefined; + obj.expected_uptime = message.expectedUptime === "" ? undefined : message.expectedUptime; + obj.slash_constant = message.slashConstant === "" ? undefined : message.slashConstant; + obj.minimum_block_updates = message.minimumBlockUpdates !== BigInt(0) ? message.minimumBlockUpdates.toString() : undefined; + obj.frequency = message.frequency !== BigInt(0) ? message.frequency.toString() : undefined; + obj.id = message.id === "" ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: PriceFeedSLAAminoMsg): PriceFeedSLA { + return PriceFeedSLA.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedSLAProtoMsg): PriceFeedSLA { + return PriceFeedSLA.decode(message.value); + }, + toProto(message: PriceFeedSLA): Uint8Array { + return PriceFeedSLA.encode(message).finish(); + }, + toProtoMsg(message: PriceFeedSLA): PriceFeedSLAProtoMsg { + return { + typeUrl: "/slinky.sla.v1.PriceFeedSLA", + value: PriceFeedSLA.encode(message).finish() + }; + } +}; +function createBasePriceFeed(): PriceFeed { + return { + updateMap: new Uint8Array(), + inclusionMap: new Uint8Array(), + index: BigInt(0), + validator: new Uint8Array(), + currencyPair: CurrencyPair.fromPartial({}), + maximumViableWindow: BigInt(0), + id: "" + }; +} +export const PriceFeed = { + typeUrl: "/slinky.sla.v1.PriceFeed", + encode(message: PriceFeed, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.updateMap.length !== 0) { + writer.uint32(10).bytes(message.updateMap); + } + if (message.inclusionMap.length !== 0) { + writer.uint32(18).bytes(message.inclusionMap); + } + if (message.index !== BigInt(0)) { + writer.uint32(24).uint64(message.index); + } + if (message.validator.length !== 0) { + writer.uint32(34).bytes(message.validator); + } + if (message.currencyPair !== undefined) { + CurrencyPair.encode(message.currencyPair, writer.uint32(42).fork()).ldelim(); + } + if (message.maximumViableWindow !== BigInt(0)) { + writer.uint32(48).uint64(message.maximumViableWindow); + } + if (message.id !== "") { + writer.uint32(58).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PriceFeed { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceFeed(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updateMap = reader.bytes(); + break; + case 2: + message.inclusionMap = reader.bytes(); + break; + case 3: + message.index = reader.uint64(); + break; + case 4: + message.validator = reader.bytes(); + break; + case 5: + message.currencyPair = CurrencyPair.decode(reader, reader.uint32()); + break; + case 6: + message.maximumViableWindow = reader.uint64(); + break; + case 7: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PriceFeed { + const message = createBasePriceFeed(); + message.updateMap = object.updateMap ?? new Uint8Array(); + message.inclusionMap = object.inclusionMap ?? new Uint8Array(); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.validator = object.validator ?? new Uint8Array(); + message.currencyPair = object.currencyPair !== undefined && object.currencyPair !== null ? CurrencyPair.fromPartial(object.currencyPair) : undefined; + message.maximumViableWindow = object.maximumViableWindow !== undefined && object.maximumViableWindow !== null ? BigInt(object.maximumViableWindow.toString()) : BigInt(0); + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: PriceFeedAmino): PriceFeed { + const message = createBasePriceFeed(); + if (object.update_map !== undefined && object.update_map !== null) { + message.updateMap = bytesFromBase64(object.update_map); + } + if (object.inclusion_map !== undefined && object.inclusion_map !== null) { + message.inclusionMap = bytesFromBase64(object.inclusion_map); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = bytesFromBase64(object.validator); + } + if (object.currency_pair !== undefined && object.currency_pair !== null) { + message.currencyPair = CurrencyPair.fromAmino(object.currency_pair); + } + if (object.maximum_viable_window !== undefined && object.maximum_viable_window !== null) { + message.maximumViableWindow = BigInt(object.maximum_viable_window); + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: PriceFeed): PriceFeedAmino { + const obj: any = {}; + obj.update_map = message.updateMap ? base64FromBytes(message.updateMap) : undefined; + obj.inclusion_map = message.inclusionMap ? base64FromBytes(message.inclusionMap) : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.validator = message.validator ? base64FromBytes(message.validator) : undefined; + obj.currency_pair = message.currencyPair ? CurrencyPair.toAmino(message.currencyPair) : undefined; + obj.maximum_viable_window = message.maximumViableWindow !== BigInt(0) ? message.maximumViableWindow.toString() : undefined; + obj.id = message.id === "" ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: PriceFeedAminoMsg): PriceFeed { + return PriceFeed.fromAmino(object.value); + }, + fromProtoMsg(message: PriceFeedProtoMsg): PriceFeed { + return PriceFeed.decode(message.value); + }, + toProto(message: PriceFeed): Uint8Array { + return PriceFeed.encode(message).finish(); + }, + toProtoMsg(message: PriceFeed): PriceFeedProtoMsg { + return { + typeUrl: "/slinky.sla.v1.PriceFeed", + value: PriceFeed.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/sla/v1/query.rpc.Query.ts b/dydxjs/packages/dydxjs/src/slinky/sla/v1/query.rpc.Query.ts new file mode 100644 index 00000000..8e84da3f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/sla/v1/query.rpc.Query.ts @@ -0,0 +1,56 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { GetAllSLAsRequest, GetAllSLAsResponse, GetPriceFeedsRequest, GetPriceFeedsResponse, ParamsRequest, ParamsResponse } from "./query"; +/** Query is the query service for the x/sla module. */ +export interface Query { + /** GetAllSLAs returns all SLAs that the module is currently enforcing. */ + getAllSLAs(request?: GetAllSLAsRequest): Promise; + /** + * GetPriceFeeds returns all price feeds that the module is currently + * tracking. This request type inputs the SLA ID to query price feeds for. + */ + getPriceFeeds(request: GetPriceFeedsRequest): Promise; + /** Params returns the current SLA module parameters. */ + params(request?: ParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.getAllSLAs = this.getAllSLAs.bind(this); + this.getPriceFeeds = this.getPriceFeeds.bind(this); + this.params = this.params.bind(this); + } + getAllSLAs(request: GetAllSLAsRequest = {}): Promise { + const data = GetAllSLAsRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.sla.v1.Query", "GetAllSLAs", data); + return promise.then(data => GetAllSLAsResponse.decode(new BinaryReader(data))); + } + getPriceFeeds(request: GetPriceFeedsRequest): Promise { + const data = GetPriceFeedsRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.sla.v1.Query", "GetPriceFeeds", data); + return promise.then(data => GetPriceFeedsResponse.decode(new BinaryReader(data))); + } + params(request: ParamsRequest = {}): Promise { + const data = ParamsRequest.encode(request).finish(); + const promise = this.rpc.request("slinky.sla.v1.Query", "Params", data); + return promise.then(data => ParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + getAllSLAs(request?: GetAllSLAsRequest): Promise { + return queryService.getAllSLAs(request); + }, + getPriceFeeds(request: GetPriceFeedsRequest): Promise { + return queryService.getPriceFeeds(request); + }, + params(request?: ParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/sla/v1/query.ts b/dydxjs/packages/dydxjs/src/slinky/sla/v1/query.ts new file mode 100644 index 00000000..5b127f95 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/sla/v1/query.ts @@ -0,0 +1,498 @@ +//@ts-nocheck +import { PriceFeedSLA, PriceFeedSLAAmino, PriceFeedSLASDKType, PriceFeed, PriceFeedAmino, PriceFeedSDKType, Params, ParamsAmino, ParamsSDKType } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryAllSLAsRequest is the request type for the Query/GetAllSLAs RPC method. */ +export interface GetAllSLAsRequest {} +export interface GetAllSLAsRequestProtoMsg { + typeUrl: "/slinky.sla.v1.GetAllSLAsRequest"; + value: Uint8Array; +} +/** QueryAllSLAsRequest is the request type for the Query/GetAllSLAs RPC method. */ +export interface GetAllSLAsRequestAmino {} +export interface GetAllSLAsRequestAminoMsg { + type: "/slinky.sla.v1.GetAllSLAsRequest"; + value: GetAllSLAsRequestAmino; +} +/** QueryAllSLAsRequest is the request type for the Query/GetAllSLAs RPC method. */ +export interface GetAllSLAsRequestSDKType {} +/** + * QueryAllSLAsResponse is the response type for the Query/GetAllSLAs RPC + * method. + */ +export interface GetAllSLAsResponse { + slas: PriceFeedSLA[]; +} +export interface GetAllSLAsResponseProtoMsg { + typeUrl: "/slinky.sla.v1.GetAllSLAsResponse"; + value: Uint8Array; +} +/** + * QueryAllSLAsResponse is the response type for the Query/GetAllSLAs RPC + * method. + */ +export interface GetAllSLAsResponseAmino { + slas?: PriceFeedSLAAmino[]; +} +export interface GetAllSLAsResponseAminoMsg { + type: "/slinky.sla.v1.GetAllSLAsResponse"; + value: GetAllSLAsResponseAmino; +} +/** + * QueryAllSLAsResponse is the response type for the Query/GetAllSLAs RPC + * method. + */ +export interface GetAllSLAsResponseSDKType { + slas: PriceFeedSLASDKType[]; +} +/** + * QueryGetPriceFeedsRequest is the request type for the Query/GetPriceFeeds RPC + * method. + */ +export interface GetPriceFeedsRequest { + /** ID defines the SLA to query price feeds for. */ + id: string; +} +export interface GetPriceFeedsRequestProtoMsg { + typeUrl: "/slinky.sla.v1.GetPriceFeedsRequest"; + value: Uint8Array; +} +/** + * QueryGetPriceFeedsRequest is the request type for the Query/GetPriceFeeds RPC + * method. + */ +export interface GetPriceFeedsRequestAmino { + /** ID defines the SLA to query price feeds for. */ + id?: string; +} +export interface GetPriceFeedsRequestAminoMsg { + type: "/slinky.sla.v1.GetPriceFeedsRequest"; + value: GetPriceFeedsRequestAmino; +} +/** + * QueryGetPriceFeedsRequest is the request type for the Query/GetPriceFeeds RPC + * method. + */ +export interface GetPriceFeedsRequestSDKType { + id: string; +} +/** + * QueryGetPriceFeedsResponse is the response type for the Query/GetPriceFeeds + * RPC method. + */ +export interface GetPriceFeedsResponse { + /** PriceFeeds defines the price feeds for the given SLA. */ + priceFeeds: PriceFeed[]; +} +export interface GetPriceFeedsResponseProtoMsg { + typeUrl: "/slinky.sla.v1.GetPriceFeedsResponse"; + value: Uint8Array; +} +/** + * QueryGetPriceFeedsResponse is the response type for the Query/GetPriceFeeds + * RPC method. + */ +export interface GetPriceFeedsResponseAmino { + /** PriceFeeds defines the price feeds for the given SLA. */ + price_feeds?: PriceFeedAmino[]; +} +export interface GetPriceFeedsResponseAminoMsg { + type: "/slinky.sla.v1.GetPriceFeedsResponse"; + value: GetPriceFeedsResponseAmino; +} +/** + * QueryGetPriceFeedsResponse is the response type for the Query/GetPriceFeeds + * RPC method. + */ +export interface GetPriceFeedsResponseSDKType { + price_feeds: PriceFeedSDKType[]; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequest {} +export interface ParamsRequestProtoMsg { + typeUrl: "/slinky.sla.v1.ParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestAmino {} +export interface ParamsRequestAminoMsg { + type: "/slinky.sla.v1.ParamsRequest"; + value: ParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponse { + params: Params; +} +export interface ParamsResponseProtoMsg { + typeUrl: "/slinky.sla.v1.ParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseAmino { + params?: ParamsAmino; +} +export interface ParamsResponseAminoMsg { + type: "/slinky.sla.v1.ParamsResponse"; + value: ParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseSDKType { + params: ParamsSDKType; +} +function createBaseGetAllSLAsRequest(): GetAllSLAsRequest { + return {}; +} +export const GetAllSLAsRequest = { + typeUrl: "/slinky.sla.v1.GetAllSLAsRequest", + encode(_: GetAllSLAsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAllSLAsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAllSLAsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GetAllSLAsRequest { + const message = createBaseGetAllSLAsRequest(); + return message; + }, + fromAmino(_: GetAllSLAsRequestAmino): GetAllSLAsRequest { + const message = createBaseGetAllSLAsRequest(); + return message; + }, + toAmino(_: GetAllSLAsRequest): GetAllSLAsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GetAllSLAsRequestAminoMsg): GetAllSLAsRequest { + return GetAllSLAsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetAllSLAsRequestProtoMsg): GetAllSLAsRequest { + return GetAllSLAsRequest.decode(message.value); + }, + toProto(message: GetAllSLAsRequest): Uint8Array { + return GetAllSLAsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetAllSLAsRequest): GetAllSLAsRequestProtoMsg { + return { + typeUrl: "/slinky.sla.v1.GetAllSLAsRequest", + value: GetAllSLAsRequest.encode(message).finish() + }; + } +}; +function createBaseGetAllSLAsResponse(): GetAllSLAsResponse { + return { + slas: [] + }; +} +export const GetAllSLAsResponse = { + typeUrl: "/slinky.sla.v1.GetAllSLAsResponse", + encode(message: GetAllSLAsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.slas) { + PriceFeedSLA.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetAllSLAsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAllSLAsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.slas.push(PriceFeedSLA.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAllSLAsResponse { + const message = createBaseGetAllSLAsResponse(); + message.slas = object.slas?.map(e => PriceFeedSLA.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetAllSLAsResponseAmino): GetAllSLAsResponse { + const message = createBaseGetAllSLAsResponse(); + message.slas = object.slas?.map(e => PriceFeedSLA.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetAllSLAsResponse): GetAllSLAsResponseAmino { + const obj: any = {}; + if (message.slas) { + obj.slas = message.slas.map(e => e ? PriceFeedSLA.toAmino(e) : undefined); + } else { + obj.slas = message.slas; + } + return obj; + }, + fromAminoMsg(object: GetAllSLAsResponseAminoMsg): GetAllSLAsResponse { + return GetAllSLAsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetAllSLAsResponseProtoMsg): GetAllSLAsResponse { + return GetAllSLAsResponse.decode(message.value); + }, + toProto(message: GetAllSLAsResponse): Uint8Array { + return GetAllSLAsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetAllSLAsResponse): GetAllSLAsResponseProtoMsg { + return { + typeUrl: "/slinky.sla.v1.GetAllSLAsResponse", + value: GetAllSLAsResponse.encode(message).finish() + }; + } +}; +function createBaseGetPriceFeedsRequest(): GetPriceFeedsRequest { + return { + id: "" + }; +} +export const GetPriceFeedsRequest = { + typeUrl: "/slinky.sla.v1.GetPriceFeedsRequest", + encode(message: GetPriceFeedsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetPriceFeedsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPriceFeedsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetPriceFeedsRequest { + const message = createBaseGetPriceFeedsRequest(); + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: GetPriceFeedsRequestAmino): GetPriceFeedsRequest { + const message = createBaseGetPriceFeedsRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: GetPriceFeedsRequest): GetPriceFeedsRequestAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: GetPriceFeedsRequestAminoMsg): GetPriceFeedsRequest { + return GetPriceFeedsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GetPriceFeedsRequestProtoMsg): GetPriceFeedsRequest { + return GetPriceFeedsRequest.decode(message.value); + }, + toProto(message: GetPriceFeedsRequest): Uint8Array { + return GetPriceFeedsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetPriceFeedsRequest): GetPriceFeedsRequestProtoMsg { + return { + typeUrl: "/slinky.sla.v1.GetPriceFeedsRequest", + value: GetPriceFeedsRequest.encode(message).finish() + }; + } +}; +function createBaseGetPriceFeedsResponse(): GetPriceFeedsResponse { + return { + priceFeeds: [] + }; +} +export const GetPriceFeedsResponse = { + typeUrl: "/slinky.sla.v1.GetPriceFeedsResponse", + encode(message: GetPriceFeedsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.priceFeeds) { + PriceFeed.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetPriceFeedsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPriceFeedsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceFeeds.push(PriceFeed.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetPriceFeedsResponse { + const message = createBaseGetPriceFeedsResponse(); + message.priceFeeds = object.priceFeeds?.map(e => PriceFeed.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetPriceFeedsResponseAmino): GetPriceFeedsResponse { + const message = createBaseGetPriceFeedsResponse(); + message.priceFeeds = object.price_feeds?.map(e => PriceFeed.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetPriceFeedsResponse): GetPriceFeedsResponseAmino { + const obj: any = {}; + if (message.priceFeeds) { + obj.price_feeds = message.priceFeeds.map(e => e ? PriceFeed.toAmino(e) : undefined); + } else { + obj.price_feeds = message.priceFeeds; + } + return obj; + }, + fromAminoMsg(object: GetPriceFeedsResponseAminoMsg): GetPriceFeedsResponse { + return GetPriceFeedsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GetPriceFeedsResponseProtoMsg): GetPriceFeedsResponse { + return GetPriceFeedsResponse.decode(message.value); + }, + toProto(message: GetPriceFeedsResponse): Uint8Array { + return GetPriceFeedsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetPriceFeedsResponse): GetPriceFeedsResponseProtoMsg { + return { + typeUrl: "/slinky.sla.v1.GetPriceFeedsResponse", + value: GetPriceFeedsResponse.encode(message).finish() + }; + } +}; +function createBaseParamsRequest(): ParamsRequest { + return {}; +} +export const ParamsRequest = { + typeUrl: "/slinky.sla.v1.ParamsRequest", + encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + fromAmino(_: ParamsRequestAmino): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + toAmino(_: ParamsRequest): ParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsRequestAminoMsg): ParamsRequest { + return ParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsRequestProtoMsg): ParamsRequest { + return ParamsRequest.decode(message.value); + }, + toProto(message: ParamsRequest): Uint8Array { + return ParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: ParamsRequest): ParamsRequestProtoMsg { + return { + typeUrl: "/slinky.sla.v1.ParamsRequest", + value: ParamsRequest.encode(message).finish() + }; + } +}; +function createBaseParamsResponse(): ParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const ParamsResponse = { + typeUrl: "/slinky.sla.v1.ParamsResponse", + encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParamsResponse { + const message = createBaseParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: ParamsResponseAmino): ParamsResponse { + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: ParamsResponse): ParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsResponseAminoMsg): ParamsResponse { + return ParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsResponseProtoMsg): ParamsResponse { + return ParamsResponse.decode(message.value); + }, + toProto(message: ParamsResponse): Uint8Array { + return ParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: ParamsResponse): ParamsResponseProtoMsg { + return { + typeUrl: "/slinky.sla.v1.ParamsResponse", + value: ParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.amino.ts b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.amino.ts new file mode 100644 index 00000000..3556fa30 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgAddSLAs, MsgRemoveSLAs, MsgParams } from "./tx"; +export const AminoConverter = { + "/slinky.sla.v1.MsgAddSLAs": { + aminoType: "/slinky.sla.v1.MsgAddSLAs", + toAmino: MsgAddSLAs.toAmino, + fromAmino: MsgAddSLAs.fromAmino + }, + "/slinky.sla.v1.MsgRemoveSLAs": { + aminoType: "/slinky.sla.v1.MsgRemoveSLAs", + toAmino: MsgRemoveSLAs.toAmino, + fromAmino: MsgRemoveSLAs.fromAmino + }, + "/slinky.sla.v1.MsgParams": { + aminoType: "/slinky.sla.v1.MsgParams", + toAmino: MsgParams.toAmino, + fromAmino: MsgParams.fromAmino + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.registry.ts b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.registry.ts new file mode 100644 index 00000000..d6767b15 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAddSLAs, MsgRemoveSLAs, MsgParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/slinky.sla.v1.MsgAddSLAs", MsgAddSLAs], ["/slinky.sla.v1.MsgRemoveSLAs", MsgRemoveSLAs], ["/slinky.sla.v1.MsgParams", MsgParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + addSLAs(value: MsgAddSLAs) { + return { + typeUrl: "/slinky.sla.v1.MsgAddSLAs", + value: MsgAddSLAs.encode(value).finish() + }; + }, + removeSLAs(value: MsgRemoveSLAs) { + return { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAs", + value: MsgRemoveSLAs.encode(value).finish() + }; + }, + params(value: MsgParams) { + return { + typeUrl: "/slinky.sla.v1.MsgParams", + value: MsgParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + addSLAs(value: MsgAddSLAs) { + return { + typeUrl: "/slinky.sla.v1.MsgAddSLAs", + value + }; + }, + removeSLAs(value: MsgRemoveSLAs) { + return { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAs", + value + }; + }, + params(value: MsgParams) { + return { + typeUrl: "/slinky.sla.v1.MsgParams", + value + }; + } + }, + fromPartial: { + addSLAs(value: MsgAddSLAs) { + return { + typeUrl: "/slinky.sla.v1.MsgAddSLAs", + value: MsgAddSLAs.fromPartial(value) + }; + }, + removeSLAs(value: MsgRemoveSLAs) { + return { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAs", + value: MsgRemoveSLAs.fromPartial(value) + }; + }, + params(value: MsgParams) { + return { + typeUrl: "/slinky.sla.v1.MsgParams", + value: MsgParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.rpc.msg.ts b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.rpc.msg.ts new file mode 100644 index 00000000..a8e1250f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.rpc.msg.ts @@ -0,0 +1,43 @@ +//@ts-nocheck +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgAddSLAs, MsgAddSLAsResponse, MsgRemoveSLAs, MsgRemoveSLAsResponse, MsgParams, MsgParamsResponse } from "./tx"; +/** Msg is the message service for the x/sla module. */ +export interface Msg { + /** + * AddSLA defines a method for adding a new SLAs to the store. Note, this will + * overwrite any existing SLA with the same ID. + */ + addSLAs(request: MsgAddSLAs): Promise; + /** + * RemoveSLA defines a method for removing existing SLAs from the store. Note, + * this will not panic if the SLA does not exist. + */ + removeSLAs(request: MsgRemoveSLAs): Promise; + /** Params defines a method for updating the SLA module parameters. */ + params(request: MsgParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.addSLAs = this.addSLAs.bind(this); + this.removeSLAs = this.removeSLAs.bind(this); + this.params = this.params.bind(this); + } + addSLAs(request: MsgAddSLAs): Promise { + const data = MsgAddSLAs.encode(request).finish(); + const promise = this.rpc.request("slinky.sla.v1.Msg", "AddSLAs", data); + return promise.then(data => MsgAddSLAsResponse.decode(new BinaryReader(data))); + } + removeSLAs(request: MsgRemoveSLAs): Promise { + const data = MsgRemoveSLAs.encode(request).finish(); + const promise = this.rpc.request("slinky.sla.v1.Msg", "RemoveSLAs", data); + return promise.then(data => MsgRemoveSLAsResponse.decode(new BinaryReader(data))); + } + params(request: MsgParams): Promise { + const data = MsgParams.encode(request).finish(); + const promise = this.rpc.request("slinky.sla.v1.Msg", "Params", data); + return promise.then(data => MsgParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.ts b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.ts new file mode 100644 index 00000000..31e8005f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/sla/v1/tx.ts @@ -0,0 +1,532 @@ +//@ts-nocheck +import { PriceFeedSLA, PriceFeedSLAAmino, PriceFeedSLASDKType, Params, ParamsAmino, ParamsSDKType } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgAddSLAs defines the Msg/AddSLAs request type. It contains the + * SLAs to be added to the store. + */ +export interface MsgAddSLAs { + /** SLAs defines the SLAs to be added to the store. */ + slas: PriceFeedSLA[]; + /** Authority defines the authority that is adding the SLAs. */ + authority: string; +} +export interface MsgAddSLAsProtoMsg { + typeUrl: "/slinky.sla.v1.MsgAddSLAs"; + value: Uint8Array; +} +/** + * MsgAddSLAs defines the Msg/AddSLAs request type. It contains the + * SLAs to be added to the store. + */ +export interface MsgAddSLAsAmino { + /** SLAs defines the SLAs to be added to the store. */ + slas?: PriceFeedSLAAmino[]; + /** Authority defines the authority that is adding the SLAs. */ + authority?: string; +} +export interface MsgAddSLAsAminoMsg { + type: "/slinky.sla.v1.MsgAddSLAs"; + value: MsgAddSLAsAmino; +} +/** + * MsgAddSLAs defines the Msg/AddSLAs request type. It contains the + * SLAs to be added to the store. + */ +export interface MsgAddSLAsSDKType { + slas: PriceFeedSLASDKType[]; + authority: string; +} +/** MsgAddSLAsResponse defines the Msg/AddSLAs response type. */ +export interface MsgAddSLAsResponse {} +export interface MsgAddSLAsResponseProtoMsg { + typeUrl: "/slinky.sla.v1.MsgAddSLAsResponse"; + value: Uint8Array; +} +/** MsgAddSLAsResponse defines the Msg/AddSLAs response type. */ +export interface MsgAddSLAsResponseAmino {} +export interface MsgAddSLAsResponseAminoMsg { + type: "/slinky.sla.v1.MsgAddSLAsResponse"; + value: MsgAddSLAsResponseAmino; +} +/** MsgAddSLAsResponse defines the Msg/AddSLAs response type. */ +export interface MsgAddSLAsResponseSDKType {} +/** + * MsgRemoveSLAs defines the Msg/RemoveSLAs request type. It contains the + * IDs of the SLAs to be removed from the store. + */ +export interface MsgRemoveSLAs { + /** IDs defines the IDs of the SLAs to be removed from the store. */ + ids: string[]; + /** Authority defines the authority that is removing the SLAs. */ + authority: string; +} +export interface MsgRemoveSLAsProtoMsg { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAs"; + value: Uint8Array; +} +/** + * MsgRemoveSLAs defines the Msg/RemoveSLAs request type. It contains the + * IDs of the SLAs to be removed from the store. + */ +export interface MsgRemoveSLAsAmino { + /** IDs defines the IDs of the SLAs to be removed from the store. */ + ids?: string[]; + /** Authority defines the authority that is removing the SLAs. */ + authority?: string; +} +export interface MsgRemoveSLAsAminoMsg { + type: "/slinky.sla.v1.MsgRemoveSLAs"; + value: MsgRemoveSLAsAmino; +} +/** + * MsgRemoveSLAs defines the Msg/RemoveSLAs request type. It contains the + * IDs of the SLAs to be removed from the store. + */ +export interface MsgRemoveSLAsSDKType { + ids: string[]; + authority: string; +} +/** MsgRemoveSLAsResponse defines the Msg/RemoveSLAs response type. */ +export interface MsgRemoveSLAsResponse {} +export interface MsgRemoveSLAsResponseProtoMsg { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAsResponse"; + value: Uint8Array; +} +/** MsgRemoveSLAsResponse defines the Msg/RemoveSLAs response type. */ +export interface MsgRemoveSLAsResponseAmino {} +export interface MsgRemoveSLAsResponseAminoMsg { + type: "/slinky.sla.v1.MsgRemoveSLAsResponse"; + value: MsgRemoveSLAsResponseAmino; +} +/** MsgRemoveSLAsResponse defines the Msg/RemoveSLAs response type. */ +export interface MsgRemoveSLAsResponseSDKType {} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the SLA module. + */ +export interface MsgParams { + /** Params defines the new parameters for the SLA module. */ + params: Params; + /** Authority defines the authority that is updating the SLA module parameters. */ + authority: string; +} +export interface MsgParamsProtoMsg { + typeUrl: "/slinky.sla.v1.MsgParams"; + value: Uint8Array; +} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the SLA module. + */ +export interface MsgParamsAmino { + /** Params defines the new parameters for the SLA module. */ + params?: ParamsAmino; + /** Authority defines the authority that is updating the SLA module parameters. */ + authority?: string; +} +export interface MsgParamsAminoMsg { + type: "/slinky.sla.v1.MsgParams"; + value: MsgParamsAmino; +} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the SLA module. + */ +export interface MsgParamsSDKType { + params: ParamsSDKType; + authority: string; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponse {} +export interface MsgParamsResponseProtoMsg { + typeUrl: "/slinky.sla.v1.MsgParamsResponse"; + value: Uint8Array; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponseAmino {} +export interface MsgParamsResponseAminoMsg { + type: "/slinky.sla.v1.MsgParamsResponse"; + value: MsgParamsResponseAmino; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponseSDKType {} +function createBaseMsgAddSLAs(): MsgAddSLAs { + return { + slas: [], + authority: "" + }; +} +export const MsgAddSLAs = { + typeUrl: "/slinky.sla.v1.MsgAddSLAs", + encode(message: MsgAddSLAs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.slas) { + PriceFeedSLA.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddSLAs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddSLAs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.slas.push(PriceFeedSLA.decode(reader, reader.uint32())); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddSLAs { + const message = createBaseMsgAddSLAs(); + message.slas = object.slas?.map(e => PriceFeedSLA.fromPartial(e)) || []; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgAddSLAsAmino): MsgAddSLAs { + const message = createBaseMsgAddSLAs(); + message.slas = object.slas?.map(e => PriceFeedSLA.fromAmino(e)) || []; + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgAddSLAs): MsgAddSLAsAmino { + const obj: any = {}; + if (message.slas) { + obj.slas = message.slas.map(e => e ? PriceFeedSLA.toAmino(e) : undefined); + } else { + obj.slas = message.slas; + } + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgAddSLAsAminoMsg): MsgAddSLAs { + return MsgAddSLAs.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddSLAsProtoMsg): MsgAddSLAs { + return MsgAddSLAs.decode(message.value); + }, + toProto(message: MsgAddSLAs): Uint8Array { + return MsgAddSLAs.encode(message).finish(); + }, + toProtoMsg(message: MsgAddSLAs): MsgAddSLAsProtoMsg { + return { + typeUrl: "/slinky.sla.v1.MsgAddSLAs", + value: MsgAddSLAs.encode(message).finish() + }; + } +}; +function createBaseMsgAddSLAsResponse(): MsgAddSLAsResponse { + return {}; +} +export const MsgAddSLAsResponse = { + typeUrl: "/slinky.sla.v1.MsgAddSLAsResponse", + encode(_: MsgAddSLAsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddSLAsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddSLAsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAddSLAsResponse { + const message = createBaseMsgAddSLAsResponse(); + return message; + }, + fromAmino(_: MsgAddSLAsResponseAmino): MsgAddSLAsResponse { + const message = createBaseMsgAddSLAsResponse(); + return message; + }, + toAmino(_: MsgAddSLAsResponse): MsgAddSLAsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddSLAsResponseAminoMsg): MsgAddSLAsResponse { + return MsgAddSLAsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddSLAsResponseProtoMsg): MsgAddSLAsResponse { + return MsgAddSLAsResponse.decode(message.value); + }, + toProto(message: MsgAddSLAsResponse): Uint8Array { + return MsgAddSLAsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddSLAsResponse): MsgAddSLAsResponseProtoMsg { + return { + typeUrl: "/slinky.sla.v1.MsgAddSLAsResponse", + value: MsgAddSLAsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveSLAs(): MsgRemoveSLAs { + return { + ids: [], + authority: "" + }; +} +export const MsgRemoveSLAs = { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAs", + encode(message: MsgRemoveSLAs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.ids) { + writer.uint32(10).string(v!); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveSLAs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveSLAs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ids.push(reader.string()); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveSLAs { + const message = createBaseMsgRemoveSLAs(); + message.ids = object.ids?.map(e => e) || []; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgRemoveSLAsAmino): MsgRemoveSLAs { + const message = createBaseMsgRemoveSLAs(); + message.ids = object.ids?.map(e => e) || []; + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgRemoveSLAs): MsgRemoveSLAsAmino { + const obj: any = {}; + if (message.ids) { + obj.ids = message.ids.map(e => e); + } else { + obj.ids = message.ids; + } + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgRemoveSLAsAminoMsg): MsgRemoveSLAs { + return MsgRemoveSLAs.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRemoveSLAsProtoMsg): MsgRemoveSLAs { + return MsgRemoveSLAs.decode(message.value); + }, + toProto(message: MsgRemoveSLAs): Uint8Array { + return MsgRemoveSLAs.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveSLAs): MsgRemoveSLAsProtoMsg { + return { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAs", + value: MsgRemoveSLAs.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveSLAsResponse(): MsgRemoveSLAsResponse { + return {}; +} +export const MsgRemoveSLAsResponse = { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAsResponse", + encode(_: MsgRemoveSLAsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveSLAsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveSLAsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRemoveSLAsResponse { + const message = createBaseMsgRemoveSLAsResponse(); + return message; + }, + fromAmino(_: MsgRemoveSLAsResponseAmino): MsgRemoveSLAsResponse { + const message = createBaseMsgRemoveSLAsResponse(); + return message; + }, + toAmino(_: MsgRemoveSLAsResponse): MsgRemoveSLAsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveSLAsResponseAminoMsg): MsgRemoveSLAsResponse { + return MsgRemoveSLAsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRemoveSLAsResponseProtoMsg): MsgRemoveSLAsResponse { + return MsgRemoveSLAsResponse.decode(message.value); + }, + toProto(message: MsgRemoveSLAsResponse): Uint8Array { + return MsgRemoveSLAsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveSLAsResponse): MsgRemoveSLAsResponseProtoMsg { + return { + typeUrl: "/slinky.sla.v1.MsgRemoveSLAsResponse", + value: MsgRemoveSLAsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgParams(): MsgParams { + return { + params: Params.fromPartial({}), + authority: "" + }; +} +export const MsgParams = { + typeUrl: "/slinky.sla.v1.MsgParams", + encode(message: MsgParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgParams { + const message = createBaseMsgParams(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgParamsAmino): MsgParams { + const message = createBaseMsgParams(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgParams): MsgParamsAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgParamsAminoMsg): MsgParams { + return MsgParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgParamsProtoMsg): MsgParams { + return MsgParams.decode(message.value); + }, + toProto(message: MsgParams): Uint8Array { + return MsgParams.encode(message).finish(); + }, + toProtoMsg(message: MsgParams): MsgParamsProtoMsg { + return { + typeUrl: "/slinky.sla.v1.MsgParams", + value: MsgParams.encode(message).finish() + }; + } +}; +function createBaseMsgParamsResponse(): MsgParamsResponse { + return {}; +} +export const MsgParamsResponse = { + typeUrl: "/slinky.sla.v1.MsgParamsResponse", + encode(_: MsgParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgParamsResponse { + const message = createBaseMsgParamsResponse(); + return message; + }, + fromAmino(_: MsgParamsResponseAmino): MsgParamsResponse { + const message = createBaseMsgParamsResponse(); + return message; + }, + toAmino(_: MsgParamsResponse): MsgParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgParamsResponseAminoMsg): MsgParamsResponse { + return MsgParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgParamsResponseProtoMsg): MsgParamsResponse { + return MsgParamsResponse.decode(message.value); + }, + toProto(message: MsgParamsResponse): Uint8Array { + return MsgParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgParamsResponse): MsgParamsResponseProtoMsg { + return { + typeUrl: "/slinky.sla.v1.MsgParamsResponse", + value: MsgParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/slinky/types/v1/currency_pair.ts b/dydxjs/packages/dydxjs/src/slinky/types/v1/currency_pair.ts new file mode 100644 index 00000000..be6a1504 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/slinky/types/v1/currency_pair.ts @@ -0,0 +1,109 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * CurrencyPair is the standard representation of a pair of assets, where one + * (Base) is priced in terms of the other (Quote) + */ +export interface CurrencyPair { + base: string; + quote: string; +} +export interface CurrencyPairProtoMsg { + typeUrl: "/slinky.types.v1.CurrencyPair"; + value: Uint8Array; +} +/** + * CurrencyPair is the standard representation of a pair of assets, where one + * (Base) is priced in terms of the other (Quote) + */ +export interface CurrencyPairAmino { + Base?: string; + Quote?: string; +} +export interface CurrencyPairAminoMsg { + type: "/slinky.types.v1.CurrencyPair"; + value: CurrencyPairAmino; +} +/** + * CurrencyPair is the standard representation of a pair of assets, where one + * (Base) is priced in terms of the other (Quote) + */ +export interface CurrencyPairSDKType { + Base: string; + Quote: string; +} +function createBaseCurrencyPair(): CurrencyPair { + return { + base: "", + quote: "" + }; +} +export const CurrencyPair = { + typeUrl: "/slinky.types.v1.CurrencyPair", + encode(message: CurrencyPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.base !== "") { + writer.uint32(10).string(message.base); + } + if (message.quote !== "") { + writer.uint32(18).string(message.quote); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CurrencyPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCurrencyPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.base = reader.string(); + break; + case 2: + message.quote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CurrencyPair { + const message = createBaseCurrencyPair(); + message.base = object.base ?? ""; + message.quote = object.quote ?? ""; + return message; + }, + fromAmino(object: CurrencyPairAmino): CurrencyPair { + const message = createBaseCurrencyPair(); + if (object.Base !== undefined && object.Base !== null) { + message.base = object.Base; + } + if (object.Quote !== undefined && object.Quote !== null) { + message.quote = object.Quote; + } + return message; + }, + toAmino(message: CurrencyPair): CurrencyPairAmino { + const obj: any = {}; + obj.Base = message.base === "" ? undefined : message.base; + obj.Quote = message.quote === "" ? undefined : message.quote; + return obj; + }, + fromAminoMsg(object: CurrencyPairAminoMsg): CurrencyPair { + return CurrencyPair.fromAmino(object.value); + }, + fromProtoMsg(message: CurrencyPairProtoMsg): CurrencyPair { + return CurrencyPair.decode(message.value); + }, + toProto(message: CurrencyPair): Uint8Array { + return CurrencyPair.encode(message).finish(); + }, + toProtoMsg(message: CurrencyPair): CurrencyPairProtoMsg { + return { + typeUrl: "/slinky.types.v1.CurrencyPair", + value: CurrencyPair.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/abci/types.ts b/dydxjs/packages/dydxjs/src/tendermint/abci/types.ts new file mode 100644 index 00000000..35b669e7 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/abci/types.ts @@ -0,0 +1,5409 @@ +//@ts-nocheck +import { Timestamp } from "../../google/protobuf/timestamp"; +import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; +import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; +import { EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, VersionParamsAmino, VersionParamsSDKType } from "../types/params"; +import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../helpers"; +export enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} +export const CheckTxTypeSDKType = CheckTxType; +export const CheckTxTypeAmino = CheckTxType; +export function checkTxTypeFromJSON(object: any): CheckTxType { + switch (object) { + case 0: + case "NEW": + return CheckTxType.NEW; + case 1: + case "RECHECK": + return CheckTxType.RECHECK; + case -1: + case "UNRECOGNIZED": + default: + return CheckTxType.UNRECOGNIZED; + } +} +export function checkTxTypeToJSON(object: CheckTxType): string { + switch (object) { + case CheckTxType.NEW: + return "NEW"; + case CheckTxType.RECHECK: + return "RECHECK"; + case CheckTxType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseOfferSnapshot_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Snapshot accepted, apply chunks */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** REJECT - Reject this specific snapshot, try others */ + REJECT = 3, + /** REJECT_FORMAT - Reject all snapshots of this format, try others */ + REJECT_FORMAT = 4, + /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ + REJECT_SENDER = 5, + UNRECOGNIZED = -1, +} +export const ResponseOfferSnapshot_ResultSDKType = ResponseOfferSnapshot_Result; +export const ResponseOfferSnapshot_ResultAmino = ResponseOfferSnapshot_Result; +export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseOfferSnapshot_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseOfferSnapshot_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseOfferSnapshot_Result.ABORT; + case 3: + case "REJECT": + return ResponseOfferSnapshot_Result.REJECT; + case 4: + case "REJECT_FORMAT": + return ResponseOfferSnapshot_Result.REJECT_FORMAT; + case 5: + case "REJECT_SENDER": + return ResponseOfferSnapshot_Result.REJECT_SENDER; + case -1: + case "UNRECOGNIZED": + default: + return ResponseOfferSnapshot_Result.UNRECOGNIZED; + } +} +export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { + switch (object) { + case ResponseOfferSnapshot_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseOfferSnapshot_Result.ACCEPT: + return "ACCEPT"; + case ResponseOfferSnapshot_Result.ABORT: + return "ABORT"; + case ResponseOfferSnapshot_Result.REJECT: + return "REJECT"; + case ResponseOfferSnapshot_Result.REJECT_FORMAT: + return "REJECT_FORMAT"; + case ResponseOfferSnapshot_Result.REJECT_SENDER: + return "REJECT_SENDER"; + case ResponseOfferSnapshot_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseApplySnapshotChunk_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Chunk successfully accepted */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** RETRY - Retry chunk (combine with refetch and reject) */ + RETRY = 3, + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ + RETRY_SNAPSHOT = 4, + /** REJECT_SNAPSHOT - Reject this snapshot, try others */ + REJECT_SNAPSHOT = 5, + UNRECOGNIZED = -1, +} +export const ResponseApplySnapshotChunk_ResultSDKType = ResponseApplySnapshotChunk_Result; +export const ResponseApplySnapshotChunk_ResultAmino = ResponseApplySnapshotChunk_Result; +export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseApplySnapshotChunk_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseApplySnapshotChunk_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseApplySnapshotChunk_Result.ABORT; + case 3: + case "RETRY": + return ResponseApplySnapshotChunk_Result.RETRY; + case 4: + case "RETRY_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; + case 5: + case "REJECT_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; + } +} +export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { + switch (object) { + case ResponseApplySnapshotChunk_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseApplySnapshotChunk_Result.ACCEPT: + return "ACCEPT"; + case ResponseApplySnapshotChunk_Result.ABORT: + return "ABORT"; + case ResponseApplySnapshotChunk_Result.RETRY: + return "RETRY"; + case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: + return "RETRY_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: + return "REJECT_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum EvidenceType { + UNKNOWN = 0, + DUPLICATE_VOTE = 1, + LIGHT_CLIENT_ATTACK = 2, + UNRECOGNIZED = -1, +} +export const EvidenceTypeSDKType = EvidenceType; +export const EvidenceTypeAmino = EvidenceType; +export function evidenceTypeFromJSON(object: any): EvidenceType { + switch (object) { + case 0: + case "UNKNOWN": + return EvidenceType.UNKNOWN; + case 1: + case "DUPLICATE_VOTE": + return EvidenceType.DUPLICATE_VOTE; + case 2: + case "LIGHT_CLIENT_ATTACK": + return EvidenceType.LIGHT_CLIENT_ATTACK; + case -1: + case "UNRECOGNIZED": + default: + return EvidenceType.UNRECOGNIZED; + } +} +export function evidenceTypeToJSON(object: EvidenceType): string { + switch (object) { + case EvidenceType.UNKNOWN: + return "UNKNOWN"; + case EvidenceType.DUPLICATE_VOTE: + return "DUPLICATE_VOTE"; + case EvidenceType.LIGHT_CLIENT_ATTACK: + return "LIGHT_CLIENT_ATTACK"; + case EvidenceType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface Request { + echo?: RequestEcho; + flush?: RequestFlush; + info?: RequestInfo; + setOption?: RequestSetOption; + initChain?: RequestInitChain; + query?: RequestQuery; + beginBlock?: RequestBeginBlock; + checkTx?: RequestCheckTx; + deliverTx?: RequestDeliverTx; + endBlock?: RequestEndBlock; + commit?: RequestCommit; + listSnapshots?: RequestListSnapshots; + offerSnapshot?: RequestOfferSnapshot; + loadSnapshotChunk?: RequestLoadSnapshotChunk; + applySnapshotChunk?: RequestApplySnapshotChunk; +} +export interface RequestProtoMsg { + typeUrl: "/tendermint.abci.Request"; + value: Uint8Array; +} +export interface RequestAmino { + echo?: RequestEchoAmino; + flush?: RequestFlushAmino; + info?: RequestInfoAmino; + set_option?: RequestSetOptionAmino; + init_chain?: RequestInitChainAmino; + query?: RequestQueryAmino; + begin_block?: RequestBeginBlockAmino; + check_tx?: RequestCheckTxAmino; + deliver_tx?: RequestDeliverTxAmino; + end_block?: RequestEndBlockAmino; + commit?: RequestCommitAmino; + list_snapshots?: RequestListSnapshotsAmino; + offer_snapshot?: RequestOfferSnapshotAmino; + load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; + apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; +} +export interface RequestAminoMsg { + type: "/tendermint.abci.Request"; + value: RequestAmino; +} +export interface RequestSDKType { + echo?: RequestEchoSDKType; + flush?: RequestFlushSDKType; + info?: RequestInfoSDKType; + set_option?: RequestSetOptionSDKType; + init_chain?: RequestInitChainSDKType; + query?: RequestQuerySDKType; + begin_block?: RequestBeginBlockSDKType; + check_tx?: RequestCheckTxSDKType; + deliver_tx?: RequestDeliverTxSDKType; + end_block?: RequestEndBlockSDKType; + commit?: RequestCommitSDKType; + list_snapshots?: RequestListSnapshotsSDKType; + offer_snapshot?: RequestOfferSnapshotSDKType; + load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; + apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; +} +export interface RequestEcho { + message: string; +} +export interface RequestEchoProtoMsg { + typeUrl: "/tendermint.abci.RequestEcho"; + value: Uint8Array; +} +export interface RequestEchoAmino { + message?: string; +} +export interface RequestEchoAminoMsg { + type: "/tendermint.abci.RequestEcho"; + value: RequestEchoAmino; +} +export interface RequestEchoSDKType { + message: string; +} +export interface RequestFlush {} +export interface RequestFlushProtoMsg { + typeUrl: "/tendermint.abci.RequestFlush"; + value: Uint8Array; +} +export interface RequestFlushAmino {} +export interface RequestFlushAminoMsg { + type: "/tendermint.abci.RequestFlush"; + value: RequestFlushAmino; +} +export interface RequestFlushSDKType {} +export interface RequestInfo { + version: string; + blockVersion: bigint; + p2pVersion: bigint; +} +export interface RequestInfoProtoMsg { + typeUrl: "/tendermint.abci.RequestInfo"; + value: Uint8Array; +} +export interface RequestInfoAmino { + version?: string; + block_version?: string; + p2p_version?: string; +} +export interface RequestInfoAminoMsg { + type: "/tendermint.abci.RequestInfo"; + value: RequestInfoAmino; +} +export interface RequestInfoSDKType { + version: string; + block_version: bigint; + p2p_version: bigint; +} +/** nondeterministic */ +export interface RequestSetOption { + key: string; + value: string; +} +export interface RequestSetOptionProtoMsg { + typeUrl: "/tendermint.abci.RequestSetOption"; + value: Uint8Array; +} +/** nondeterministic */ +export interface RequestSetOptionAmino { + key?: string; + value?: string; +} +export interface RequestSetOptionAminoMsg { + type: "/tendermint.abci.RequestSetOption"; + value: RequestSetOptionAmino; +} +/** nondeterministic */ +export interface RequestSetOptionSDKType { + key: string; + value: string; +} +export interface RequestInitChain { + time: Date; + chainId: string; + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: bigint; +} +export interface RequestInitChainProtoMsg { + typeUrl: "/tendermint.abci.RequestInitChain"; + value: Uint8Array; +} +export interface RequestInitChainAmino { + time?: string; + chain_id?: string; + consensus_params?: ConsensusParamsAmino; + validators?: ValidatorUpdateAmino[]; + app_state_bytes?: string; + initial_height?: string; +} +export interface RequestInitChainAminoMsg { + type: "/tendermint.abci.RequestInitChain"; + value: RequestInitChainAmino; +} +export interface RequestInitChainSDKType { + time: Date; + chain_id: string; + consensus_params?: ConsensusParamsSDKType; + validators: ValidatorUpdateSDKType[]; + app_state_bytes: Uint8Array; + initial_height: bigint; +} +export interface RequestQuery { + data: Uint8Array; + path: string; + height: bigint; + prove: boolean; +} +export interface RequestQueryProtoMsg { + typeUrl: "/tendermint.abci.RequestQuery"; + value: Uint8Array; +} +export interface RequestQueryAmino { + data?: string; + path?: string; + height?: string; + prove?: boolean; +} +export interface RequestQueryAminoMsg { + type: "/tendermint.abci.RequestQuery"; + value: RequestQueryAmino; +} +export interface RequestQuerySDKType { + data: Uint8Array; + path: string; + height: bigint; + prove: boolean; +} +export interface RequestBeginBlock { + hash: Uint8Array; + header: Header; + lastCommitInfo: LastCommitInfo; + byzantineValidators: Evidence[]; +} +export interface RequestBeginBlockProtoMsg { + typeUrl: "/tendermint.abci.RequestBeginBlock"; + value: Uint8Array; +} +export interface RequestBeginBlockAmino { + hash?: string; + header?: HeaderAmino; + last_commit_info?: LastCommitInfoAmino; + byzantine_validators?: EvidenceAmino[]; +} +export interface RequestBeginBlockAminoMsg { + type: "/tendermint.abci.RequestBeginBlock"; + value: RequestBeginBlockAmino; +} +export interface RequestBeginBlockSDKType { + hash: Uint8Array; + header: HeaderSDKType; + last_commit_info: LastCommitInfoSDKType; + byzantine_validators: EvidenceSDKType[]; +} +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestCheckTxProtoMsg { + typeUrl: "/tendermint.abci.RequestCheckTx"; + value: Uint8Array; +} +export interface RequestCheckTxAmino { + tx?: string; + type?: CheckTxType; +} +export interface RequestCheckTxAminoMsg { + type: "/tendermint.abci.RequestCheckTx"; + value: RequestCheckTxAmino; +} +export interface RequestCheckTxSDKType { + tx: Uint8Array; + type: CheckTxType; +} +export interface RequestDeliverTx { + tx: Uint8Array; +} +export interface RequestDeliverTxProtoMsg { + typeUrl: "/tendermint.abci.RequestDeliverTx"; + value: Uint8Array; +} +export interface RequestDeliverTxAmino { + tx?: string; +} +export interface RequestDeliverTxAminoMsg { + type: "/tendermint.abci.RequestDeliverTx"; + value: RequestDeliverTxAmino; +} +export interface RequestDeliverTxSDKType { + tx: Uint8Array; +} +export interface RequestEndBlock { + height: bigint; +} +export interface RequestEndBlockProtoMsg { + typeUrl: "/tendermint.abci.RequestEndBlock"; + value: Uint8Array; +} +export interface RequestEndBlockAmino { + height?: string; +} +export interface RequestEndBlockAminoMsg { + type: "/tendermint.abci.RequestEndBlock"; + value: RequestEndBlockAmino; +} +export interface RequestEndBlockSDKType { + height: bigint; +} +export interface RequestCommit {} +export interface RequestCommitProtoMsg { + typeUrl: "/tendermint.abci.RequestCommit"; + value: Uint8Array; +} +export interface RequestCommitAmino {} +export interface RequestCommitAminoMsg { + type: "/tendermint.abci.RequestCommit"; + value: RequestCommitAmino; +} +export interface RequestCommitSDKType {} +/** lists available snapshots */ +export interface RequestListSnapshots {} +export interface RequestListSnapshotsProtoMsg { + typeUrl: "/tendermint.abci.RequestListSnapshots"; + value: Uint8Array; +} +/** lists available snapshots */ +export interface RequestListSnapshotsAmino {} +export interface RequestListSnapshotsAminoMsg { + type: "/tendermint.abci.RequestListSnapshots"; + value: RequestListSnapshotsAmino; +} +/** lists available snapshots */ +export interface RequestListSnapshotsSDKType {} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshot { + /** snapshot offered by peers */ + snapshot?: Snapshot; + /** light client-verified app hash for snapshot height */ + appHash: Uint8Array; +} +export interface RequestOfferSnapshotProtoMsg { + typeUrl: "/tendermint.abci.RequestOfferSnapshot"; + value: Uint8Array; +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshotAmino { + /** snapshot offered by peers */ + snapshot?: SnapshotAmino; + /** light client-verified app hash for snapshot height */ + app_hash?: string; +} +export interface RequestOfferSnapshotAminoMsg { + type: "/tendermint.abci.RequestOfferSnapshot"; + value: RequestOfferSnapshotAmino; +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshotSDKType { + snapshot?: SnapshotSDKType; + app_hash: Uint8Array; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: bigint; + format: number; + chunk: number; +} +export interface RequestLoadSnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk"; + value: Uint8Array; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunkAmino { + height?: string; + format?: number; + chunk?: number; +} +export interface RequestLoadSnapshotChunkAminoMsg { + type: "/tendermint.abci.RequestLoadSnapshotChunk"; + value: RequestLoadSnapshotChunkAmino; +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunkSDKType { + height: bigint; + format: number; + chunk: number; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number; + chunk: Uint8Array; + sender: string; +} +export interface RequestApplySnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk"; + value: Uint8Array; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunkAmino { + index?: number; + chunk?: string; + sender?: string; +} +export interface RequestApplySnapshotChunkAminoMsg { + type: "/tendermint.abci.RequestApplySnapshotChunk"; + value: RequestApplySnapshotChunkAmino; +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunkSDKType { + index: number; + chunk: Uint8Array; + sender: string; +} +export interface Response { + exception?: ResponseException; + echo?: ResponseEcho; + flush?: ResponseFlush; + info?: ResponseInfo; + setOption?: ResponseSetOption; + initChain?: ResponseInitChain; + query?: ResponseQuery; + beginBlock?: ResponseBeginBlock; + checkTx?: ResponseCheckTx; + deliverTx?: ResponseDeliverTx; + endBlock?: ResponseEndBlock; + commit?: ResponseCommit; + listSnapshots?: ResponseListSnapshots; + offerSnapshot?: ResponseOfferSnapshot; + loadSnapshotChunk?: ResponseLoadSnapshotChunk; + applySnapshotChunk?: ResponseApplySnapshotChunk; +} +export interface ResponseProtoMsg { + typeUrl: "/tendermint.abci.Response"; + value: Uint8Array; +} +export interface ResponseAmino { + exception?: ResponseExceptionAmino; + echo?: ResponseEchoAmino; + flush?: ResponseFlushAmino; + info?: ResponseInfoAmino; + set_option?: ResponseSetOptionAmino; + init_chain?: ResponseInitChainAmino; + query?: ResponseQueryAmino; + begin_block?: ResponseBeginBlockAmino; + check_tx?: ResponseCheckTxAmino; + deliver_tx?: ResponseDeliverTxAmino; + end_block?: ResponseEndBlockAmino; + commit?: ResponseCommitAmino; + list_snapshots?: ResponseListSnapshotsAmino; + offer_snapshot?: ResponseOfferSnapshotAmino; + load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; + apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; +} +export interface ResponseAminoMsg { + type: "/tendermint.abci.Response"; + value: ResponseAmino; +} +export interface ResponseSDKType { + exception?: ResponseExceptionSDKType; + echo?: ResponseEchoSDKType; + flush?: ResponseFlushSDKType; + info?: ResponseInfoSDKType; + set_option?: ResponseSetOptionSDKType; + init_chain?: ResponseInitChainSDKType; + query?: ResponseQuerySDKType; + begin_block?: ResponseBeginBlockSDKType; + check_tx?: ResponseCheckTxSDKType; + deliver_tx?: ResponseDeliverTxSDKType; + end_block?: ResponseEndBlockSDKType; + commit?: ResponseCommitSDKType; + list_snapshots?: ResponseListSnapshotsSDKType; + offer_snapshot?: ResponseOfferSnapshotSDKType; + load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; + apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; +} +/** nondeterministic */ +export interface ResponseException { + error: string; +} +export interface ResponseExceptionProtoMsg { + typeUrl: "/tendermint.abci.ResponseException"; + value: Uint8Array; +} +/** nondeterministic */ +export interface ResponseExceptionAmino { + error?: string; +} +export interface ResponseExceptionAminoMsg { + type: "/tendermint.abci.ResponseException"; + value: ResponseExceptionAmino; +} +/** nondeterministic */ +export interface ResponseExceptionSDKType { + error: string; +} +export interface ResponseEcho { + message: string; +} +export interface ResponseEchoProtoMsg { + typeUrl: "/tendermint.abci.ResponseEcho"; + value: Uint8Array; +} +export interface ResponseEchoAmino { + message?: string; +} +export interface ResponseEchoAminoMsg { + type: "/tendermint.abci.ResponseEcho"; + value: ResponseEchoAmino; +} +export interface ResponseEchoSDKType { + message: string; +} +export interface ResponseFlush {} +export interface ResponseFlushProtoMsg { + typeUrl: "/tendermint.abci.ResponseFlush"; + value: Uint8Array; +} +export interface ResponseFlushAmino {} +export interface ResponseFlushAminoMsg { + type: "/tendermint.abci.ResponseFlush"; + value: ResponseFlushAmino; +} +export interface ResponseFlushSDKType {} +export interface ResponseInfo { + data: string; + version: string; + appVersion: bigint; + lastBlockHeight: bigint; + lastBlockAppHash: Uint8Array; +} +export interface ResponseInfoProtoMsg { + typeUrl: "/tendermint.abci.ResponseInfo"; + value: Uint8Array; +} +export interface ResponseInfoAmino { + data?: string; + version?: string; + app_version?: string; + last_block_height?: string; + last_block_app_hash?: string; +} +export interface ResponseInfoAminoMsg { + type: "/tendermint.abci.ResponseInfo"; + value: ResponseInfoAmino; +} +export interface ResponseInfoSDKType { + data: string; + version: string; + app_version: bigint; + last_block_height: bigint; + last_block_app_hash: Uint8Array; +} +/** nondeterministic */ +export interface ResponseSetOption { + code: number; + /** bytes data = 2; */ + log: string; + info: string; +} +export interface ResponseSetOptionProtoMsg { + typeUrl: "/tendermint.abci.ResponseSetOption"; + value: Uint8Array; +} +/** nondeterministic */ +export interface ResponseSetOptionAmino { + code?: number; + /** bytes data = 2; */ + log?: string; + info?: string; +} +export interface ResponseSetOptionAminoMsg { + type: "/tendermint.abci.ResponseSetOption"; + value: ResponseSetOptionAmino; +} +/** nondeterministic */ +export interface ResponseSetOptionSDKType { + code: number; + log: string; + info: string; +} +export interface ResponseInitChain { + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appHash: Uint8Array; +} +export interface ResponseInitChainProtoMsg { + typeUrl: "/tendermint.abci.ResponseInitChain"; + value: Uint8Array; +} +export interface ResponseInitChainAmino { + consensus_params?: ConsensusParamsAmino; + validators?: ValidatorUpdateAmino[]; + app_hash?: string; +} +export interface ResponseInitChainAminoMsg { + type: "/tendermint.abci.ResponseInitChain"; + value: ResponseInitChainAmino; +} +export interface ResponseInitChainSDKType { + consensus_params?: ConsensusParamsSDKType; + validators: ValidatorUpdateSDKType[]; + app_hash: Uint8Array; +} +export interface ResponseQuery { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: bigint; + key: Uint8Array; + value: Uint8Array; + proofOps?: ProofOps; + height: bigint; + codespace: string; +} +export interface ResponseQueryProtoMsg { + typeUrl: "/tendermint.abci.ResponseQuery"; + value: Uint8Array; +} +export interface ResponseQueryAmino { + code?: number; + /** bytes data = 2; // use "value" instead. */ + log?: string; + /** nondeterministic */ + info?: string; + index?: string; + key?: string; + value?: string; + proof_ops?: ProofOpsAmino; + height?: string; + codespace?: string; +} +export interface ResponseQueryAminoMsg { + type: "/tendermint.abci.ResponseQuery"; + value: ResponseQueryAmino; +} +export interface ResponseQuerySDKType { + code: number; + log: string; + info: string; + index: bigint; + key: Uint8Array; + value: Uint8Array; + proof_ops?: ProofOpsSDKType; + height: bigint; + codespace: string; +} +export interface ResponseBeginBlock { + events: Event[]; +} +export interface ResponseBeginBlockProtoMsg { + typeUrl: "/tendermint.abci.ResponseBeginBlock"; + value: Uint8Array; +} +export interface ResponseBeginBlockAmino { + events?: EventAmino[]; +} +export interface ResponseBeginBlockAminoMsg { + type: "/tendermint.abci.ResponseBeginBlock"; + value: ResponseBeginBlockAmino; +} +export interface ResponseBeginBlockSDKType { + events: EventSDKType[]; +} +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: bigint; + gasUsed: bigint; + events: Event[]; + codespace: string; +} +export interface ResponseCheckTxProtoMsg { + typeUrl: "/tendermint.abci.ResponseCheckTx"; + value: Uint8Array; +} +export interface ResponseCheckTxAmino { + code?: number; + data?: string; + /** nondeterministic */ + log?: string; + /** nondeterministic */ + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; +} +export interface ResponseCheckTxAminoMsg { + type: "/tendermint.abci.ResponseCheckTx"; + value: ResponseCheckTxAmino; +} +export interface ResponseCheckTxSDKType { + code: number; + data: Uint8Array; + log: string; + info: string; + gas_wanted: bigint; + gas_used: bigint; + events: EventSDKType[]; + codespace: string; +} +export interface ResponseDeliverTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: bigint; + gasUsed: bigint; + events: Event[]; + codespace: string; +} +export interface ResponseDeliverTxProtoMsg { + typeUrl: "/tendermint.abci.ResponseDeliverTx"; + value: Uint8Array; +} +export interface ResponseDeliverTxAmino { + code?: number; + data?: string; + /** nondeterministic */ + log?: string; + /** nondeterministic */ + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; +} +export interface ResponseDeliverTxAminoMsg { + type: "/tendermint.abci.ResponseDeliverTx"; + value: ResponseDeliverTxAmino; +} +export interface ResponseDeliverTxSDKType { + code: number; + data: Uint8Array; + log: string; + info: string; + gas_wanted: bigint; + gas_used: bigint; + events: EventSDKType[]; + codespace: string; +} +export interface ResponseEndBlock { + validatorUpdates: ValidatorUpdate[]; + consensusParamUpdates?: ConsensusParams; + events: Event[]; +} +export interface ResponseEndBlockProtoMsg { + typeUrl: "/tendermint.abci.ResponseEndBlock"; + value: Uint8Array; +} +export interface ResponseEndBlockAmino { + validator_updates?: ValidatorUpdateAmino[]; + consensus_param_updates?: ConsensusParamsAmino; + events?: EventAmino[]; +} +export interface ResponseEndBlockAminoMsg { + type: "/tendermint.abci.ResponseEndBlock"; + value: ResponseEndBlockAmino; +} +export interface ResponseEndBlockSDKType { + validator_updates: ValidatorUpdateSDKType[]; + consensus_param_updates?: ConsensusParamsSDKType; + events: EventSDKType[]; +} +export interface ResponseCommit { + /** reserve 1 */ + data: Uint8Array; + retainHeight: bigint; +} +export interface ResponseCommitProtoMsg { + typeUrl: "/tendermint.abci.ResponseCommit"; + value: Uint8Array; +} +export interface ResponseCommitAmino { + /** reserve 1 */ + data?: string; + retain_height?: string; +} +export interface ResponseCommitAminoMsg { + type: "/tendermint.abci.ResponseCommit"; + value: ResponseCommitAmino; +} +export interface ResponseCommitSDKType { + data: Uint8Array; + retain_height: bigint; +} +export interface ResponseListSnapshots { + snapshots: Snapshot[]; +} +export interface ResponseListSnapshotsProtoMsg { + typeUrl: "/tendermint.abci.ResponseListSnapshots"; + value: Uint8Array; +} +export interface ResponseListSnapshotsAmino { + snapshots?: SnapshotAmino[]; +} +export interface ResponseListSnapshotsAminoMsg { + type: "/tendermint.abci.ResponseListSnapshots"; + value: ResponseListSnapshotsAmino; +} +export interface ResponseListSnapshotsSDKType { + snapshots: SnapshotSDKType[]; +} +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result; +} +export interface ResponseOfferSnapshotProtoMsg { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot"; + value: Uint8Array; +} +export interface ResponseOfferSnapshotAmino { + result?: ResponseOfferSnapshot_Result; +} +export interface ResponseOfferSnapshotAminoMsg { + type: "/tendermint.abci.ResponseOfferSnapshot"; + value: ResponseOfferSnapshotAmino; +} +export interface ResponseOfferSnapshotSDKType { + result: ResponseOfferSnapshot_Result; +} +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} +export interface ResponseLoadSnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: Uint8Array; +} +export interface ResponseLoadSnapshotChunkAmino { + chunk?: string; +} +export interface ResponseLoadSnapshotChunkAminoMsg { + type: "/tendermint.abci.ResponseLoadSnapshotChunk"; + value: ResponseLoadSnapshotChunkAmino; +} +export interface ResponseLoadSnapshotChunkSDKType { + chunk: Uint8Array; +} +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetchChunks: number[]; + /** Chunk senders to reject and ban */ + rejectSenders: string[]; +} +export interface ResponseApplySnapshotChunkProtoMsg { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk"; + value: Uint8Array; +} +export interface ResponseApplySnapshotChunkAmino { + result?: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetch_chunks?: number[]; + /** Chunk senders to reject and ban */ + reject_senders?: string[]; +} +export interface ResponseApplySnapshotChunkAminoMsg { + type: "/tendermint.abci.ResponseApplySnapshotChunk"; + value: ResponseApplySnapshotChunkAmino; +} +export interface ResponseApplySnapshotChunkSDKType { + result: ResponseApplySnapshotChunk_Result; + refetch_chunks: number[]; + reject_senders: string[]; +} +/** + * ConsensusParams contains all consensus-relevant parameters + * that can be adjusted by the abci app + */ +export interface ConsensusParams { + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; +} +export interface ConsensusParamsProtoMsg { + typeUrl: "/tendermint.abci.ConsensusParams"; + value: Uint8Array; +} +/** + * ConsensusParams contains all consensus-relevant parameters + * that can be adjusted by the abci app + */ +export interface ConsensusParamsAmino { + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; + version?: VersionParamsAmino; +} +export interface ConsensusParamsAminoMsg { + type: "/tendermint.abci.ConsensusParams"; + value: ConsensusParamsAmino; +} +/** + * ConsensusParams contains all consensus-relevant parameters + * that can be adjusted by the abci app + */ +export interface ConsensusParamsSDKType { + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; + version?: VersionParamsSDKType; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** Note: must be greater than 0 */ + maxBytes: bigint; + /** Note: must be greater or equal to -1 */ + maxGas: bigint; +} +export interface BlockParamsProtoMsg { + typeUrl: "/tendermint.abci.BlockParams"; + value: Uint8Array; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsAmino { + /** Note: must be greater than 0 */ + max_bytes?: string; + /** Note: must be greater or equal to -1 */ + max_gas?: string; +} +export interface BlockParamsAminoMsg { + type: "/tendermint.abci.BlockParams"; + value: BlockParamsAmino; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsSDKType { + max_bytes: bigint; + max_gas: bigint; +} +export interface LastCommitInfo { + round: number; + votes: VoteInfo[]; +} +export interface LastCommitInfoProtoMsg { + typeUrl: "/tendermint.abci.LastCommitInfo"; + value: Uint8Array; +} +export interface LastCommitInfoAmino { + round?: number; + votes?: VoteInfoAmino[]; +} +export interface LastCommitInfoAminoMsg { + type: "/tendermint.abci.LastCommitInfo"; + value: LastCommitInfoAmino; +} +export interface LastCommitInfoSDKType { + round: number; + votes: VoteInfoSDKType[]; +} +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface Event { + type: string; + attributes: EventAttribute[]; +} +export interface EventProtoMsg { + typeUrl: "/tendermint.abci.Event"; + value: Uint8Array; +} +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface EventAmino { + type?: string; + attributes?: EventAttributeAmino[]; +} +export interface EventAminoMsg { + type: "/tendermint.abci.Event"; + value: EventAmino; +} +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface EventSDKType { + type: string; + attributes: EventAttributeSDKType[]; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: Uint8Array; + value: Uint8Array; + /** nondeterministic */ + index: boolean; +} +export interface EventAttributeProtoMsg { + typeUrl: "/tendermint.abci.EventAttribute"; + value: Uint8Array; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttributeAmino { + key?: string; + value?: string; + /** nondeterministic */ + index?: boolean; +} +export interface EventAttributeAminoMsg { + type: "/tendermint.abci.EventAttribute"; + value: EventAttributeAmino; +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttributeSDKType { + key: Uint8Array; + value: Uint8Array; + index: boolean; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResult { + height: bigint; + index: number; + tx: Uint8Array; + result: ResponseDeliverTx; +} +export interface TxResultProtoMsg { + typeUrl: "/tendermint.abci.TxResult"; + value: Uint8Array; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResultAmino { + height?: string; + index?: number; + tx?: string; + result?: ResponseDeliverTxAmino; +} +export interface TxResultAminoMsg { + type: "/tendermint.abci.TxResult"; + value: TxResultAmino; +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResultSDKType { + height: bigint; + index: number; + tx: Uint8Array; + result: ResponseDeliverTxSDKType; +} +/** Validator */ +export interface Validator { + /** The first 20 bytes of SHA256(public key) */ + address: Uint8Array; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: bigint; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.abci.Validator"; + value: Uint8Array; +} +/** Validator */ +export interface ValidatorAmino { + /** The first 20 bytes of SHA256(public key) */ + address?: string; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power?: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.abci.Validator"; + value: ValidatorAmino; +} +/** Validator */ +export interface ValidatorSDKType { + address: Uint8Array; + power: bigint; +} +/** ValidatorUpdate */ +export interface ValidatorUpdate { + pubKey: PublicKey; + power: bigint; +} +export interface ValidatorUpdateProtoMsg { + typeUrl: "/tendermint.abci.ValidatorUpdate"; + value: Uint8Array; +} +/** ValidatorUpdate */ +export interface ValidatorUpdateAmino { + pub_key?: PublicKeyAmino; + power?: string; +} +export interface ValidatorUpdateAminoMsg { + type: "/tendermint.abci.ValidatorUpdate"; + value: ValidatorUpdateAmino; +} +/** ValidatorUpdate */ +export interface ValidatorUpdateSDKType { + pub_key: PublicKeySDKType; + power: bigint; +} +/** VoteInfo */ +export interface VoteInfo { + validator: Validator; + signedLastBlock: boolean; +} +export interface VoteInfoProtoMsg { + typeUrl: "/tendermint.abci.VoteInfo"; + value: Uint8Array; +} +/** VoteInfo */ +export interface VoteInfoAmino { + validator?: ValidatorAmino; + signed_last_block?: boolean; +} +export interface VoteInfoAminoMsg { + type: "/tendermint.abci.VoteInfo"; + value: VoteInfoAmino; +} +/** VoteInfo */ +export interface VoteInfoSDKType { + validator: ValidatorSDKType; + signed_last_block: boolean; +} +export interface Evidence { + type: EvidenceType; + /** The offending validator */ + validator: Validator; + /** The height when the offense occurred */ + height: bigint; + /** The corresponding time where the offense occurred */ + time: Date; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + totalVotingPower: bigint; +} +export interface EvidenceProtoMsg { + typeUrl: "/tendermint.abci.Evidence"; + value: Uint8Array; +} +export interface EvidenceAmino { + type?: EvidenceType; + /** The offending validator */ + validator?: ValidatorAmino; + /** The height when the offense occurred */ + height?: string; + /** The corresponding time where the offense occurred */ + time?: string; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + total_voting_power?: string; +} +export interface EvidenceAminoMsg { + type: "/tendermint.abci.Evidence"; + value: EvidenceAmino; +} +export interface EvidenceSDKType { + type: EvidenceType; + validator: ValidatorSDKType; + height: bigint; + time: Date; + total_voting_power: bigint; +} +export interface Snapshot { + /** The height at which the snapshot was taken */ + height: bigint; + /** The application-specific snapshot format */ + format: number; + /** Number of chunks in the snapshot */ + chunks: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash: Uint8Array; + /** Arbitrary application metadata */ + metadata: Uint8Array; +} +export interface SnapshotProtoMsg { + typeUrl: "/tendermint.abci.Snapshot"; + value: Uint8Array; +} +export interface SnapshotAmino { + /** The height at which the snapshot was taken */ + height?: string; + /** The application-specific snapshot format */ + format?: number; + /** Number of chunks in the snapshot */ + chunks?: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash?: string; + /** Arbitrary application metadata */ + metadata?: string; +} +export interface SnapshotAminoMsg { + type: "/tendermint.abci.Snapshot"; + value: SnapshotAmino; +} +export interface SnapshotSDKType { + height: bigint; + format: number; + chunks: number; + hash: Uint8Array; + metadata: Uint8Array; +} +function createBaseRequest(): Request { + return { + echo: undefined, + flush: undefined, + info: undefined, + setOption: undefined, + initChain: undefined, + query: undefined, + beginBlock: undefined, + checkTx: undefined, + deliverTx: undefined, + endBlock: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined + }; +} +export const Request = { + typeUrl: "/tendermint.abci.Request", + encode(message: Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.echo !== undefined) { + RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); + } + if (message.flush !== undefined) { + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); + } + if (message.info !== undefined) { + RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); + } + if (message.setOption !== undefined) { + RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); + } + if (message.initChain !== undefined) { + RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); + } + if (message.query !== undefined) { + RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim(); + } + if (message.commit !== undefined) { + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Request { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = RequestInfo.decode(reader, reader.uint32()); + break; + case 4: + message.setOption = RequestSetOption.decode(reader, reader.uint32()); + break; + case 5: + message.initChain = RequestInitChain.decode(reader, reader.uint32()); + break; + case 6: + message.query = RequestQuery.decode(reader, reader.uint32()); + break; + case 7: + message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); + break; + case 8: + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); + break; + case 9: + message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); + break; + case 10: + message.endBlock = RequestEndBlock.decode(reader, reader.uint32()); + break; + case 11: + message.commit = RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 15: + message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Request { + const message = createBaseRequest(); + message.echo = object.echo !== undefined && object.echo !== null ? RequestEcho.fromPartial(object.echo) : undefined; + message.flush = object.flush !== undefined && object.flush !== null ? RequestFlush.fromPartial(object.flush) : undefined; + message.info = object.info !== undefined && object.info !== null ? RequestInfo.fromPartial(object.info) : undefined; + message.setOption = object.setOption !== undefined && object.setOption !== null ? RequestSetOption.fromPartial(object.setOption) : undefined; + message.initChain = object.initChain !== undefined && object.initChain !== null ? RequestInitChain.fromPartial(object.initChain) : undefined; + message.query = object.query !== undefined && object.query !== null ? RequestQuery.fromPartial(object.query) : undefined; + message.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? RequestBeginBlock.fromPartial(object.beginBlock) : undefined; + message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? RequestCheckTx.fromPartial(object.checkTx) : undefined; + message.deliverTx = object.deliverTx !== undefined && object.deliverTx !== null ? RequestDeliverTx.fromPartial(object.deliverTx) : undefined; + message.endBlock = object.endBlock !== undefined && object.endBlock !== null ? RequestEndBlock.fromPartial(object.endBlock) : undefined; + message.commit = object.commit !== undefined && object.commit !== null ? RequestCommit.fromPartial(object.commit) : undefined; + message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? RequestListSnapshots.fromPartial(object.listSnapshots) : undefined; + message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; + message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; + message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; + return message; + }, + fromAmino(object: RequestAmino): Request { + const message = createBaseRequest(); + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromAmino(object.info); + } + if (object.set_option !== undefined && object.set_option !== null) { + message.setOption = RequestSetOption.fromAmino(object.set_option); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = RequestInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = RequestBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = RequestCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = RequestDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = RequestEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + return message; + }, + toAmino(message: Request): RequestAmino { + const obj: any = {}; + obj.echo = message.echo ? RequestEcho.toAmino(message.echo) : undefined; + obj.flush = message.flush ? RequestFlush.toAmino(message.flush) : undefined; + obj.info = message.info ? RequestInfo.toAmino(message.info) : undefined; + obj.set_option = message.setOption ? RequestSetOption.toAmino(message.setOption) : undefined; + obj.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; + obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; + obj.begin_block = message.beginBlock ? RequestBeginBlock.toAmino(message.beginBlock) : undefined; + obj.check_tx = message.checkTx ? RequestCheckTx.toAmino(message.checkTx) : undefined; + obj.deliver_tx = message.deliverTx ? RequestDeliverTx.toAmino(message.deliverTx) : undefined; + obj.end_block = message.endBlock ? RequestEndBlock.toAmino(message.endBlock) : undefined; + obj.commit = message.commit ? RequestCommit.toAmino(message.commit) : undefined; + obj.list_snapshots = message.listSnapshots ? RequestListSnapshots.toAmino(message.listSnapshots) : undefined; + obj.offer_snapshot = message.offerSnapshot ? RequestOfferSnapshot.toAmino(message.offerSnapshot) : undefined; + obj.load_snapshot_chunk = message.loadSnapshotChunk ? RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; + obj.apply_snapshot_chunk = message.applySnapshotChunk ? RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + return obj; + }, + fromAminoMsg(object: RequestAminoMsg): Request { + return Request.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProtoMsg): Request { + return Request.decode(message.value); + }, + toProto(message: Request): Uint8Array { + return Request.encode(message).finish(); + }, + toProtoMsg(message: Request): RequestProtoMsg { + return { + typeUrl: "/tendermint.abci.Request", + value: Request.encode(message).finish() + }; + } +}; +function createBaseRequestEcho(): RequestEcho { + return { + message: "" + }; +} +export const RequestEcho = { + typeUrl: "/tendermint.abci.RequestEcho", + encode(message: RequestEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEcho(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestEcho { + const message = createBaseRequestEcho(); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: RequestEchoAmino): RequestEcho { + const message = createBaseRequestEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; + }, + toAmino(message: RequestEcho): RequestEchoAmino { + const obj: any = {}; + obj.message = message.message === "" ? undefined : message.message; + return obj; + }, + fromAminoMsg(object: RequestEchoAminoMsg): RequestEcho { + return RequestEcho.fromAmino(object.value); + }, + fromProtoMsg(message: RequestEchoProtoMsg): RequestEcho { + return RequestEcho.decode(message.value); + }, + toProto(message: RequestEcho): Uint8Array { + return RequestEcho.encode(message).finish(); + }, + toProtoMsg(message: RequestEcho): RequestEchoProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestEcho", + value: RequestEcho.encode(message).finish() + }; + } +}; +function createBaseRequestFlush(): RequestFlush { + return {}; +} +export const RequestFlush = { + typeUrl: "/tendermint.abci.RequestFlush", + encode(_: RequestFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestFlush(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): RequestFlush { + const message = createBaseRequestFlush(); + return message; + }, + fromAmino(_: RequestFlushAmino): RequestFlush { + const message = createBaseRequestFlush(); + return message; + }, + toAmino(_: RequestFlush): RequestFlushAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestFlushAminoMsg): RequestFlush { + return RequestFlush.fromAmino(object.value); + }, + fromProtoMsg(message: RequestFlushProtoMsg): RequestFlush { + return RequestFlush.decode(message.value); + }, + toProto(message: RequestFlush): Uint8Array { + return RequestFlush.encode(message).finish(); + }, + toProtoMsg(message: RequestFlush): RequestFlushProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestFlush", + value: RequestFlush.encode(message).finish() + }; + } +}; +function createBaseRequestInfo(): RequestInfo { + return { + version: "", + blockVersion: BigInt(0), + p2pVersion: BigInt(0) + }; +} +export const RequestInfo = { + typeUrl: "/tendermint.abci.RequestInfo", + encode(message: RequestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.blockVersion !== BigInt(0)) { + writer.uint32(16).uint64(message.blockVersion); + } + if (message.p2pVersion !== BigInt(0)) { + writer.uint32(24).uint64(message.p2pVersion); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64(); + break; + case 3: + message.p2pVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestInfo { + const message = createBaseRequestInfo(); + message.version = object.version ?? ""; + message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); + message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RequestInfoAmino): RequestInfo { + const message = createBaseRequestInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.block_version !== undefined && object.block_version !== null) { + message.blockVersion = BigInt(object.block_version); + } + if (object.p2p_version !== undefined && object.p2p_version !== null) { + message.p2pVersion = BigInt(object.p2p_version); + } + return message; + }, + toAmino(message: RequestInfo): RequestInfoAmino { + const obj: any = {}; + obj.version = message.version === "" ? undefined : message.version; + obj.block_version = message.blockVersion !== BigInt(0) ? message.blockVersion.toString() : undefined; + obj.p2p_version = message.p2pVersion !== BigInt(0) ? message.p2pVersion.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { + return RequestInfo.fromAmino(object.value); + }, + fromProtoMsg(message: RequestInfoProtoMsg): RequestInfo { + return RequestInfo.decode(message.value); + }, + toProto(message: RequestInfo): Uint8Array { + return RequestInfo.encode(message).finish(); + }, + toProtoMsg(message: RequestInfo): RequestInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestInfo", + value: RequestInfo.encode(message).finish() + }; + } +}; +function createBaseRequestSetOption(): RequestSetOption { + return { + key: "", + value: "" + }; +} +export const RequestSetOption = { + typeUrl: "/tendermint.abci.RequestSetOption", + encode(message: RequestSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestSetOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestSetOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestSetOption { + const message = createBaseRequestSetOption(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: RequestSetOptionAmino): RequestSetOption { + const message = createBaseRequestSetOption(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: RequestSetOption): RequestSetOptionAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: RequestSetOptionAminoMsg): RequestSetOption { + return RequestSetOption.fromAmino(object.value); + }, + fromProtoMsg(message: RequestSetOptionProtoMsg): RequestSetOption { + return RequestSetOption.decode(message.value); + }, + toProto(message: RequestSetOption): Uint8Array { + return RequestSetOption.encode(message).finish(); + }, + toProtoMsg(message: RequestSetOption): RequestSetOptionProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestSetOption", + value: RequestSetOption.encode(message).finish() + }; + } +}; +function createBaseRequestInitChain(): RequestInitChain { + return { + time: new Date(), + chainId: "", + consensusParams: undefined, + validators: [], + appStateBytes: new Uint8Array(), + initialHeight: BigInt(0) + }; +} +export const RequestInitChain = { + typeUrl: "/tendermint.abci.RequestInitChain", + encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.appStateBytes.length !== 0) { + writer.uint32(42).bytes(message.appStateBytes); + } + if (message.initialHeight !== BigInt(0)) { + writer.uint32(48).int64(message.initialHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInitChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestInitChain { + const message = createBaseRequestInitChain(); + message.time = object.time ?? undefined; + message.chainId = object.chainId ?? ""; + message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; + message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.appStateBytes = object.appStateBytes ?? new Uint8Array(); + message.initialHeight = object.initialHeight !== undefined && object.initialHeight !== null ? BigInt(object.initialHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RequestInitChainAmino): RequestInitChain { + const message = createBaseRequestInitChain(); + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_state_bytes !== undefined && object.app_state_bytes !== null) { + message.appStateBytes = bytesFromBase64(object.app_state_bytes); + } + if (object.initial_height !== undefined && object.initial_height !== null) { + message.initialHeight = BigInt(object.initial_height); + } + return message; + }, + toAmino(message: RequestInitChain): RequestInitChainAmino { + const obj: any = {}; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; + if (message.validators) { + obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.app_state_bytes = message.appStateBytes ? base64FromBytes(message.appStateBytes) : undefined; + obj.initial_height = message.initialHeight !== BigInt(0) ? message.initialHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RequestInitChainAminoMsg): RequestInitChain { + return RequestInitChain.fromAmino(object.value); + }, + fromProtoMsg(message: RequestInitChainProtoMsg): RequestInitChain { + return RequestInitChain.decode(message.value); + }, + toProto(message: RequestInitChain): Uint8Array { + return RequestInitChain.encode(message).finish(); + }, + toProtoMsg(message: RequestInitChain): RequestInitChainProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestInitChain", + value: RequestInitChain.encode(message).finish() + }; + } +}; +function createBaseRequestQuery(): RequestQuery { + return { + data: new Uint8Array(), + path: "", + height: BigInt(0), + prove: false + }; +} +export const RequestQuery = { + typeUrl: "/tendermint.abci.RequestQuery", + encode(message: RequestQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.prove === true) { + writer.uint32(32).bool(message.prove); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestQuery(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestQuery { + const message = createBaseRequestQuery(); + message.data = object.data ?? new Uint8Array(); + message.path = object.path ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.prove = object.prove ?? false; + return message; + }, + fromAmino(object: RequestQueryAmino): RequestQuery { + const message = createBaseRequestQuery(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } + return message; + }, + toAmino(message: RequestQuery): RequestQueryAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.path = message.path === "" ? undefined : message.path; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.prove = message.prove === false ? undefined : message.prove; + return obj; + }, + fromAminoMsg(object: RequestQueryAminoMsg): RequestQuery { + return RequestQuery.fromAmino(object.value); + }, + fromProtoMsg(message: RequestQueryProtoMsg): RequestQuery { + return RequestQuery.decode(message.value); + }, + toProto(message: RequestQuery): Uint8Array { + return RequestQuery.encode(message).finish(); + }, + toProtoMsg(message: RequestQuery): RequestQueryProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestQuery", + value: RequestQuery.encode(message).finish() + }; + } +}; +function createBaseRequestBeginBlock(): RequestBeginBlock { + return { + hash: new Uint8Array(), + header: Header.fromPartial({}), + lastCommitInfo: LastCommitInfo.fromPartial({}), + byzantineValidators: [] + }; +} +export const RequestBeginBlock = { + typeUrl: "/tendermint.abci.RequestBeginBlock", + encode(message: RequestBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(18).fork()).ldelim(); + } + if (message.lastCommitInfo !== undefined) { + LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.byzantineValidators) { + Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestBeginBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestBeginBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.header = Header.decode(reader, reader.uint32()); + break; + case 3: + message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestBeginBlock { + const message = createBaseRequestBeginBlock(); + message.hash = object.hash ?? new Uint8Array(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.lastCommitInfo = object.lastCommitInfo !== undefined && object.lastCommitInfo !== null ? LastCommitInfo.fromPartial(object.lastCommitInfo) : undefined; + message.byzantineValidators = object.byzantineValidators?.map(e => Evidence.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { + const message = createBaseRequestBeginBlock(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.last_commit_info !== undefined && object.last_commit_info !== null) { + message.lastCommitInfo = LastCommitInfo.fromAmino(object.last_commit_info); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Evidence.fromAmino(e)) || []; + return message; + }, + toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.last_commit_info = message.lastCommitInfo ? LastCommitInfo.toAmino(message.lastCommitInfo) : undefined; + if (message.byzantineValidators) { + obj.byzantine_validators = message.byzantineValidators.map(e => e ? Evidence.toAmino(e) : undefined); + } else { + obj.byzantine_validators = message.byzantineValidators; + } + return obj; + }, + fromAminoMsg(object: RequestBeginBlockAminoMsg): RequestBeginBlock { + return RequestBeginBlock.fromAmino(object.value); + }, + fromProtoMsg(message: RequestBeginBlockProtoMsg): RequestBeginBlock { + return RequestBeginBlock.decode(message.value); + }, + toProto(message: RequestBeginBlock): Uint8Array { + return RequestBeginBlock.encode(message).finish(); + }, + toProtoMsg(message: RequestBeginBlock): RequestBeginBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestBeginBlock", + value: RequestBeginBlock.encode(message).finish() + }; + } +}; +function createBaseRequestCheckTx(): RequestCheckTx { + return { + tx: new Uint8Array(), + type: 0 + }; +} +export const RequestCheckTx = { + typeUrl: "/tendermint.abci.RequestCheckTx", + encode(message: RequestCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx.length !== 0) { + writer.uint32(10).bytes(message.tx); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestCheckTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestCheckTx { + const message = createBaseRequestCheckTx(); + message.tx = object.tx ?? new Uint8Array(); + message.type = object.type ?? 0; + return message; + }, + fromAmino(object: RequestCheckTxAmino): RequestCheckTx { + const message = createBaseRequestCheckTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: RequestCheckTx): RequestCheckTxAmino { + const obj: any = {}; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; + obj.type = message.type === 0 ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { + return RequestCheckTx.fromAmino(object.value); + }, + fromProtoMsg(message: RequestCheckTxProtoMsg): RequestCheckTx { + return RequestCheckTx.decode(message.value); + }, + toProto(message: RequestCheckTx): Uint8Array { + return RequestCheckTx.encode(message).finish(); + }, + toProtoMsg(message: RequestCheckTx): RequestCheckTxProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestCheckTx", + value: RequestCheckTx.encode(message).finish() + }; + } +}; +function createBaseRequestDeliverTx(): RequestDeliverTx { + return { + tx: new Uint8Array() + }; +} +export const RequestDeliverTx = { + typeUrl: "/tendermint.abci.RequestDeliverTx", + encode(message: RequestDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx.length !== 0) { + writer.uint32(10).bytes(message.tx); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestDeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestDeliverTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestDeliverTx { + const message = createBaseRequestDeliverTx(); + message.tx = object.tx ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { + const message = createBaseRequestDeliverTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + return message; + }, + toAmino(message: RequestDeliverTx): RequestDeliverTxAmino { + const obj: any = {}; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { + return RequestDeliverTx.fromAmino(object.value); + }, + fromProtoMsg(message: RequestDeliverTxProtoMsg): RequestDeliverTx { + return RequestDeliverTx.decode(message.value); + }, + toProto(message: RequestDeliverTx): Uint8Array { + return RequestDeliverTx.encode(message).finish(); + }, + toProtoMsg(message: RequestDeliverTx): RequestDeliverTxProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestDeliverTx", + value: RequestDeliverTx.encode(message).finish() + }; + } +}; +function createBaseRequestEndBlock(): RequestEndBlock { + return { + height: BigInt(0) + }; +} +export const RequestEndBlock = { + typeUrl: "/tendermint.abci.RequestEndBlock", + encode(message: RequestEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestEndBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEndBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestEndBlock { + const message = createBaseRequestEndBlock(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: RequestEndBlockAmino): RequestEndBlock { + const message = createBaseRequestEndBlock(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: RequestEndBlock): RequestEndBlockAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + return obj; + }, + fromAminoMsg(object: RequestEndBlockAminoMsg): RequestEndBlock { + return RequestEndBlock.fromAmino(object.value); + }, + fromProtoMsg(message: RequestEndBlockProtoMsg): RequestEndBlock { + return RequestEndBlock.decode(message.value); + }, + toProto(message: RequestEndBlock): Uint8Array { + return RequestEndBlock.encode(message).finish(); + }, + toProtoMsg(message: RequestEndBlock): RequestEndBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestEndBlock", + value: RequestEndBlock.encode(message).finish() + }; + } +}; +function createBaseRequestCommit(): RequestCommit { + return {}; +} +export const RequestCommit = { + typeUrl: "/tendermint.abci.RequestCommit", + encode(_: RequestCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): RequestCommit { + const message = createBaseRequestCommit(); + return message; + }, + fromAmino(_: RequestCommitAmino): RequestCommit { + const message = createBaseRequestCommit(); + return message; + }, + toAmino(_: RequestCommit): RequestCommitAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestCommitAminoMsg): RequestCommit { + return RequestCommit.fromAmino(object.value); + }, + fromProtoMsg(message: RequestCommitProtoMsg): RequestCommit { + return RequestCommit.decode(message.value); + }, + toProto(message: RequestCommit): Uint8Array { + return RequestCommit.encode(message).finish(); + }, + toProtoMsg(message: RequestCommit): RequestCommitProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestCommit", + value: RequestCommit.encode(message).finish() + }; + } +}; +function createBaseRequestListSnapshots(): RequestListSnapshots { + return {}; +} +export const RequestListSnapshots = { + typeUrl: "/tendermint.abci.RequestListSnapshots", + encode(_: RequestListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); + return message; + }, + fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); + return message; + }, + toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: RequestListSnapshotsAminoMsg): RequestListSnapshots { + return RequestListSnapshots.fromAmino(object.value); + }, + fromProtoMsg(message: RequestListSnapshotsProtoMsg): RequestListSnapshots { + return RequestListSnapshots.decode(message.value); + }, + toProto(message: RequestListSnapshots): Uint8Array { + return RequestListSnapshots.encode(message).finish(); + }, + toProtoMsg(message: RequestListSnapshots): RequestListSnapshotsProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestListSnapshots", + value: RequestListSnapshots.encode(message).finish() + }; + } +}; +function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { + return { + snapshot: undefined, + appHash: new Uint8Array() + }; +} +export const RequestOfferSnapshot = { + typeUrl: "/tendermint.abci.RequestOfferSnapshot", + encode(message: RequestOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.snapshot !== undefined) { + Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(18).bytes(message.appHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestOfferSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + message.snapshot = object.snapshot !== undefined && object.snapshot !== null ? Snapshot.fromPartial(object.snapshot) : undefined; + message.appHash = object.appHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromAmino(object.snapshot); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; + }, + toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { + const obj: any = {}; + obj.snapshot = message.snapshot ? Snapshot.toAmino(message.snapshot) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.fromAmino(object.value); + }, + fromProtoMsg(message: RequestOfferSnapshotProtoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.decode(message.value); + }, + toProto(message: RequestOfferSnapshot): Uint8Array { + return RequestOfferSnapshot.encode(message).finish(); + }, + toProtoMsg(message: RequestOfferSnapshot): RequestOfferSnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestOfferSnapshot", + value: RequestOfferSnapshot.encode(message).finish() + }; + } +}; +function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { + return { + height: BigInt(0), + format: 0, + chunk: 0 + }; +} +export const RequestLoadSnapshotChunk = { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + encode(message: RequestLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunk !== 0) { + writer.uint32(24).uint32(message.chunk); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestLoadSnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.format = object.format ?? 0; + message.chunk = object.chunk ?? 0; + return message; + }, + fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } + return message; + }, + toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunk = message.chunk === 0 ? undefined : message.chunk; + return obj; + }, + fromAminoMsg(object: RequestLoadSnapshotChunkAminoMsg): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: RequestLoadSnapshotChunkProtoMsg): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.decode(message.value); + }, + toProto(message: RequestLoadSnapshotChunk): Uint8Array { + return RequestLoadSnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + value: RequestLoadSnapshotChunk.encode(message).finish() + }; + } +}; +function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { + return { + index: 0, + chunk: new Uint8Array(), + sender: "" + }; +} +export const RequestApplySnapshotChunk = { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + encode(message: RequestApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.chunk.length !== 0) { + writer.uint32(18).bytes(message.chunk); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + message.index = object.index ?? 0; + message.chunk = object.chunk ?? new Uint8Array(); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { + const obj: any = {}; + obj.index = message.index === 0 ? undefined : message.index; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; + return obj; + }, + fromAminoMsg(object: RequestApplySnapshotChunkAminoMsg): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: RequestApplySnapshotChunkProtoMsg): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.decode(message.value); + }, + toProto(message: RequestApplySnapshotChunk): Uint8Array { + return RequestApplySnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + value: RequestApplySnapshotChunk.encode(message).finish() + }; + } +}; +function createBaseResponse(): Response { + return { + exception: undefined, + echo: undefined, + flush: undefined, + info: undefined, + setOption: undefined, + initChain: undefined, + query: undefined, + beginBlock: undefined, + checkTx: undefined, + deliverTx: undefined, + endBlock: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined + }; +} +export const Response = { + typeUrl: "/tendermint.abci.Response", + encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exception !== undefined) { + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); + } + if (message.echo !== undefined) { + ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); + } + if (message.flush !== undefined) { + ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + if (message.setOption !== undefined) { + ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); + } + if (message.initChain !== undefined) { + ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); + } + if (message.query !== undefined) { + ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); + } + if (message.commit !== undefined) { + ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + message.info = ResponseInfo.decode(reader, reader.uint32()); + break; + case 5: + message.setOption = ResponseSetOption.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = ResponseQuery.decode(reader, reader.uint32()); + break; + case 8: + message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 10: + message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + case 11: + message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()); + break; + case 12: + message.commit = ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Response { + const message = createBaseResponse(); + message.exception = object.exception !== undefined && object.exception !== null ? ResponseException.fromPartial(object.exception) : undefined; + message.echo = object.echo !== undefined && object.echo !== null ? ResponseEcho.fromPartial(object.echo) : undefined; + message.flush = object.flush !== undefined && object.flush !== null ? ResponseFlush.fromPartial(object.flush) : undefined; + message.info = object.info !== undefined && object.info !== null ? ResponseInfo.fromPartial(object.info) : undefined; + message.setOption = object.setOption !== undefined && object.setOption !== null ? ResponseSetOption.fromPartial(object.setOption) : undefined; + message.initChain = object.initChain !== undefined && object.initChain !== null ? ResponseInitChain.fromPartial(object.initChain) : undefined; + message.query = object.query !== undefined && object.query !== null ? ResponseQuery.fromPartial(object.query) : undefined; + message.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? ResponseBeginBlock.fromPartial(object.beginBlock) : undefined; + message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? ResponseCheckTx.fromPartial(object.checkTx) : undefined; + message.deliverTx = object.deliverTx !== undefined && object.deliverTx !== null ? ResponseDeliverTx.fromPartial(object.deliverTx) : undefined; + message.endBlock = object.endBlock !== undefined && object.endBlock !== null ? ResponseEndBlock.fromPartial(object.endBlock) : undefined; + message.commit = object.commit !== undefined && object.commit !== null ? ResponseCommit.fromPartial(object.commit) : undefined; + message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? ResponseListSnapshots.fromPartial(object.listSnapshots) : undefined; + message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; + message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; + message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; + return message; + }, + fromAmino(object: ResponseAmino): Response { + const message = createBaseResponse(); + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromAmino(object.exception); + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromAmino(object.info); + } + if (object.set_option !== undefined && object.set_option !== null) { + message.setOption = ResponseSetOption.fromAmino(object.set_option); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = ResponseInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = ResponseBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = ResponseDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = ResponseEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + return message; + }, + toAmino(message: Response): ResponseAmino { + const obj: any = {}; + obj.exception = message.exception ? ResponseException.toAmino(message.exception) : undefined; + obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; + obj.flush = message.flush ? ResponseFlush.toAmino(message.flush) : undefined; + obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; + obj.set_option = message.setOption ? ResponseSetOption.toAmino(message.setOption) : undefined; + obj.init_chain = message.initChain ? ResponseInitChain.toAmino(message.initChain) : undefined; + obj.query = message.query ? ResponseQuery.toAmino(message.query) : undefined; + obj.begin_block = message.beginBlock ? ResponseBeginBlock.toAmino(message.beginBlock) : undefined; + obj.check_tx = message.checkTx ? ResponseCheckTx.toAmino(message.checkTx) : undefined; + obj.deliver_tx = message.deliverTx ? ResponseDeliverTx.toAmino(message.deliverTx) : undefined; + obj.end_block = message.endBlock ? ResponseEndBlock.toAmino(message.endBlock) : undefined; + obj.commit = message.commit ? ResponseCommit.toAmino(message.commit) : undefined; + obj.list_snapshots = message.listSnapshots ? ResponseListSnapshots.toAmino(message.listSnapshots) : undefined; + obj.offer_snapshot = message.offerSnapshot ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) : undefined; + obj.load_snapshot_chunk = message.loadSnapshotChunk ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; + obj.apply_snapshot_chunk = message.applySnapshotChunk ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseAminoMsg): Response { + return Response.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseProtoMsg): Response { + return Response.decode(message.value); + }, + toProto(message: Response): Uint8Array { + return Response.encode(message).finish(); + }, + toProtoMsg(message: Response): ResponseProtoMsg { + return { + typeUrl: "/tendermint.abci.Response", + value: Response.encode(message).finish() + }; + } +}; +function createBaseResponseException(): ResponseException { + return { + error: "" + }; +} +export const ResponseException = { + typeUrl: "/tendermint.abci.ResponseException", + encode(message: ResponseException, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.error !== "") { + writer.uint32(10).string(message.error); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseException { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseException(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseException { + const message = createBaseResponseException(); + message.error = object.error ?? ""; + return message; + }, + fromAmino(object: ResponseExceptionAmino): ResponseException { + const message = createBaseResponseException(); + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: ResponseException): ResponseExceptionAmino { + const obj: any = {}; + obj.error = message.error === "" ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { + return ResponseException.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { + return ResponseException.decode(message.value); + }, + toProto(message: ResponseException): Uint8Array { + return ResponseException.encode(message).finish(); + }, + toProtoMsg(message: ResponseException): ResponseExceptionProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseException", + value: ResponseException.encode(message).finish() + }; + } +}; +function createBaseResponseEcho(): ResponseEcho { + return { + message: "" + }; +} +export const ResponseEcho = { + typeUrl: "/tendermint.abci.ResponseEcho", + encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseEcho(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseEcho { + const message = createBaseResponseEcho(); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: ResponseEchoAmino): ResponseEcho { + const message = createBaseResponseEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; + }, + toAmino(message: ResponseEcho): ResponseEchoAmino { + const obj: any = {}; + obj.message = message.message === "" ? undefined : message.message; + return obj; + }, + fromAminoMsg(object: ResponseEchoAminoMsg): ResponseEcho { + return ResponseEcho.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseEchoProtoMsg): ResponseEcho { + return ResponseEcho.decode(message.value); + }, + toProto(message: ResponseEcho): Uint8Array { + return ResponseEcho.encode(message).finish(); + }, + toProtoMsg(message: ResponseEcho): ResponseEchoProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseEcho", + value: ResponseEcho.encode(message).finish() + }; + } +}; +function createBaseResponseFlush(): ResponseFlush { + return {}; +} +export const ResponseFlush = { + typeUrl: "/tendermint.abci.ResponseFlush", + encode(_: ResponseFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseFlush(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ResponseFlush { + const message = createBaseResponseFlush(); + return message; + }, + fromAmino(_: ResponseFlushAmino): ResponseFlush { + const message = createBaseResponseFlush(); + return message; + }, + toAmino(_: ResponseFlush): ResponseFlushAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ResponseFlushAminoMsg): ResponseFlush { + return ResponseFlush.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseFlushProtoMsg): ResponseFlush { + return ResponseFlush.decode(message.value); + }, + toProto(message: ResponseFlush): Uint8Array { + return ResponseFlush.encode(message).finish(); + }, + toProtoMsg(message: ResponseFlush): ResponseFlushProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseFlush", + value: ResponseFlush.encode(message).finish() + }; + } +}; +function createBaseResponseInfo(): ResponseInfo { + return { + data: "", + version: "", + appVersion: BigInt(0), + lastBlockHeight: BigInt(0), + lastBlockAppHash: new Uint8Array() + }; +} +export const ResponseInfo = { + typeUrl: "/tendermint.abci.ResponseInfo", + encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + if (message.appVersion !== BigInt(0)) { + writer.uint32(24).uint64(message.appVersion); + } + if (message.lastBlockHeight !== BigInt(0)) { + writer.uint32(32).int64(message.lastBlockHeight); + } + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64(); + break; + case 4: + message.lastBlockHeight = reader.int64(); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseInfo { + const message = createBaseResponseInfo(); + message.data = object.data ?? ""; + message.version = object.version ?? ""; + message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + message.lastBlockHeight = object.lastBlockHeight !== undefined && object.lastBlockHeight !== null ? BigInt(object.lastBlockHeight.toString()) : BigInt(0); + message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: ResponseInfoAmino): ResponseInfo { + const message = createBaseResponseInfo(); + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); + } + if (object.last_block_height !== undefined && object.last_block_height !== null) { + message.lastBlockHeight = BigInt(object.last_block_height); + } + if (object.last_block_app_hash !== undefined && object.last_block_app_hash !== null) { + message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); + } + return message; + }, + toAmino(message: ResponseInfo): ResponseInfoAmino { + const obj: any = {}; + obj.data = message.data === "" ? undefined : message.data; + obj.version = message.version === "" ? undefined : message.version; + obj.app_version = message.appVersion !== BigInt(0) ? message.appVersion.toString() : undefined; + obj.last_block_height = message.lastBlockHeight !== BigInt(0) ? message.lastBlockHeight.toString() : undefined; + obj.last_block_app_hash = message.lastBlockAppHash ? base64FromBytes(message.lastBlockAppHash) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { + return ResponseInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { + return ResponseInfo.decode(message.value); + }, + toProto(message: ResponseInfo): Uint8Array { + return ResponseInfo.encode(message).finish(); + }, + toProtoMsg(message: ResponseInfo): ResponseInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseInfo", + value: ResponseInfo.encode(message).finish() + }; + } +}; +function createBaseResponseSetOption(): ResponseSetOption { + return { + code: 0, + log: "", + info: "" + }; +} +export const ResponseSetOption = { + typeUrl: "/tendermint.abci.ResponseSetOption", + encode(message: ResponseSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseSetOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseSetOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseSetOption { + const message = createBaseResponseSetOption(); + message.code = object.code ?? 0; + message.log = object.log ?? ""; + message.info = object.info ?? ""; + return message; + }, + fromAmino(object: ResponseSetOptionAmino): ResponseSetOption { + const message = createBaseResponseSetOption(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + return message; + }, + toAmino(message: ResponseSetOption): ResponseSetOptionAmino { + const obj: any = {}; + obj.code = message.code === 0 ? undefined : message.code; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + return obj; + }, + fromAminoMsg(object: ResponseSetOptionAminoMsg): ResponseSetOption { + return ResponseSetOption.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseSetOptionProtoMsg): ResponseSetOption { + return ResponseSetOption.decode(message.value); + }, + toProto(message: ResponseSetOption): Uint8Array { + return ResponseSetOption.encode(message).finish(); + }, + toProtoMsg(message: ResponseSetOption): ResponseSetOptionProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseSetOption", + value: ResponseSetOption.encode(message).finish() + }; + } +}; +function createBaseResponseInitChain(): ResponseInitChain { + return { + consensusParams: undefined, + validators: [], + appHash: new Uint8Array() + }; +} +export const ResponseInitChain = { + typeUrl: "/tendermint.abci.ResponseInitChain", + encode(message: ResponseInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(26).bytes(message.appHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseInitChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseInitChain { + const message = createBaseResponseInitChain(); + message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; + message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.appHash = object.appHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: ResponseInitChainAmino): ResponseInitChain { + const message = createBaseResponseInitChain(); + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; + }, + toAmino(message: ResponseInitChain): ResponseInitChainAmino { + const obj: any = {}; + obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; + if (message.validators) { + obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { + return ResponseInitChain.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { + return ResponseInitChain.decode(message.value); + }, + toProto(message: ResponseInitChain): Uint8Array { + return ResponseInitChain.encode(message).finish(); + }, + toProtoMsg(message: ResponseInitChain): ResponseInitChainProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseInitChain", + value: ResponseInitChain.encode(message).finish() + }; + } +}; +function createBaseResponseQuery(): ResponseQuery { + return { + code: 0, + log: "", + info: "", + index: BigInt(0), + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: BigInt(0), + codespace: "" + }; +} +export const ResponseQuery = { + typeUrl: "/tendermint.abci.ResponseQuery", + encode(message: ResponseQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.index !== BigInt(0)) { + writer.uint32(40).int64(message.index); + } + if (message.key.length !== 0) { + writer.uint32(50).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(58).bytes(message.value); + } + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(72).int64(message.height); + } + if (message.codespace !== "") { + writer.uint32(82).string(message.codespace); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseQuery(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = reader.int64(); + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = reader.int64(); + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseQuery { + const message = createBaseResponseQuery(); + message.code = object.code ?? 0; + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.codespace = object.codespace ?? ""; + return message; + }, + fromAmino(object: ResponseQueryAmino): ResponseQuery { + const message = createBaseResponseQuery(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proof_ops !== undefined && object.proof_ops !== null) { + message.proofOps = ProofOps.fromAmino(object.proof_ops); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; + }, + toAmino(message: ResponseQuery): ResponseQueryAmino { + const obj: any = {}; + obj.code = message.code === 0 ? undefined : message.code; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.codespace = message.codespace === "" ? undefined : message.codespace; + return obj; + }, + fromAminoMsg(object: ResponseQueryAminoMsg): ResponseQuery { + return ResponseQuery.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { + return ResponseQuery.decode(message.value); + }, + toProto(message: ResponseQuery): Uint8Array { + return ResponseQuery.encode(message).finish(); + }, + toProtoMsg(message: ResponseQuery): ResponseQueryProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseQuery", + value: ResponseQuery.encode(message).finish() + }; + } +}; +function createBaseResponseBeginBlock(): ResponseBeginBlock { + return { + events: [] + }; +} +export const ResponseBeginBlock = { + typeUrl: "/tendermint.abci.ResponseBeginBlock", + encode(message: ResponseBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.events) { + Event.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseBeginBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseBeginBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseBeginBlock { + const message = createBaseResponseBeginBlock(); + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { + const message = createBaseResponseBeginBlock(); + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; + }, + toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: ResponseBeginBlockAminoMsg): ResponseBeginBlock { + return ResponseBeginBlock.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseBeginBlockProtoMsg): ResponseBeginBlock { + return ResponseBeginBlock.decode(message.value); + }, + toProto(message: ResponseBeginBlock): Uint8Array { + return ResponseBeginBlock.encode(message).finish(); + }, + toProtoMsg(message: ResponseBeginBlock): ResponseBeginBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseBeginBlock", + value: ResponseBeginBlock.encode(message).finish() + }; + } +}; +function createBaseResponseCheckTx(): ResponseCheckTx { + return { + code: 0, + data: new Uint8Array(), + log: "", + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + events: [], + codespace: "" + }; +} +export const ResponseCheckTx = { + typeUrl: "/tendermint.abci.ResponseCheckTx", + encode(message: ResponseCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(40).int64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(48).int64(message.gasUsed); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.codespace !== "") { + writer.uint32(66).string(message.codespace); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCheckTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseCheckTx { + const message = createBaseResponseCheckTx(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; + return message; + }, + fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { + const message = createBaseResponseCheckTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; + }, + toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { + const obj: any = {}; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + obj.codespace = message.codespace === "" ? undefined : message.codespace; + return obj; + }, + fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { + return ResponseCheckTx.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { + return ResponseCheckTx.decode(message.value); + }, + toProto(message: ResponseCheckTx): Uint8Array { + return ResponseCheckTx.encode(message).finish(); + }, + toProtoMsg(message: ResponseCheckTx): ResponseCheckTxProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseCheckTx", + value: ResponseCheckTx.encode(message).finish() + }; + } +}; +function createBaseResponseDeliverTx(): ResponseDeliverTx { + return { + code: 0, + data: new Uint8Array(), + log: "", + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + events: [], + codespace: "" + }; +} +export const ResponseDeliverTx = { + typeUrl: "/tendermint.abci.ResponseDeliverTx", + encode(message: ResponseDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(40).int64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(48).int64(message.gasUsed); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.codespace !== "") { + writer.uint32(66).string(message.codespace); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseDeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseDeliverTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseDeliverTx { + const message = createBaseResponseDeliverTx(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; + return message; + }, + fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { + const message = createBaseResponseDeliverTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; + }, + toAmino(message: ResponseDeliverTx): ResponseDeliverTxAmino { + const obj: any = {}; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + obj.codespace = message.codespace === "" ? undefined : message.codespace; + return obj; + }, + fromAminoMsg(object: ResponseDeliverTxAminoMsg): ResponseDeliverTx { + return ResponseDeliverTx.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseDeliverTxProtoMsg): ResponseDeliverTx { + return ResponseDeliverTx.decode(message.value); + }, + toProto(message: ResponseDeliverTx): Uint8Array { + return ResponseDeliverTx.encode(message).finish(); + }, + toProtoMsg(message: ResponseDeliverTx): ResponseDeliverTxProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseDeliverTx", + value: ResponseDeliverTx.encode(message).finish() + }; + } +}; +function createBaseResponseEndBlock(): ResponseEndBlock { + return { + validatorUpdates: [], + consensusParamUpdates: undefined, + events: [] + }; +} +export const ResponseEndBlock = { + typeUrl: "/tendermint.abci.ResponseEndBlock", + encode(message: ResponseEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validatorUpdates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusParamUpdates !== undefined) { + ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEndBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseEndBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + break; + case 3: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseEndBlock { + const message = createBaseResponseEndBlock(); + message.validatorUpdates = object.validatorUpdates?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.consensusParamUpdates = object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null ? ConsensusParams.fromPartial(object.consensusParamUpdates) : undefined; + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { + const message = createBaseResponseEndBlock(); + message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.consensus_param_updates !== undefined && object.consensus_param_updates !== null) { + message.consensusParamUpdates = ConsensusParams.fromAmino(object.consensus_param_updates); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; + }, + toAmino(message: ResponseEndBlock): ResponseEndBlockAmino { + const obj: any = {}; + if (message.validatorUpdates) { + obj.validator_updates = message.validatorUpdates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.validator_updates = message.validatorUpdates; + } + obj.consensus_param_updates = message.consensusParamUpdates ? ConsensusParams.toAmino(message.consensusParamUpdates) : undefined; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + return obj; + }, + fromAminoMsg(object: ResponseEndBlockAminoMsg): ResponseEndBlock { + return ResponseEndBlock.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseEndBlockProtoMsg): ResponseEndBlock { + return ResponseEndBlock.decode(message.value); + }, + toProto(message: ResponseEndBlock): Uint8Array { + return ResponseEndBlock.encode(message).finish(); + }, + toProtoMsg(message: ResponseEndBlock): ResponseEndBlockProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseEndBlock", + value: ResponseEndBlock.encode(message).finish() + }; + } +}; +function createBaseResponseCommit(): ResponseCommit { + return { + data: new Uint8Array(), + retainHeight: BigInt(0) + }; +} +export const ResponseCommit = { + typeUrl: "/tendermint.abci.ResponseCommit", + encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.retainHeight !== BigInt(0)) { + writer.uint32(24).int64(message.retainHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.data = reader.bytes(); + break; + case 3: + message.retainHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseCommit { + const message = createBaseResponseCommit(); + message.data = object.data ?? new Uint8Array(); + message.retainHeight = object.retainHeight !== undefined && object.retainHeight !== null ? BigInt(object.retainHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ResponseCommitAmino): ResponseCommit { + const message = createBaseResponseCommit(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.retain_height !== undefined && object.retain_height !== null) { + message.retainHeight = BigInt(object.retain_height); + } + return message; + }, + toAmino(message: ResponseCommit): ResponseCommitAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.retain_height = message.retainHeight !== BigInt(0) ? message.retainHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ResponseCommitAminoMsg): ResponseCommit { + return ResponseCommit.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseCommitProtoMsg): ResponseCommit { + return ResponseCommit.decode(message.value); + }, + toProto(message: ResponseCommit): Uint8Array { + return ResponseCommit.encode(message).finish(); + }, + toProtoMsg(message: ResponseCommit): ResponseCommitProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseCommit", + value: ResponseCommit.encode(message).finish() + }; + } +}; +function createBaseResponseListSnapshots(): ResponseListSnapshots { + return { + snapshots: [] + }; +} +export const ResponseListSnapshots = { + typeUrl: "/tendermint.abci.ResponseListSnapshots", + encode(message: ResponseListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.snapshots) { + Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshots.push(Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; + return message; + }, + toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { + const obj: any = {}; + if (message.snapshots) { + obj.snapshots = message.snapshots.map(e => e ? Snapshot.toAmino(e) : undefined); + } else { + obj.snapshots = message.snapshots; + } + return obj; + }, + fromAminoMsg(object: ResponseListSnapshotsAminoMsg): ResponseListSnapshots { + return ResponseListSnapshots.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseListSnapshotsProtoMsg): ResponseListSnapshots { + return ResponseListSnapshots.decode(message.value); + }, + toProto(message: ResponseListSnapshots): Uint8Array { + return ResponseListSnapshots.encode(message).finish(); + }, + toProtoMsg(message: ResponseListSnapshots): ResponseListSnapshotsProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseListSnapshots", + value: ResponseListSnapshots.encode(message).finish() + }; + } +}; +function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { + return { + result: 0 + }; +} +export const ResponseOfferSnapshot = { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + encode(message: ResponseOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseOfferSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseOfferSnapshotProtoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.decode(message.value); + }, + toProto(message: ResponseOfferSnapshot): Uint8Array { + return ResponseOfferSnapshot.encode(message).finish(); + }, + toProtoMsg(message: ResponseOfferSnapshot): ResponseOfferSnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + value: ResponseOfferSnapshot.encode(message).finish() + }; + } +}; +function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { + return { + chunk: new Uint8Array() + }; +} +export const ResponseLoadSnapshotChunk = { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + encode(message: ResponseLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chunk.length !== 0) { + writer.uint32(10).bytes(message.chunk); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseLoadSnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + message.chunk = object.chunk ?? new Uint8Array(); + return message; + }, + fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; + }, + toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { + const obj: any = {}; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseLoadSnapshotChunkAminoMsg): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseLoadSnapshotChunkProtoMsg): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.decode(message.value); + }, + toProto(message: ResponseLoadSnapshotChunk): Uint8Array { + return ResponseLoadSnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + value: ResponseLoadSnapshotChunk.encode(message).finish() + }; + } +}; +function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { + return { + result: 0, + refetchChunks: [], + rejectSenders: [] + }; +} +export const ResponseApplySnapshotChunk = { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + encode(message: ResponseApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + writer.uint32(18).fork(); + for (const v of message.refetchChunks) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.rejectSenders) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.refetchChunks.push(reader.uint32()); + } + } else { + message.refetchChunks.push(reader.uint32()); + } + break; + case 3: + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + message.result = object.result ?? 0; + message.refetchChunks = object.refetchChunks?.map(e => e) || []; + message.rejectSenders = object.rejectSenders?.map(e => e) || []; + return message; + }, + fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + message.refetchChunks = object.refetch_chunks?.map(e => e) || []; + message.rejectSenders = object.reject_senders?.map(e => e) || []; + return message; + }, + toAmino(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + if (message.refetchChunks) { + obj.refetch_chunks = message.refetchChunks.map(e => e); + } else { + obj.refetch_chunks = message.refetchChunks; + } + if (message.rejectSenders) { + obj.reject_senders = message.rejectSenders.map(e => e); + } else { + obj.reject_senders = message.rejectSenders; + } + return obj; + }, + fromAminoMsg(object: ResponseApplySnapshotChunkAminoMsg): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseApplySnapshotChunkProtoMsg): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.decode(message.value); + }, + toProto(message: ResponseApplySnapshotChunk): Uint8Array { + return ResponseApplySnapshotChunk.encode(message).finish(); + }, + toProtoMsg(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + value: ResponseApplySnapshotChunk.encode(message).finish() + }; + } +}; +function createBaseConsensusParams(): ConsensusParams { + return { + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined + }; +} +export const ConsensusParams = { + typeUrl: "/tendermint.abci.ConsensusParams", + encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusParams { + const message = createBaseConsensusParams(); + message.block = object.block !== undefined && object.block !== null ? BlockParams.fromPartial(object.block) : undefined; + message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceParams.fromPartial(object.evidence) : undefined; + message.validator = object.validator !== undefined && object.validator !== null ? ValidatorParams.fromPartial(object.validator) : undefined; + message.version = object.version !== undefined && object.version !== null ? VersionParams.fromPartial(object.version) : undefined; + return message; + }, + fromAmino(object: ConsensusParamsAmino): ConsensusParams { + const message = createBaseConsensusParams(); + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromAmino(object.version); + } + return message; + }, + toAmino(message: ConsensusParams): ConsensusParamsAmino { + const obj: any = {}; + obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; + obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; + obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; + obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { + return ConsensusParams.fromAmino(object.value); + }, + fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { + return ConsensusParams.decode(message.value); + }, + toProto(message: ConsensusParams): Uint8Array { + return ConsensusParams.encode(message).finish(); + }, + toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + return { + typeUrl: "/tendermint.abci.ConsensusParams", + value: ConsensusParams.encode(message).finish() + }; + } +}; +function createBaseBlockParams(): BlockParams { + return { + maxBytes: BigInt(0), + maxGas: BigInt(0) + }; +} +export const BlockParams = { + typeUrl: "/tendermint.abci.BlockParams", + encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxBytes); + } + if (message.maxGas !== BigInt(0)) { + writer.uint32(16).int64(message.maxGas); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockParams { + const message = createBaseBlockParams(); + message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); + message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BlockParamsAmino): BlockParams { + const message = createBaseBlockParams(); + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + if (object.max_gas !== undefined && object.max_gas !== null) { + message.maxGas = BigInt(object.max_gas); + } + return message; + }, + toAmino(message: BlockParams): BlockParamsAmino { + const obj: any = {}; + obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; + obj.max_gas = message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { + return BlockParams.fromAmino(object.value); + }, + fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { + return BlockParams.decode(message.value); + }, + toProto(message: BlockParams): Uint8Array { + return BlockParams.encode(message).finish(); + }, + toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + return { + typeUrl: "/tendermint.abci.BlockParams", + value: BlockParams.encode(message).finish() + }; + } +}; +function createBaseLastCommitInfo(): LastCommitInfo { + return { + round: 0, + votes: [] + }; +} +export const LastCommitInfo = { + typeUrl: "/tendermint.abci.LastCommitInfo", + encode(message: LastCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); + } + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LastCommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastCommitInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + message.votes.push(VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LastCommitInfo { + const message = createBaseLastCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LastCommitInfoAmino): LastCommitInfo { + const message = createBaseLastCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: LastCommitInfo): LastCommitInfoAmino { + const obj: any = {}; + obj.round = message.round === 0 ? undefined : message.round; + if (message.votes) { + obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: LastCommitInfoAminoMsg): LastCommitInfo { + return LastCommitInfo.fromAmino(object.value); + }, + fromProtoMsg(message: LastCommitInfoProtoMsg): LastCommitInfo { + return LastCommitInfo.decode(message.value); + }, + toProto(message: LastCommitInfo): Uint8Array { + return LastCommitInfo.encode(message).finish(); + }, + toProtoMsg(message: LastCommitInfo): LastCommitInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.LastCommitInfo", + value: LastCommitInfo.encode(message).finish() + }; + } +}; +function createBaseEvent(): Event { + return { + type: "", + attributes: [] + }; +} +export const Event = { + typeUrl: "/tendermint.abci.Event", + encode(message: Event, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Event { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Event { + const message = createBaseEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map(e => EventAttribute.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EventAmino): Event { + const message = createBaseEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; + return message; + }, + toAmino(message: Event): EventAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? EventAttribute.toAmino(e) : undefined); + } else { + obj.attributes = message.attributes; + } + return obj; + }, + fromAminoMsg(object: EventAminoMsg): Event { + return Event.fromAmino(object.value); + }, + fromProtoMsg(message: EventProtoMsg): Event { + return Event.decode(message.value); + }, + toProto(message: Event): Uint8Array { + return Event.encode(message).finish(); + }, + toProtoMsg(message: Event): EventProtoMsg { + return { + typeUrl: "/tendermint.abci.Event", + value: Event.encode(message).finish() + }; + } +}; +function createBaseEventAttribute(): EventAttribute { + return { + key: new Uint8Array(), + value: new Uint8Array(), + index: false + }; +} +export const EventAttribute = { + typeUrl: "/tendermint.abci.EventAttribute", + encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.index === true) { + writer.uint32(24).bool(message.index); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventAttribute { + const message = createBaseEventAttribute(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.index = object.index ?? false; + return message; + }, + fromAmino(object: EventAttributeAmino): EventAttribute { + const message = createBaseEventAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + return message; + }, + toAmino(message: EventAttribute): EventAttributeAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.index = message.index === false ? undefined : message.index; + return obj; + }, + fromAminoMsg(object: EventAttributeAminoMsg): EventAttribute { + return EventAttribute.fromAmino(object.value); + }, + fromProtoMsg(message: EventAttributeProtoMsg): EventAttribute { + return EventAttribute.decode(message.value); + }, + toProto(message: EventAttribute): Uint8Array { + return EventAttribute.encode(message).finish(); + }, + toProtoMsg(message: EventAttribute): EventAttributeProtoMsg { + return { + typeUrl: "/tendermint.abci.EventAttribute", + value: EventAttribute.encode(message).finish() + }; + } +}; +function createBaseTxResult(): TxResult { + return { + height: BigInt(0), + index: 0, + tx: new Uint8Array(), + result: ResponseDeliverTx.fromPartial({}) + }; +} +export const TxResult = { + typeUrl: "/tendermint.abci.TxResult", + encode(message: TxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.index !== 0) { + writer.uint32(16).uint32(message.index); + } + if (message.tx.length !== 0) { + writer.uint32(26).bytes(message.tx); + } + if (message.result !== undefined) { + ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxResult { + const message = createBaseTxResult(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.index = object.index ?? 0; + message.tx = object.tx ?? new Uint8Array(); + message.result = object.result !== undefined && object.result !== null ? ResponseDeliverTx.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: TxResultAmino): TxResult { + const message = createBaseTxResult(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromAmino(object.result); + } + return message; + }, + toAmino(message: TxResult): TxResultAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.index = message.index === 0 ? undefined : message.index; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; + obj.result = message.result ? ResponseDeliverTx.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: TxResultAminoMsg): TxResult { + return TxResult.fromAmino(object.value); + }, + fromProtoMsg(message: TxResultProtoMsg): TxResult { + return TxResult.decode(message.value); + }, + toProto(message: TxResult): Uint8Array { + return TxResult.encode(message).finish(); + }, + toProtoMsg(message: TxResult): TxResultProtoMsg { + return { + typeUrl: "/tendermint.abci.TxResult", + value: TxResult.encode(message).finish() + }; + } +}; +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + power: BigInt(0) + }; +} +export const Validator = { + typeUrl: "/tendermint.abci.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.power !== BigInt(0)) { + writer.uint32(24).int64(message.power); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/tendermint.abci.Validator", + value: Validator.encode(message).finish() + }; + } +}; +function createBaseValidatorUpdate(): ValidatorUpdate { + return { + pubKey: PublicKey.fromPartial({}), + power: BigInt(0) + }; +} +export const ValidatorUpdate = { + typeUrl: "/tendermint.abci.ValidatorUpdate", + encode(message: ValidatorUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.power !== BigInt(0)) { + writer.uint32(16).int64(message.power); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; + }, + toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { + const obj: any = {}; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorUpdateAminoMsg): ValidatorUpdate { + return ValidatorUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorUpdateProtoMsg): ValidatorUpdate { + return ValidatorUpdate.decode(message.value); + }, + toProto(message: ValidatorUpdate): Uint8Array { + return ValidatorUpdate.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUpdate): ValidatorUpdateProtoMsg { + return { + typeUrl: "/tendermint.abci.ValidatorUpdate", + value: ValidatorUpdate.encode(message).finish() + }; + } +}; +function createBaseVoteInfo(): VoteInfo { + return { + validator: Validator.fromPartial({}), + signedLastBlock: false + }; +} +export const VoteInfo = { + typeUrl: "/tendermint.abci.VoteInfo", + encode(message: VoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VoteInfo { + const message = createBaseVoteInfo(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + return message; + }, + fromAmino(object: VoteInfoAmino): VoteInfo { + const message = createBaseVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.signed_last_block !== undefined && object.signed_last_block !== null) { + message.signedLastBlock = object.signed_last_block; + } + return message; + }, + toAmino(message: VoteInfo): VoteInfoAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.signed_last_block = message.signedLastBlock === false ? undefined : message.signedLastBlock; + return obj; + }, + fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { + return VoteInfo.fromAmino(object.value); + }, + fromProtoMsg(message: VoteInfoProtoMsg): VoteInfo { + return VoteInfo.decode(message.value); + }, + toProto(message: VoteInfo): Uint8Array { + return VoteInfo.encode(message).finish(); + }, + toProtoMsg(message: VoteInfo): VoteInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.VoteInfo", + value: VoteInfo.encode(message).finish() + }; + } +}; +function createBaseEvidence(): Evidence { + return { + type: 0, + validator: Validator.fromPartial({}), + height: BigInt(0), + time: new Date(), + totalVotingPower: BigInt(0) + }; +} +export const Evidence = { + typeUrl: "/tendermint.abci.Evidence", + encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(40).int64(message.totalVotingPower); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Evidence { + const message = createBaseEvidence(); + message.type = object.type ?? 0; + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EvidenceAmino): Evidence { + const message = createBaseEvidence(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; + }, + toAmino(message: Evidence): EvidenceAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EvidenceAminoMsg): Evidence { + return Evidence.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceProtoMsg): Evidence { + return Evidence.decode(message.value); + }, + toProto(message: Evidence): Uint8Array { + return Evidence.encode(message).finish(); + }, + toProtoMsg(message: Evidence): EvidenceProtoMsg { + return { + typeUrl: "/tendermint.abci.Evidence", + value: Evidence.encode(message).finish() + }; + } +}; +function createBaseSnapshot(): Snapshot { + return { + height: BigInt(0), + format: 0, + chunks: 0, + hash: new Uint8Array(), + metadata: new Uint8Array() + }; +} +export const Snapshot = { + typeUrl: "/tendermint.abci.Snapshot", + encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunks !== 0) { + writer.uint32(24).uint32(message.chunks); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.metadata.length !== 0) { + writer.uint32(42).bytes(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Snapshot { + const message = createBaseSnapshot(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.format = object.format ?? 0; + message.chunks = object.chunks ?? 0; + message.hash = object.hash ?? new Uint8Array(); + message.metadata = object.metadata ?? new Uint8Array(); + return message; + }, + fromAmino(object: SnapshotAmino): Snapshot { + const message = createBaseSnapshot(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + return message; + }, + toAmino(message: Snapshot): SnapshotAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunks = message.chunks === 0 ? undefined : message.chunks; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: SnapshotAminoMsg): Snapshot { + return Snapshot.fromAmino(object.value); + }, + fromProtoMsg(message: SnapshotProtoMsg): Snapshot { + return Snapshot.decode(message.value); + }, + toProto(message: Snapshot): Uint8Array { + return Snapshot.encode(message).finish(); + }, + toProtoMsg(message: Snapshot): SnapshotProtoMsg { + return { + typeUrl: "/tendermint.abci.Snapshot", + value: Snapshot.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/bundle.ts b/dydxjs/packages/dydxjs/src/tendermint/bundle.ts new file mode 100644 index 00000000..12130cbc --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/bundle.ts @@ -0,0 +1,39 @@ +//@ts-nocheck +import * as _245 from "./abci/types"; +import * as _246 from "./crypto/keys"; +import * as _247 from "./crypto/proof"; +import * as _248 from "./libs/bits/types"; +import * as _249 from "./p2p/types"; +import * as _250 from "./types/block"; +import * as _251 from "./types/evidence"; +import * as _252 from "./types/params"; +import * as _253 from "./types/types"; +import * as _254 from "./types/validator"; +import * as _255 from "./version/types"; +export namespace tendermint { + export const abci = { + ..._245 + }; + export const crypto = { + ..._246, + ..._247 + }; + export namespace libs { + export const bits = { + ..._248 + }; + } + export const p2p = { + ..._249 + }; + export const types = { + ..._250, + ..._251, + ..._252, + ..._253, + ..._254 + }; + export const version = { + ..._255 + }; +} \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/crypto/keys.ts b/dydxjs/packages/dydxjs/src/tendermint/crypto/keys.ts new file mode 100644 index 00000000..91ffc7d1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/crypto/keys.ts @@ -0,0 +1,101 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** PublicKey defines the keys available for use with Tendermint Validators */ +export interface PublicKey { + ed25519?: Uint8Array; + secp256k1?: Uint8Array; +} +export interface PublicKeyProtoMsg { + typeUrl: "/tendermint.crypto.PublicKey"; + value: Uint8Array; +} +/** PublicKey defines the keys available for use with Tendermint Validators */ +export interface PublicKeyAmino { + ed25519?: string; + secp256k1?: string; +} +export interface PublicKeyAminoMsg { + type: "/tendermint.crypto.PublicKey"; + value: PublicKeyAmino; +} +/** PublicKey defines the keys available for use with Tendermint Validators */ +export interface PublicKeySDKType { + ed25519?: Uint8Array; + secp256k1?: Uint8Array; +} +function createBasePublicKey(): PublicKey { + return { + ed25519: undefined, + secp256k1: undefined + }; +} +export const PublicKey = { + typeUrl: "/tendermint.crypto.PublicKey", + encode(message: PublicKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ed25519 !== undefined) { + writer.uint32(10).bytes(message.ed25519); + } + if (message.secp256k1 !== undefined) { + writer.uint32(18).bytes(message.secp256k1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePublicKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PublicKey { + const message = createBasePublicKey(); + message.ed25519 = object.ed25519 ?? undefined; + message.secp256k1 = object.secp256k1 ?? undefined; + return message; + }, + fromAmino(object: PublicKeyAmino): PublicKey { + const message = createBasePublicKey(); + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; + }, + toAmino(message: PublicKey): PublicKeyAmino { + const obj: any = {}; + obj.ed25519 = message.ed25519 ? base64FromBytes(message.ed25519) : undefined; + obj.secp256k1 = message.secp256k1 ? base64FromBytes(message.secp256k1) : undefined; + return obj; + }, + fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { + return PublicKey.fromAmino(object.value); + }, + fromProtoMsg(message: PublicKeyProtoMsg): PublicKey { + return PublicKey.decode(message.value); + }, + toProto(message: PublicKey): Uint8Array { + return PublicKey.encode(message).finish(); + }, + toProtoMsg(message: PublicKey): PublicKeyProtoMsg { + return { + typeUrl: "/tendermint.crypto.PublicKey", + value: PublicKey.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/crypto/proof.ts b/dydxjs/packages/dydxjs/src/tendermint/crypto/proof.ts new file mode 100644 index 00000000..c619c83c --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/crypto/proof.ts @@ -0,0 +1,549 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +export interface Proof { + total: bigint; + index: bigint; + leafHash: Uint8Array; + aunts: Uint8Array[]; +} +export interface ProofProtoMsg { + typeUrl: "/tendermint.crypto.Proof"; + value: Uint8Array; +} +export interface ProofAmino { + total?: string; + index?: string; + leaf_hash?: string; + aunts?: string[]; +} +export interface ProofAminoMsg { + type: "/tendermint.crypto.Proof"; + value: ProofAmino; +} +export interface ProofSDKType { + total: bigint; + index: bigint; + leaf_hash: Uint8Array; + aunts: Uint8Array[]; +} +export interface ValueOp { + /** Encoded in ProofOp.Key. */ + key: Uint8Array; + /** To encode in ProofOp.Data */ + proof?: Proof; +} +export interface ValueOpProtoMsg { + typeUrl: "/tendermint.crypto.ValueOp"; + value: Uint8Array; +} +export interface ValueOpAmino { + /** Encoded in ProofOp.Key. */ + key?: string; + /** To encode in ProofOp.Data */ + proof?: ProofAmino; +} +export interface ValueOpAminoMsg { + type: "/tendermint.crypto.ValueOp"; + value: ValueOpAmino; +} +export interface ValueOpSDKType { + key: Uint8Array; + proof?: ProofSDKType; +} +export interface DominoOp { + key: string; + input: string; + output: string; +} +export interface DominoOpProtoMsg { + typeUrl: "/tendermint.crypto.DominoOp"; + value: Uint8Array; +} +export interface DominoOpAmino { + key?: string; + input?: string; + output?: string; +} +export interface DominoOpAminoMsg { + type: "/tendermint.crypto.DominoOp"; + value: DominoOpAmino; +} +export interface DominoOpSDKType { + key: string; + input: string; + output: string; +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOp { + type: string; + key: Uint8Array; + data: Uint8Array; +} +export interface ProofOpProtoMsg { + typeUrl: "/tendermint.crypto.ProofOp"; + value: Uint8Array; +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOpAmino { + type?: string; + key?: string; + data?: string; +} +export interface ProofOpAminoMsg { + type: "/tendermint.crypto.ProofOp"; + value: ProofOpAmino; +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOpSDKType { + type: string; + key: Uint8Array; + data: Uint8Array; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOps { + ops: ProofOp[]; +} +export interface ProofOpsProtoMsg { + typeUrl: "/tendermint.crypto.ProofOps"; + value: Uint8Array; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOpsAmino { + ops?: ProofOpAmino[]; +} +export interface ProofOpsAminoMsg { + type: "/tendermint.crypto.ProofOps"; + value: ProofOpsAmino; +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOpsSDKType { + ops: ProofOpSDKType[]; +} +function createBaseProof(): Proof { + return { + total: BigInt(0), + index: BigInt(0), + leafHash: new Uint8Array(), + aunts: [] + }; +} +export const Proof = { + typeUrl: "/tendermint.crypto.Proof", + encode(message: Proof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== BigInt(0)) { + writer.uint32(8).int64(message.total); + } + if (message.index !== BigInt(0)) { + writer.uint32(16).int64(message.index); + } + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash); + } + for (const v of message.aunts) { + writer.uint32(34).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64(); + break; + case 2: + message.index = reader.int64(); + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Proof { + const message = createBaseProof(); + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.leafHash = object.leafHash ?? new Uint8Array(); + message.aunts = object.aunts?.map(e => e) || []; + return message; + }, + fromAmino(object: ProofAmino): Proof { + const message = createBaseProof(); + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.leaf_hash !== undefined && object.leaf_hash !== null) { + message.leafHash = bytesFromBase64(object.leaf_hash); + } + message.aunts = object.aunts?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Proof): ProofAmino { + const obj: any = {}; + obj.total = message.total !== BigInt(0) ? message.total.toString() : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.leaf_hash = message.leafHash ? base64FromBytes(message.leafHash) : undefined; + if (message.aunts) { + obj.aunts = message.aunts.map(e => base64FromBytes(e)); + } else { + obj.aunts = message.aunts; + } + return obj; + }, + fromAminoMsg(object: ProofAminoMsg): Proof { + return Proof.fromAmino(object.value); + }, + fromProtoMsg(message: ProofProtoMsg): Proof { + return Proof.decode(message.value); + }, + toProto(message: Proof): Uint8Array { + return Proof.encode(message).finish(); + }, + toProtoMsg(message: Proof): ProofProtoMsg { + return { + typeUrl: "/tendermint.crypto.Proof", + value: Proof.encode(message).finish() + }; + } +}; +function createBaseValueOp(): ValueOp { + return { + key: new Uint8Array(), + proof: undefined + }; +} +export const ValueOp = { + typeUrl: "/tendermint.crypto.ValueOp", + encode(message: ValueOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValueOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValueOp { + const message = createBaseValueOp(); + message.key = object.key ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: ValueOpAmino): ValueOp { + const message = createBaseValueOp(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: ValueOp): ValueOpAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: ValueOpAminoMsg): ValueOp { + return ValueOp.fromAmino(object.value); + }, + fromProtoMsg(message: ValueOpProtoMsg): ValueOp { + return ValueOp.decode(message.value); + }, + toProto(message: ValueOp): Uint8Array { + return ValueOp.encode(message).finish(); + }, + toProtoMsg(message: ValueOp): ValueOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.ValueOp", + value: ValueOp.encode(message).finish() + }; + } +}; +function createBaseDominoOp(): DominoOp { + return { + key: "", + input: "", + output: "" + }; +} +export const DominoOp = { + typeUrl: "/tendermint.crypto.DominoOp", + encode(message: DominoOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.input !== "") { + writer.uint32(18).string(message.input); + } + if (message.output !== "") { + writer.uint32(26).string(message.output); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDominoOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DominoOp { + const message = createBaseDominoOp(); + message.key = object.key ?? ""; + message.input = object.input ?? ""; + message.output = object.output ?? ""; + return message; + }, + fromAmino(object: DominoOpAmino): DominoOp { + const message = createBaseDominoOp(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } + return message; + }, + toAmino(message: DominoOp): DominoOpAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.input = message.input === "" ? undefined : message.input; + obj.output = message.output === "" ? undefined : message.output; + return obj; + }, + fromAminoMsg(object: DominoOpAminoMsg): DominoOp { + return DominoOp.fromAmino(object.value); + }, + fromProtoMsg(message: DominoOpProtoMsg): DominoOp { + return DominoOp.decode(message.value); + }, + toProto(message: DominoOp): Uint8Array { + return DominoOp.encode(message).finish(); + }, + toProtoMsg(message: DominoOp): DominoOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.DominoOp", + value: DominoOp.encode(message).finish() + }; + } +}; +function createBaseProofOp(): ProofOp { + return { + type: "", + key: new Uint8Array(), + data: new Uint8Array() + }; +} +export const ProofOp = { + typeUrl: "/tendermint.crypto.ProofOp", + encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.key.length !== 0) { + writer.uint32(18).bytes(message.key); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProofOp { + const message = createBaseProofOp(); + message.type = object.type ?? ""; + message.key = object.key ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ProofOpAmino): ProofOp { + const message = createBaseProofOp(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ProofOp): ProofOpAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ProofOpAminoMsg): ProofOp { + return ProofOp.fromAmino(object.value); + }, + fromProtoMsg(message: ProofOpProtoMsg): ProofOp { + return ProofOp.decode(message.value); + }, + toProto(message: ProofOp): Uint8Array { + return ProofOp.encode(message).finish(); + }, + toProtoMsg(message: ProofOp): ProofOpProtoMsg { + return { + typeUrl: "/tendermint.crypto.ProofOp", + value: ProofOp.encode(message).finish() + }; + } +}; +function createBaseProofOps(): ProofOps { + return { + ops: [] + }; +} +export const ProofOps = { + typeUrl: "/tendermint.crypto.ProofOps", + encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.ops) { + ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofOps(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ops.push(ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ProofOpsAmino): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: ProofOps): ProofOpsAmino { + const obj: any = {}; + if (message.ops) { + obj.ops = message.ops.map(e => e ? ProofOp.toAmino(e) : undefined); + } else { + obj.ops = message.ops; + } + return obj; + }, + fromAminoMsg(object: ProofOpsAminoMsg): ProofOps { + return ProofOps.fromAmino(object.value); + }, + fromProtoMsg(message: ProofOpsProtoMsg): ProofOps { + return ProofOps.decode(message.value); + }, + toProto(message: ProofOps): Uint8Array { + return ProofOps.encode(message).finish(); + }, + toProtoMsg(message: ProofOps): ProofOpsProtoMsg { + return { + typeUrl: "/tendermint.crypto.ProofOps", + value: ProofOps.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/libs/bits/types.ts b/dydxjs/packages/dydxjs/src/tendermint/libs/bits/types.ts new file mode 100644 index 00000000..0ced0802 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/libs/bits/types.ts @@ -0,0 +1,108 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface BitArray { + bits: bigint; + elems: bigint[]; +} +export interface BitArrayProtoMsg { + typeUrl: "/tendermint.libs.bits.BitArray"; + value: Uint8Array; +} +export interface BitArrayAmino { + bits?: string; + elems?: string[]; +} +export interface BitArrayAminoMsg { + type: "/tendermint.libs.bits.BitArray"; + value: BitArrayAmino; +} +export interface BitArraySDKType { + bits: bigint; + elems: bigint[]; +} +function createBaseBitArray(): BitArray { + return { + bits: BigInt(0), + elems: [] + }; +} +export const BitArray = { + typeUrl: "/tendermint.libs.bits.BitArray", + encode(message: BitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bits !== BigInt(0)) { + writer.uint32(8).int64(message.bits); + } + writer.uint32(18).fork(); + for (const v of message.elems) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BitArray { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBitArray(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bits = reader.int64(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.elems.push(reader.uint64()); + } + } else { + message.elems.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BitArray { + const message = createBaseBitArray(); + message.bits = object.bits !== undefined && object.bits !== null ? BigInt(object.bits.toString()) : BigInt(0); + message.elems = object.elems?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: BitArrayAmino): BitArray { + const message = createBaseBitArray(); + if (object.bits !== undefined && object.bits !== null) { + message.bits = BigInt(object.bits); + } + message.elems = object.elems?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: BitArray): BitArrayAmino { + const obj: any = {}; + obj.bits = message.bits !== BigInt(0) ? message.bits.toString() : undefined; + if (message.elems) { + obj.elems = message.elems.map(e => e.toString()); + } else { + obj.elems = message.elems; + } + return obj; + }, + fromAminoMsg(object: BitArrayAminoMsg): BitArray { + return BitArray.fromAmino(object.value); + }, + fromProtoMsg(message: BitArrayProtoMsg): BitArray { + return BitArray.decode(message.value); + }, + toProto(message: BitArray): Uint8Array { + return BitArray.encode(message).finish(); + }, + toProtoMsg(message: BitArray): BitArrayProtoMsg { + return { + typeUrl: "/tendermint.libs.bits.BitArray", + value: BitArray.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/p2p/types.ts b/dydxjs/packages/dydxjs/src/tendermint/p2p/types.ts new file mode 100644 index 00000000..a078437f --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/p2p/types.ts @@ -0,0 +1,631 @@ +//@ts-nocheck +import { Timestamp } from "../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../helpers"; +export interface ProtocolVersion { + p2p: bigint; + block: bigint; + app: bigint; +} +export interface ProtocolVersionProtoMsg { + typeUrl: "/tendermint.p2p.ProtocolVersion"; + value: Uint8Array; +} +export interface ProtocolVersionAmino { + p2p?: string; + block?: string; + app?: string; +} +export interface ProtocolVersionAminoMsg { + type: "/tendermint.p2p.ProtocolVersion"; + value: ProtocolVersionAmino; +} +export interface ProtocolVersionSDKType { + p2p: bigint; + block: bigint; + app: bigint; +} +export interface NodeInfo { + protocolVersion: ProtocolVersion; + nodeId: string; + listenAddr: string; + network: string; + version: string; + channels: Uint8Array; + moniker: string; + other: NodeInfoOther; +} +export interface NodeInfoProtoMsg { + typeUrl: "/tendermint.p2p.NodeInfo"; + value: Uint8Array; +} +export interface NodeInfoAmino { + protocol_version?: ProtocolVersionAmino; + node_id?: string; + listen_addr?: string; + network?: string; + version?: string; + channels?: string; + moniker?: string; + other?: NodeInfoOtherAmino; +} +export interface NodeInfoAminoMsg { + type: "/tendermint.p2p.NodeInfo"; + value: NodeInfoAmino; +} +export interface NodeInfoSDKType { + protocol_version: ProtocolVersionSDKType; + node_id: string; + listen_addr: string; + network: string; + version: string; + channels: Uint8Array; + moniker: string; + other: NodeInfoOtherSDKType; +} +export interface NodeInfoOther { + txIndex: string; + rpcAddress: string; +} +export interface NodeInfoOtherProtoMsg { + typeUrl: "/tendermint.p2p.NodeInfoOther"; + value: Uint8Array; +} +export interface NodeInfoOtherAmino { + tx_index?: string; + rpc_address?: string; +} +export interface NodeInfoOtherAminoMsg { + type: "/tendermint.p2p.NodeInfoOther"; + value: NodeInfoOtherAmino; +} +export interface NodeInfoOtherSDKType { + tx_index: string; + rpc_address: string; +} +export interface PeerInfo { + id: string; + addressInfo: PeerAddressInfo[]; + lastConnected?: Date; +} +export interface PeerInfoProtoMsg { + typeUrl: "/tendermint.p2p.PeerInfo"; + value: Uint8Array; +} +export interface PeerInfoAmino { + id?: string; + address_info?: PeerAddressInfoAmino[]; + last_connected?: string; +} +export interface PeerInfoAminoMsg { + type: "/tendermint.p2p.PeerInfo"; + value: PeerInfoAmino; +} +export interface PeerInfoSDKType { + id: string; + address_info: PeerAddressInfoSDKType[]; + last_connected?: Date; +} +export interface PeerAddressInfo { + address: string; + lastDialSuccess?: Date; + lastDialFailure?: Date; + dialFailures: number; +} +export interface PeerAddressInfoProtoMsg { + typeUrl: "/tendermint.p2p.PeerAddressInfo"; + value: Uint8Array; +} +export interface PeerAddressInfoAmino { + address?: string; + last_dial_success?: string; + last_dial_failure?: string; + dial_failures?: number; +} +export interface PeerAddressInfoAminoMsg { + type: "/tendermint.p2p.PeerAddressInfo"; + value: PeerAddressInfoAmino; +} +export interface PeerAddressInfoSDKType { + address: string; + last_dial_success?: Date; + last_dial_failure?: Date; + dial_failures: number; +} +function createBaseProtocolVersion(): ProtocolVersion { + return { + p2p: BigInt(0), + block: BigInt(0), + app: BigInt(0) + }; +} +export const ProtocolVersion = { + typeUrl: "/tendermint.p2p.ProtocolVersion", + encode(message: ProtocolVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.p2p !== BigInt(0)) { + writer.uint32(8).uint64(message.p2p); + } + if (message.block !== BigInt(0)) { + writer.uint32(16).uint64(message.block); + } + if (message.app !== BigInt(0)) { + writer.uint32(24).uint64(message.app); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProtocolVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProtocolVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint64(); + break; + case 2: + message.block = reader.uint64(); + break; + case 3: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProtocolVersion { + const message = createBaseProtocolVersion(); + message.p2p = object.p2p !== undefined && object.p2p !== null ? BigInt(object.p2p.toString()) : BigInt(0); + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ProtocolVersionAmino): ProtocolVersion { + const message = createBaseProtocolVersion(); + if (object.p2p !== undefined && object.p2p !== null) { + message.p2p = BigInt(object.p2p); + } + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; + }, + toAmino(message: ProtocolVersion): ProtocolVersionAmino { + const obj: any = {}; + obj.p2p = message.p2p !== BigInt(0) ? message.p2p.toString() : undefined; + obj.block = message.block !== BigInt(0) ? message.block.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ProtocolVersionAminoMsg): ProtocolVersion { + return ProtocolVersion.fromAmino(object.value); + }, + fromProtoMsg(message: ProtocolVersionProtoMsg): ProtocolVersion { + return ProtocolVersion.decode(message.value); + }, + toProto(message: ProtocolVersion): Uint8Array { + return ProtocolVersion.encode(message).finish(); + }, + toProtoMsg(message: ProtocolVersion): ProtocolVersionProtoMsg { + return { + typeUrl: "/tendermint.p2p.ProtocolVersion", + value: ProtocolVersion.encode(message).finish() + }; + } +}; +function createBaseNodeInfo(): NodeInfo { + return { + protocolVersion: ProtocolVersion.fromPartial({}), + nodeId: "", + listenAddr: "", + network: "", + version: "", + channels: new Uint8Array(), + moniker: "", + other: NodeInfoOther.fromPartial({}) + }; +} +export const NodeInfo = { + typeUrl: "/tendermint.p2p.NodeInfo", + encode(message: NodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.protocolVersion !== undefined) { + ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); + } + if (message.nodeId !== "") { + writer.uint32(18).string(message.nodeId); + } + if (message.listenAddr !== "") { + writer.uint32(26).string(message.listenAddr); + } + if (message.network !== "") { + writer.uint32(34).string(message.network); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.channels.length !== 0) { + writer.uint32(50).bytes(message.channels); + } + if (message.moniker !== "") { + writer.uint32(58).string(message.moniker); + } + if (message.other !== undefined) { + NodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()); + break; + case 2: + message.nodeId = reader.string(); + break; + case 3: + message.listenAddr = reader.string(); + break; + case 4: + message.network = reader.string(); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.channels = reader.bytes(); + break; + case 7: + message.moniker = reader.string(); + break; + case 8: + message.other = NodeInfoOther.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NodeInfo { + const message = createBaseNodeInfo(); + message.protocolVersion = object.protocolVersion !== undefined && object.protocolVersion !== null ? ProtocolVersion.fromPartial(object.protocolVersion) : undefined; + message.nodeId = object.nodeId ?? ""; + message.listenAddr = object.listenAddr ?? ""; + message.network = object.network ?? ""; + message.version = object.version ?? ""; + message.channels = object.channels ?? new Uint8Array(); + message.moniker = object.moniker ?? ""; + message.other = object.other !== undefined && object.other !== null ? NodeInfoOther.fromPartial(object.other) : undefined; + return message; + }, + fromAmino(object: NodeInfoAmino): NodeInfo { + const message = createBaseNodeInfo(); + if (object.protocol_version !== undefined && object.protocol_version !== null) { + message.protocolVersion = ProtocolVersion.fromAmino(object.protocol_version); + } + if (object.node_id !== undefined && object.node_id !== null) { + message.nodeId = object.node_id; + } + if (object.listen_addr !== undefined && object.listen_addr !== null) { + message.listenAddr = object.listen_addr; + } + if (object.network !== undefined && object.network !== null) { + message.network = object.network; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.channels !== undefined && object.channels !== null) { + message.channels = bytesFromBase64(object.channels); + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.other !== undefined && object.other !== null) { + message.other = NodeInfoOther.fromAmino(object.other); + } + return message; + }, + toAmino(message: NodeInfo): NodeInfoAmino { + const obj: any = {}; + obj.protocol_version = message.protocolVersion ? ProtocolVersion.toAmino(message.protocolVersion) : undefined; + obj.node_id = message.nodeId === "" ? undefined : message.nodeId; + obj.listen_addr = message.listenAddr === "" ? undefined : message.listenAddr; + obj.network = message.network === "" ? undefined : message.network; + obj.version = message.version === "" ? undefined : message.version; + obj.channels = message.channels ? base64FromBytes(message.channels) : undefined; + obj.moniker = message.moniker === "" ? undefined : message.moniker; + obj.other = message.other ? NodeInfoOther.toAmino(message.other) : undefined; + return obj; + }, + fromAminoMsg(object: NodeInfoAminoMsg): NodeInfo { + return NodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: NodeInfoProtoMsg): NodeInfo { + return NodeInfo.decode(message.value); + }, + toProto(message: NodeInfo): Uint8Array { + return NodeInfo.encode(message).finish(); + }, + toProtoMsg(message: NodeInfo): NodeInfoProtoMsg { + return { + typeUrl: "/tendermint.p2p.NodeInfo", + value: NodeInfo.encode(message).finish() + }; + } +}; +function createBaseNodeInfoOther(): NodeInfoOther { + return { + txIndex: "", + rpcAddress: "" + }; +} +export const NodeInfoOther = { + typeUrl: "/tendermint.p2p.NodeInfoOther", + encode(message: NodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txIndex !== "") { + writer.uint32(10).string(message.txIndex); + } + if (message.rpcAddress !== "") { + writer.uint32(18).string(message.rpcAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NodeInfoOther { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNodeInfoOther(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txIndex = reader.string(); + break; + case 2: + message.rpcAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NodeInfoOther { + const message = createBaseNodeInfoOther(); + message.txIndex = object.txIndex ?? ""; + message.rpcAddress = object.rpcAddress ?? ""; + return message; + }, + fromAmino(object: NodeInfoOtherAmino): NodeInfoOther { + const message = createBaseNodeInfoOther(); + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = object.tx_index; + } + if (object.rpc_address !== undefined && object.rpc_address !== null) { + message.rpcAddress = object.rpc_address; + } + return message; + }, + toAmino(message: NodeInfoOther): NodeInfoOtherAmino { + const obj: any = {}; + obj.tx_index = message.txIndex === "" ? undefined : message.txIndex; + obj.rpc_address = message.rpcAddress === "" ? undefined : message.rpcAddress; + return obj; + }, + fromAminoMsg(object: NodeInfoOtherAminoMsg): NodeInfoOther { + return NodeInfoOther.fromAmino(object.value); + }, + fromProtoMsg(message: NodeInfoOtherProtoMsg): NodeInfoOther { + return NodeInfoOther.decode(message.value); + }, + toProto(message: NodeInfoOther): Uint8Array { + return NodeInfoOther.encode(message).finish(); + }, + toProtoMsg(message: NodeInfoOther): NodeInfoOtherProtoMsg { + return { + typeUrl: "/tendermint.p2p.NodeInfoOther", + value: NodeInfoOther.encode(message).finish() + }; + } +}; +function createBasePeerInfo(): PeerInfo { + return { + id: "", + addressInfo: [], + lastConnected: undefined + }; +} +export const PeerInfo = { + typeUrl: "/tendermint.p2p.PeerInfo", + encode(message: PeerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + for (const v of message.addressInfo) { + PeerAddressInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.lastConnected !== undefined) { + Timestamp.encode(toTimestamp(message.lastConnected), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeerInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeerInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.addressInfo.push(PeerAddressInfo.decode(reader, reader.uint32())); + break; + case 3: + message.lastConnected = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PeerInfo { + const message = createBasePeerInfo(); + message.id = object.id ?? ""; + message.addressInfo = object.addressInfo?.map(e => PeerAddressInfo.fromPartial(e)) || []; + message.lastConnected = object.lastConnected ?? undefined; + return message; + }, + fromAmino(object: PeerInfoAmino): PeerInfo { + const message = createBasePeerInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + message.addressInfo = object.address_info?.map(e => PeerAddressInfo.fromAmino(e)) || []; + if (object.last_connected !== undefined && object.last_connected !== null) { + message.lastConnected = fromTimestamp(Timestamp.fromAmino(object.last_connected)); + } + return message; + }, + toAmino(message: PeerInfo): PeerInfoAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + if (message.addressInfo) { + obj.address_info = message.addressInfo.map(e => e ? PeerAddressInfo.toAmino(e) : undefined); + } else { + obj.address_info = message.addressInfo; + } + obj.last_connected = message.lastConnected ? Timestamp.toAmino(toTimestamp(message.lastConnected)) : undefined; + return obj; + }, + fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { + return PeerInfo.fromAmino(object.value); + }, + fromProtoMsg(message: PeerInfoProtoMsg): PeerInfo { + return PeerInfo.decode(message.value); + }, + toProto(message: PeerInfo): Uint8Array { + return PeerInfo.encode(message).finish(); + }, + toProtoMsg(message: PeerInfo): PeerInfoProtoMsg { + return { + typeUrl: "/tendermint.p2p.PeerInfo", + value: PeerInfo.encode(message).finish() + }; + } +}; +function createBasePeerAddressInfo(): PeerAddressInfo { + return { + address: "", + lastDialSuccess: undefined, + lastDialFailure: undefined, + dialFailures: 0 + }; +} +export const PeerAddressInfo = { + typeUrl: "/tendermint.p2p.PeerAddressInfo", + encode(message: PeerAddressInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.lastDialSuccess !== undefined) { + Timestamp.encode(toTimestamp(message.lastDialSuccess), writer.uint32(18).fork()).ldelim(); + } + if (message.lastDialFailure !== undefined) { + Timestamp.encode(toTimestamp(message.lastDialFailure), writer.uint32(26).fork()).ldelim(); + } + if (message.dialFailures !== 0) { + writer.uint32(32).uint32(message.dialFailures); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeerAddressInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeerAddressInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.lastDialSuccess = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.lastDialFailure = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.dialFailures = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PeerAddressInfo { + const message = createBasePeerAddressInfo(); + message.address = object.address ?? ""; + message.lastDialSuccess = object.lastDialSuccess ?? undefined; + message.lastDialFailure = object.lastDialFailure ?? undefined; + message.dialFailures = object.dialFailures ?? 0; + return message; + }, + fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { + const message = createBasePeerAddressInfo(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.last_dial_success !== undefined && object.last_dial_success !== null) { + message.lastDialSuccess = fromTimestamp(Timestamp.fromAmino(object.last_dial_success)); + } + if (object.last_dial_failure !== undefined && object.last_dial_failure !== null) { + message.lastDialFailure = fromTimestamp(Timestamp.fromAmino(object.last_dial_failure)); + } + if (object.dial_failures !== undefined && object.dial_failures !== null) { + message.dialFailures = object.dial_failures; + } + return message; + }, + toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.last_dial_success = message.lastDialSuccess ? Timestamp.toAmino(toTimestamp(message.lastDialSuccess)) : undefined; + obj.last_dial_failure = message.lastDialFailure ? Timestamp.toAmino(toTimestamp(message.lastDialFailure)) : undefined; + obj.dial_failures = message.dialFailures === 0 ? undefined : message.dialFailures; + return obj; + }, + fromAminoMsg(object: PeerAddressInfoAminoMsg): PeerAddressInfo { + return PeerAddressInfo.fromAmino(object.value); + }, + fromProtoMsg(message: PeerAddressInfoProtoMsg): PeerAddressInfo { + return PeerAddressInfo.decode(message.value); + }, + toProto(message: PeerAddressInfo): Uint8Array { + return PeerAddressInfo.encode(message).finish(); + }, + toProtoMsg(message: PeerAddressInfo): PeerAddressInfoProtoMsg { + return { + typeUrl: "/tendermint.p2p.PeerAddressInfo", + value: PeerAddressInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/types/block.ts b/dydxjs/packages/dydxjs/src/tendermint/types/block.ts new file mode 100644 index 00000000..f7082757 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/types/block.ts @@ -0,0 +1,129 @@ +//@ts-nocheck +import { Header, HeaderAmino, HeaderSDKType, Data, DataAmino, DataSDKType, Commit, CommitAmino, CommitSDKType } from "./types"; +import { EvidenceList, EvidenceListAmino, EvidenceListSDKType } from "./evidence"; +import { BinaryReader, BinaryWriter } from "../../binary"; +export interface Block { + header: Header; + data: Data; + evidence: EvidenceList; + lastCommit?: Commit; +} +export interface BlockProtoMsg { + typeUrl: "/tendermint.types.Block"; + value: Uint8Array; +} +export interface BlockAmino { + header?: HeaderAmino; + data?: DataAmino; + evidence?: EvidenceListAmino; + last_commit?: CommitAmino; +} +export interface BlockAminoMsg { + type: "/tendermint.types.Block"; + value: BlockAmino; +} +export interface BlockSDKType { + header: HeaderSDKType; + data: DataSDKType; + evidence: EvidenceListSDKType; + last_commit?: CommitSDKType; +} +function createBaseBlock(): Block { + return { + header: Header.fromPartial({}), + data: Data.fromPartial({}), + evidence: EvidenceList.fromPartial({}), + lastCommit: undefined + }; +} +export const Block = { + typeUrl: "/tendermint.types.Block", + encode(message: Block, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.lastCommit !== undefined) { + Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Block { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.data = Data.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceList.decode(reader, reader.uint32()); + break; + case 4: + message.lastCommit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Block { + const message = createBaseBlock(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.data = object.data !== undefined && object.data !== null ? Data.fromPartial(object.data) : undefined; + message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceList.fromPartial(object.evidence) : undefined; + message.lastCommit = object.lastCommit !== undefined && object.lastCommit !== null ? Commit.fromPartial(object.lastCommit) : undefined; + return message; + }, + fromAmino(object: BlockAmino): Block { + const message = createBaseBlock(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromAmino(object.data); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromAmino(object.evidence); + } + if (object.last_commit !== undefined && object.last_commit !== null) { + message.lastCommit = Commit.fromAmino(object.last_commit); + } + return message; + }, + toAmino(message: Block): BlockAmino { + const obj: any = {}; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.data = message.data ? Data.toAmino(message.data) : undefined; + obj.evidence = message.evidence ? EvidenceList.toAmino(message.evidence) : undefined; + obj.last_commit = message.lastCommit ? Commit.toAmino(message.lastCommit) : undefined; + return obj; + }, + fromAminoMsg(object: BlockAminoMsg): Block { + return Block.fromAmino(object.value); + }, + fromProtoMsg(message: BlockProtoMsg): Block { + return Block.decode(message.value); + }, + toProto(message: Block): Uint8Array { + return Block.encode(message).finish(); + }, + toProtoMsg(message: Block): BlockProtoMsg { + return { + typeUrl: "/tendermint.types.Block", + value: Block.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/types/evidence.ts b/dydxjs/packages/dydxjs/src/tendermint/types/evidence.ts new file mode 100644 index 00000000..a0057e31 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/types/evidence.ts @@ -0,0 +1,471 @@ +//@ts-nocheck +import { Vote, VoteAmino, VoteSDKType, LightBlock, LightBlockAmino, LightBlockSDKType } from "./types"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { Validator, ValidatorAmino, ValidatorSDKType } from "./validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { toTimestamp, fromTimestamp } from "../../helpers"; +export interface Evidence { + duplicateVoteEvidence?: DuplicateVoteEvidence; + lightClientAttackEvidence?: LightClientAttackEvidence; +} +export interface EvidenceProtoMsg { + typeUrl: "/tendermint.types.Evidence"; + value: Uint8Array; +} +export interface EvidenceAmino { + duplicate_vote_evidence?: DuplicateVoteEvidenceAmino; + light_client_attack_evidence?: LightClientAttackEvidenceAmino; +} +export interface EvidenceAminoMsg { + type: "/tendermint.types.Evidence"; + value: EvidenceAmino; +} +export interface EvidenceSDKType { + duplicate_vote_evidence?: DuplicateVoteEvidenceSDKType; + light_client_attack_evidence?: LightClientAttackEvidenceSDKType; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidence { + voteA?: Vote; + voteB?: Vote; + totalVotingPower: bigint; + validatorPower: bigint; + timestamp: Date; +} +export interface DuplicateVoteEvidenceProtoMsg { + typeUrl: "/tendermint.types.DuplicateVoteEvidence"; + value: Uint8Array; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidenceAmino { + vote_a?: VoteAmino; + vote_b?: VoteAmino; + total_voting_power?: string; + validator_power?: string; + timestamp?: string; +} +export interface DuplicateVoteEvidenceAminoMsg { + type: "/tendermint.types.DuplicateVoteEvidence"; + value: DuplicateVoteEvidenceAmino; +} +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidenceSDKType { + vote_a?: VoteSDKType; + vote_b?: VoteSDKType; + total_voting_power: bigint; + validator_power: bigint; + timestamp: Date; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidence { + conflictingBlock?: LightBlock; + commonHeight: bigint; + byzantineValidators: Validator[]; + totalVotingPower: bigint; + timestamp: Date; +} +export interface LightClientAttackEvidenceProtoMsg { + typeUrl: "/tendermint.types.LightClientAttackEvidence"; + value: Uint8Array; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidenceAmino { + conflicting_block?: LightBlockAmino; + common_height?: string; + byzantine_validators?: ValidatorAmino[]; + total_voting_power?: string; + timestamp?: string; +} +export interface LightClientAttackEvidenceAminoMsg { + type: "/tendermint.types.LightClientAttackEvidence"; + value: LightClientAttackEvidenceAmino; +} +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidenceSDKType { + conflicting_block?: LightBlockSDKType; + common_height: bigint; + byzantine_validators: ValidatorSDKType[]; + total_voting_power: bigint; + timestamp: Date; +} +export interface EvidenceList { + evidence: Evidence[]; +} +export interface EvidenceListProtoMsg { + typeUrl: "/tendermint.types.EvidenceList"; + value: Uint8Array; +} +export interface EvidenceListAmino { + evidence?: EvidenceAmino[]; +} +export interface EvidenceListAminoMsg { + type: "/tendermint.types.EvidenceList"; + value: EvidenceListAmino; +} +export interface EvidenceListSDKType { + evidence: EvidenceSDKType[]; +} +function createBaseEvidence(): Evidence { + return { + duplicateVoteEvidence: undefined, + lightClientAttackEvidence: undefined + }; +} +export const Evidence = { + typeUrl: "/tendermint.types.Evidence", + encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.duplicateVoteEvidence !== undefined) { + DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); + } + if (message.lightClientAttackEvidence !== undefined) { + LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duplicateVoteEvidence = DuplicateVoteEvidence.decode(reader, reader.uint32()); + break; + case 2: + message.lightClientAttackEvidence = LightClientAttackEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Evidence { + const message = createBaseEvidence(); + message.duplicateVoteEvidence = object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null ? DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence) : undefined; + message.lightClientAttackEvidence = object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null ? LightClientAttackEvidence.fromPartial(object.lightClientAttackEvidence) : undefined; + return message; + }, + fromAmino(object: EvidenceAmino): Evidence { + const message = createBaseEvidence(); + if (object.duplicate_vote_evidence !== undefined && object.duplicate_vote_evidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence); + } + if (object.light_client_attack_evidence !== undefined && object.light_client_attack_evidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence); + } + return message; + }, + toAmino(message: Evidence): EvidenceAmino { + const obj: any = {}; + obj.duplicate_vote_evidence = message.duplicateVoteEvidence ? DuplicateVoteEvidence.toAmino(message.duplicateVoteEvidence) : undefined; + obj.light_client_attack_evidence = message.lightClientAttackEvidence ? LightClientAttackEvidence.toAmino(message.lightClientAttackEvidence) : undefined; + return obj; + }, + fromAminoMsg(object: EvidenceAminoMsg): Evidence { + return Evidence.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceProtoMsg): Evidence { + return Evidence.decode(message.value); + }, + toProto(message: Evidence): Uint8Array { + return Evidence.encode(message).finish(); + }, + toProtoMsg(message: Evidence): EvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.Evidence", + value: Evidence.encode(message).finish() + }; + } +}; +function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { + return { + voteA: undefined, + voteB: undefined, + totalVotingPower: BigInt(0), + validatorPower: BigInt(0), + timestamp: new Date() + }; +} +export const DuplicateVoteEvidence = { + typeUrl: "/tendermint.types.DuplicateVoteEvidence", + encode(message: DuplicateVoteEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.voteA !== undefined) { + Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); + } + if (message.voteB !== undefined) { + Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(24).int64(message.totalVotingPower); + } + if (message.validatorPower !== BigInt(0)) { + writer.uint32(32).int64(message.validatorPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuplicateVoteEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteA = Vote.decode(reader, reader.uint32()); + break; + case 2: + message.voteB = Vote.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + case 4: + message.validatorPower = reader.int64(); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + message.voteA = object.voteA !== undefined && object.voteA !== null ? Vote.fromPartial(object.voteA) : undefined; + message.voteB = object.voteB !== undefined && object.voteB !== null ? Vote.fromPartial(object.voteB) : undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + message.validatorPower = object.validatorPower !== undefined && object.validatorPower !== null ? BigInt(object.validatorPower.toString()) : BigInt(0); + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: DuplicateVoteEvidenceAmino): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + if (object.vote_a !== undefined && object.vote_a !== null) { + message.voteA = Vote.fromAmino(object.vote_a); + } + if (object.vote_b !== undefined && object.vote_b !== null) { + message.voteB = Vote.fromAmino(object.vote_b); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.validator_power !== undefined && object.validator_power !== null) { + message.validatorPower = BigInt(object.validator_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { + const obj: any = {}; + obj.vote_a = message.voteA ? Vote.toAmino(message.voteA) : undefined; + obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; + obj.validator_power = message.validatorPower !== BigInt(0) ? message.validatorPower.toString() : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { + return DuplicateVoteEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: DuplicateVoteEvidenceProtoMsg): DuplicateVoteEvidence { + return DuplicateVoteEvidence.decode(message.value); + }, + toProto(message: DuplicateVoteEvidence): Uint8Array { + return DuplicateVoteEvidence.encode(message).finish(); + }, + toProtoMsg(message: DuplicateVoteEvidence): DuplicateVoteEvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.DuplicateVoteEvidence", + value: DuplicateVoteEvidence.encode(message).finish() + }; + } +}; +function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { + return { + conflictingBlock: undefined, + commonHeight: BigInt(0), + byzantineValidators: [], + totalVotingPower: BigInt(0), + timestamp: new Date() + }; +} +export const LightClientAttackEvidence = { + typeUrl: "/tendermint.types.LightClientAttackEvidence", + encode(message: LightClientAttackEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.conflictingBlock !== undefined) { + LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); + } + if (message.commonHeight !== BigInt(0)) { + writer.uint32(16).int64(message.commonHeight); + } + for (const v of message.byzantineValidators) { + Validator.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(32).int64(message.totalVotingPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLightClientAttackEvidence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); + break; + case 2: + message.commonHeight = reader.int64(); + break; + case 3: + message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); + break; + case 4: + message.totalVotingPower = reader.int64(); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + message.conflictingBlock = object.conflictingBlock !== undefined && object.conflictingBlock !== null ? LightBlock.fromPartial(object.conflictingBlock) : undefined; + message.commonHeight = object.commonHeight !== undefined && object.commonHeight !== null ? BigInt(object.commonHeight.toString()) : BigInt(0); + message.byzantineValidators = object.byzantineValidators?.map(e => Validator.fromPartial(e)) || []; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: LightClientAttackEvidenceAmino): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + if (object.conflicting_block !== undefined && object.conflicting_block !== null) { + message.conflictingBlock = LightBlock.fromAmino(object.conflicting_block); + } + if (object.common_height !== undefined && object.common_height !== null) { + message.commonHeight = BigInt(object.common_height); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Validator.fromAmino(e)) || []; + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { + const obj: any = {}; + obj.conflicting_block = message.conflictingBlock ? LightBlock.toAmino(message.conflictingBlock) : undefined; + obj.common_height = message.commonHeight !== BigInt(0) ? message.commonHeight.toString() : undefined; + if (message.byzantineValidators) { + obj.byzantine_validators = message.byzantineValidators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.byzantine_validators = message.byzantineValidators; + } + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { + return LightClientAttackEvidence.fromAmino(object.value); + }, + fromProtoMsg(message: LightClientAttackEvidenceProtoMsg): LightClientAttackEvidence { + return LightClientAttackEvidence.decode(message.value); + }, + toProto(message: LightClientAttackEvidence): Uint8Array { + return LightClientAttackEvidence.encode(message).finish(); + }, + toProtoMsg(message: LightClientAttackEvidence): LightClientAttackEvidenceProtoMsg { + return { + typeUrl: "/tendermint.types.LightClientAttackEvidence", + value: LightClientAttackEvidence.encode(message).finish() + }; + } +}; +function createBaseEvidenceList(): EvidenceList { + return { + evidence: [] + }; +} +export const EvidenceList = { + typeUrl: "/tendermint.types.EvidenceList", + encode(message: EvidenceList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.evidence) { + Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence.push(Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EvidenceListAmino): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromAmino(e)) || []; + return message; + }, + toAmino(message: EvidenceList): EvidenceListAmino { + const obj: any = {}; + if (message.evidence) { + obj.evidence = message.evidence.map(e => e ? Evidence.toAmino(e) : undefined); + } else { + obj.evidence = message.evidence; + } + return obj; + }, + fromAminoMsg(object: EvidenceListAminoMsg): EvidenceList { + return EvidenceList.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceListProtoMsg): EvidenceList { + return EvidenceList.decode(message.value); + }, + toProto(message: EvidenceList): Uint8Array { + return EvidenceList.encode(message).finish(); + }, + toProtoMsg(message: EvidenceList): EvidenceListProtoMsg { + return { + typeUrl: "/tendermint.types.EvidenceList", + value: EvidenceList.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/types/params.ts b/dydxjs/packages/dydxjs/src/tendermint/types/params.ts new file mode 100644 index 00000000..8584278b --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/types/params.ts @@ -0,0 +1,717 @@ +//@ts-nocheck +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block: BlockParams; + evidence: EvidenceParams; + validator: ValidatorParams; + version: VersionParams; +} +export interface ConsensusParamsProtoMsg { + typeUrl: "/tendermint.types.ConsensusParams"; + value: Uint8Array; +} +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParamsAmino { + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; + version?: VersionParamsAmino; +} +export interface ConsensusParamsAminoMsg { + type: "/tendermint.types.ConsensusParams"; + value: ConsensusParamsAmino; +} +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParamsSDKType { + block: BlockParamsSDKType; + evidence: EvidenceParamsSDKType; + validator: ValidatorParamsSDKType; + version: VersionParamsSDKType; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: bigint; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: bigint; + /** + * Minimum time increment between consecutive blocks (in milliseconds) If the + * block header timestamp is ahead of the system clock, decrease this value. + * + * Not exposed to the application. + */ + timeIotaMs: bigint; +} +export interface BlockParamsProtoMsg { + typeUrl: "/tendermint.types.BlockParams"; + value: Uint8Array; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsAmino { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + max_bytes?: string; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + max_gas?: string; + /** + * Minimum time increment between consecutive blocks (in milliseconds) If the + * block header timestamp is ahead of the system clock, decrease this value. + * + * Not exposed to the application. + */ + time_iota_ms?: string; +} +export interface BlockParamsAminoMsg { + type: "/tendermint.types.BlockParams"; + value: BlockParamsAmino; +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsSDKType { + max_bytes: bigint; + max_gas: bigint; + time_iota_ms: bigint; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: bigint; + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + maxAgeDuration: Duration; + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + maxBytes: bigint; +} +export interface EvidenceParamsProtoMsg { + typeUrl: "/tendermint.types.EvidenceParams"; + value: Uint8Array; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParamsAmino { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + max_age_num_blocks?: string; + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + max_age_duration?: DurationAmino; + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + max_bytes?: string; +} +export interface EvidenceParamsAminoMsg { + type: "/tendermint.types.EvidenceParams"; + value: EvidenceParamsAmino; +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParamsSDKType { + max_age_num_blocks: bigint; + max_age_duration: DurationSDKType; + max_bytes: bigint; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParams { + pubKeyTypes: string[]; +} +export interface ValidatorParamsProtoMsg { + typeUrl: "/tendermint.types.ValidatorParams"; + value: Uint8Array; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParamsAmino { + pub_key_types?: string[]; +} +export interface ValidatorParamsAminoMsg { + type: "/tendermint.types.ValidatorParams"; + value: ValidatorParamsAmino; +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParamsSDKType { + pub_key_types: string[]; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + appVersion: bigint; +} +export interface VersionParamsProtoMsg { + typeUrl: "/tendermint.types.VersionParams"; + value: Uint8Array; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsAmino { + app_version?: string; +} +export interface VersionParamsAminoMsg { + type: "/tendermint.types.VersionParams"; + value: VersionParamsAmino; +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsSDKType { + app_version: bigint; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: bigint; + blockMaxGas: bigint; +} +export interface HashedParamsProtoMsg { + typeUrl: "/tendermint.types.HashedParams"; + value: Uint8Array; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParamsAmino { + block_max_bytes?: string; + block_max_gas?: string; +} +export interface HashedParamsAminoMsg { + type: "/tendermint.types.HashedParams"; + value: HashedParamsAmino; +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParamsSDKType { + block_max_bytes: bigint; + block_max_gas: bigint; +} +function createBaseConsensusParams(): ConsensusParams { + return { + block: BlockParams.fromPartial({}), + evidence: EvidenceParams.fromPartial({}), + validator: ValidatorParams.fromPartial({}), + version: VersionParams.fromPartial({}) + }; +} +export const ConsensusParams = { + typeUrl: "/tendermint.types.ConsensusParams", + encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusParams { + const message = createBaseConsensusParams(); + message.block = object.block !== undefined && object.block !== null ? BlockParams.fromPartial(object.block) : undefined; + message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceParams.fromPartial(object.evidence) : undefined; + message.validator = object.validator !== undefined && object.validator !== null ? ValidatorParams.fromPartial(object.validator) : undefined; + message.version = object.version !== undefined && object.version !== null ? VersionParams.fromPartial(object.version) : undefined; + return message; + }, + fromAmino(object: ConsensusParamsAmino): ConsensusParams { + const message = createBaseConsensusParams(); + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromAmino(object.version); + } + return message; + }, + toAmino(message: ConsensusParams): ConsensusParamsAmino { + const obj: any = {}; + obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; + obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; + obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; + obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { + return ConsensusParams.fromAmino(object.value); + }, + fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { + return ConsensusParams.decode(message.value); + }, + toProto(message: ConsensusParams): Uint8Array { + return ConsensusParams.encode(message).finish(); + }, + toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + return { + typeUrl: "/tendermint.types.ConsensusParams", + value: ConsensusParams.encode(message).finish() + }; + } +}; +function createBaseBlockParams(): BlockParams { + return { + maxBytes: BigInt(0), + maxGas: BigInt(0), + timeIotaMs: BigInt(0) + }; +} +export const BlockParams = { + typeUrl: "/tendermint.types.BlockParams", + encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxBytes); + } + if (message.maxGas !== BigInt(0)) { + writer.uint32(16).int64(message.maxGas); + } + if (message.timeIotaMs !== BigInt(0)) { + writer.uint32(24).int64(message.timeIotaMs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64(); + break; + case 2: + message.maxGas = reader.int64(); + break; + case 3: + message.timeIotaMs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockParams { + const message = createBaseBlockParams(); + message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); + message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); + message.timeIotaMs = object.timeIotaMs !== undefined && object.timeIotaMs !== null ? BigInt(object.timeIotaMs.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BlockParamsAmino): BlockParams { + const message = createBaseBlockParams(); + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + if (object.max_gas !== undefined && object.max_gas !== null) { + message.maxGas = BigInt(object.max_gas); + } + if (object.time_iota_ms !== undefined && object.time_iota_ms !== null) { + message.timeIotaMs = BigInt(object.time_iota_ms); + } + return message; + }, + toAmino(message: BlockParams): BlockParamsAmino { + const obj: any = {}; + obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; + obj.max_gas = message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; + obj.time_iota_ms = message.timeIotaMs !== BigInt(0) ? message.timeIotaMs.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { + return BlockParams.fromAmino(object.value); + }, + fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { + return BlockParams.decode(message.value); + }, + toProto(message: BlockParams): Uint8Array { + return BlockParams.encode(message).finish(); + }, + toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + return { + typeUrl: "/tendermint.types.BlockParams", + value: BlockParams.encode(message).finish() + }; + } +}; +function createBaseEvidenceParams(): EvidenceParams { + return { + maxAgeNumBlocks: BigInt(0), + maxAgeDuration: Duration.fromPartial({}), + maxBytes: BigInt(0) + }; +} +export const EvidenceParams = { + typeUrl: "/tendermint.types.EvidenceParams", + encode(message: EvidenceParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxAgeNumBlocks !== BigInt(0)) { + writer.uint32(8).int64(message.maxAgeNumBlocks); + } + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + } + if (message.maxBytes !== BigInt(0)) { + writer.uint32(24).int64(message.maxBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64(); + break; + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EvidenceParams { + const message = createBaseEvidenceParams(); + message.maxAgeNumBlocks = object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null ? BigInt(object.maxAgeNumBlocks.toString()) : BigInt(0); + message.maxAgeDuration = object.maxAgeDuration !== undefined && object.maxAgeDuration !== null ? Duration.fromPartial(object.maxAgeDuration) : undefined; + message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EvidenceParamsAmino): EvidenceParams { + const message = createBaseEvidenceParams(); + if (object.max_age_num_blocks !== undefined && object.max_age_num_blocks !== null) { + message.maxAgeNumBlocks = BigInt(object.max_age_num_blocks); + } + if (object.max_age_duration !== undefined && object.max_age_duration !== null) { + message.maxAgeDuration = Duration.fromAmino(object.max_age_duration); + } + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + return message; + }, + toAmino(message: EvidenceParams): EvidenceParamsAmino { + const obj: any = {}; + obj.max_age_num_blocks = message.maxAgeNumBlocks !== BigInt(0) ? message.maxAgeNumBlocks.toString() : undefined; + obj.max_age_duration = message.maxAgeDuration ? Duration.toAmino(message.maxAgeDuration) : undefined; + obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EvidenceParamsAminoMsg): EvidenceParams { + return EvidenceParams.fromAmino(object.value); + }, + fromProtoMsg(message: EvidenceParamsProtoMsg): EvidenceParams { + return EvidenceParams.decode(message.value); + }, + toProto(message: EvidenceParams): Uint8Array { + return EvidenceParams.encode(message).finish(); + }, + toProtoMsg(message: EvidenceParams): EvidenceParamsProtoMsg { + return { + typeUrl: "/tendermint.types.EvidenceParams", + value: EvidenceParams.encode(message).finish() + }; + } +}; +function createBaseValidatorParams(): ValidatorParams { + return { + pubKeyTypes: [] + }; +} +export const ValidatorParams = { + typeUrl: "/tendermint.types.ValidatorParams", + encode(message: ValidatorParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pubKeyTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pubKeyTypes?.map(e => e) || []; + return message; + }, + fromAmino(object: ValidatorParamsAmino): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pub_key_types?.map(e => e) || []; + return message; + }, + toAmino(message: ValidatorParams): ValidatorParamsAmino { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pub_key_types = message.pubKeyTypes.map(e => e); + } else { + obj.pub_key_types = message.pubKeyTypes; + } + return obj; + }, + fromAminoMsg(object: ValidatorParamsAminoMsg): ValidatorParams { + return ValidatorParams.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorParamsProtoMsg): ValidatorParams { + return ValidatorParams.decode(message.value); + }, + toProto(message: ValidatorParams): Uint8Array { + return ValidatorParams.encode(message).finish(); + }, + toProtoMsg(message: ValidatorParams): ValidatorParamsProtoMsg { + return { + typeUrl: "/tendermint.types.ValidatorParams", + value: ValidatorParams.encode(message).finish() + }; + } +}; +function createBaseVersionParams(): VersionParams { + return { + appVersion: BigInt(0) + }; +} +export const VersionParams = { + typeUrl: "/tendermint.types.VersionParams", + encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.appVersion !== BigInt(0)) { + writer.uint32(8).uint64(message.appVersion); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersionParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appVersion = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VersionParams { + const message = createBaseVersionParams(); + message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + return message; + }, + fromAmino(object: VersionParamsAmino): VersionParams { + const message = createBaseVersionParams(); + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); + } + return message; + }, + toAmino(message: VersionParams): VersionParamsAmino { + const obj: any = {}; + obj.app_version = message.appVersion !== BigInt(0) ? message.appVersion.toString() : undefined; + return obj; + }, + fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { + return VersionParams.fromAmino(object.value); + }, + fromProtoMsg(message: VersionParamsProtoMsg): VersionParams { + return VersionParams.decode(message.value); + }, + toProto(message: VersionParams): Uint8Array { + return VersionParams.encode(message).finish(); + }, + toProtoMsg(message: VersionParams): VersionParamsProtoMsg { + return { + typeUrl: "/tendermint.types.VersionParams", + value: VersionParams.encode(message).finish() + }; + } +}; +function createBaseHashedParams(): HashedParams { + return { + blockMaxBytes: BigInt(0), + blockMaxGas: BigInt(0) + }; +} +export const HashedParams = { + typeUrl: "/tendermint.types.HashedParams", + encode(message: HashedParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockMaxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.blockMaxBytes); + } + if (message.blockMaxGas !== BigInt(0)) { + writer.uint32(16).int64(message.blockMaxGas); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHashedParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64(); + break; + case 2: + message.blockMaxGas = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HashedParams { + const message = createBaseHashedParams(); + message.blockMaxBytes = object.blockMaxBytes !== undefined && object.blockMaxBytes !== null ? BigInt(object.blockMaxBytes.toString()) : BigInt(0); + message.blockMaxGas = object.blockMaxGas !== undefined && object.blockMaxGas !== null ? BigInt(object.blockMaxGas.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HashedParamsAmino): HashedParams { + const message = createBaseHashedParams(); + if (object.block_max_bytes !== undefined && object.block_max_bytes !== null) { + message.blockMaxBytes = BigInt(object.block_max_bytes); + } + if (object.block_max_gas !== undefined && object.block_max_gas !== null) { + message.blockMaxGas = BigInt(object.block_max_gas); + } + return message; + }, + toAmino(message: HashedParams): HashedParamsAmino { + const obj: any = {}; + obj.block_max_bytes = message.blockMaxBytes !== BigInt(0) ? message.blockMaxBytes.toString() : undefined; + obj.block_max_gas = message.blockMaxGas !== BigInt(0) ? message.blockMaxGas.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HashedParamsAminoMsg): HashedParams { + return HashedParams.fromAmino(object.value); + }, + fromProtoMsg(message: HashedParamsProtoMsg): HashedParams { + return HashedParams.decode(message.value); + }, + toProto(message: HashedParams): Uint8Array { + return HashedParams.encode(message).finish(); + }, + toProtoMsg(message: HashedParams): HashedParamsProtoMsg { + return { + typeUrl: "/tendermint.types.HashedParams", + value: HashedParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/types/types.ts b/dydxjs/packages/dydxjs/src/tendermint/types/types.ts new file mode 100644 index 00000000..817daab8 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/types/types.ts @@ -0,0 +1,1855 @@ +//@ts-nocheck +import { Proof, ProofAmino, ProofSDKType } from "../crypto/proof"; +import { Consensus, ConsensusAmino, ConsensusSDKType } from "../version/types"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "./validator"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../helpers"; +/** BlockIdFlag indicates which BlcokID the signature is for */ +export enum BlockIDFlag { + BLOCK_ID_FLAG_UNKNOWN = 0, + BLOCK_ID_FLAG_ABSENT = 1, + BLOCK_ID_FLAG_COMMIT = 2, + BLOCK_ID_FLAG_NIL = 3, + UNRECOGNIZED = -1, +} +export const BlockIDFlagSDKType = BlockIDFlag; +export const BlockIDFlagAmino = BlockIDFlag; +export function blockIDFlagFromJSON(object: any): BlockIDFlag { + switch (object) { + case 0: + case "BLOCK_ID_FLAG_UNKNOWN": + return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; + case 1: + case "BLOCK_ID_FLAG_ABSENT": + return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; + case 2: + case "BLOCK_ID_FLAG_COMMIT": + return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; + case 3: + case "BLOCK_ID_FLAG_NIL": + return BlockIDFlag.BLOCK_ID_FLAG_NIL; + case -1: + case "UNRECOGNIZED": + default: + return BlockIDFlag.UNRECOGNIZED; + } +} +export function blockIDFlagToJSON(object: BlockIDFlag): string { + switch (object) { + case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: + return "BLOCK_ID_FLAG_UNKNOWN"; + case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: + return "BLOCK_ID_FLAG_ABSENT"; + case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: + return "BLOCK_ID_FLAG_COMMIT"; + case BlockIDFlag.BLOCK_ID_FLAG_NIL: + return "BLOCK_ID_FLAG_NIL"; + case BlockIDFlag.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** SignedMsgType is a type of signed message in the consensus. */ +export enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0, + /** SIGNED_MSG_TYPE_PREVOTE - Votes */ + SIGNED_MSG_TYPE_PREVOTE = 1, + SIGNED_MSG_TYPE_PRECOMMIT = 2, + /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ + SIGNED_MSG_TYPE_PROPOSAL = 32, + UNRECOGNIZED = -1, +} +export const SignedMsgTypeSDKType = SignedMsgType; +export const SignedMsgTypeAmino = SignedMsgType; +export function signedMsgTypeFromJSON(object: any): SignedMsgType { + switch (object) { + case 0: + case "SIGNED_MSG_TYPE_UNKNOWN": + return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; + case 1: + case "SIGNED_MSG_TYPE_PREVOTE": + return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; + case 2: + case "SIGNED_MSG_TYPE_PRECOMMIT": + return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; + case 32: + case "SIGNED_MSG_TYPE_PROPOSAL": + return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; + case -1: + case "UNRECOGNIZED": + default: + return SignedMsgType.UNRECOGNIZED; + } +} +export function signedMsgTypeToJSON(object: SignedMsgType): string { + switch (object) { + case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: + return "SIGNED_MSG_TYPE_UNKNOWN"; + case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: + return "SIGNED_MSG_TYPE_PREVOTE"; + case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: + return "SIGNED_MSG_TYPE_PRECOMMIT"; + case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: + return "SIGNED_MSG_TYPE_PROPOSAL"; + case SignedMsgType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** PartsetHeader */ +export interface PartSetHeader { + total: number; + hash: Uint8Array; +} +export interface PartSetHeaderProtoMsg { + typeUrl: "/tendermint.types.PartSetHeader"; + value: Uint8Array; +} +/** PartsetHeader */ +export interface PartSetHeaderAmino { + total?: number; + hash?: string; +} +export interface PartSetHeaderAminoMsg { + type: "/tendermint.types.PartSetHeader"; + value: PartSetHeaderAmino; +} +/** PartsetHeader */ +export interface PartSetHeaderSDKType { + total: number; + hash: Uint8Array; +} +export interface Part { + index: number; + bytes: Uint8Array; + proof: Proof; +} +export interface PartProtoMsg { + typeUrl: "/tendermint.types.Part"; + value: Uint8Array; +} +export interface PartAmino { + index?: number; + bytes?: string; + proof?: ProofAmino; +} +export interface PartAminoMsg { + type: "/tendermint.types.Part"; + value: PartAmino; +} +export interface PartSDKType { + index: number; + bytes: Uint8Array; + proof: ProofSDKType; +} +/** BlockID */ +export interface BlockID { + hash: Uint8Array; + partSetHeader: PartSetHeader; +} +export interface BlockIDProtoMsg { + typeUrl: "/tendermint.types.BlockID"; + value: Uint8Array; +} +/** BlockID */ +export interface BlockIDAmino { + hash?: string; + part_set_header?: PartSetHeaderAmino; +} +export interface BlockIDAminoMsg { + type: "/tendermint.types.BlockID"; + value: BlockIDAmino; +} +/** BlockID */ +export interface BlockIDSDKType { + hash: Uint8Array; + part_set_header: PartSetHeaderSDKType; +} +/** Header defines the structure of a Tendermint block header. */ +export interface Header { + /** basic block info */ + version: Consensus; + chainId: string; + height: bigint; + time: Date; + /** prev block info */ + lastBlockId: BlockID; + /** hashes of block data */ + lastCommitHash: Uint8Array; + /** transactions */ + dataHash: Uint8Array; + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array; + /** validators for the next block */ + nextValidatorsHash: Uint8Array; + /** consensus params for current block */ + consensusHash: Uint8Array; + /** state after txs from the previous block */ + appHash: Uint8Array; + /** root hash of all results from the txs from the previous block */ + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** original proposer of the block */ + proposerAddress: Uint8Array; +} +export interface HeaderProtoMsg { + typeUrl: "/tendermint.types.Header"; + value: Uint8Array; +} +/** Header defines the structure of a Tendermint block header. */ +export interface HeaderAmino { + /** basic block info */ + version?: ConsensusAmino; + chain_id?: string; + height?: string; + time?: string; + /** prev block info */ + last_block_id?: BlockIDAmino; + /** hashes of block data */ + last_commit_hash?: string; + /** transactions */ + data_hash?: string; + /** hashes from the app output from the prev block */ + validators_hash?: string; + /** validators for the next block */ + next_validators_hash?: string; + /** consensus params for current block */ + consensus_hash?: string; + /** state after txs from the previous block */ + app_hash?: string; + /** root hash of all results from the txs from the previous block */ + last_results_hash?: string; + /** consensus info */ + evidence_hash?: string; + /** original proposer of the block */ + proposer_address?: string; +} +export interface HeaderAminoMsg { + type: "/tendermint.types.Header"; + value: HeaderAmino; +} +/** Header defines the structure of a Tendermint block header. */ +export interface HeaderSDKType { + version: ConsensusSDKType; + chain_id: string; + height: bigint; + time: Date; + last_block_id: BlockIDSDKType; + last_commit_hash: Uint8Array; + data_hash: Uint8Array; + validators_hash: Uint8Array; + next_validators_hash: Uint8Array; + consensus_hash: Uint8Array; + app_hash: Uint8Array; + last_results_hash: Uint8Array; + evidence_hash: Uint8Array; + proposer_address: Uint8Array; +} +/** Data contains the set of transactions included in the block */ +export interface Data { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs: Uint8Array[]; +} +export interface DataProtoMsg { + typeUrl: "/tendermint.types.Data"; + value: Uint8Array; +} +/** Data contains the set of transactions included in the block */ +export interface DataAmino { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs?: string[]; +} +export interface DataAminoMsg { + type: "/tendermint.types.Data"; + value: DataAmino; +} +/** Data contains the set of transactions included in the block */ +export interface DataSDKType { + txs: Uint8Array[]; +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface Vote { + type: SignedMsgType; + height: bigint; + round: number; + /** zero if vote is nil. */ + blockId: BlockID; + timestamp: Date; + validatorAddress: Uint8Array; + validatorIndex: number; + signature: Uint8Array; +} +export interface VoteProtoMsg { + typeUrl: "/tendermint.types.Vote"; + value: Uint8Array; +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface VoteAmino { + type?: SignedMsgType; + height?: string; + round?: number; + /** zero if vote is nil. */ + block_id?: BlockIDAmino; + timestamp?: string; + validator_address?: string; + validator_index?: number; + signature?: string; +} +export interface VoteAminoMsg { + type: "/tendermint.types.Vote"; + value: VoteAmino; +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface VoteSDKType { + type: SignedMsgType; + height: bigint; + round: number; + block_id: BlockIDSDKType; + timestamp: Date; + validator_address: Uint8Array; + validator_index: number; + signature: Uint8Array; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface Commit { + height: bigint; + round: number; + blockId: BlockID; + signatures: CommitSig[]; +} +export interface CommitProtoMsg { + typeUrl: "/tendermint.types.Commit"; + value: Uint8Array; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface CommitAmino { + height?: string; + round?: number; + block_id?: BlockIDAmino; + signatures?: CommitSigAmino[]; +} +export interface CommitAminoMsg { + type: "/tendermint.types.Commit"; + value: CommitAmino; +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface CommitSDKType { + height: bigint; + round: number; + block_id: BlockIDSDKType; + signatures: CommitSigSDKType[]; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSig { + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; + timestamp: Date; + signature: Uint8Array; +} +export interface CommitSigProtoMsg { + typeUrl: "/tendermint.types.CommitSig"; + value: Uint8Array; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSigAmino { + block_id_flag?: BlockIDFlag; + validator_address?: string; + timestamp?: string; + signature?: string; +} +export interface CommitSigAminoMsg { + type: "/tendermint.types.CommitSig"; + value: CommitSigAmino; +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSigSDKType { + block_id_flag: BlockIDFlag; + validator_address: Uint8Array; + timestamp: Date; + signature: Uint8Array; +} +export interface Proposal { + type: SignedMsgType; + height: bigint; + round: number; + polRound: number; + blockId: BlockID; + timestamp: Date; + signature: Uint8Array; +} +export interface ProposalProtoMsg { + typeUrl: "/tendermint.types.Proposal"; + value: Uint8Array; +} +export interface ProposalAmino { + type?: SignedMsgType; + height?: string; + round?: number; + pol_round?: number; + block_id?: BlockIDAmino; + timestamp?: string; + signature?: string; +} +export interface ProposalAminoMsg { + type: "/tendermint.types.Proposal"; + value: ProposalAmino; +} +export interface ProposalSDKType { + type: SignedMsgType; + height: bigint; + round: number; + pol_round: number; + block_id: BlockIDSDKType; + timestamp: Date; + signature: Uint8Array; +} +export interface SignedHeader { + header?: Header; + commit?: Commit; +} +export interface SignedHeaderProtoMsg { + typeUrl: "/tendermint.types.SignedHeader"; + value: Uint8Array; +} +export interface SignedHeaderAmino { + header?: HeaderAmino; + commit?: CommitAmino; +} +export interface SignedHeaderAminoMsg { + type: "/tendermint.types.SignedHeader"; + value: SignedHeaderAmino; +} +export interface SignedHeaderSDKType { + header?: HeaderSDKType; + commit?: CommitSDKType; +} +export interface LightBlock { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; +} +export interface LightBlockProtoMsg { + typeUrl: "/tendermint.types.LightBlock"; + value: Uint8Array; +} +export interface LightBlockAmino { + signed_header?: SignedHeaderAmino; + validator_set?: ValidatorSetAmino; +} +export interface LightBlockAminoMsg { + type: "/tendermint.types.LightBlock"; + value: LightBlockAmino; +} +export interface LightBlockSDKType { + signed_header?: SignedHeaderSDKType; + validator_set?: ValidatorSetSDKType; +} +export interface BlockMeta { + blockId: BlockID; + blockSize: bigint; + header: Header; + numTxs: bigint; +} +export interface BlockMetaProtoMsg { + typeUrl: "/tendermint.types.BlockMeta"; + value: Uint8Array; +} +export interface BlockMetaAmino { + block_id?: BlockIDAmino; + block_size?: string; + header?: HeaderAmino; + num_txs?: string; +} +export interface BlockMetaAminoMsg { + type: "/tendermint.types.BlockMeta"; + value: BlockMetaAmino; +} +export interface BlockMetaSDKType { + block_id: BlockIDSDKType; + block_size: bigint; + header: HeaderSDKType; + num_txs: bigint; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProof { + rootHash: Uint8Array; + data: Uint8Array; + proof?: Proof; +} +export interface TxProofProtoMsg { + typeUrl: "/tendermint.types.TxProof"; + value: Uint8Array; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProofAmino { + root_hash?: string; + data?: string; + proof?: ProofAmino; +} +export interface TxProofAminoMsg { + type: "/tendermint.types.TxProof"; + value: TxProofAmino; +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProofSDKType { + root_hash: Uint8Array; + data: Uint8Array; + proof?: ProofSDKType; +} +function createBasePartSetHeader(): PartSetHeader { + return { + total: 0, + hash: new Uint8Array() + }; +} +export const PartSetHeader = { + typeUrl: "/tendermint.types.PartSetHeader", + encode(message: PartSetHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== 0) { + writer.uint32(8).uint32(message.total); + } + if (message.hash.length !== 0) { + writer.uint32(18).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePartSetHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PartSetHeader { + const message = createBasePartSetHeader(); + message.total = object.total ?? 0; + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: PartSetHeaderAmino): PartSetHeader { + const message = createBasePartSetHeader(); + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: PartSetHeader): PartSetHeaderAmino { + const obj: any = {}; + obj.total = message.total === 0 ? undefined : message.total; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { + return PartSetHeader.fromAmino(object.value); + }, + fromProtoMsg(message: PartSetHeaderProtoMsg): PartSetHeader { + return PartSetHeader.decode(message.value); + }, + toProto(message: PartSetHeader): Uint8Array { + return PartSetHeader.encode(message).finish(); + }, + toProtoMsg(message: PartSetHeader): PartSetHeaderProtoMsg { + return { + typeUrl: "/tendermint.types.PartSetHeader", + value: PartSetHeader.encode(message).finish() + }; + } +}; +function createBasePart(): Part { + return { + index: 0, + bytes: new Uint8Array(), + proof: Proof.fromPartial({}) + }; +} +export const Part = { + typeUrl: "/tendermint.types.Part", + encode(message: Part, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.bytes.length !== 0) { + writer.uint32(18).bytes(message.bytes); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Part { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Part { + const message = createBasePart(); + message.index = object.index ?? 0; + message.bytes = object.bytes ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: PartAmino): Part { + const message = createBasePart(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: Part): PartAmino { + const obj: any = {}; + obj.index = message.index === 0 ? undefined : message.index; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: PartAminoMsg): Part { + return Part.fromAmino(object.value); + }, + fromProtoMsg(message: PartProtoMsg): Part { + return Part.decode(message.value); + }, + toProto(message: Part): Uint8Array { + return Part.encode(message).finish(); + }, + toProtoMsg(message: Part): PartProtoMsg { + return { + typeUrl: "/tendermint.types.Part", + value: Part.encode(message).finish() + }; + } +}; +function createBaseBlockID(): BlockID { + return { + hash: new Uint8Array(), + partSetHeader: PartSetHeader.fromPartial({}) + }; +} +export const BlockID = { + typeUrl: "/tendermint.types.BlockID", + encode(message: BlockID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockID { + const message = createBaseBlockID(); + message.hash = object.hash ?? new Uint8Array(); + message.partSetHeader = object.partSetHeader !== undefined && object.partSetHeader !== null ? PartSetHeader.fromPartial(object.partSetHeader) : undefined; + return message; + }, + fromAmino(object: BlockIDAmino): BlockID { + const message = createBaseBlockID(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.part_set_header !== undefined && object.part_set_header !== null) { + message.partSetHeader = PartSetHeader.fromAmino(object.part_set_header); + } + return message; + }, + toAmino(message: BlockID): BlockIDAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.part_set_header = message.partSetHeader ? PartSetHeader.toAmino(message.partSetHeader) : undefined; + return obj; + }, + fromAminoMsg(object: BlockIDAminoMsg): BlockID { + return BlockID.fromAmino(object.value); + }, + fromProtoMsg(message: BlockIDProtoMsg): BlockID { + return BlockID.decode(message.value); + }, + toProto(message: BlockID): Uint8Array { + return BlockID.encode(message).finish(); + }, + toProtoMsg(message: BlockID): BlockIDProtoMsg { + return { + typeUrl: "/tendermint.types.BlockID", + value: BlockID.encode(message).finish() + }; + } +}; +function createBaseHeader(): Header { + return { + version: Consensus.fromPartial({}), + chainId: "", + height: BigInt(0), + time: new Date(), + lastBlockId: BlockID.fromPartial({}), + lastCommitHash: new Uint8Array(), + dataHash: new Uint8Array(), + validatorsHash: new Uint8Array(), + nextValidatorsHash: new Uint8Array(), + consensusHash: new Uint8Array(), + appHash: new Uint8Array(), + lastResultsHash: new Uint8Array(), + evidenceHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const Header = { + typeUrl: "/tendermint.types.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== undefined) { + Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); + } + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash); + } + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash); + } + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash); + } + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash); + } + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash); + } + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash); + } + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(114).bytes(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.lastBlockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial
): Header { + const message = createBaseHeader(); + message.version = object.version !== undefined && object.version !== null ? Consensus.fromPartial(object.version) : undefined; + message.chainId = object.chainId ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.lastBlockId = object.lastBlockId !== undefined && object.lastBlockId !== null ? BlockID.fromPartial(object.lastBlockId) : undefined; + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); + message.dataHash = object.dataHash ?? new Uint8Array(); + message.validatorsHash = object.validatorsHash ?? new Uint8Array(); + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.consensusHash = object.consensusHash ?? new Uint8Array(); + message.appHash = object.appHash ?? new Uint8Array(); + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(); + message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, + fromAmino(object: HeaderAmino): Header { + const message = createBaseHeader(); + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromAmino(object.version); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.last_block_id !== undefined && object.last_block_id !== null) { + message.lastBlockId = BlockID.fromAmino(object.last_block_id); + } + if (object.last_commit_hash !== undefined && object.last_commit_hash !== null) { + message.lastCommitHash = bytesFromBase64(object.last_commit_hash); + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.validators_hash !== undefined && object.validators_hash !== null) { + message.validatorsHash = bytesFromBase64(object.validators_hash); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.consensus_hash !== undefined && object.consensus_hash !== null) { + message.consensusHash = bytesFromBase64(object.consensus_hash); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + if (object.last_results_hash !== undefined && object.last_results_hash !== null) { + message.lastResultsHash = bytesFromBase64(object.last_results_hash); + } + if (object.evidence_hash !== undefined && object.evidence_hash !== null) { + message.evidenceHash = bytesFromBase64(object.evidence_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.version = message.version ? Consensus.toAmino(message.version) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; + obj.last_commit_hash = message.lastCommitHash ? base64FromBytes(message.lastCommitHash) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.validators_hash = message.validatorsHash ? base64FromBytes(message.validatorsHash) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.consensus_hash = message.consensusHash ? base64FromBytes(message.consensusHash) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.last_results_hash = message.lastResultsHash ? base64FromBytes(message.lastResultsHash) : undefined; + obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/tendermint.types.Header", + value: Header.encode(message).finish() + }; + } +}; +function createBaseData(): Data { + return { + txs: [] + }; +} +export const Data = { + typeUrl: "/tendermint.types.Data", + encode(message: Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Data { + const message = createBaseData(); + message.txs = object.txs?.map(e => e) || []; + return message; + }, + fromAmino(object: DataAmino): Data { + const message = createBaseData(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Data): DataAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + return obj; + }, + fromAminoMsg(object: DataAminoMsg): Data { + return Data.fromAmino(object.value); + }, + fromProtoMsg(message: DataProtoMsg): Data { + return Data.decode(message.value); + }, + toProto(message: Data): Uint8Array { + return Data.encode(message).finish(); + }, + toProtoMsg(message: Data): DataProtoMsg { + return { + typeUrl: "/tendermint.types.Data", + value: Data.encode(message).finish() + }; + } +}; +function createBaseVote(): Vote { + return { + type: 0, + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + timestamp: new Date(), + validatorAddress: new Uint8Array(), + validatorIndex: 0, + signature: new Uint8Array() + }; +} +export const Vote = { + typeUrl: "/tendermint.types.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress); + } + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex); + } + if (message.signature.length !== 0) { + writer.uint32(66).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + case 8: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote(); + message.type = object.type ?? 0; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.round = object.round ?? 0; + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.timestamp = object.timestamp ?? undefined; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.validatorIndex = object.validatorIndex ?? 0; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: VoteAmino): Vote { + const message = createBaseVote(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.validator_index !== undefined && object.validator_index !== null) { + message.validatorIndex = object.validator_index; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: Vote): VoteAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; + obj.validator_index = message.validatorIndex === 0 ? undefined : message.validatorIndex; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value); + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/tendermint.types.Vote", + value: Vote.encode(message).finish() + }; + } +}; +function createBaseCommit(): Commit { + return { + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + signatures: [] + }; +} +export const Commit = { + typeUrl: "/tendermint.types.Commit", + encode(message: Commit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(16).int32(message.round); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.signatures) { + CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.round = reader.int32(); + break; + case 3: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 4: + message.signatures.push(CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Commit { + const message = createBaseCommit(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.round = object.round ?? 0; + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.signatures = object.signatures?.map(e => CommitSig.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CommitAmino): Commit { + const message = createBaseCommit(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + message.signatures = object.signatures?.map(e => CommitSig.fromAmino(e)) || []; + return message; + }, + toAmino(message: Commit): CommitAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? CommitSig.toAmino(e) : undefined); + } else { + obj.signatures = message.signatures; + } + return obj; + }, + fromAminoMsg(object: CommitAminoMsg): Commit { + return Commit.fromAmino(object.value); + }, + fromProtoMsg(message: CommitProtoMsg): Commit { + return Commit.decode(message.value); + }, + toProto(message: Commit): Uint8Array { + return Commit.encode(message).finish(); + }, + toProtoMsg(message: Commit): CommitProtoMsg { + return { + typeUrl: "/tendermint.types.Commit", + value: Commit.encode(message).finish() + }; + } +}; +function createBaseCommitSig(): CommitSig { + return { + blockIdFlag: 0, + validatorAddress: new Uint8Array(), + timestamp: new Date(), + signature: new Uint8Array() + }; +} +export const CommitSig = { + typeUrl: "/tendermint.types.CommitSig", + encode(message: CommitSig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockIdFlag !== 0) { + writer.uint32(8).int32(message.blockIdFlag); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); + } + if (message.signature.length !== 0) { + writer.uint32(34).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitSig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockIdFlag = reader.int32() as any; + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommitSig { + const message = createBaseCommitSig(); + message.blockIdFlag = object.blockIdFlag ?? 0; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: CommitSigAmino): CommitSig { + const message = createBaseCommitSig(); + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = object.block_id_flag; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: CommitSig): CommitSigAmino { + const obj: any = {}; + obj.block_id_flag = message.blockIdFlag === 0 ? undefined : message.blockIdFlag; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: CommitSigAminoMsg): CommitSig { + return CommitSig.fromAmino(object.value); + }, + fromProtoMsg(message: CommitSigProtoMsg): CommitSig { + return CommitSig.decode(message.value); + }, + toProto(message: CommitSig): Uint8Array { + return CommitSig.encode(message).finish(); + }, + toProtoMsg(message: CommitSig): CommitSigProtoMsg { + return { + typeUrl: "/tendermint.types.CommitSig", + value: CommitSig.encode(message).finish() + }; + } +}; +function createBaseProposal(): Proposal { + return { + type: 0, + height: BigInt(0), + round: 0, + polRound: 0, + blockId: BlockID.fromPartial({}), + timestamp: new Date(), + signature: new Uint8Array() + }; +} +export const Proposal = { + typeUrl: "/tendermint.types.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); + } + if (message.signature.length !== 0) { + writer.uint32(58).bytes(message.signature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Proposal { + const message = createBaseProposal(); + message.type = object.type ?? 0; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.round = object.round ?? 0; + message.polRound = object.polRound ?? 0; + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.pol_round !== undefined && object.pol_round !== null) { + message.polRound = object.pol_round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.type = message.type === 0 ? undefined : message.type; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + obj.pol_round = message.polRound === 0 ? undefined : message.polRound; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/tendermint.types.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +function createBaseSignedHeader(): SignedHeader { + return { + header: undefined, + commit: undefined + }; +} +export const SignedHeader = { + typeUrl: "/tendermint.types.SignedHeader", + encode(message: SignedHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.commit !== undefined) { + Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignedHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignedHeader { + const message = createBaseSignedHeader(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.commit = object.commit !== undefined && object.commit !== null ? Commit.fromPartial(object.commit) : undefined; + return message; + }, + fromAmino(object: SignedHeaderAmino): SignedHeader { + const message = createBaseSignedHeader(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromAmino(object.commit); + } + return message; + }, + toAmino(message: SignedHeader): SignedHeaderAmino { + const obj: any = {}; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.commit = message.commit ? Commit.toAmino(message.commit) : undefined; + return obj; + }, + fromAminoMsg(object: SignedHeaderAminoMsg): SignedHeader { + return SignedHeader.fromAmino(object.value); + }, + fromProtoMsg(message: SignedHeaderProtoMsg): SignedHeader { + return SignedHeader.decode(message.value); + }, + toProto(message: SignedHeader): Uint8Array { + return SignedHeader.encode(message).finish(); + }, + toProtoMsg(message: SignedHeader): SignedHeaderProtoMsg { + return { + typeUrl: "/tendermint.types.SignedHeader", + value: SignedHeader.encode(message).finish() + }; + } +}; +function createBaseLightBlock(): LightBlock { + return { + signedHeader: undefined, + validatorSet: undefined + }; +} +export const LightBlock = { + typeUrl: "/tendermint.types.LightBlock", + encode(message: LightBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLightBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LightBlock { + const message = createBaseLightBlock(); + message.signedHeader = object.signedHeader !== undefined && object.signedHeader !== null ? SignedHeader.fromPartial(object.signedHeader) : undefined; + message.validatorSet = object.validatorSet !== undefined && object.validatorSet !== null ? ValidatorSet.fromPartial(object.validatorSet) : undefined; + return message; + }, + fromAmino(object: LightBlockAmino): LightBlock { + const message = createBaseLightBlock(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + return message; + }, + toAmino(message: LightBlock): LightBlockAmino { + const obj: any = {}; + obj.signed_header = message.signedHeader ? SignedHeader.toAmino(message.signedHeader) : undefined; + obj.validator_set = message.validatorSet ? ValidatorSet.toAmino(message.validatorSet) : undefined; + return obj; + }, + fromAminoMsg(object: LightBlockAminoMsg): LightBlock { + return LightBlock.fromAmino(object.value); + }, + fromProtoMsg(message: LightBlockProtoMsg): LightBlock { + return LightBlock.decode(message.value); + }, + toProto(message: LightBlock): Uint8Array { + return LightBlock.encode(message).finish(); + }, + toProtoMsg(message: LightBlock): LightBlockProtoMsg { + return { + typeUrl: "/tendermint.types.LightBlock", + value: LightBlock.encode(message).finish() + }; + } +}; +function createBaseBlockMeta(): BlockMeta { + return { + blockId: BlockID.fromPartial({}), + blockSize: BigInt(0), + header: Header.fromPartial({}), + numTxs: BigInt(0) + }; +} +export const BlockMeta = { + typeUrl: "/tendermint.types.BlockMeta", + encode(message: BlockMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + } + if (message.blockSize !== BigInt(0)) { + writer.uint32(16).int64(message.blockSize); + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(26).fork()).ldelim(); + } + if (message.numTxs !== BigInt(0)) { + writer.uint32(32).int64(message.numTxs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockMeta(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64(); + break; + case 3: + message.header = Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockMeta { + const message = createBaseBlockMeta(); + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.blockSize = object.blockSize !== undefined && object.blockSize !== null ? BigInt(object.blockSize.toString()) : BigInt(0); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.numTxs = object.numTxs !== undefined && object.numTxs !== null ? BigInt(object.numTxs.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BlockMetaAmino): BlockMeta { + const message = createBaseBlockMeta(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block_size !== undefined && object.block_size !== null) { + message.blockSize = BigInt(object.block_size); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.num_txs !== undefined && object.num_txs !== null) { + message.numTxs = BigInt(object.num_txs); + } + return message; + }, + toAmino(message: BlockMeta): BlockMetaAmino { + const obj: any = {}; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block_size = message.blockSize !== BigInt(0) ? message.blockSize.toString() : undefined; + obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.num_txs = message.numTxs !== BigInt(0) ? message.numTxs.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BlockMetaAminoMsg): BlockMeta { + return BlockMeta.fromAmino(object.value); + }, + fromProtoMsg(message: BlockMetaProtoMsg): BlockMeta { + return BlockMeta.decode(message.value); + }, + toProto(message: BlockMeta): Uint8Array { + return BlockMeta.encode(message).finish(); + }, + toProtoMsg(message: BlockMeta): BlockMetaProtoMsg { + return { + typeUrl: "/tendermint.types.BlockMeta", + value: BlockMeta.encode(message).finish() + }; + } +}; +function createBaseTxProof(): TxProof { + return { + rootHash: new Uint8Array(), + data: new Uint8Array(), + proof: undefined + }; +} +export const TxProof = { + typeUrl: "/tendermint.types.TxProof", + encode(message: TxProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rootHash.length !== 0) { + writer.uint32(10).bytes(message.rootHash); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxProof { + const message = createBaseTxProof(); + message.rootHash = object.rootHash ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + message.proof = object.proof !== undefined && object.proof !== null ? Proof.fromPartial(object.proof) : undefined; + return message; + }, + fromAmino(object: TxProofAmino): TxProof { + const message = createBaseTxProof(); + if (object.root_hash !== undefined && object.root_hash !== null) { + message.rootHash = bytesFromBase64(object.root_hash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; + }, + toAmino(message: TxProof): TxProofAmino { + const obj: any = {}; + obj.root_hash = message.rootHash ? base64FromBytes(message.rootHash) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; + return obj; + }, + fromAminoMsg(object: TxProofAminoMsg): TxProof { + return TxProof.fromAmino(object.value); + }, + fromProtoMsg(message: TxProofProtoMsg): TxProof { + return TxProof.decode(message.value); + }, + toProto(message: TxProof): Uint8Array { + return TxProof.encode(message).finish(); + }, + toProtoMsg(message: TxProof): TxProofProtoMsg { + return { + typeUrl: "/tendermint.types.TxProof", + value: TxProof.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/types/validator.ts b/dydxjs/packages/dydxjs/src/tendermint/types/validator.ts new file mode 100644 index 00000000..0907fd74 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/types/validator.ts @@ -0,0 +1,336 @@ +//@ts-nocheck +import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +export interface ValidatorSet { + validators: Validator[]; + proposer?: Validator; + totalVotingPower: bigint; +} +export interface ValidatorSetProtoMsg { + typeUrl: "/tendermint.types.ValidatorSet"; + value: Uint8Array; +} +export interface ValidatorSetAmino { + validators?: ValidatorAmino[]; + proposer?: ValidatorAmino; + total_voting_power?: string; +} +export interface ValidatorSetAminoMsg { + type: "/tendermint.types.ValidatorSet"; + value: ValidatorSetAmino; +} +export interface ValidatorSetSDKType { + validators: ValidatorSDKType[]; + proposer?: ValidatorSDKType; + total_voting_power: bigint; +} +export interface Validator { + address: Uint8Array; + pubKey: PublicKey; + votingPower: bigint; + proposerPriority: bigint; +} +export interface ValidatorProtoMsg { + typeUrl: "/tendermint.types.Validator"; + value: Uint8Array; +} +export interface ValidatorAmino { + address?: string; + pub_key?: PublicKeyAmino; + voting_power?: string; + proposer_priority?: string; +} +export interface ValidatorAminoMsg { + type: "/tendermint.types.Validator"; + value: ValidatorAmino; +} +export interface ValidatorSDKType { + address: Uint8Array; + pub_key: PublicKeySDKType; + voting_power: bigint; + proposer_priority: bigint; +} +export interface SimpleValidator { + pubKey?: PublicKey; + votingPower: bigint; +} +export interface SimpleValidatorProtoMsg { + typeUrl: "/tendermint.types.SimpleValidator"; + value: Uint8Array; +} +export interface SimpleValidatorAmino { + pub_key?: PublicKeyAmino; + voting_power?: string; +} +export interface SimpleValidatorAminoMsg { + type: "/tendermint.types.SimpleValidator"; + value: SimpleValidatorAmino; +} +export interface SimpleValidatorSDKType { + pub_key?: PublicKeySDKType; + voting_power: bigint; +} +function createBaseValidatorSet(): ValidatorSet { + return { + validators: [], + proposer: undefined, + totalVotingPower: BigInt(0) + }; +} +export const ValidatorSet = { + typeUrl: "/tendermint.types.ValidatorSet", + encode(message: ValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.proposer !== undefined) { + Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(24).int64(message.totalVotingPower); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.proposer = object.proposer !== undefined && object.proposer !== null ? Validator.fromPartial(object.proposer) : undefined; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorSetAmino): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromAmino(object.proposer); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; + }, + toAmino(message: ValidatorSet): ValidatorSetAmino { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); + } else { + obj.validators = message.validators; + } + obj.proposer = message.proposer ? Validator.toAmino(message.proposer) : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorSetAminoMsg): ValidatorSet { + return ValidatorSet.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorSetProtoMsg): ValidatorSet { + return ValidatorSet.decode(message.value); + }, + toProto(message: ValidatorSet): Uint8Array { + return ValidatorSet.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSet): ValidatorSetProtoMsg { + return { + typeUrl: "/tendermint.types.ValidatorSet", + value: ValidatorSet.encode(message).finish() + }; + } +}; +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + pubKey: PublicKey.fromPartial({}), + votingPower: BigInt(0), + proposerPriority: BigInt(0) + }; +} +export const Validator = { + typeUrl: "/tendermint.types.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(24).int64(message.votingPower); + } + if (message.proposerPriority !== BigInt(0)) { + writer.uint32(32).int64(message.proposerPriority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64(); + break; + case 4: + message.proposerPriority = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? BigInt(object.proposerPriority.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + if (object.proposer_priority !== undefined && object.proposer_priority !== null) { + message.proposerPriority = BigInt(object.proposer_priority); + } + return message; + }, + toAmino(message: Validator): ValidatorAmino { + const obj: any = {}; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower.toString() : undefined; + obj.proposer_priority = message.proposerPriority !== BigInt(0) ? message.proposerPriority.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/tendermint.types.Validator", + value: Validator.encode(message).finish() + }; + } +}; +function createBaseSimpleValidator(): SimpleValidator { + return { + pubKey: undefined, + votingPower: BigInt(0) + }; +} +export const SimpleValidator = { + typeUrl: "/tendermint.types.SimpleValidator", + encode(message: SimpleValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(16).int64(message.votingPower); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSimpleValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SimpleValidator { + const message = createBaseSimpleValidator(); + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SimpleValidatorAmino): SimpleValidator { + const message = createBaseSimpleValidator(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + return message; + }, + toAmino(message: SimpleValidator): SimpleValidatorAmino { + const obj: any = {}; + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SimpleValidatorAminoMsg): SimpleValidator { + return SimpleValidator.fromAmino(object.value); + }, + fromProtoMsg(message: SimpleValidatorProtoMsg): SimpleValidator { + return SimpleValidator.decode(message.value); + }, + toProto(message: SimpleValidator): Uint8Array { + return SimpleValidator.encode(message).finish(); + }, + toProtoMsg(message: SimpleValidator): SimpleValidatorProtoMsg { + return { + typeUrl: "/tendermint.types.SimpleValidator", + value: SimpleValidator.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/tendermint/version/types.ts b/dydxjs/packages/dydxjs/src/tendermint/version/types.ts new file mode 100644 index 00000000..f862a449 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/tendermint/version/types.ts @@ -0,0 +1,222 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface App { + protocol: bigint; + software: string; +} +export interface AppProtoMsg { + typeUrl: "/tendermint.version.App"; + value: Uint8Array; +} +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface AppAmino { + protocol?: string; + software?: string; +} +export interface AppAminoMsg { + type: "/tendermint.version.App"; + value: AppAmino; +} +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface AppSDKType { + protocol: bigint; + software: string; +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface Consensus { + block: bigint; + app: bigint; +} +export interface ConsensusProtoMsg { + typeUrl: "/tendermint.version.Consensus"; + value: Uint8Array; +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface ConsensusAmino { + block?: string; + app?: string; +} +export interface ConsensusAminoMsg { + type: "/tendermint.version.Consensus"; + value: ConsensusAmino; +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface ConsensusSDKType { + block: bigint; + app: bigint; +} +function createBaseApp(): App { + return { + protocol: BigInt(0), + software: "" + }; +} +export const App = { + typeUrl: "/tendermint.version.App", + encode(message: App, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.protocol !== BigInt(0)) { + writer.uint32(8).uint64(message.protocol); + } + if (message.software !== "") { + writer.uint32(18).string(message.software); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): App { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64(); + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): App { + const message = createBaseApp(); + message.protocol = object.protocol !== undefined && object.protocol !== null ? BigInt(object.protocol.toString()) : BigInt(0); + message.software = object.software ?? ""; + return message; + }, + fromAmino(object: AppAmino): App { + const message = createBaseApp(); + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = BigInt(object.protocol); + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } + return message; + }, + toAmino(message: App): AppAmino { + const obj: any = {}; + obj.protocol = message.protocol !== BigInt(0) ? message.protocol.toString() : undefined; + obj.software = message.software === "" ? undefined : message.software; + return obj; + }, + fromAminoMsg(object: AppAminoMsg): App { + return App.fromAmino(object.value); + }, + fromProtoMsg(message: AppProtoMsg): App { + return App.decode(message.value); + }, + toProto(message: App): Uint8Array { + return App.encode(message).finish(); + }, + toProtoMsg(message: App): AppProtoMsg { + return { + typeUrl: "/tendermint.version.App", + value: App.encode(message).finish() + }; + } +}; +function createBaseConsensus(): Consensus { + return { + block: BigInt(0), + app: BigInt(0) + }; +} +export const Consensus = { + typeUrl: "/tendermint.version.Consensus", + encode(message: Consensus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== BigInt(0)) { + writer.uint32(8).uint64(message.block); + } + if (message.app !== BigInt(0)) { + writer.uint32(16).uint64(message.app); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Consensus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64(); + break; + case 2: + message.app = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Consensus { + const message = createBaseConsensus(); + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConsensusAmino): Consensus { + const message = createBaseConsensus(); + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; + }, + toAmino(message: Consensus): ConsensusAmino { + const obj: any = {}; + obj.block = message.block !== BigInt(0) ? message.block.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusAminoMsg): Consensus { + return Consensus.fromAmino(object.value); + }, + fromProtoMsg(message: ConsensusProtoMsg): Consensus { + return Consensus.decode(message.value); + }, + toProto(message: Consensus): Uint8Array { + return Consensus.encode(message).finish(); + }, + toProtoMsg(message: Consensus): ConsensusProtoMsg { + return { + typeUrl: "/tendermint.version.Consensus", + value: Consensus.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/dydxjs/packages/dydxjs/src/utf8.ts b/dydxjs/packages/dydxjs/src/utf8.ts new file mode 100644 index 00000000..a6cb1157 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/utf8.ts @@ -0,0 +1,149 @@ +//@ts-nocheck +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"use strict"; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function utf8Length(str: string) { + let len = 0, + c = 0; + for (let i = 0; i < str.length; ++i) { + c = str.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ( + (c & 0xfc00) === 0xd800 && + (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i; + len += 4; + } else len += 3; + } + return len; +} + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function utf8Read( + buffer: ArrayLike, + start: number, + end: number +) { + const len = end - start; + if (len < 1) return ""; + const chunk = []; + let parts: string[] = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63); + else if (t > 239 && t < 365) { + t = + (((t & 7) << 18) | + ((buffer[start++] & 63) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63)) - + 0x10000; + chunk[i++] = 0xd800 + (t >> 10); + chunk[i++] = 0xdc00 + (t & 1023); + } else + chunk[i++] = + ((t & 15) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63); + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode(...chunk)); + i = 0; + } + } + if (parts) { + if (i) parts.push(String.fromCharCode(...chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode(...chunk.slice(0, i)); +} + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function utf8Write( + str: string, + buffer: Uint8Array | Array, + offset: number +) { + const start = offset; + let c1, // character 1 + c2; // character 2 + for (let i = 0; i < str.length; ++i) { + c1 = str.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return offset - start; +} diff --git a/dydxjs/packages/dydxjs/src/varint.ts b/dydxjs/packages/dydxjs/src/varint.ts new file mode 100644 index 00000000..74ed54b1 --- /dev/null +++ b/dydxjs/packages/dydxjs/src/varint.ts @@ -0,0 +1,489 @@ +//@ts-nocheck +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */ + +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read(this: ReaderLike): [number, number] { + let lowBits = 0; + let highBits = 0; + + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + let middleByte = this.buf[this.pos++]; + + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + throw new Error("invalid varint"); +} + +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo: number, hi: number, bytes: number[]): void { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + + if (!hasMoreBits) { + return; + } + + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + bytes.push((hi >>> 31) & 0x01); +} + +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; + +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec: string): { lo: number; hi: number } { + // Check for minus sign. + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + + function add1e6digit(begin: number, end?: number) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} + +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo: number, hi: number): string { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} + +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo: number, hi: number): string { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return ( + digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA) + ); +} + +function toUnsigned(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} + +function newBits(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo | 0, hi: hi | 0 }; +} + +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits: number, highBits: number) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} + +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7: number) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}; + +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value: number, bytes: number[]): void { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} + +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read(this: ReaderLike): number { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + + if ((b & 0x80) != 0) throw new Error("invalid varint"); + + this.assertBounds(); + + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} + +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; + +/** + * encode zig zag + */ +export function zzEncode(lo: number, hi: number) { + let mask = hi >> 31; + hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0; + lo = ((lo << 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * decode zig zag + */ +export function zzDecode(lo: number, hi: number) { + let mask = -(lo & 1); + lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0; + hi = ((hi >>> 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * unsigned int32 without moving pos. + */ +export function readUInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + buf[pos + 3] * 0x1000000 + ); +} + +/** + * signed int32 without moving pos. + */ +export function readInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + (buf[pos + 3] << 24) + ); +} + +/** + * writing varint32 to pos + */ +export function writeVarint32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + while (val > 127) { + buf[pos++] = (val & 127) | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * writing varint64 to pos + */ +export function writeVarint64( + val: { lo: number; hi: number }, + buf: Uint8Array | number[], + pos: number +) { + while (val.hi) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +export function int64Length(lo: number, hi: number) { + let part0 = lo, + part1 = ((lo >>> 28) | (hi << 4)) >>> 0, + part2 = hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 + ? 1 + : 2 + : part0 < 2097152 + ? 3 + : 4 + : part1 < 16384 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 + : part2 < 128 + ? 9 + : 10; +} + +export function writeFixed32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; + buf[pos + 1] = (val >>> 8) & 255; + buf[pos + 2] = (val >>> 16) & 255; + buf[pos + 3] = val >>> 24; +} + +export function writeByte( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; +} diff --git a/dydxjs/packages/dydxjs/tsconfig.esm.json b/dydxjs/packages/dydxjs/tsconfig.esm.json new file mode 100644 index 00000000..800d7506 --- /dev/null +++ b/dydxjs/packages/dydxjs/tsconfig.esm.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "dist/esm", + "module": "es2022", + "rootDir": "src/", + "declaration": false + } +} diff --git a/dydxjs/packages/dydxjs/tsconfig.json b/dydxjs/packages/dydxjs/tsconfig.json new file mode 100644 index 00000000..1a9d5696 --- /dev/null +++ b/dydxjs/packages/dydxjs/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src/" + }, + "include": ["src/**/*.ts"], + "exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"] +} diff --git a/dydxjs/tsconfig.json b/dydxjs/tsconfig.json new file mode 100644 index 00000000..02c6945b --- /dev/null +++ b/dydxjs/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "es2022", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "strictNullChecks": false, + "skipLibCheck": true, + "sourceMap": false, + "declaration": true, + "resolveJsonModule": true, + "moduleResolution": "node", + "types": ["@types/jest"] + }, + "exclude": ["dist", "node_modules"] +} diff --git a/v4-client-js/.npmignore b/v4-client-js/.npmignore new file mode 100644 index 00000000..b92fd189 --- /dev/null +++ b/v4-client-js/.npmignore @@ -0,0 +1 @@ +!build/node_modules/@dydxprotocol/v4-proto/**/**.ts diff --git a/v4-client-js/.nvmrc b/v4-client-js/.nvmrc index 3f430af8..af9754bc 100644 --- a/v4-client-js/.nvmrc +++ b/v4-client-js/.nvmrc @@ -1 +1 @@ -v18 +v20.8.1 diff --git a/v4-client-js/.releaserc b/v4-client-js/.releaserc new file mode 100644 index 00000000..d3b25bb5 --- /dev/null +++ b/v4-client-js/.releaserc @@ -0,0 +1,10 @@ +{ + "branches": ["main"], + "tagFormat": "v4-client-js@${version}", + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/npm" + ] +} diff --git a/v4-client-js/.telescope.json b/v4-client-js/.telescope.json deleted file mode 100644 index 7323068a..00000000 --- a/v4-client-js/.telescope.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "protoDirs": ["./proto"], - "outPath": "./src/codegen", - "options": { - "aminoEncoding": { - "enabled": false - }, - "lcdClients": { - "enabled": true - }, - "rpcClients": { - "enabled": true - } - } -} diff --git a/v4-client-js/README.md b/v4-client-js/README.md index af1c84f4..d45a3262 100644 --- a/v4-client-js/README.md +++ b/v4-client-js/README.md @@ -15,7 +15,8 @@ The v4-Client Typescript client is used for placing transactions and querying th ## Development -`v4-client-js` uses node `v18` for development. You can use `nvm` to manage different versions of node. +`v4-client-js` uses node `v18` for development, see the .nvmrc file [here](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-js/.nvmrc). +You can use `nvm` to manage different versions of node. ``` nvm install @@ -26,10 +27,44 @@ nvm alias default $(nvm version) # optional You can run the following commands to ensure that you are running the correct `node` and `npm` versions. ``` -node -v # expected: v18.x.x (should match .nvmrc) -npm -v # expected: 8.x.x +node -v # expected: v20.x.x (should match .nvmrc) +npm -v # expected: 10.x.x ``` +### 1. Clone or fork the V4 clients repo + +```bash +git clone git@github.com:dydxprotocol/v4-clients.git +``` + +### 2. Go to one of the examples + +- Go to `v4-client-js/examples` + +```bash +cd v4-client-js/examples +``` + +These examples by default use a test account with `DYDX_TEST_MNEMONIC` from the TS client library under `v4-client-js/examples/constants`. + +### 3. Run the scripts with node + +```bash +npm install +npm run build +``` + +You should now see a `/build/examples` dir generated with JS files. We will use node to run these scripts + +- Open a terminal to run an example, e.g. account_endpoints. + +```bash +node ../build/examples/composite_example.js + +``` + +Everytime you change the TS code, you need to run `npm run build` again, before you execute using node. + ## Single-JS for mobile apps Mobile apps needs to load JS as a single JS file. To build, run diff --git a/v4-client-js/__native__/__ios__/v4-native-client.js b/v4-client-js/__native__/__ios__/v4-native-client.js index 23629892..1dc4190c 100644 --- a/v4-client-js/__native__/__ios__/v4-native-client.js +++ b/v4-client-js/__native__/__ios__/v4-native-client.js @@ -24463,9 +24463,10 @@ base64.test = function test(string) { /*!***************************************************!*\ !*** ./node_modules/@protobufjs/codegen/index.js ***! \***************************************************/ -/***/ (function(module) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); module.exports = codegen; @@ -28311,10 +28312,7 @@ zoo`.split('\n'); \******************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const asn1 = exports; +var asn1 = exports; asn1.bignum = __webpack_require__(/*! bn.js */ "./node_modules/asn1.js/node_modules/bn.js/lib/bn.js"); @@ -28333,14 +28331,10 @@ asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ "./node_modules/asn1. \**********************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const encoders = __webpack_require__(/*! ./encoders */ "./node_modules/asn1.js/lib/asn1/encoders/index.js"); -const decoders = __webpack_require__(/*! ./decoders */ "./node_modules/asn1.js/lib/asn1/decoders/index.js"); -const inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var asn1 = __webpack_require__(/*! ../asn1 */ "./node_modules/asn1.js/lib/asn1.js"); +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -const api = exports; +var api = exports; api.define = function define(name, body) { return new Entity(name, body); @@ -28352,27 +28346,34 @@ function Entity(name, body) { this.decoders = {}; this.encoders = {}; -} - -Entity.prototype._createNamed = function createNamed(Base) { - const name = this.name; +}; - function Generated(entity) { - this._initNamed(entity, name); +Entity.prototype._createNamed = function createNamed(base) { + var named; + try { + named = (__webpack_require__(/*! vm */ "./node_modules/vm-browserify/index.js").runInThisContext)( + '(function ' + this.name + '(entity) {\n' + + ' this._initNamed(entity);\n' + + '})' + ); + } catch (e) { + named = function (entity) { + this._initNamed(entity); + }; } - inherits(Generated, Base); - Generated.prototype._initNamed = function _initNamed(entity, name) { - Base.call(this, entity, name); + inherits(named, base); + named.prototype._initNamed = function initnamed(entity) { + base.call(this, entity); }; - return new Generated(this); + return new named(this); }; Entity.prototype._getDecoder = function _getDecoder(enc) { enc = enc || 'der'; // Lazily create decoder if (!this.decoders.hasOwnProperty(enc)) - this.decoders[enc] = this._createNamed(decoders[enc]); + this.decoders[enc] = this._createNamed(asn1.decoders[enc]); return this.decoders[enc]; }; @@ -28384,7 +28385,7 @@ Entity.prototype._getEncoder = function _getEncoder(enc) { enc = enc || 'der'; // Lazily create encoder if (!this.encoders.hasOwnProperty(enc)) - this.encoders[enc] = this._createNamed(encoders[enc]); + this.encoders[enc] = this._createNamed(asn1.encoders[enc]); return this.encoders[enc]; }; @@ -28401,12 +28402,9 @@ Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { \******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -const Reporter = (__webpack_require__(/*! ../base/reporter */ "./node_modules/asn1.js/lib/asn1/base/reporter.js").Reporter); -const Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var Reporter = (__webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").Reporter); +var Buffer = (__webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer); function DecoderBuffer(base, options) { Reporter.call(this, options); @@ -28422,34 +28420,13 @@ function DecoderBuffer(base, options) { inherits(DecoderBuffer, Reporter); exports.DecoderBuffer = DecoderBuffer; -DecoderBuffer.isDecoderBuffer = function isDecoderBuffer(data) { - if (data instanceof DecoderBuffer) { - return true; - } - - // Or accept compatible API - const isCompatible = typeof data === 'object' && - Buffer.isBuffer(data.base) && - data.constructor.name === 'DecoderBuffer' && - typeof data.offset === 'number' && - typeof data.length === 'number' && - typeof data.save === 'function' && - typeof data.restore === 'function' && - typeof data.isEmpty === 'function' && - typeof data.readUInt8 === 'function' && - typeof data.skip === 'function' && - typeof data.raw === 'function'; - - return isCompatible; -}; - DecoderBuffer.prototype.save = function save() { return { offset: this.offset, reporter: Reporter.prototype.save.call(this) }; }; DecoderBuffer.prototype.restore = function restore(save) { // Return skipped data - const res = new DecoderBuffer(this.base); + var res = new DecoderBuffer(this.base); res.offset = save.offset; res.length = this.offset; @@ -28468,13 +28445,13 @@ DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) { return this.base.readUInt8(this.offset++, true); else return this.error(fail || 'DecoderBuffer overrun'); -}; +} DecoderBuffer.prototype.skip = function skip(bytes, fail) { if (!(this.offset + bytes <= this.length)) return this.error(fail || 'DecoderBuffer overrun'); - const res = new DecoderBuffer(this.base); + var res = new DecoderBuffer(this.base); // Share reporter state res._reporterState = this._reporterState; @@ -28483,17 +28460,17 @@ DecoderBuffer.prototype.skip = function skip(bytes, fail) { res.length = this.offset + bytes; this.offset += bytes; return res; -}; +} DecoderBuffer.prototype.raw = function raw(save) { return this.base.slice(save ? save.offset : this.offset, this.length); -}; +} function EncoderBuffer(value, reporter) { if (Array.isArray(value)) { this.length = 0; this.value = value.map(function(item) { - if (!EncoderBuffer.isEncoderBuffer(item)) + if (!(item instanceof EncoderBuffer)) item = new EncoderBuffer(item, reporter); this.length += item.length; return item; @@ -28515,23 +28492,9 @@ function EncoderBuffer(value, reporter) { } exports.EncoderBuffer = EncoderBuffer; -EncoderBuffer.isEncoderBuffer = function isEncoderBuffer(data) { - if (data instanceof EncoderBuffer) { - return true; - } - - // Or accept compatible API - const isCompatible = typeof data === 'object' && - data.constructor.name === 'EncoderBuffer' && - typeof data.length === 'number' && - typeof data.join === 'function'; - - return isCompatible; -}; - EncoderBuffer.prototype.join = function join(out, offset) { if (!out) - out = Buffer.alloc(this.length); + out = new Buffer(this.length); if (!offset) offset = 0; @@ -28565,10 +28528,7 @@ EncoderBuffer.prototype.join = function join(out, offset) { \*****************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const base = exports; +var base = exports; base.Reporter = (__webpack_require__(/*! ./reporter */ "./node_modules/asn1.js/lib/asn1/base/reporter.js").Reporter); base.DecoderBuffer = (__webpack_require__(/*! ./buffer */ "./node_modules/asn1.js/lib/asn1/base/buffer.js").DecoderBuffer); @@ -28584,16 +28544,13 @@ base.Node = __webpack_require__(/*! ./node */ "./node_modules/asn1.js/lib/asn1/b \****************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; - - -const Reporter = (__webpack_require__(/*! ../base/reporter */ "./node_modules/asn1.js/lib/asn1/base/reporter.js").Reporter); -const EncoderBuffer = (__webpack_require__(/*! ../base/buffer */ "./node_modules/asn1.js/lib/asn1/base/buffer.js").EncoderBuffer); -const DecoderBuffer = (__webpack_require__(/*! ../base/buffer */ "./node_modules/asn1.js/lib/asn1/base/buffer.js").DecoderBuffer); -const assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); +var Reporter = (__webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").Reporter); +var EncoderBuffer = (__webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").EncoderBuffer); +var DecoderBuffer = (__webpack_require__(/*! ../base */ "./node_modules/asn1.js/lib/asn1/base/index.js").DecoderBuffer); +var assert = __webpack_require__(/*! minimalistic-assert */ "./node_modules/minimalistic-assert/index.js"); // Supported tags -const tags = [ +var tags = [ 'seq', 'seqof', 'set', 'setof', 'objid', 'bool', 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc', 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str', @@ -28601,13 +28558,13 @@ const tags = [ ]; // Public methods list -const methods = [ +var methods = [ 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', 'any', 'contains' ].concat(tags); // Overrided methods list -const overrided = [ +var overrided = [ '_peekTag', '_decodeTag', '_use', '_decodeStr', '_decodeObjid', '_decodeTime', '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', @@ -28616,11 +28573,10 @@ const overrided = [ '_encodeNull', '_encodeInt', '_encodeBool' ]; -function Node(enc, parent, name) { - const state = {}; +function Node(enc, parent) { + var state = {}; this._baseState = state; - state.name = name; state.enc = enc; state.parent = parent || null; @@ -28650,28 +28606,28 @@ function Node(enc, parent, name) { } module.exports = Node; -const stateProps = [ +var stateProps = [ 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', 'implicit', 'contains' ]; Node.prototype.clone = function clone() { - const state = this._baseState; - const cstate = {}; + var state = this._baseState; + var cstate = {}; stateProps.forEach(function(prop) { cstate[prop] = state[prop]; }); - const res = new this.constructor(cstate.parent); + var res = new this.constructor(cstate.parent); res._baseState = cstate; return res; }; Node.prototype._wrap = function wrap() { - const state = this._baseState; + var state = this._baseState; methods.forEach(function(method) { this[method] = function _wrappedMethod() { - const clone = new this.constructor(this); + var clone = new this.constructor(this); state.children.push(clone); return clone[method].apply(clone, arguments); }; @@ -28679,7 +28635,7 @@ Node.prototype._wrap = function wrap() { }; Node.prototype._init = function init(body) { - const state = this._baseState; + var state = this._baseState; assert(state.parent === null); body.call(this); @@ -28692,10 +28648,10 @@ Node.prototype._init = function init(body) { }; Node.prototype._useArgs = function useArgs(args) { - const state = this._baseState; + var state = this._baseState; // Filter children and args - const children = args.filter(function(arg) { + var children = args.filter(function(arg) { return arg instanceof this.constructor; }, this); args = args.filter(function(arg) { @@ -28718,11 +28674,11 @@ Node.prototype._useArgs = function useArgs(args) { if (typeof arg !== 'object' || arg.constructor !== Object) return arg; - const res = {}; + var res = {}; Object.keys(arg).forEach(function(key) { if (key == (key | 0)) key |= 0; - const value = arg[key]; + var value = arg[key]; res[value] = key; }); return res; @@ -28736,7 +28692,7 @@ Node.prototype._useArgs = function useArgs(args) { overrided.forEach(function(method) { Node.prototype[method] = function _overrided() { - const state = this._baseState; + var state = this._baseState; throw new Error(method + ' not implemented for encoding: ' + state.enc); }; }); @@ -28747,8 +28703,8 @@ overrided.forEach(function(method) { tags.forEach(function(tag) { Node.prototype[tag] = function _tagMethod() { - const state = this._baseState; - const args = Array.prototype.slice.call(arguments); + var state = this._baseState; + var args = Array.prototype.slice.call(arguments); assert(state.tag === null); state.tag = tag; @@ -28761,7 +28717,7 @@ tags.forEach(function(tag) { Node.prototype.use = function use(item) { assert(item); - const state = this._baseState; + var state = this._baseState; assert(state.use === null); state.use = item; @@ -28770,7 +28726,7 @@ Node.prototype.use = function use(item) { }; Node.prototype.optional = function optional() { - const state = this._baseState; + var state = this._baseState; state.optional = true; @@ -28778,7 +28734,7 @@ Node.prototype.optional = function optional() { }; Node.prototype.def = function def(val) { - const state = this._baseState; + var state = this._baseState; assert(state['default'] === null); state['default'] = val; @@ -28788,7 +28744,7 @@ Node.prototype.def = function def(val) { }; Node.prototype.explicit = function explicit(num) { - const state = this._baseState; + var state = this._baseState; assert(state.explicit === null && state.implicit === null); state.explicit = num; @@ -28797,7 +28753,7 @@ Node.prototype.explicit = function explicit(num) { }; Node.prototype.implicit = function implicit(num) { - const state = this._baseState; + var state = this._baseState; assert(state.explicit === null && state.implicit === null); state.implicit = num; @@ -28806,8 +28762,8 @@ Node.prototype.implicit = function implicit(num) { }; Node.prototype.obj = function obj() { - const state = this._baseState; - const args = Array.prototype.slice.call(arguments); + var state = this._baseState; + var args = Array.prototype.slice.call(arguments); state.obj = true; @@ -28818,7 +28774,7 @@ Node.prototype.obj = function obj() { }; Node.prototype.key = function key(newKey) { - const state = this._baseState; + var state = this._baseState; assert(state.key === null); state.key = newKey; @@ -28827,7 +28783,7 @@ Node.prototype.key = function key(newKey) { }; Node.prototype.any = function any() { - const state = this._baseState; + var state = this._baseState; state.any = true; @@ -28835,7 +28791,7 @@ Node.prototype.any = function any() { }; Node.prototype.choice = function choice(obj) { - const state = this._baseState; + var state = this._baseState; assert(state.choice === null); state.choice = obj; @@ -28847,7 +28803,7 @@ Node.prototype.choice = function choice(obj) { }; Node.prototype.contains = function contains(item) { - const state = this._baseState; + var state = this._baseState; assert(state.use === null); state.contains = item; @@ -28860,22 +28816,22 @@ Node.prototype.contains = function contains(item) { // Node.prototype._decode = function decode(input, options) { - const state = this._baseState; + var state = this._baseState; // Decode root node if (state.parent === null) return input.wrapResult(state.children[0]._decode(input, options)); - let result = state['default']; - let present = true; + var result = state['default']; + var present = true; - let prevKey = null; + var prevKey = null; if (state.key !== null) prevKey = input.enterKey(state.key); // Check if tag is there if (state.optional) { - let tag = null; + var tag = null; if (state.explicit !== null) tag = state.explicit; else if (state.implicit !== null) @@ -28885,7 +28841,7 @@ Node.prototype._decode = function decode(input, options) { if (tag === null && !state.any) { // Trial and Error - const save = input.save(); + var save = input.save(); try { if (state.choice === null) this._decodeGeneric(state.tag, input, options); @@ -28905,27 +28861,26 @@ Node.prototype._decode = function decode(input, options) { } // Push object on stack - let prevObj; + var prevObj; if (state.obj && present) prevObj = input.enterObject(); if (present) { // Unwrap explicit values if (state.explicit !== null) { - const explicit = this._decodeTag(input, state.explicit); + var explicit = this._decodeTag(input, state.explicit); if (input.isError(explicit)) return explicit; input = explicit; } - const start = input.offset; + var start = input.offset; // Unwrap implicit and normal values if (state.use === null && state.choice === null) { - let save; if (state.any) - save = input.save(); - const body = this._decodeTag( + var save = input.save(); + var body = this._decodeTag( input, state.implicit !== null ? state.implicit : state.tag, state.any @@ -28946,13 +28901,12 @@ Node.prototype._decode = function decode(input, options) { options.track(input.path(), input.offset, input.length, 'content'); // Select proper method for tag - if (state.any) { - // no-op - } else if (state.choice === null) { + if (state.any) + result = result; + else if (state.choice === null) result = this._decodeGeneric(state.tag, input, options); - } else { + else result = this._decodeChoice(input, options); - } if (input.isError(result)) return result; @@ -28968,9 +28922,9 @@ Node.prototype._decode = function decode(input, options) { // Decode contained/encoded by schema, only in bit or octet strings if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) { - const data = new DecoderBuffer(result); + var data = new DecoderBuffer(result); result = this._getUse(state.contains, input._reporterState.obj) - ._decode(data, options); + ._decode(data, options); } } @@ -28988,7 +28942,7 @@ Node.prototype._decode = function decode(input, options) { }; Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { - const state = this._baseState; + var state = this._baseState; if (tag === 'seq' || tag === 'set') return null; @@ -29013,7 +28967,7 @@ Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { if (state.use !== null) { return this._getUse(state.use, input._reporterState.obj) - ._decode(input, options); + ._decode(input, options); } else { return input.error('unknown tag: ' + tag); } @@ -29021,7 +28975,7 @@ Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { Node.prototype._getUse = function _getUse(entity, obj) { - const state = this._baseState; + var state = this._baseState; // Create altered use decoder if implicit is set state.useDecoder = this._use(entity, obj); assert(state.useDecoder._baseState.parent === null); @@ -29034,15 +28988,15 @@ Node.prototype._getUse = function _getUse(entity, obj) { }; Node.prototype._decodeChoice = function decodeChoice(input, options) { - const state = this._baseState; - let result = null; - let match = false; + var state = this._baseState; + var result = null; + var match = false; Object.keys(state.choice).some(function(key) { - const save = input.save(); - const node = state.choice[key]; + var save = input.save(); + var node = state.choice[key]; try { - const value = node._decode(input, options); + var value = node._decode(input, options); if (input.isError(value)) return false; @@ -29070,11 +29024,11 @@ Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) { }; Node.prototype._encode = function encode(data, reporter, parent) { - const state = this._baseState; + var state = this._baseState; if (state['default'] !== null && state['default'] === data) return; - const result = this._encodeValue(data, reporter, parent); + var result = this._encodeValue(data, reporter, parent); if (result === undefined) return; @@ -29085,13 +29039,13 @@ Node.prototype._encode = function encode(data, reporter, parent) { }; Node.prototype._encodeValue = function encode(data, reporter, parent) { - const state = this._baseState; + var state = this._baseState; // Decode root node if (state.parent === null) return state.children[0]._encode(data, reporter || new Reporter()); - let result = null; + var result = null; // Set reporter to share it with a child class this.reporter = reporter; @@ -29099,14 +29053,14 @@ Node.prototype._encodeValue = function encode(data, reporter, parent) { // Check if data is there if (state.optional && data === undefined) { if (state['default'] !== null) - data = state['default']; + data = state['default'] else return; } // Encode children first - let content = null; - let primitive = false; + var content = null; + var primitive = false; if (state.any) { // Anything that was given is translated to buffer result = this._createEncoderBuffer(data); @@ -29122,12 +29076,12 @@ Node.prototype._encodeValue = function encode(data, reporter, parent) { if (child._baseState.key === null) return reporter.error('Child should have a key'); - const prevKey = reporter.enterKey(child._baseState.key); + var prevKey = reporter.enterKey(child._baseState.key); if (typeof data !== 'object') return reporter.error('Child expected, but input is not object'); - const res = child._encode(data[child._baseState.key], reporter, data); + var res = child._encode(data[child._baseState.key], reporter, data); reporter.leaveKey(prevKey); return res; @@ -29144,10 +29098,10 @@ Node.prototype._encodeValue = function encode(data, reporter, parent) { if (!Array.isArray(data)) return reporter.error('seqof/setof, but data is not Array'); - const child = this.clone(); + var child = this.clone(); child._baseState.implicit = null; content = this._createEncoderBuffer(data.map(function(item) { - const state = this._baseState; + var state = this._baseState; return this._getUse(state.args[0], data)._encode(item, reporter); }, child)); @@ -29160,9 +29114,10 @@ Node.prototype._encodeValue = function encode(data, reporter, parent) { } // Encode data itself + var result; if (!state.any && state.choice === null) { - const tag = state.implicit !== null ? state.implicit : state.tag; - const cls = state.implicit === null ? 'universal' : 'context'; + var tag = state.implicit !== null ? state.implicit : state.tag; + var cls = state.implicit === null ? 'universal' : 'context'; if (tag === null) { if (state.use === null) @@ -29181,20 +29136,20 @@ Node.prototype._encodeValue = function encode(data, reporter, parent) { }; Node.prototype._encodeChoice = function encodeChoice(data, reporter) { - const state = this._baseState; + var state = this._baseState; - const node = state.choice[data.type]; + var node = state.choice[data.type]; if (!node) { assert( - false, - data.type + ' not found in ' + + false, + data.type + ' not found in ' + JSON.stringify(Object.keys(state.choice))); } return node._encode(data.value, reporter); }; Node.prototype._encodePrimitive = function encodePrimitive(tag, data) { - const state = this._baseState; + var state = this._baseState; if (/str$/.test(tag)) return this._encodeStr(data, tag); @@ -29221,7 +29176,7 @@ Node.prototype._isNumstr = function isNumstr(str) { }; Node.prototype._isPrintstr = function isPrintstr(str) { - return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str); + return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); }; @@ -29233,10 +29188,7 @@ Node.prototype._isPrintstr = function isPrintstr(str) { \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); function Reporter(options) { this._reporterState = { @@ -29253,13 +29205,13 @@ Reporter.prototype.isError = function isError(obj) { }; Reporter.prototype.save = function save() { - const state = this._reporterState; + var state = this._reporterState; return { obj: state.obj, pathLen: state.path.length }; }; Reporter.prototype.restore = function restore(data) { - const state = this._reporterState; + var state = this._reporterState; state.obj = data.obj; state.path = state.path.slice(0, data.pathLen); @@ -29270,13 +29222,13 @@ Reporter.prototype.enterKey = function enterKey(key) { }; Reporter.prototype.exitKey = function exitKey(index) { - const state = this._reporterState; + var state = this._reporterState; state.path = state.path.slice(0, index - 1); }; Reporter.prototype.leaveKey = function leaveKey(index, key, value) { - const state = this._reporterState; + var state = this._reporterState; this.exitKey(index); if (state.obj !== null) @@ -29288,26 +29240,26 @@ Reporter.prototype.path = function path() { }; Reporter.prototype.enterObject = function enterObject() { - const state = this._reporterState; + var state = this._reporterState; - const prev = state.obj; + var prev = state.obj; state.obj = {}; return prev; }; Reporter.prototype.leaveObject = function leaveObject(prev) { - const state = this._reporterState; + var state = this._reporterState; - const now = state.obj; + var now = state.obj; state.obj = prev; return now; }; Reporter.prototype.error = function error(msg) { - let err; - const state = this._reporterState; + var err; + var state = this._reporterState; - const inherited = msg instanceof ReporterError; + var inherited = msg instanceof ReporterError; if (inherited) { err = msg; } else { @@ -29326,7 +29278,7 @@ Reporter.prototype.error = function error(msg) { }; Reporter.prototype.wrapResult = function wrapResult(result) { - const state = this._reporterState; + var state = this._reporterState; if (!state.options.partial) return result; @@ -29339,7 +29291,7 @@ Reporter.prototype.wrapResult = function wrapResult(result) { function ReporterError(path, msg) { this.path = path; this.rethrow(msg); -} +}; inherits(ReporterError, Error); ReporterError.prototype.rethrow = function rethrow(msg) { @@ -29365,26 +29317,9 @@ ReporterError.prototype.rethrow = function rethrow(msg) { /*!********************************************************!*\ !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***! \********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -// Helper -function reverse(map) { - const res = {}; - - Object.keys(map).forEach(function(key) { - // Convert key to integer if it is stringified - if ((key | 0) == key) - key = key | 0; - - const value = map[key]; - res[value] = key; - }); +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - return res; -} +var constants = __webpack_require__(/*! ../constants */ "./node_modules/asn1.js/lib/asn1/constants/index.js"); exports.tagClass = { 0: 'universal', @@ -29392,7 +29327,7 @@ exports.tagClass = { 2: 'context', 3: 'private' }; -exports.tagClassByName = reverse(exports.tagClass); +exports.tagClassByName = constants._reverse(exports.tagClass); exports.tag = { 0x00: 'end', @@ -29425,7 +29360,7 @@ exports.tag = { 0x1d: 'charstr', 0x1e: 'bmpstr' }; -exports.tagByName = reverse(exports.tag); +exports.tagByName = constants._reverse(exports.tag); /***/ }), @@ -29436,21 +29371,18 @@ exports.tagByName = reverse(exports.tag); \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const constants = exports; +var constants = exports; // Helper constants._reverse = function reverse(map) { - const res = {}; + var res = {}; Object.keys(map).forEach(function(key) { // Convert key to integer if it is stringified if ((key | 0) == key) key = key | 0; - const value = map[key]; + var value = map[key]; res[value] = key; }); @@ -29468,17 +29400,14 @@ constants.der = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn \*******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; - - -const inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -const bignum = __webpack_require__(/*! bn.js */ "./node_modules/asn1.js/node_modules/bn.js/lib/bn.js"); -const DecoderBuffer = (__webpack_require__(/*! ../base/buffer */ "./node_modules/asn1.js/lib/asn1/base/buffer.js").DecoderBuffer); -const Node = __webpack_require__(/*! ../base/node */ "./node_modules/asn1.js/lib/asn1/base/node.js"); +var asn1 = __webpack_require__(/*! ../../asn1 */ "./node_modules/asn1.js/lib/asn1.js"); +var base = asn1.base; +var bignum = asn1.bignum; // Import DER constants -const der = __webpack_require__(/*! ../constants/der */ "./node_modules/asn1.js/lib/asn1/constants/der.js"); +var der = asn1.constants.der; function DERDecoder(entity) { this.enc = 'der'; @@ -29488,13 +29417,12 @@ function DERDecoder(entity) { // Construct base tree this.tree = new DERNode(); this.tree._init(entity.body); -} +}; module.exports = DERDecoder; DERDecoder.prototype.decode = function decode(data, options) { - if (!DecoderBuffer.isDecoderBuffer(data)) { - data = new DecoderBuffer(data, options); - } + if (!(data instanceof base.DecoderBuffer)) + data = new base.DecoderBuffer(data, options); return this.tree._decode(data, options); }; @@ -29502,16 +29430,16 @@ DERDecoder.prototype.decode = function decode(data, options) { // Tree methods function DERNode(parent) { - Node.call(this, 'der', parent); + base.Node.call(this, 'der', parent); } -inherits(DERNode, Node); +inherits(DERNode, base.Node); DERNode.prototype._peekTag = function peekTag(buffer, tag, any) { if (buffer.isEmpty()) return false; - const state = buffer.save(); - const decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"'); + var state = buffer.save(); + var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"'); if (buffer.isError(decodedTag)) return decodedTag; @@ -29522,14 +29450,14 @@ DERNode.prototype._peekTag = function peekTag(buffer, tag, any) { }; DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) { - const decodedTag = derDecodeTag(buffer, - 'Failed to decode tag of "' + tag + '"'); + var decodedTag = derDecodeTag(buffer, + 'Failed to decode tag of "' + tag + '"'); if (buffer.isError(decodedTag)) return decodedTag; - let len = derDecodeLen(buffer, - decodedTag.primitive, - 'Failed to get length of "' + tag + '"'); + var len = derDecodeLen(buffer, + decodedTag.primitive, + 'Failed to get length of "' + tag + '"'); // Failure if (buffer.isError(len)) @@ -29546,10 +29474,10 @@ DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) { return buffer.skip(len, 'Failed to match body of: "' + tag + '"'); // Indefinite length... find END tag - const state = buffer.save(); - const res = this._skipUntilEnd( - buffer, - 'Failed to skip indefinite length body: "' + this.tag + '"'); + var state = buffer.save(); + var res = this._skipUntilEnd( + buffer, + 'Failed to skip indefinite length body: "' + this.tag + '"'); if (buffer.isError(res)) return res; @@ -29559,17 +29487,17 @@ DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) { }; DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) { - for (;;) { - const tag = derDecodeTag(buffer, fail); + while (true) { + var tag = derDecodeTag(buffer, fail); if (buffer.isError(tag)) return tag; - const len = derDecodeLen(buffer, tag.primitive, fail); + var len = derDecodeLen(buffer, tag.primitive, fail); if (buffer.isError(len)) return len; - let res; + var res; if (tag.primitive || len !== null) - res = buffer.skip(len); + res = buffer.skip(len) else res = this._skipUntilEnd(buffer, fail); @@ -29583,14 +29511,14 @@ DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) { }; DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, - options) { - const result = []; + options) { + var result = []; while (!buffer.isEmpty()) { - const possibleEnd = this._peekTag(buffer, 'end'); + var possibleEnd = this._peekTag(buffer, 'end'); if (buffer.isError(possibleEnd)) return possibleEnd; - const res = decoder.decode(buffer, 'der', options); + var res = decoder.decode(buffer, 'der', options); if (buffer.isError(res) && possibleEnd) break; result.push(res); @@ -29600,22 +29528,22 @@ DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, DERNode.prototype._decodeStr = function decodeStr(buffer, tag) { if (tag === 'bitstr') { - const unused = buffer.readUInt8(); + var unused = buffer.readUInt8(); if (buffer.isError(unused)) return unused; return { unused: unused, data: buffer.raw() }; } else if (tag === 'bmpstr') { - const raw = buffer.raw(); + var raw = buffer.raw(); if (raw.length % 2 === 1) return buffer.error('Decoding of string type: bmpstr length mismatch'); - let str = ''; - for (let i = 0; i < raw.length / 2; i++) { + var str = ''; + for (var i = 0; i < raw.length / 2; i++) { str += String.fromCharCode(raw.readUInt16BE(i * 2)); } return str; } else if (tag === 'numstr') { - const numstr = buffer.raw().toString('ascii'); + var numstr = buffer.raw().toString('ascii'); if (!this._isNumstr(numstr)) { return buffer.error('Decoding of string type: ' + 'numstr unsupported characters'); @@ -29626,7 +29554,7 @@ DERNode.prototype._decodeStr = function decodeStr(buffer, tag) { } else if (tag === 'objDesc') { return buffer.raw(); } else if (tag === 'printstr') { - const printstr = buffer.raw().toString('ascii'); + var printstr = buffer.raw().toString('ascii'); if (!this._isPrintstr(printstr)) { return buffer.error('Decoding of string type: ' + 'printstr unsupported characters'); @@ -29640,12 +29568,11 @@ DERNode.prototype._decodeStr = function decodeStr(buffer, tag) { }; DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) { - let result; - const identifiers = []; - let ident = 0; - let subident = 0; + var result; + var identifiers = []; + var ident = 0; while (!buffer.isEmpty()) { - subident = buffer.readUInt8(); + var subident = buffer.readUInt8(); ident <<= 7; ident |= subident & 0x7f; if ((subident & 0x80) === 0) { @@ -29656,8 +29583,8 @@ DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) if (subident & 0x80) identifiers.push(ident); - const first = (identifiers[0] / 40) | 0; - const second = identifiers[0] % 40; + var first = (identifiers[0] / 40) | 0; + var second = identifiers[0] % 40; if (relative) result = identifiers; @@ -29665,7 +29592,7 @@ DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) result = [first, second].concat(identifiers.slice(1)); if (values) { - let tmp = values[result.join(' ')]; + var tmp = values[result.join(' ')]; if (tmp === undefined) tmp = values[result.join('.')]; if (tmp !== undefined) @@ -29676,28 +29603,21 @@ DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) }; DERNode.prototype._decodeTime = function decodeTime(buffer, tag) { - const str = buffer.raw().toString(); - - let year; - let mon; - let day; - let hour; - let min; - let sec; + var str = buffer.raw().toString(); if (tag === 'gentime') { - year = str.slice(0, 4) | 0; - mon = str.slice(4, 6) | 0; - day = str.slice(6, 8) | 0; - hour = str.slice(8, 10) | 0; - min = str.slice(10, 12) | 0; - sec = str.slice(12, 14) | 0; + var year = str.slice(0, 4) | 0; + var mon = str.slice(4, 6) | 0; + var day = str.slice(6, 8) | 0; + var hour = str.slice(8, 10) | 0; + var min = str.slice(10, 12) | 0; + var sec = str.slice(12, 14) | 0; } else if (tag === 'utctime') { - year = str.slice(0, 2) | 0; - mon = str.slice(2, 4) | 0; - day = str.slice(4, 6) | 0; - hour = str.slice(6, 8) | 0; - min = str.slice(8, 10) | 0; - sec = str.slice(10, 12) | 0; + var year = str.slice(0, 2) | 0; + var mon = str.slice(2, 4) | 0; + var day = str.slice(4, 6) | 0; + var hour = str.slice(6, 8) | 0; + var min = str.slice(8, 10) | 0; + var sec = str.slice(10, 12) | 0; if (year < 70) year = 2000 + year; else @@ -29709,12 +29629,12 @@ DERNode.prototype._decodeTime = function decodeTime(buffer, tag) { return Date.UTC(year, mon - 1, day, hour, min, sec, 0); }; -DERNode.prototype._decodeNull = function decodeNull() { +DERNode.prototype._decodeNull = function decodeNull(buffer) { return null; }; DERNode.prototype._decodeBool = function decodeBool(buffer) { - const res = buffer.readUInt8(); + var res = buffer.readUInt8(); if (buffer.isError(res)) return res; else @@ -29723,8 +29643,8 @@ DERNode.prototype._decodeBool = function decodeBool(buffer) { DERNode.prototype._decodeInt = function decodeInt(buffer, values) { // Bigint, return as it is (assume big endian) - const raw = buffer.raw(); - let res = new bignum(raw); + var raw = buffer.raw(); + var res = new bignum(raw); if (values) res = values[res.toString(10)] || res; @@ -29741,16 +29661,16 @@ DERNode.prototype._use = function use(entity, obj) { // Utility methods function derDecodeTag(buf, fail) { - let tag = buf.readUInt8(fail); + var tag = buf.readUInt8(fail); if (buf.isError(tag)) return tag; - const cls = der.tagClass[tag >> 6]; - const primitive = (tag & 0x20) === 0; + var cls = der.tagClass[tag >> 6]; + var primitive = (tag & 0x20) === 0; // Multi-octet tag - load if ((tag & 0x1f) === 0x1f) { - let oct = tag; + var oct = tag; tag = 0; while ((oct & 0x80) === 0x80) { oct = buf.readUInt8(fail); @@ -29763,7 +29683,7 @@ function derDecodeTag(buf, fail) { } else { tag &= 0x1f; } - const tagStr = der.tag[tag]; + var tagStr = der.tag[tag]; return { cls: cls, @@ -29774,7 +29694,7 @@ function derDecodeTag(buf, fail) { } function derDecodeLen(buf, primitive, fail) { - let len = buf.readUInt8(fail); + var len = buf.readUInt8(fail); if (buf.isError(len)) return len; @@ -29789,14 +29709,14 @@ function derDecodeLen(buf, primitive, fail) { } // Long form - const num = len & 0x7f; + var num = len & 0x7f; if (num > 4) return buf.error('length octect is too long'); len = 0; - for (let i = 0; i < num; i++) { + for (var i = 0; i < num; i++) { len <<= 8; - const j = buf.readUInt8(fail); + var j = buf.readUInt8(fail); if (buf.isError(j)) return j; len |= j; @@ -29814,10 +29734,7 @@ function derDecodeLen(buf, primitive, fail) { \*********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const decoders = exports; +var decoders = exports; decoders.der = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/decoders/der.js"); decoders.pem = __webpack_require__(/*! ./pem */ "./node_modules/asn1.js/lib/asn1/decoders/pem.js"); @@ -29831,31 +29748,28 @@ decoders.pem = __webpack_require__(/*! ./pem */ "./node_modules/asn1.js/lib/asn1 \*******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; - - -const inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -const Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var Buffer = (__webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer); -const DERDecoder = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/decoders/der.js"); +var DERDecoder = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/decoders/der.js"); function PEMDecoder(entity) { DERDecoder.call(this, entity); this.enc = 'pem'; -} +}; inherits(PEMDecoder, DERDecoder); module.exports = PEMDecoder; PEMDecoder.prototype.decode = function decode(data, options) { - const lines = data.toString().split(/[\r\n]+/g); + var lines = data.toString().split(/[\r\n]+/g); - const label = options.label.toUpperCase(); + var label = options.label.toUpperCase(); - const re = /^-----(BEGIN|END) ([^-]+)-----$/; - let start = -1; - let end = -1; - for (let i = 0; i < lines.length; i++) { - const match = lines[i].match(re); + var re = /^-----(BEGIN|END) ([^-]+)-----$/; + var start = -1; + var end = -1; + for (var i = 0; i < lines.length; i++) { + var match = lines[i].match(re); if (match === null) continue; @@ -29876,11 +29790,11 @@ PEMDecoder.prototype.decode = function decode(data, options) { if (start === -1 || end === -1) throw new Error('PEM section not found for: ' + label); - const base64 = lines.slice(start + 1, end).join(''); + var base64 = lines.slice(start + 1, end).join(''); // Remove excessive symbols - base64.replace(/[^a-z0-9+/=]+/gi, ''); + base64.replace(/[^a-z0-9\+\/=]+/gi, ''); - const input = Buffer.from(base64, 'base64'); + var input = new Buffer(base64, 'base64'); return DERDecoder.prototype.decode.call(this, input, options); }; @@ -29893,15 +29807,14 @@ PEMDecoder.prototype.decode = function decode(data, options) { \*******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; - +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var Buffer = (__webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer); -const inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -const Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); -const Node = __webpack_require__(/*! ../base/node */ "./node_modules/asn1.js/lib/asn1/base/node.js"); +var asn1 = __webpack_require__(/*! ../../asn1 */ "./node_modules/asn1.js/lib/asn1.js"); +var base = asn1.base; // Import DER constants -const der = __webpack_require__(/*! ../constants/der */ "./node_modules/asn1.js/lib/asn1/constants/der.js"); +var der = asn1.constants.der; function DEREncoder(entity) { this.enc = 'der'; @@ -29911,7 +29824,7 @@ function DEREncoder(entity) { // Construct base tree this.tree = new DERNode(); this.tree._init(entity.body); -} +}; module.exports = DEREncoder; DEREncoder.prototype.encode = function encode(data, reporter) { @@ -29921,19 +29834,19 @@ DEREncoder.prototype.encode = function encode(data, reporter) { // Tree methods function DERNode(parent) { - Node.call(this, 'der', parent); + base.Node.call(this, 'der', parent); } -inherits(DERNode, Node); +inherits(DERNode, base.Node); DERNode.prototype._encodeComposite = function encodeComposite(tag, - primitive, - cls, - content) { - const encodedTag = encodeTag(tag, primitive, cls, this.reporter); + primitive, + cls, + content) { + var encodedTag = encodeTag(tag, primitive, cls, this.reporter); // Short form if (content.length < 0x80) { - const header = Buffer.alloc(2); + var header = new Buffer(2); header[0] = encodedTag; header[1] = content.length; return this._createEncoderBuffer([ header, content ]); @@ -29941,15 +29854,15 @@ DERNode.prototype._encodeComposite = function encodeComposite(tag, // Long form // Count octets required to store length - let lenOctets = 1; - for (let i = content.length; i >= 0x100; i >>= 8) + var lenOctets = 1; + for (var i = content.length; i >= 0x100; i >>= 8) lenOctets++; - const header = Buffer.alloc(1 + 1 + lenOctets); + var header = new Buffer(1 + 1 + lenOctets); header[0] = encodedTag; header[1] = 0x80 | lenOctets; - for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) + for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) header[i] = j & 0xff; return this._createEncoderBuffer([ header, content ]); @@ -29959,8 +29872,8 @@ DERNode.prototype._encodeStr = function encodeStr(str, tag) { if (tag === 'bitstr') { return this._createEncoderBuffer([ str.unused | 0, str.data ]); } else if (tag === 'bmpstr') { - const buf = Buffer.alloc(str.length * 2); - for (let i = 0; i < str.length; i++) { + var buf = new Buffer(str.length * 2); + for (var i = 0; i < str.length; i++) { buf.writeUInt16BE(str.charCodeAt(i), i * 2); } return this._createEncoderBuffer(buf); @@ -29996,12 +29909,12 @@ DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) { return this.reporter.error('string objid given, but no values map found'); if (!values.hasOwnProperty(id)) return this.reporter.error('objid not found in values map'); - id = values[id].split(/[\s.]+/g); - for (let i = 0; i < id.length; i++) + id = values[id].split(/[\s\.]+/g); + for (var i = 0; i < id.length; i++) id[i] |= 0; } else if (Array.isArray(id)) { id = id.slice(); - for (let i = 0; i < id.length; i++) + for (var i = 0; i < id.length; i++) id[i] |= 0; } @@ -30017,17 +29930,17 @@ DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) { } // Count number of octets - let size = 0; - for (let i = 0; i < id.length; i++) { - let ident = id[i]; + var size = 0; + for (var i = 0; i < id.length; i++) { + var ident = id[i]; for (size++; ident >= 0x80; ident >>= 7) size++; } - const objid = Buffer.alloc(size); - let offset = objid.length - 1; - for (let i = id.length - 1; i >= 0; i--) { - let ident = id[i]; + var objid = new Buffer(size); + var offset = objid.length - 1; + for (var i = id.length - 1; i >= 0; i--) { + var ident = id[i]; objid[offset--] = ident & 0x7f; while ((ident >>= 7) > 0) objid[offset--] = 0x80 | (ident & 0x7f); @@ -30044,12 +29957,12 @@ function two(num) { } DERNode.prototype._encodeTime = function encodeTime(time, tag) { - let str; - const date = new Date(time); + var str; + var date = new Date(time); if (tag === 'gentime') { str = [ - two(date.getUTCFullYear()), + two(date.getFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), @@ -30059,7 +29972,7 @@ DERNode.prototype._encodeTime = function encodeTime(time, tag) { ].join(''); } else if (tag === 'utctime') { str = [ - two(date.getUTCFullYear() % 100), + two(date.getFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), @@ -30091,22 +30004,22 @@ DERNode.prototype._encodeInt = function encodeInt(num, values) { // Bignum, assume big endian if (typeof num !== 'number' && !Buffer.isBuffer(num)) { - const numArray = num.toArray(); + var numArray = num.toArray(); if (!num.sign && numArray[0] & 0x80) { numArray.unshift(0); } - num = Buffer.from(numArray); + num = new Buffer(numArray); } if (Buffer.isBuffer(num)) { - let size = num.length; + var size = num.length; if (num.length === 0) size++; - const out = Buffer.alloc(size); + var out = new Buffer(size); num.copy(out); if (num.length === 0) - out[0] = 0; + out[0] = 0 return this._createEncoderBuffer(out); } @@ -30116,12 +30029,12 @@ DERNode.prototype._encodeInt = function encodeInt(num, values) { if (num < 0x100) return this._createEncoderBuffer([0, num]); - let size = 1; - for (let i = num; i >= 0x100; i >>= 8) + var size = 1; + for (var i = num; i >= 0x100; i >>= 8) size++; - const out = new Array(size); - for (let i = out.length - 1; i >= 0; i--) { + var out = new Array(size); + for (var i = out.length - 1; i >= 0; i--) { out[i] = num & 0xff; num >>= 8; } @@ -30129,7 +30042,7 @@ DERNode.prototype._encodeInt = function encodeInt(num, values) { out.unshift(0); } - return this._createEncoderBuffer(Buffer.from(out)); + return this._createEncoderBuffer(new Buffer(out)); }; DERNode.prototype._encodeBool = function encodeBool(value) { @@ -30143,12 +30056,12 @@ DERNode.prototype._use = function use(entity, obj) { }; DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) { - const state = this._baseState; - let i; + var state = this._baseState; + var i; if (state['default'] === null) return false; - const data = dataBuffer.join(); + var data = dataBuffer.join(); if (state.defaultBuffer === undefined) state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join(); @@ -30165,7 +30078,7 @@ DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, pare // Utility methods function encodeTag(tag, primitive, cls, reporter) { - let res; + var res; if (tag === 'seqof') tag = 'seq'; @@ -30199,10 +30112,7 @@ function encodeTag(tag, primitive, cls, reporter) { \*********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; - - -const encoders = exports; +var encoders = exports; encoders.der = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/encoders/der.js"); encoders.pem = __webpack_require__(/*! ./pem */ "./node_modules/asn1.js/lib/asn1/encoders/pem.js"); @@ -30216,26 +30126,23 @@ encoders.pem = __webpack_require__(/*! ./pem */ "./node_modules/asn1.js/lib/asn1 \*******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; - - -const inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); -const DEREncoder = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/encoders/der.js"); +var DEREncoder = __webpack_require__(/*! ./der */ "./node_modules/asn1.js/lib/asn1/encoders/der.js"); function PEMEncoder(entity) { DEREncoder.call(this, entity); this.enc = 'pem'; -} +}; inherits(PEMEncoder, DEREncoder); module.exports = PEMEncoder; PEMEncoder.prototype.encode = function encode(data, options) { - const buf = DEREncoder.prototype.encode.call(this, data); + var buf = DEREncoder.prototype.encode.call(this, data); - const p = buf.toString('base64'); - const out = [ '-----BEGIN ' + options.label + '-----' ]; - for (let i = 0; i < p.length; i += 64) + var p = buf.toString('base64'); + var out = [ '-----BEGIN ' + options.label + '-----' ]; + for (var i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64)); out.push('-----END ' + options.label + '-----'); return out.join('\n'); @@ -33708,6 +33615,7 @@ PEMEncoder.prototype.encode = function encode(data, options) { /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); // Currently in sync with Node.js lib/assert.js // https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b // Originally from narwhal.js (http://narwhaljs.org) @@ -33745,10 +33653,10 @@ var _require = __webpack_require__(/*! ./internal/errors */ "./node_modules/asse var AssertionError = __webpack_require__(/*! ./internal/assert/assertion_error */ "./node_modules/assert/build/internal/assert/assertion_error.js"); -var _require2 = __webpack_require__(/*! util/ */ "./node_modules/assert/node_modules/util/util.js"), +var _require2 = __webpack_require__(/*! util/ */ "./node_modules/util/util.js"), inspect = _require2.inspect; -var _require$types = (__webpack_require__(/*! util/ */ "./node_modules/assert/node_modules/util/util.js").types), +var _require$types = (__webpack_require__(/*! util/ */ "./node_modules/util/util.js").types), isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp; @@ -34383,7 +34291,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -var _require = __webpack_require__(/*! util/ */ "./node_modules/assert/node_modules/util/util.js"), +var _require = __webpack_require__(/*! util/ */ "./node_modules/util/util.js"), inspect = _require.inspect; var _require2 = __webpack_require__(/*! ../errors */ "./node_modules/assert/build/internal/errors.js"), @@ -35004,7 +34912,7 @@ createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { }, TypeError); createErrorType('ERR_INVALID_ARG_VALUE', function (name, value) { var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid'; - if (util === undefined) util = __webpack_require__(/*! util/ */ "./node_modules/assert/node_modules/util/util.js"); + if (util === undefined) util = __webpack_require__(/*! util/ */ "./node_modules/util/util.js"); var inspected = util.inspect(value); if (inspected.length > 128) { @@ -35111,7 +35019,7 @@ var hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty); var propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable); var objectToString = uncurryThis(Object.prototype.toString); -var _require$types = (__webpack_require__(/*! util/ */ "./node_modules/assert/node_modules/util/util.js").types), +var _require$types = (__webpack_require__(/*! util/ */ "./node_modules/util/util.js").types), isAnyArrayBuffer = _require$types.isAnyArrayBuffer, isArrayBufferView = _require$types.isArrayBufferView, isDate = _require$types.isDate, @@ -35756,1449 +35664,368 @@ module.exports = { /***/ }), -/***/ "./node_modules/assert/node_modules/util/support/isBufferBrowser.js": -/*!**************************************************************************!*\ - !*** ./node_modules/assert/node_modules/util/support/isBufferBrowser.js ***! - \**************************************************************************/ +/***/ "./node_modules/axios/node_modules/form-data/lib/browser.js": +/*!******************************************************************!*\ + !*** ./node_modules/axios/node_modules/form-data/lib/browser.js ***! + \******************************************************************/ /***/ (function(module) { -module.exports = function isBuffer(arg) { - return arg && typeof arg === 'object' - && typeof arg.copy === 'function' - && typeof arg.fill === 'function' - && typeof arg.readUInt8 === 'function'; -} +/* eslint-env browser */ +module.exports = typeof self == 'object' ? self.FormData : window.FormData; + /***/ }), -/***/ "./node_modules/assert/node_modules/util/support/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/assert/node_modules/util/support/types.js ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "./node_modules/base64-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/base64-js/index.js ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, exports) { "use strict"; -// Currently in sync with Node.js lib/internal/util/types.js -// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 - - - -var isArgumentsObject = __webpack_require__(/*! is-arguments */ "./node_modules/is-arguments/index.js"); -var isGeneratorFunction = __webpack_require__(/*! is-generator-function */ "./node_modules/is-generator-function/index.js"); -var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); -var isTypedArray = __webpack_require__(/*! is-typed-array */ "./node_modules/is-typed-array/index.js"); - -function uncurryThis(f) { - return f.call.bind(f); -} -var BigIntSupported = typeof BigInt !== 'undefined'; -var SymbolSupported = typeof Symbol !== 'undefined'; - -var ObjectToString = uncurryThis(Object.prototype.toString); - -var numberValue = uncurryThis(Number.prototype.valueOf); -var stringValue = uncurryThis(String.prototype.valueOf); -var booleanValue = uncurryThis(Boolean.prototype.valueOf); -if (BigIntSupported) { - var bigIntValue = uncurryThis(BigInt.prototype.valueOf); -} +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray -if (SymbolSupported) { - var symbolValue = uncurryThis(Symbol.prototype.valueOf); -} +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array -function checkBoxedPrimitive(value, prototypeValueOf) { - if (typeof value !== 'object') { - return false; - } - try { - prototypeValueOf(value); - return true; - } catch(e) { - return false; - } +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i } -exports.isArgumentsObject = isArgumentsObject; -exports.isGeneratorFunction = isGeneratorFunction; -exports.isTypedArray = isTypedArray; +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 -// Taken from here and modified for better browser support -// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js -function isPromise(input) { - return ( - ( - typeof Promise !== 'undefined' && - input instanceof Promise - ) || - ( - input !== null && - typeof input === 'object' && - typeof input.then === 'function' && - typeof input.catch === 'function' - ) - ); -} -exports.isPromise = isPromise; +function getLens (b64) { + var len = b64.length -function isArrayBufferView(value) { - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - return ArrayBuffer.isView(value); + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') } - return ( - isTypedArray(value) || - isDataView(value) - ); -} -exports.isArrayBufferView = isArrayBufferView; - - -function isUint8Array(value) { - return whichTypedArray(value) === 'Uint8Array'; -} -exports.isUint8Array = isUint8Array; - -function isUint8ClampedArray(value) { - return whichTypedArray(value) === 'Uint8ClampedArray'; -} -exports.isUint8ClampedArray = isUint8ClampedArray; - -function isUint16Array(value) { - return whichTypedArray(value) === 'Uint16Array'; -} -exports.isUint16Array = isUint16Array; - -function isUint32Array(value) { - return whichTypedArray(value) === 'Uint32Array'; -} -exports.isUint32Array = isUint32Array; + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len -function isInt8Array(value) { - return whichTypedArray(value) === 'Int8Array'; -} -exports.isInt8Array = isInt8Array; + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) -function isInt16Array(value) { - return whichTypedArray(value) === 'Int16Array'; + return [validLen, placeHoldersLen] } -exports.isInt16Array = isInt16Array; -function isInt32Array(value) { - return whichTypedArray(value) === 'Int32Array'; +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } -exports.isInt32Array = isInt32Array; -function isFloat32Array(value) { - return whichTypedArray(value) === 'Float32Array'; +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } -exports.isFloat32Array = isFloat32Array; -function isFloat64Array(value) { - return whichTypedArray(value) === 'Float64Array'; -} -exports.isFloat64Array = isFloat64Array; +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] -function isBigInt64Array(value) { - return whichTypedArray(value) === 'BigInt64Array'; -} -exports.isBigInt64Array = isBigInt64Array; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) -function isBigUint64Array(value) { - return whichTypedArray(value) === 'BigUint64Array'; -} -exports.isBigUint64Array = isBigUint64Array; + var curByte = 0 -function isMapToString(value) { - return ObjectToString(value) === '[object Map]'; -} -isMapToString.working = ( - typeof Map !== 'undefined' && - isMapToString(new Map()) -); + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen -function isMap(value) { - if (typeof Map === 'undefined') { - return false; + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF } - return isMapToString.working - ? isMapToString(value) - : value instanceof Map; -} -exports.isMap = isMap; - -function isSetToString(value) { - return ObjectToString(value) === '[object Set]'; -} -isSetToString.working = ( - typeof Set !== 'undefined' && - isSetToString(new Set()) -); -function isSet(value) { - if (typeof Set === 'undefined') { - return false; + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF } - return isSetToString.working - ? isSetToString(value) - : value instanceof Set; -} -exports.isSet = isSet; - -function isWeakMapToString(value) { - return ObjectToString(value) === '[object WeakMap]'; -} -isWeakMapToString.working = ( - typeof WeakMap !== 'undefined' && - isWeakMapToString(new WeakMap()) -); -function isWeakMap(value) { - if (typeof WeakMap === 'undefined') { - return false; + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF } - return isWeakMapToString.working - ? isWeakMapToString(value) - : value instanceof WeakMap; + return arr } -exports.isWeakMap = isWeakMap; -function isWeakSetToString(value) { - return ObjectToString(value) === '[object WeakSet]'; -} -isWeakSetToString.working = ( - typeof WeakSet !== 'undefined' && - isWeakSetToString(new WeakSet()) -); -function isWeakSet(value) { - return isWeakSetToString(value); +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] } -exports.isWeakSet = isWeakSet; -function isArrayBufferToString(value) { - return ObjectToString(value) === '[object ArrayBuffer]'; -} -isArrayBufferToString.working = ( - typeof ArrayBuffer !== 'undefined' && - isArrayBufferToString(new ArrayBuffer()) -); -function isArrayBuffer(value) { - if (typeof ArrayBuffer === 'undefined') { - return false; +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) } - - return isArrayBufferToString.working - ? isArrayBufferToString(value) - : value instanceof ArrayBuffer; -} -exports.isArrayBuffer = isArrayBuffer; - -function isDataViewToString(value) { - return ObjectToString(value) === '[object DataView]'; + return output.join('') } -isDataViewToString.working = ( - typeof ArrayBuffer !== 'undefined' && - typeof DataView !== 'undefined' && - isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)) -); -function isDataView(value) { - if (typeof DataView === 'undefined') { - return false; - } - return isDataViewToString.working - ? isDataViewToString(value) - : value instanceof DataView; -} -exports.isDataView = isDataView; +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 -// Store a copy of SharedArrayBuffer in case it's deleted elsewhere -var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; -function isSharedArrayBufferToString(value) { - return ObjectToString(value) === '[object SharedArrayBuffer]'; -} -function isSharedArrayBuffer(value) { - if (typeof SharedArrayBufferCopy === 'undefined') { - return false; + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } - if (typeof isSharedArrayBufferToString.working === 'undefined') { - isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) } - return isSharedArrayBufferToString.working - ? isSharedArrayBufferToString(value) - : value instanceof SharedArrayBufferCopy; -} -exports.isSharedArrayBuffer = isSharedArrayBuffer; - -function isAsyncFunction(value) { - return ObjectToString(value) === '[object AsyncFunction]'; + return parts.join('') } -exports.isAsyncFunction = isAsyncFunction; -function isMapIterator(value) { - return ObjectToString(value) === '[object Map Iterator]'; -} -exports.isMapIterator = isMapIterator; -function isSetIterator(value) { - return ObjectToString(value) === '[object Set Iterator]'; -} -exports.isSetIterator = isSetIterator; +/***/ }), -function isGeneratorObject(value) { - return ObjectToString(value) === '[object Generator]'; -} -exports.isGeneratorObject = isGeneratorObject; +/***/ "./node_modules/bech32/index.js": +/*!**************************************!*\ + !*** ./node_modules/bech32/index.js ***! + \**************************************/ +/***/ (function(module) { -function isWebAssemblyCompiledModule(value) { - return ObjectToString(value) === '[object WebAssembly.Module]'; -} -exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; +"use strict"; -function isNumberObject(value) { - return checkBoxedPrimitive(value, numberValue); -} -exports.isNumberObject = isNumberObject; +var ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l' -function isStringObject(value) { - return checkBoxedPrimitive(value, stringValue); -} -exports.isStringObject = isStringObject; +// pre-compute lookup table +var ALPHABET_MAP = {} +for (var z = 0; z < ALPHABET.length; z++) { + var x = ALPHABET.charAt(z) -function isBooleanObject(value) { - return checkBoxedPrimitive(value, booleanValue); + if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous') + ALPHABET_MAP[x] = z } -exports.isBooleanObject = isBooleanObject; -function isBigIntObject(value) { - return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); +function polymodStep (pre) { + var b = pre >> 25 + return ((pre & 0x1FFFFFF) << 5) ^ + (-((b >> 0) & 1) & 0x3b6a57b2) ^ + (-((b >> 1) & 1) & 0x26508e6d) ^ + (-((b >> 2) & 1) & 0x1ea119fa) ^ + (-((b >> 3) & 1) & 0x3d4233dd) ^ + (-((b >> 4) & 1) & 0x2a1462b3) } -exports.isBigIntObject = isBigIntObject; -function isSymbolObject(value) { - return SymbolSupported && checkBoxedPrimitive(value, symbolValue); -} -exports.isSymbolObject = isSymbolObject; +function prefixChk (prefix) { + var chk = 1 + for (var i = 0; i < prefix.length; ++i) { + var c = prefix.charCodeAt(i) + if (c < 33 || c > 126) return 'Invalid prefix (' + prefix + ')' -function isBoxedPrimitive(value) { - return ( - isNumberObject(value) || - isStringObject(value) || - isBooleanObject(value) || - isBigIntObject(value) || - isSymbolObject(value) - ); -} -exports.isBoxedPrimitive = isBoxedPrimitive; + chk = polymodStep(chk) ^ (c >> 5) + } + chk = polymodStep(chk) -function isAnyArrayBuffer(value) { - return typeof Uint8Array !== 'undefined' && ( - isArrayBuffer(value) || - isSharedArrayBuffer(value) - ); + for (i = 0; i < prefix.length; ++i) { + var v = prefix.charCodeAt(i) + chk = polymodStep(chk) ^ (v & 0x1f) + } + return chk } -exports.isAnyArrayBuffer = isAnyArrayBuffer; - -['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) { - Object.defineProperty(exports, method, { - enumerable: false, - value: function() { - throw new Error(method + ' is not supported in userland'); - } - }); -}); - - -/***/ }), -/***/ "./node_modules/assert/node_modules/util/util.js": -/*!*******************************************************!*\ - !*** ./node_modules/assert/node_modules/util/util.js ***! - \*******************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +function encode (prefix, words, LIMIT) { + LIMIT = LIMIT || 90 + if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit') -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + prefix = prefix.toLowerCase() -var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || - function getOwnPropertyDescriptors(obj) { - var keys = Object.keys(obj); - var descriptors = {}; - for (var i = 0; i < keys.length; i++) { - descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); - } - return descriptors; - }; + // determine chk mod + var chk = prefixChk(prefix) + if (typeof chk === 'string') throw new Error(chk) -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } + var result = prefix + '1' + for (var i = 0; i < words.length; ++i) { + var x = words[i] + if ((x >> 5) !== 0) throw new Error('Non 5-bit word') - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } + chk = polymodStep(chk) ^ x + result += ALPHABET.charAt(x) } - return str; -}; - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - if ( true && ({"env":{"NODE_ENV":"production"}}).noDeprecation === true) { - return fn; + for (i = 0; i < 6; ++i) { + chk = polymodStep(chk) } + chk ^= 1 - // Allow for deprecating things in the process of starting up. - if (false) {} - - var warned = false; - function deprecated() { - if (!warned) { - if (({"env":{"NODE_ENV":"production"}}).throwDeprecation) { - throw new Error(msg); - } else if (({"env":{"NODE_ENV":"production"}}).traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); + for (i = 0; i < 6; ++i) { + var v = (chk >> ((5 - i) * 5)) & 0x1f + result += ALPHABET.charAt(v) } - return deprecated; -}; - - -var debugs = {}; -var debugEnvRegex = /^$/; - -if (({"NODE_ENV":"production"}).NODE_DEBUG) { - var debugEnv = ({"NODE_ENV":"production"}).NODE_DEBUG; - debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') - .replace(/\*/g, '.*') - .replace(/,/g, '$|^') - .toUpperCase(); - debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i'); + return result } -exports.debuglog = function(set) { - set = set.toUpperCase(); - if (!debugs[set]) { - if (debugEnvRegex.test(set)) { - var pid = ({"env":{"NODE_ENV":"production"}}).pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; +function __decode (str, LIMIT) { + LIMIT = LIMIT || 90 + if (str.length < 8) return str + ' too short' + if (str.length > LIMIT) return 'Exceeds length limit' + // don't allow mixed case + var lowered = str.toLowerCase() + var uppered = str.toUpperCase() + if (str !== lowered && str !== uppered) return 'Mixed-case string ' + str + str = lowered -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; + var split = str.lastIndexOf('1') + if (split === -1) return 'No separator character for ' + str + if (split === 0) return 'Missing prefix for ' + str -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; + var prefix = str.slice(0, split) + var wordChars = str.slice(split + 1) + if (wordChars.length < 6) return 'Data too short' + var chk = prefixChk(prefix) + if (typeof chk === 'string') return chk -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; + var words = [] + for (var i = 0; i < wordChars.length; ++i) { + var c = wordChars.charAt(i) + var v = ALPHABET_MAP[c] + if (v === undefined) return 'Unknown character ' + c + chk = polymodStep(chk) ^ v - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; + // not in the checksum? + if (i + 6 >= wordChars.length) continue + words.push(v) } -} - -function stylizeNoColor(str, styleType) { - return str; + if (chk !== 1) return 'Invalid checksum for ' + str + return { prefix: prefix, words: words } } - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; +function decodeUnsafe () { + var res = __decode.apply(null, arguments) + if (typeof res === 'object') return res } +function decode (str) { + var res = __decode.apply(null, arguments) + if (typeof res === 'object') return res -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); + throw new Error(res) +} - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } +function convert (data, inBits, outBits, pad) { + var value = 0 + var bits = 0 + var maxV = (1 << outBits) - 1 - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } + var result = [] + for (var i = 0; i < data.length; ++i) { + value = (value << inBits) | data[i] + bits += inBits - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); + while (bits >= outBits) { + bits -= outBits + result.push((value >> bits) & maxV) } } - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); + if (pad) { + if (bits > 0) { + result.push((value << (outBits - bits)) & maxV) } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); + if (bits >= inBits) return 'Excess padding' + if ((value << (outBits - bits)) & maxV) return 'Non-zero padding' } - ctx.seen.pop(); + return result +} - return reduceToSingleString(output, base, braces); +function toWordsUnsafe (bytes) { + var res = convert(bytes, 8, 5, true) + if (Array.isArray(res)) return res } +function toWords (bytes) { + var res = convert(bytes, 8, 5, true) + if (Array.isArray(res)) return res -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); + throw new Error(res) } - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; +function fromWordsUnsafe (words) { + var res = convert(words, 5, 8, false) + if (Array.isArray(res)) return res } +function fromWords (words) { + var res = convert(words, 5, 8, false) + if (Array.isArray(res)) return res -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; + throw new Error(res) } - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').slice(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.slice(1, -1); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -exports.types = __webpack_require__(/*! ./support/types */ "./node_modules/assert/node_modules/util/support/types.js"); - -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; -exports.types.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; -exports.types.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; -exports.types.isNativeError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ "./node_modules/assert/node_modules/util/support/isBufferBrowser.js"); - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; - -exports.promisify = function promisify(original) { - if (typeof original !== 'function') - throw new TypeError('The "original" argument must be of type Function'); - - if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { - var fn = original[kCustomPromisifiedSymbol]; - if (typeof fn !== 'function') { - throw new TypeError('The "util.promisify.custom" argument must be of type Function'); - } - Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return fn; - } - - function fn() { - var promiseResolve, promiseReject; - var promise = new Promise(function (resolve, reject) { - promiseResolve = resolve; - promiseReject = reject; - }); - - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - args.push(function (err, value) { - if (err) { - promiseReject(err); - } else { - promiseResolve(value); - } - }); - - try { - original.apply(this, args); - } catch (err) { - promiseReject(err); - } - - return promise; - } - - Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); - - if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return Object.defineProperties( - fn, - getOwnPropertyDescriptors(original) - ); -} - -exports.promisify.custom = kCustomPromisifiedSymbol - -function callbackifyOnRejected(reason, cb) { - // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). - // Because `null` is a special error value in callbacks which means "no error - // occurred", we error-wrap so the callback consumer can distinguish between - // "the promise rejected with null" or "the promise fulfilled with undefined". - if (!reason) { - var newReason = new Error('Promise was rejected with a falsy value'); - newReason.reason = reason; - reason = newReason; - } - return cb(reason); -} - -function callbackify(original) { - if (typeof original !== 'function') { - throw new TypeError('The "original" argument must be of type Function'); - } - - // We DO NOT return the promise as it gives the user a false sense that - // the promise is actually somehow related to the callback's execution - // and that the callback throwing will reject the promise. - function callbackified() { - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - - var maybeCb = args.pop(); - if (typeof maybeCb !== 'function') { - throw new TypeError('The last argument must be of type Function'); - } - var self = this; - var cb = function() { - return maybeCb.apply(self, arguments); - }; - // In true node style we process the callback on `nextTick` with all the - // implications (stack, `uncaughtException`, `async_hooks`) - original.apply(this, args) - .then(function(ret) { ({"env":{"NODE_ENV":"production"}}).nextTick(cb.bind(null, null, ret)) }, - function(rej) { ({"env":{"NODE_ENV":"production"}}).nextTick(callbackifyOnRejected.bind(null, rej, cb)) }); - } - - Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); - Object.defineProperties(callbackified, - getOwnPropertyDescriptors(original)); - return callbackified; -} -exports.callbackify = callbackify; - - -/***/ }), - -/***/ "./node_modules/axios/node_modules/form-data/lib/browser.js": -/*!******************************************************************!*\ - !*** ./node_modules/axios/node_modules/form-data/lib/browser.js ***! - \******************************************************************/ -/***/ (function(module) { - -/* eslint-env browser */ -module.exports = typeof self == 'object' ? self.FormData : window.FormData; - - -/***/ }), - -/***/ "./node_modules/base64-js/index.js": -/*!*****************************************!*\ - !*** ./node_modules/base64-js/index.js ***! - \*****************************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} - - -/***/ }), - -/***/ "./node_modules/bech32/index.js": -/*!**************************************!*\ - !*** ./node_modules/bech32/index.js ***! - \**************************************/ -/***/ (function(module) { - -"use strict"; - -var ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l' - -// pre-compute lookup table -var ALPHABET_MAP = {} -for (var z = 0; z < ALPHABET.length; z++) { - var x = ALPHABET.charAt(z) - - if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous') - ALPHABET_MAP[x] = z -} - -function polymodStep (pre) { - var b = pre >> 25 - return ((pre & 0x1FFFFFF) << 5) ^ - (-((b >> 0) & 1) & 0x3b6a57b2) ^ - (-((b >> 1) & 1) & 0x26508e6d) ^ - (-((b >> 2) & 1) & 0x1ea119fa) ^ - (-((b >> 3) & 1) & 0x3d4233dd) ^ - (-((b >> 4) & 1) & 0x2a1462b3) -} - -function prefixChk (prefix) { - var chk = 1 - for (var i = 0; i < prefix.length; ++i) { - var c = prefix.charCodeAt(i) - if (c < 33 || c > 126) return 'Invalid prefix (' + prefix + ')' - - chk = polymodStep(chk) ^ (c >> 5) - } - chk = polymodStep(chk) - - for (i = 0; i < prefix.length; ++i) { - var v = prefix.charCodeAt(i) - chk = polymodStep(chk) ^ (v & 0x1f) - } - return chk -} - -function encode (prefix, words, LIMIT) { - LIMIT = LIMIT || 90 - if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit') - - prefix = prefix.toLowerCase() - - // determine chk mod - var chk = prefixChk(prefix) - if (typeof chk === 'string') throw new Error(chk) - - var result = prefix + '1' - for (var i = 0; i < words.length; ++i) { - var x = words[i] - if ((x >> 5) !== 0) throw new Error('Non 5-bit word') - - chk = polymodStep(chk) ^ x - result += ALPHABET.charAt(x) - } - - for (i = 0; i < 6; ++i) { - chk = polymodStep(chk) - } - chk ^= 1 - - for (i = 0; i < 6; ++i) { - var v = (chk >> ((5 - i) * 5)) & 0x1f - result += ALPHABET.charAt(v) - } - - return result -} - -function __decode (str, LIMIT) { - LIMIT = LIMIT || 90 - if (str.length < 8) return str + ' too short' - if (str.length > LIMIT) return 'Exceeds length limit' - - // don't allow mixed case - var lowered = str.toLowerCase() - var uppered = str.toUpperCase() - if (str !== lowered && str !== uppered) return 'Mixed-case string ' + str - str = lowered - - var split = str.lastIndexOf('1') - if (split === -1) return 'No separator character for ' + str - if (split === 0) return 'Missing prefix for ' + str - - var prefix = str.slice(0, split) - var wordChars = str.slice(split + 1) - if (wordChars.length < 6) return 'Data too short' - - var chk = prefixChk(prefix) - if (typeof chk === 'string') return chk - - var words = [] - for (var i = 0; i < wordChars.length; ++i) { - var c = wordChars.charAt(i) - var v = ALPHABET_MAP[c] - if (v === undefined) return 'Unknown character ' + c - chk = polymodStep(chk) ^ v - - // not in the checksum? - if (i + 6 >= wordChars.length) continue - words.push(v) - } - - if (chk !== 1) return 'Invalid checksum for ' + str - return { prefix: prefix, words: words } -} - -function decodeUnsafe () { - var res = __decode.apply(null, arguments) - if (typeof res === 'object') return res -} - -function decode (str) { - var res = __decode.apply(null, arguments) - if (typeof res === 'object') return res - - throw new Error(res) -} - -function convert (data, inBits, outBits, pad) { - var value = 0 - var bits = 0 - var maxV = (1 << outBits) - 1 - - var result = [] - for (var i = 0; i < data.length; ++i) { - value = (value << inBits) | data[i] - bits += inBits - - while (bits >= outBits) { - bits -= outBits - result.push((value >> bits) & maxV) - } - } - - if (pad) { - if (bits > 0) { - result.push((value << (outBits - bits)) & maxV) - } - } else { - if (bits >= inBits) return 'Excess padding' - if ((value << (outBits - bits)) & maxV) return 'Non-zero padding' - } - - return result -} - -function toWordsUnsafe (bytes) { - var res = convert(bytes, 8, 5, true) - if (Array.isArray(res)) return res -} - -function toWords (bytes) { - var res = convert(bytes, 8, 5, true) - if (Array.isArray(res)) return res - - throw new Error(res) -} - -function fromWordsUnsafe (words) { - var res = convert(words, 5, 8, false) - if (Array.isArray(res)) return res -} - -function fromWords (words) { - var res = convert(words, 5, 8, false) - if (Array.isArray(res)) return res - - throw new Error(res) -} - -module.exports = { - decodeUnsafe: decodeUnsafe, - decode: decode, - encode: encode, - toWordsUnsafe: toWordsUnsafe, - toWords: toWords, - fromWordsUnsafe: fromWordsUnsafe, - fromWords: fromWords -} +module.exports = { + decodeUnsafe: decodeUnsafe, + decode: decode, + encode: encode, + toWordsUnsafe: toWordsUnsafe, + toWords: toWords, + fromWordsUnsafe: fromWordsUnsafe, + fromWords: fromWords +} /***/ }), @@ -45062,7 +43889,10 @@ module.exports = crt \***********************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports = __webpack_require__(/*! ./browser/algorithms.json */ "./node_modules/browserify-sign/browser/algorithms.json") +"use strict"; + + +module.exports = __webpack_require__(/*! ./browser/algorithms.json */ "./node_modules/browserify-sign/browser/algorithms.json"); /***/ }), @@ -45073,90 +43903,91 @@ module.exports = __webpack_require__(/*! ./browser/algorithms.json */ "./node_mo \*******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer) -var createHash = __webpack_require__(/*! create-hash */ "./node_modules/create-hash/browser.js") -var stream = __webpack_require__(/*! readable-stream */ "./node_modules/browserify-sign/node_modules/readable-stream/readable-browser.js") -var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js") -var sign = __webpack_require__(/*! ./sign */ "./node_modules/browserify-sign/browser/sign.js") -var verify = __webpack_require__(/*! ./verify */ "./node_modules/browserify-sign/browser/verify.js") +"use strict"; + + +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer); +var createHash = __webpack_require__(/*! create-hash */ "./node_modules/create-hash/browser.js"); +var stream = __webpack_require__(/*! readable-stream */ "./node_modules/browserify-sign/node_modules/readable-stream/readable-browser.js"); +var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +var sign = __webpack_require__(/*! ./sign */ "./node_modules/browserify-sign/browser/sign.js"); +var verify = __webpack_require__(/*! ./verify */ "./node_modules/browserify-sign/browser/verify.js"); -var algorithms = __webpack_require__(/*! ./algorithms.json */ "./node_modules/browserify-sign/browser/algorithms.json") +var algorithms = __webpack_require__(/*! ./algorithms.json */ "./node_modules/browserify-sign/browser/algorithms.json"); Object.keys(algorithms).forEach(function (key) { - algorithms[key].id = Buffer.from(algorithms[key].id, 'hex') - algorithms[key.toLowerCase()] = algorithms[key] -}) + algorithms[key].id = Buffer.from(algorithms[key].id, 'hex'); + algorithms[key.toLowerCase()] = algorithms[key]; +}); -function Sign (algorithm) { - stream.Writable.call(this) +function Sign(algorithm) { + stream.Writable.call(this); - var data = algorithms[algorithm] - if (!data) throw new Error('Unknown message digest') + var data = algorithms[algorithm]; + if (!data) { throw new Error('Unknown message digest'); } - this._hashType = data.hash - this._hash = createHash(data.hash) - this._tag = data.id - this._signType = data.sign + this._hashType = data.hash; + this._hash = createHash(data.hash); + this._tag = data.id; + this._signType = data.sign; } -inherits(Sign, stream.Writable) +inherits(Sign, stream.Writable); -Sign.prototype._write = function _write (data, _, done) { - this._hash.update(data) - done() -} +Sign.prototype._write = function _write(data, _, done) { + this._hash.update(data); + done(); +}; -Sign.prototype.update = function update (data, enc) { - if (typeof data === 'string') data = Buffer.from(data, enc) +Sign.prototype.update = function update(data, enc) { + this._hash.update(typeof data === 'string' ? Buffer.from(data, enc) : data); - this._hash.update(data) - return this -} + return this; +}; -Sign.prototype.sign = function signMethod (key, enc) { - this.end() - var hash = this._hash.digest() - var sig = sign(hash, key, this._hashType, this._signType, this._tag) +Sign.prototype.sign = function signMethod(key, enc) { + this.end(); + var hash = this._hash.digest(); + var sig = sign(hash, key, this._hashType, this._signType, this._tag); - return enc ? sig.toString(enc) : sig -} + return enc ? sig.toString(enc) : sig; +}; -function Verify (algorithm) { - stream.Writable.call(this) +function Verify(algorithm) { + stream.Writable.call(this); - var data = algorithms[algorithm] - if (!data) throw new Error('Unknown message digest') + var data = algorithms[algorithm]; + if (!data) { throw new Error('Unknown message digest'); } - this._hash = createHash(data.hash) - this._tag = data.id - this._signType = data.sign + this._hash = createHash(data.hash); + this._tag = data.id; + this._signType = data.sign; } -inherits(Verify, stream.Writable) +inherits(Verify, stream.Writable); -Verify.prototype._write = function _write (data, _, done) { - this._hash.update(data) - done() -} +Verify.prototype._write = function _write(data, _, done) { + this._hash.update(data); + done(); +}; -Verify.prototype.update = function update (data, enc) { - if (typeof data === 'string') data = Buffer.from(data, enc) +Verify.prototype.update = function update(data, enc) { + this._hash.update(typeof data === 'string' ? Buffer.from(data, enc) : data); - this._hash.update(data) - return this -} + return this; +}; -Verify.prototype.verify = function verifyMethod (key, sig, enc) { - if (typeof sig === 'string') sig = Buffer.from(sig, enc) +Verify.prototype.verify = function verifyMethod(key, sig, enc) { + var sigBuffer = typeof sig === 'string' ? Buffer.from(sig, enc) : sig; - this.end() - var hash = this._hash.digest() - return verify(sig, hash, key, this._signType, this._tag) -} + this.end(); + var hash = this._hash.digest(); + return verify(sigBuffer, hash, key, this._signType, this._tag); +}; -function createSign (algorithm) { - return new Sign(algorithm) +function createSign(algorithm) { + return new Sign(algorithm); } -function createVerify (algorithm) { - return new Verify(algorithm) +function createVerify(algorithm) { + return new Verify(algorithm); } module.exports = { @@ -45164,7 +43995,7 @@ module.exports = { Verify: createVerify, createSign: createSign, createVerify: createVerify -} +}; /***/ }), @@ -45175,149 +44006,157 @@ module.exports = { \******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; + + // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js -var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer) -var createHmac = __webpack_require__(/*! create-hmac */ "./node_modules/create-hmac/browser.js") -var crt = __webpack_require__(/*! browserify-rsa */ "./node_modules/browserify-rsa/index.js") -var EC = (__webpack_require__(/*! elliptic */ "./node_modules/elliptic/lib/elliptic.js").ec) -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js") -var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js") -var curves = __webpack_require__(/*! ./curves.json */ "./node_modules/browserify-sign/browser/curves.json") +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer); +var createHmac = __webpack_require__(/*! create-hmac */ "./node_modules/create-hmac/browser.js"); +var crt = __webpack_require__(/*! browserify-rsa */ "./node_modules/browserify-rsa/index.js"); +var EC = (__webpack_require__(/*! elliptic */ "./node_modules/elliptic/lib/elliptic.js").ec); +var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); +var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js"); +var curves = __webpack_require__(/*! ./curves.json */ "./node_modules/browserify-sign/browser/curves.json"); -function sign (hash, key, hashType, signType, tag) { - var priv = parseKeys(key) +var RSA_PKCS1_PADDING = 1; + +function sign(hash, key, hashType, signType, tag) { + var priv = parseKeys(key); if (priv.curve) { // rsa keys can be interpreted as ecdsa ones in openssl - if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type') - return ecSign(hash, priv) + if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong private key type'); } + return ecSign(hash, priv); } else if (priv.type === 'dsa') { - if (signType !== 'dsa') throw new Error('wrong private key type') - return dsaSign(hash, priv, hashType) - } else { - if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type') + if (signType !== 'dsa') { throw new Error('wrong private key type'); } + return dsaSign(hash, priv, hashType); } - hash = Buffer.concat([tag, hash]) - var len = priv.modulus.byteLength() - var pad = [0, 1] - while (hash.length + pad.length + 1 < len) pad.push(0xff) - pad.push(0x00) - var i = -1 - while (++i < hash.length) pad.push(hash[i]) + if (signType !== 'rsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong private key type'); } + if (key.padding !== undefined && key.padding !== RSA_PKCS1_PADDING) { throw new Error('illegal or unsupported padding mode'); } - var out = crt(pad, priv) - return out + hash = Buffer.concat([tag, hash]); + var len = priv.modulus.byteLength(); + var pad = [0, 1]; + while (hash.length + pad.length + 1 < len) { pad.push(0xff); } + pad.push(0x00); + var i = -1; + while (++i < hash.length) { pad.push(hash[i]); } + + var out = crt(pad, priv); + return out; } -function ecSign (hash, priv) { - var curveId = curves[priv.curve.join('.')] - if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.')) +function ecSign(hash, priv) { + var curveId = curves[priv.curve.join('.')]; + if (!curveId) { throw new Error('unknown curve ' + priv.curve.join('.')); } - var curve = new EC(curveId) - var key = curve.keyFromPrivate(priv.privateKey) - var out = key.sign(hash) + var curve = new EC(curveId); + var key = curve.keyFromPrivate(priv.privateKey); + var out = key.sign(hash); - return Buffer.from(out.toDER()) + return Buffer.from(out.toDER()); } -function dsaSign (hash, priv, algo) { - var x = priv.params.priv_key - var p = priv.params.p - var q = priv.params.q - var g = priv.params.g - var r = new BN(0) - var k - var H = bits2int(hash, q).mod(q) - var s = false - var kv = getKey(x, q, hash, algo) +function dsaSign(hash, priv, algo) { + var x = priv.params.priv_key; + var p = priv.params.p; + var q = priv.params.q; + var g = priv.params.g; + var r = new BN(0); + var k; + var H = bits2int(hash, q).mod(q); + var s = false; + var kv = getKey(x, q, hash, algo); while (s === false) { - k = makeKey(q, kv, algo) - r = makeR(g, k, p, q) - s = k.invm(q).imul(H.add(x.mul(r))).mod(q) + k = makeKey(q, kv, algo); + r = makeR(g, k, p, q); + s = k.invm(q).imul(H.add(x.mul(r))).mod(q); if (s.cmpn(0) === 0) { - s = false - r = new BN(0) + s = false; + r = new BN(0); } } - return toDER(r, s) + return toDER(r, s); } -function toDER (r, s) { - r = r.toArray() - s = s.toArray() +function toDER(r, s) { + r = r.toArray(); + s = s.toArray(); // Pad values - if (r[0] & 0x80) r = [0].concat(r) - if (s[0] & 0x80) s = [0].concat(s) + if (r[0] & 0x80) { r = [0].concat(r); } + if (s[0] & 0x80) { s = [0].concat(s); } - var total = r.length + s.length + 4 - var res = [0x30, total, 0x02, r.length] - res = res.concat(r, [0x02, s.length], s) - return Buffer.from(res) + var total = r.length + s.length + 4; + var res = [ + 0x30, total, 0x02, r.length + ]; + res = res.concat(r, [0x02, s.length], s); + return Buffer.from(res); } -function getKey (x, q, hash, algo) { - x = Buffer.from(x.toArray()) +function getKey(x, q, hash, algo) { + x = Buffer.from(x.toArray()); if (x.length < q.byteLength()) { - var zeros = Buffer.alloc(q.byteLength() - x.length) - x = Buffer.concat([zeros, x]) - } - var hlen = hash.length - var hbits = bits2octets(hash, q) - var v = Buffer.alloc(hlen) - v.fill(1) - var k = Buffer.alloc(hlen) - k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest() - v = createHmac(algo, k).update(v).digest() - k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest() - v = createHmac(algo, k).update(v).digest() - return { k: k, v: v } -} - -function bits2int (obits, q) { - var bits = new BN(obits) - var shift = (obits.length << 3) - q.bitLength() - if (shift > 0) bits.ishrn(shift) - return bits -} - -function bits2octets (bits, q) { - bits = bits2int(bits, q) - bits = bits.mod(q) - var out = Buffer.from(bits.toArray()) + var zeros = Buffer.alloc(q.byteLength() - x.length); + x = Buffer.concat([zeros, x]); + } + var hlen = hash.length; + var hbits = bits2octets(hash, q); + var v = Buffer.alloc(hlen); + v.fill(1); + var k = Buffer.alloc(hlen); + k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest(); + v = createHmac(algo, k).update(v).digest(); + k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest(); + v = createHmac(algo, k).update(v).digest(); + return { k: k, v: v }; +} + +function bits2int(obits, q) { + var bits = new BN(obits); + var shift = (obits.length << 3) - q.bitLength(); + if (shift > 0) { bits.ishrn(shift); } + return bits; +} + +function bits2octets(bits, q) { + bits = bits2int(bits, q); + bits = bits.mod(q); + var out = Buffer.from(bits.toArray()); if (out.length < q.byteLength()) { - var zeros = Buffer.alloc(q.byteLength() - out.length) - out = Buffer.concat([zeros, out]) + var zeros = Buffer.alloc(q.byteLength() - out.length); + out = Buffer.concat([zeros, out]); } - return out + return out; } -function makeKey (q, kv, algo) { - var t - var k +function makeKey(q, kv, algo) { + var t; + var k; do { - t = Buffer.alloc(0) + t = Buffer.alloc(0); while (t.length * 8 < q.bitLength()) { - kv.v = createHmac(algo, kv.k).update(kv.v).digest() - t = Buffer.concat([t, kv.v]) + kv.v = createHmac(algo, kv.k).update(kv.v).digest(); + t = Buffer.concat([t, kv.v]); } - k = bits2int(t, q) - kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest() - kv.v = createHmac(algo, kv.k).update(kv.v).digest() - } while (k.cmp(q) !== -1) + k = bits2int(t, q); + kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest(); + kv.v = createHmac(algo, kv.k).update(kv.v).digest(); + } while (k.cmp(q) !== -1); - return k + return k; } -function makeR (g, k, p, q) { - return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q) +function makeR(g, k, p, q) { + return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q); } -module.exports = sign -module.exports.getKey = getKey -module.exports.makeKey = makeKey +module.exports = sign; +module.exports.getKey = getKey; +module.exports.makeKey = makeKey; /***/ }), @@ -45328,228 +44167,93 @@ module.exports.makeKey = makeKey \********************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; + + // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js -var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer) -var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js") -var EC = (__webpack_require__(/*! elliptic */ "./node_modules/elliptic/lib/elliptic.js").ec) -var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js") -var curves = __webpack_require__(/*! ./curves.json */ "./node_modules/browserify-sign/browser/curves.json") +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer); +var BN = __webpack_require__(/*! bn.js */ "./node_modules/bn.js/lib/bn.js"); +var EC = (__webpack_require__(/*! elliptic */ "./node_modules/elliptic/lib/elliptic.js").ec); +var parseKeys = __webpack_require__(/*! parse-asn1 */ "./node_modules/parse-asn1/index.js"); +var curves = __webpack_require__(/*! ./curves.json */ "./node_modules/browserify-sign/browser/curves.json"); -function verify (sig, hash, key, signType, tag) { - var pub = parseKeys(key) +function verify(sig, hash, key, signType, tag) { + var pub = parseKeys(key); if (pub.type === 'ec') { // rsa keys can be interpreted as ecdsa ones in openssl - if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type') - return ecVerify(sig, hash, pub) + if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong public key type'); } + return ecVerify(sig, hash, pub); } else if (pub.type === 'dsa') { - if (signType !== 'dsa') throw new Error('wrong public key type') - return dsaVerify(sig, hash, pub) - } else { - if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type') + if (signType !== 'dsa') { throw new Error('wrong public key type'); } + return dsaVerify(sig, hash, pub); } - hash = Buffer.concat([tag, hash]) - var len = pub.modulus.byteLength() - var pad = [1] - var padNum = 0 + if (signType !== 'rsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong public key type'); } + + hash = Buffer.concat([tag, hash]); + var len = pub.modulus.byteLength(); + var pad = [1]; + var padNum = 0; while (hash.length + pad.length + 2 < len) { - pad.push(0xff) - padNum++ + pad.push(0xff); + padNum += 1; } - pad.push(0x00) - var i = -1 + pad.push(0x00); + var i = -1; while (++i < hash.length) { - pad.push(hash[i]) + pad.push(hash[i]); } - pad = Buffer.from(pad) - var red = BN.mont(pub.modulus) - sig = new BN(sig).toRed(red) + pad = Buffer.from(pad); + var red = BN.mont(pub.modulus); + sig = new BN(sig).toRed(red); - sig = sig.redPow(new BN(pub.publicExponent)) - sig = Buffer.from(sig.fromRed().toArray()) - var out = padNum < 8 ? 1 : 0 - len = Math.min(sig.length, pad.length) - if (sig.length !== pad.length) out = 1 + sig = sig.redPow(new BN(pub.publicExponent)); + sig = Buffer.from(sig.fromRed().toArray()); + var out = padNum < 8 ? 1 : 0; + len = Math.min(sig.length, pad.length); + if (sig.length !== pad.length) { out = 1; } - i = -1 - while (++i < len) out |= sig[i] ^ pad[i] - return out === 0 + i = -1; + while (++i < len) { out |= sig[i] ^ pad[i]; } + return out === 0; } -function ecVerify (sig, hash, pub) { - var curveId = curves[pub.data.algorithm.curve.join('.')] - if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.')) +function ecVerify(sig, hash, pub) { + var curveId = curves[pub.data.algorithm.curve.join('.')]; + if (!curveId) { throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.')); } - var curve = new EC(curveId) - var pubkey = pub.data.subjectPrivateKey.data + var curve = new EC(curveId); + var pubkey = pub.data.subjectPrivateKey.data; - return curve.verify(hash, sig, pubkey) + return curve.verify(hash, sig, pubkey); } -function dsaVerify (sig, hash, pub) { - var p = pub.data.p - var q = pub.data.q - var g = pub.data.g - var y = pub.data.pub_key - var unpacked = parseKeys.signature.decode(sig, 'der') - var s = unpacked.s - var r = unpacked.r - checkValue(s, q) - checkValue(r, q) - var montp = BN.mont(p) - var w = s.invm(q) +function dsaVerify(sig, hash, pub) { + var p = pub.data.p; + var q = pub.data.q; + var g = pub.data.g; + var y = pub.data.pub_key; + var unpacked = parseKeys.signature.decode(sig, 'der'); + var s = unpacked.s; + var r = unpacked.r; + checkValue(s, q); + checkValue(r, q); + var montp = BN.mont(p); + var w = s.invm(q); var v = g.toRed(montp) .redPow(new BN(hash).mul(w).mod(q)) .fromRed() .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()) .mod(p) - .mod(q) - return v.cmp(r) === 0 + .mod(q); + return v.cmp(r) === 0; } -function checkValue (b, q) { - if (b.cmpn(0) <= 0) throw new Error('invalid sig') - if (b.cmp(q) >= q) throw new Error('invalid sig') +function checkValue(b, q) { + if (b.cmpn(0) <= 0) { throw new Error('invalid sig'); } + if (b.cmp(q) >= 0) { throw new Error('invalid sig'); } } -module.exports = verify - - -/***/ }), - -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js ***! - \*************************************************************************************/ -/***/ (function(module) { - -"use strict"; - - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -var codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; - } - - return NodeError; - }(Base); - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - - -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); - - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } - } else { - return "of ".concat(thing, " ").concat(String(expected)); - } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - - -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - - -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; - - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - var msg; - - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; +module.exports = verify; /***/ }), @@ -45589,92 +44293,90 @@ module.exports.codes = codes; +/**/ + +var pna = __webpack_require__(/*! process-nextick-args */ "./node_modules/process-nextick-args/index.js"); +/**/ + /**/ var objectKeys = Object.keys || function (obj) { var keys = []; - for (var key in obj) keys.push(key); - return keys; + for (var key in obj) { + keys.push(key); + }return keys; }; /**/ module.exports = Duplex; + +/**/ +var util = Object.create(__webpack_require__(/*! core-util-is */ "./node_modules/core-util-is/lib/util.js")); +util.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +/**/ + var Readable = __webpack_require__(/*! ./_stream_readable */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_readable.js"); var Writable = __webpack_require__(/*! ./_stream_writable */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_writable.js"); -__webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Duplex, Readable); + +util.inherits(Duplex, Readable); + { - // Allow the keys array to be GC'ed. + // avoid scope creep, the keys array can then be collected var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } + function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + this.allowHalfOpen = true; - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); } + Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get() { + get: function () { return this._writableState.highWaterMark; } }); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); // the no-half-open enforcer function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. - ({"env":{"NODE_ENV":"production"}}).nextTick(onEndNT, this); + pna.nextTick(onEndNT, this); } + function onEndNT(self) { self.end(); } + Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { + get: function () { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, - set: function set(value) { + set: function (value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { @@ -45688,6 +44390,13 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { } }); +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; + /***/ }), /***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_passthrough.js": @@ -45725,12 +44434,22 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { module.exports = PassThrough; + var Transform = __webpack_require__(/*! ./_stream_transform */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_transform.js"); -__webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(PassThrough, Transform); + +/**/ +var util = Object.create(__webpack_require__(/*! core-util-is */ "./node_modules/core-util-is/lib/util.js")); +util.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +/**/ + +util.inherits(PassThrough, Transform); + function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); } + PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; @@ -45767,8 +44486,17 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) { +/**/ + +var pna = __webpack_require__(/*! process-nextick-args */ "./node_modules/process-nextick-args/index.js"); +/**/ + module.exports = Readable; +/**/ +var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js"); +/**/ + /**/ var Duplex; /**/ @@ -45777,7 +44505,8 @@ Readable.ReadableState = ReadableState; /**/ var EE = (__webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter); -var EElistenerCount = function EElistenerCount(emitter, type) { + +var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; /**/ @@ -45786,7 +44515,9 @@ var EElistenerCount = function EElistenerCount(emitter, type) { var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js"); /**/ -var Buffer = (__webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer); +/**/ + +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js").Buffer); var OurUint8Array = (typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); @@ -45795,33 +44526,31 @@ function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } +/**/ + +/**/ +var util = Object.create(__webpack_require__(/*! core-util-is */ "./node_modules/core-util-is/lib/util.js")); +util.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +/**/ + /**/ var debugUtil = __webpack_require__(/*! util */ "?593c"); -var debug; +var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { - debug = function debug() {}; + debug = function () {}; } /**/ -var BufferList = __webpack_require__(/*! ./internal/streams/buffer_list */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/buffer_list.js"); +var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/BufferList.js"); var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/destroy.js"); -var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/state.js"), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = (__webpack_require__(/*! ../errors */ "./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js").codes), - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; - -// Lazy loaded to improve the startup performance. var StringDecoder; -var createReadableStreamAsyncIterator; -var from; -__webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Readable, Stream); -var errorOrDestroy = destroyImpl.errorOrDestroy; + +util.inherits(Readable, Stream); + var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. @@ -45831,10 +44560,12 @@ function prependListener(emitter, event, fn) { // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } -function ReadableState(options, stream, isDuplex) { + +function ReadableState(options, stream) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js"); + options = options || {}; // Duplex streams are both readable and writable, but share @@ -45842,16 +44573,24 @@ function ReadableState(options, stream, isDuplex) { // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + var isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than @@ -45877,13 +44616,6 @@ function ReadableState(options, stream, isDuplex) { this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; - this.paused = true; - - // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; - - // Should .destroy() be called after 'end' (and potentially 'finish') - this.autoDestroy = !!options.autoDestroy; // has it been destroyed this.destroyed = false; @@ -45898,43 +44630,43 @@ function ReadableState(options, stream, isDuplex) { // if true, a maybeReadMore has been scheduled this.readingMore = false; + this.decoder = null; this.encoding = null; if (options.encoding) { - if (!StringDecoder) StringDecoder = (__webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder); + if (!StringDecoder) StringDecoder = (__webpack_require__(/*! string_decoder/ */ "./node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js").StringDecoder); this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } + function Readable(options) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js"); + if (!(this instanceof Readable)) return new Readable(options); - // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); + this._readableState = new ReadableState(options, this); // legacy this.readable = true; + if (options) { if (typeof options.read === 'function') this._read = options.read; + if (typeof options.destroy === 'function') this._destroy = options.destroy; } + Stream.call(this); } + Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { + get: function () { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, - set: function set(value) { + set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { @@ -45946,9 +44678,11 @@ Object.defineProperty(Readable.prototype, 'destroyed', { this._readableState.destroyed = value; } }); + Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { + this.push(null); cb(err); }; @@ -45959,6 +44693,7 @@ Readable.prototype._destroy = function (err, cb) { Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; + if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; @@ -45971,6 +44706,7 @@ Readable.prototype.push = function (chunk, encoding) { } else { skipChunkCheck = true; } + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; @@ -45978,8 +44714,8 @@ Readable.prototype.push = function (chunk, encoding) { Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; + function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; @@ -45988,17 +44724,16 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { - errorOrDestroy(stream, er); + stream.emit('error', er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } + if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; + stream.emit('error', new Error('stream.push() after EOF')); } else { state.reading = false; if (state.decoder && !encoding) { @@ -46010,64 +44745,61 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { } } else if (!addToFront) { state.reading = false; - maybeReadMore(stream, state); } } - // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - return !state.ended && (state.length < state.highWaterMark || state.length === 0); + return needMoreData(state); } + function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; stream.emit('data', chunk); + stream.read(0); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } + function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); + er = new TypeError('Invalid non-string/buffer chunk'); } return er; } + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = (__webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder); - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; - // If setEncoding(null), decoder.encoding equals utf8 - this._readableState.encoding = this._readableState.decoder.encoding; - - // Iterate over current buffer to convert already stored Buffers: - var p = this._readableState.buffer.head; - var content = ''; - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - this._readableState.buffer.clear(); - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; + if (!StringDecoder) StringDecoder = (__webpack_require__(/*! string_decoder/ */ "./node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js").StringDecoder); + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; return this; }; -// Don't raise the hwm > 1GB -var MAX_HWM = 0x40000000; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in @@ -46109,16 +44841,18 @@ Readable.prototype.read = function (n) { n = parseInt(n, 10); var state = this._readableState; var nOrig = n; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } + n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. @@ -46177,15 +44911,17 @@ Readable.prototype.read = function (n) { // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } + var ret; if (n > 0) ret = fromList(n, state);else ret = null; + if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; + state.needReadable = true; n = 0; } else { state.length -= n; - state.awaitDrain = 0; } + if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. @@ -46194,11 +44930,13 @@ Readable.prototype.read = function (n) { // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } + if (ret !== null) this.emit('data', ret); + return ret; }; + function onEofChunk(stream, state) { - debug('onEofChunk'); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); @@ -46208,19 +44946,9 @@ function onEofChunk(stream, state) { } } state.ended = true; - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); } // Don't emit readable right away in sync mode, because this can trigger @@ -46228,29 +44956,17 @@ function onEofChunk(stream, state) { // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; - ({"env":{"NODE_ENV":"production"}}).nextTick(emitReadable_, stream); + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } } -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } - // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); flow(stream); } @@ -46263,40 +44979,18 @@ function emitReadable_(stream) { function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; - ({"env":{"NODE_ENV":"production"}}).nextTick(maybeReadMore_, stream, state); + pna.nextTick(maybeReadMore_, stream, state); } } + function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. - break; + break;else len = state.length; } state.readingMore = false; } @@ -46306,11 +45000,13 @@ function maybeReadMore_(stream, state) { // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); + this.emit('error', new Error('_read() is not implemented')); }; + Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; + switch (state.pipesCount) { case 0: state.pipes = dest; @@ -46324,9 +45020,12 @@ Readable.prototype.pipe = function (dest, pipeOpts) { } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== ({"env":{"NODE_ENV":"production"}}).stdout && dest !== ({"env":{"NODE_ENV":"production"}}).stderr; + var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) ({"env":{"NODE_ENV":"production"}}).nextTick(endFn);else src.once('end', endFn); + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); @@ -46337,6 +45036,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { } } } + function onend() { debug('onend'); dest.end(); @@ -46348,6 +45048,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); + var cleanedUp = false; function cleanup() { debug('cleanup'); @@ -46360,6 +45061,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); + cleanedUp = true; // if the reader is waiting for a drain event from this @@ -46369,12 +45071,18 @@ Readable.prototype.pipe = function (dest, pipeOpts) { // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; src.on('data', ondata); function ondata(chunk) { debug('ondata'); + increasedAwaitDrain = false; var ret = dest.write(chunk); - debug('dest.write', ret); - if (ret === false) { + if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. @@ -46382,6 +45090,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; + increasedAwaitDrain = true; } src.pause(); } @@ -46393,7 +45102,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // Make sure our error handler is attached before userland ones. @@ -46411,6 +45120,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { unpipe(); } dest.once('finish', onfinish); + function unpipe() { debug('unpipe'); src.unpipe(dest); @@ -46424,10 +45134,12 @@ Readable.prototype.pipe = function (dest, pipeOpts) { debug('pipe resume'); src.resume(); } + return dest; }; + function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { + return function () { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; @@ -46437,11 +45149,10 @@ function pipeOnDrain(src) { } }; } + Readable.prototype.unpipe = function (dest) { var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; + var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; @@ -46450,6 +45161,7 @@ Readable.prototype.unpipe = function (dest) { if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; // got a match. @@ -46469,19 +45181,22 @@ Readable.prototype.unpipe = function (dest) { state.pipes = null; state.pipesCount = 0; state.flowing = false; - for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - return this; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, { hasUnpiped: false }); + }return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; + state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit('unpipe', this, unpipeInfo); + return this; }; @@ -46489,69 +45204,27 @@ Readable.prototype.unpipe = function (dest) { // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; - // Try start flowing on next tick if stream isn't explicitly paused - if (state.flowing !== false) this.resume(); + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); } else if (ev === 'readable') { + var state = this._readableState; if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; - state.flowing = false; state.emittedReadable = false; - debug('on readable', state.length, state.reading); - if (state.length) { + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { emitReadable(this); - } else if (!state.reading) { - ({"env":{"NODE_ENV":"production"}}).nextTick(nReadingNextTick, this); } } } + return res; }; Readable.prototype.addListener = Readable.prototype.on; -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - ({"env":{"NODE_ENV":"production"}}).nextTick(updateReadableListening, this); - } - return res; -}; -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - ({"env":{"NODE_ENV":"production"}}).nextTick(updateReadableListening, this); - } - return res; -}; -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; - // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); @@ -46563,45 +45236,46 @@ Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); - // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - state.flowing = !state.readableListening; + state.flowing = true; resume(this, state); } - state.paused = false; return this; }; + function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; - ({"env":{"NODE_ENV":"production"}}).nextTick(resume_, stream, state); + pna.nextTick(resume_, stream, state); } } + function resume_(stream, state) { - debug('resume', state.reading); if (!state.reading) { + debug('resume read 0'); stream.read(0); } + state.resumeScheduled = false; + state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } + Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); - if (this._readableState.flowing !== false) { + if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } - this._readableState.paused = true; return this; }; + function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); - while (state.flowing && stream.read() !== null); + while (state.flowing && stream.read() !== null) {} } // wrap an old-style stream as the async data source. @@ -46609,22 +45283,27 @@ function flow(stream) { // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; + var state = this._readableState; var paused = false; + stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } + _this.push(null); }); + stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + var ret = _this.push(chunk); if (!ret) { paused = true; @@ -46636,8 +45315,8 @@ Readable.prototype.wrap = function (stream) { // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { + this[i] = function (method) { + return function () { return stream[method].apply(stream, arguments); }; }(i); @@ -46658,60 +45337,22 @@ Readable.prototype.wrap = function (stream) { stream.resume(); } }; + return this; }; -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = __webpack_require__(/*! ./internal/streams/async_iterator */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/async_iterator.js"); - } - return createReadableStreamAsyncIterator(this); - }; -} + Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get() { + get: function () { return this._readableState.highWaterMark; } }); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); // exposed for testing purposes only. Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. @@ -46720,51 +45361,121 @@ Object.defineProperty(Readable.prototype, 'readableLength', { function fromList(n, state) { // nothing buffered if (state.length === 0) return null; + var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list - ret = state.buffer.consume(n, state.decoder); + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; } + list.length -= c; return ret; } + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + function endReadable(stream) { var state = stream._readableState; - debug('endReadable', state.endEmitted); + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + if (!state.endEmitted) { state.ended = true; - ({"env":{"NODE_ENV":"production"}}).nextTick(endReadableNT, state, stream); + pna.nextTick(endReadableNT, state, stream); } } -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); +function endReadableNT(state, stream) { // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } } } -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = __webpack_require__(/*! ./internal/streams/from */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/from-browser.js"); - } - return from(Readable, iterable, opts); - }; -} + function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; @@ -46847,35 +45558,46 @@ function indexOf(xs, x) { module.exports = Transform; -var _require$codes = (__webpack_require__(/*! ../errors */ "./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js").codes), - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex = __webpack_require__(/*! ./_stream_duplex */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js"); -__webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Transform, Duplex); + +/**/ +var util = Object.create(__webpack_require__(/*! core-util-is */ "./node_modules/core-util-is/lib/util.js")); +util.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +/**/ + +util.inherits(Transform, Duplex); + function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; + var cb = ts.writecb; - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); } + ts.writechunk = null; ts.writecb = null; - if (data != null) - // single equals check for both `null` and `undefined` + + if (data != null) // single equals check for both `null` and `undefined` this.push(data); + cb(er); + var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } + function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, @@ -46892,17 +45614,21 @@ function Transform(options) { // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; + if (options) { if (typeof options.transform === 'function') this._transform = options.transform; + if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } + function prefinish() { var _this = this; - if (typeof this._flush === 'function' && !this._readableState.destroyed) { + + if (typeof this._flush === 'function') { this._flush(function (er, data) { done(_this, er, data); }); @@ -46910,6 +45636,7 @@ function prefinish() { done(this, null, null); } } + Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); @@ -46926,8 +45653,9 @@ Transform.prototype.push = function (chunk, encoding) { // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); + throw new Error('_transform() is not implemented'); }; + Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; @@ -46944,7 +45672,8 @@ Transform.prototype._write = function (chunk, encoding, cb) { // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; - if (ts.writechunk !== null && !ts.transforming) { + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { @@ -46953,22 +45682,28 @@ Transform.prototype._read = function (n) { ts.needTransform = true; } }; + Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); + _this2.emit('close'); }); }; + function done(stream, er, data) { if (er) return stream.emit('error', er); - if (data != null) - // single equals check for both `null` and `undefined` + + if (data != null) // single equals check for both `null` and `undefined` stream.push(data); - // TODO(BridgeAR): Write a test for these two error cases // if there's nothing in the write buffer, then that means // that nothing more will ever be provided - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + return stream.push(null); } @@ -47008,6 +45743,11 @@ function done(stream, er, data) { +/**/ + +var pna = __webpack_require__(/*! process-nextick-args */ "./node_modules/process-nextick-args/index.js"); +/**/ + module.exports = Writable; /* */ @@ -47022,6 +45762,7 @@ function WriteReq(chunk, encoding, cb) { // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; + this.next = null; this.entry = null; this.finish = function () { @@ -47030,12 +45771,21 @@ function CorkedRequest(state) { } /* */ +/**/ +var asyncWrite = !({"env":{"NODE_ENV":"production"}}).browser && ['v0.10', 'v0.9.'].indexOf(({"env":{"NODE_ENV":"production"}}).version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + /**/ var Duplex; /**/ Writable.WritableState = WritableState; +/**/ +var util = Object.create(__webpack_require__(/*! core-util-is */ "./node_modules/core-util-is/lib/util.js")); +util.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); +/**/ + /**/ var internalUtil = { deprecate: __webpack_require__(/*! util-deprecate */ "./node_modules/util-deprecate/browser.js") @@ -47046,7 +45796,9 @@ var internalUtil = { var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js"); /**/ -var Buffer = (__webpack_require__(/*! buffer */ "./node_modules/buffer/index.js").Buffer); +/**/ + +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js").Buffer); var OurUint8Array = (typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); @@ -47054,41 +45806,44 @@ function _uint8ArrayToBuffer(chunk) { function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } + +/**/ + var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/destroy.js"); -var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/state.js"), - getHighWaterMark = _require.getHighWaterMark; -var _require$codes = (__webpack_require__(/*! ../errors */ "./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js").codes), - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; -var errorOrDestroy = destroyImpl.errorOrDestroy; -__webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Writable, Stream); + +util.inherits(Writable, Stream); + function nop() {} -function WritableState(options, stream, isDuplex) { + +function WritableState(options, stream) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js"); + options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); // if _final has been called this.finalCalled = false; @@ -47148,6 +45903,7 @@ function WritableState(options, stream, isDuplex) { // the amount that is being written when _write is called. this.writelen = 0; + this.bufferedRequest = null; this.lastBufferedRequest = null; @@ -47162,12 +45918,6 @@ function WritableState(options, stream, isDuplex) { // True if the error was already emitted and should not be thrown again this.errorEmitted = false; - // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; - - // Should .destroy() be called after 'finish' (and potentially 'end') - this.autoDestroy = !!options.autoDestroy; - // count buffered requests this.bufferedRequestCount = 0; @@ -47175,6 +45925,7 @@ function WritableState(options, stream, isDuplex) { // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } + WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; @@ -47184,10 +45935,11 @@ WritableState.prototype.getBuffer = function getBuffer() { } return out; }; + (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { + get: internalUtil.deprecate(function () { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); @@ -47200,17 +45952,19 @@ var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { + value: function (object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; } }); } else { - realHasInstance = function realHasInstance(object) { + realHasInstance = function (object) { return object instanceof this; }; } + function Writable(options) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js"); @@ -47221,109 +45975,123 @@ function Writable(options) { // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); + this._writableState = new WritableState(options, this); // legacy. this.writable = true; + if (options) { if (typeof options.write === 'function') this._write = options.write; + if (typeof options.writev === 'function') this._writev = options.writev; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.final === 'function') this._final = options.final; } + Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + this.emit('error', new Error('Cannot pipe, not readable')); }; + function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); + var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb - errorOrDestroy(stream, er); - ({"env":{"NODE_ENV":"production"}}).nextTick(cb, er); + stream.emit('error', er); + pna.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { - var er; + var valid = true; + var er = false; + if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); } if (er) { - errorOrDestroy(stream, er); - ({"env":{"NODE_ENV":"production"}}).nextTick(cb, er); - return false; + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; } - return true; + return valid; } + Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); + if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } + if (typeof encoding === 'function') { cb = encoding; encoding = null; } + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } + return ret; }; + Writable.prototype.cork = function () { - this._writableState.corked++; + var state = this._writableState; + + state.corked++; }; + Writable.prototype.uncork = function () { var state = this._writableState; + if (state.corked) { state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; + Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); this._writableState.defaultEncoding = encoding; return this; }; -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); + function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } + Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get() { + get: function () { return this._writableState.highWaterMark; } }); @@ -47341,10 +46109,13 @@ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { } } var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; + if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { @@ -47363,63 +46134,75 @@ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { } else { doWrite(stream, state, false, len, chunk, encoding, cb); } + return ret; } + function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } + function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; + if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack - ({"env":{"NODE_ENV":"production"}}).nextTick(cb, er); + pna.nextTick(cb, er); // this can emit finish, and it will always happen // after error - ({"env":{"NODE_ENV":"production"}}).nextTick(finishMaybe, stream, state); + pna.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); + stream.emit('error', er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); + stream.emit('error', er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } + function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } + function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; + var finished = needFinish(state); + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } + if (sync) { - ({"env":{"NODE_ENV":"production"}}).nextTick(afterWrite, stream, state, finished, cb); + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ } else { afterWrite(stream, state, finished, cb); } } } + function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; @@ -47441,12 +46224,14 @@ function onwriteDrain(stream, state) { function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; + if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; + var count = 0; var allBuffers = true; while (entry) { @@ -47456,6 +46241,7 @@ function clearBuffer(stream, state) { count += 1; } buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time @@ -47476,6 +46262,7 @@ function clearBuffer(stream, state) { var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; @@ -47487,17 +46274,23 @@ function clearBuffer(stream, state) { break; } } + if (entry === null) state.lastBufferedRequest = null; } + state.bufferedRequest = entry; state.bufferProcessing = false; } + Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); + cb(new Error('_write() is not implemented')); }; + Writable.prototype._writev = null; + Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; + if (typeof chunk === 'function') { cb = chunk; chunk = null; @@ -47506,6 +46299,7 @@ Writable.prototype.end = function (chunk, encoding, cb) { cb = encoding; encoding = null; } + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks @@ -47516,17 +46310,8 @@ Writable.prototype.end = function (chunk, encoding, cb) { // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); - return this; }; -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); + function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } @@ -47534,7 +46319,7 @@ function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { - errorOrDestroy(stream, err); + stream.emit('error', err); } state.prefinished = true; stream.emit('prefinish'); @@ -47543,16 +46328,17 @@ function callFinal(stream, state) { } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { + if (typeof stream._final === 'function') { state.pendingcb++; state.finalCalled = true; - ({"env":{"NODE_ENV":"production"}}).nextTick(callFinal, stream, state); + pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } + function finishMaybe(stream, state) { var need = needFinish(state); if (need) { @@ -47560,27 +46346,21 @@ function finishMaybe(stream, state) { if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } } } return need; } + function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { - if (state.finished) ({"env":{"NODE_ENV":"production"}}).nextTick(cb);else stream.once('finish', cb); + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } + function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; @@ -47594,18 +46374,15 @@ function onCorkedFinish(corkReq, state, err) { // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } + Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { + get: function () { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, - set: function set(value) { + set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { @@ -47617,422 +46394,137 @@ Object.defineProperty(Writable.prototype, 'destroyed', { this._writableState.destroyed = value; } }); + Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { + this.end(); cb(err); }; /***/ }), -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/async_iterator.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/async_iterator.js ***! - \**********************************************************************************************************/ +/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/BufferList.js": +/*!******************************************************************************************************!*\ + !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/BufferList.js ***! + \******************************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var _Object$setPrototypeO; -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var finished = __webpack_require__(/*! ./end-of-stream */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"); -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - if (resolve !== null) { - var data = iter[kStream].read(); - // we defer if data is null - // we can be expecting either 'end' or - // 'error' - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - ({"env":{"NODE_ENV":"production"}}).nextTick(readAndResolve, iter); -} -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - next: function next() { - var _this = this; - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - if (error !== null) { - return Promise.reject(error); - } - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - ({"env":{"NODE_ENV":"production"}}).nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } - - // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - var lastPromise = this[kLastPromise]; - var promise; - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - promise = new Promise(this[kHandlePromise]); - } - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; - // reject if we are waiting for data in the Promise - // returned by next() and store the error - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - iterator[kError] = err; - return; - } - var resolve = iterator[kLastResolve]; - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; -module.exports = createReadableStreamAsyncIterator; - -/***/ }), - -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/buffer_list.js": -/*!*******************************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/buffer_list.js ***! - \*******************************************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js").Buffer); +var util = __webpack_require__(/*! util */ "?cad2"); -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var _require = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js"), - Buffer = _require.Buffer; -var _require2 = __webpack_require__(/*! util */ "?cad2"), - inspect = _require2.inspect; -var custom = inspect && inspect.custom || 'inspect'; function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); + src.copy(target, offset); } -module.exports = /*#__PURE__*/function () { + +module.exports = function () { function BufferList() { _classCallCheck(this, BufferList); + this.head = null; this.tail = null; this.length = 0; } - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) ret += s + p.data; - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - } - // Consumes a specified amount of bytes or characters from the buffered data. - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; - // Consumes a specified amount of characters from the buffered data. - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; - // Consumes a specified amount of bytes from the buffered data. - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; - // Make sure the linked list only shows the minimal necessary information. - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread(_objectSpread({}, options), {}, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; } - }]); + return ret; + }; + return BufferList; }(); +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} + /***/ }), /***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/destroy.js": /*!***************************************************************************************************!*\ !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/destroy.js ***! \***************************************************************************************************/ -/***/ (function(module) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/**/ + +var pna = __webpack_require__(/*! process-nextick-args */ "./node_modules/process-nextick-args/index.js"); +/**/ + // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { - ({"env":{"NODE_ENV":"production"}}).nextTick(emitErrorNT, this, err); + pna.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; - ({"env":{"NODE_ENV":"production"}}).nextTick(emitErrorNT, this, err); + pna.nextTick(emitErrorNT, this, err); } } + return this; } @@ -48047,34 +46539,23 @@ function destroy(err, cb) { if (this._writableState) { this._writableState.destroyed = true; } + this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { - ({"env":{"NODE_ENV":"production"}}).nextTick(emitErrorAndCloseNT, _this, err); + pna.nextTick(emitErrorNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; - ({"env":{"NODE_ENV":"production"}}).nextTick(emitErrorAndCloseNT, _this, err); - } else { - ({"env":{"NODE_ENV":"production"}}).nextTick(emitCloseNT, _this); + pna.nextTick(emitErrorNT, _this, err); } } else if (cb) { - ({"env":{"NODE_ENV":"production"}}).nextTick(emitCloseNT, _this); cb(err); - } else { - ({"env":{"NODE_ENV":"production"}}).nextTick(emitCloseNT, _this); } }); + return this; } -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} + function undestroy() { if (this._readableState) { this._readableState.destroyed = false; @@ -48082,6 +46563,7 @@ function undestroy() { this._readableState.ended = false; this._readableState.endEmitted = false; } + if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; @@ -48092,272 +46574,97 @@ function undestroy() { this._writableState.errorEmitted = false; } } + function emitErrorNT(self, err) { self.emit('error', err); } -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} module.exports = { destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy + undestroy: undestroy }; /***/ }), -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/end-of-stream.js": -/*!*********************************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/end-of-stream.js ***! - \*********************************************************************************************************/ +/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js": +/*!**********************************************************************************************************!*\ + !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***! + \**********************************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). - - - -var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE); -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - callback.apply(this, args); - }; -} -function noop() {} -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - var writableEnded = stream._writableState && stream._writableState.finished; - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - var readableEnded = stream._readableState && stream._readableState.endEmitted; - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - var onerror = function onerror(err) { - callback.call(stream, err); - }; - var onclose = function onclose() { - var err; - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} -module.exports = eos; - -/***/ }), - -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/from-browser.js": -/*!********************************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/from-browser.js ***! - \********************************************************************************************************/ -/***/ (function(module) { - -module.exports = function () { - throw new Error('Readable.from is not available in the browser') -}; +module.exports = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter; /***/ }), -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/pipeline.js": -/*!****************************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/pipeline.js ***! - \****************************************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). - +/***/ "./node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js ***! + \*****************************************************************************************************/ +/***/ (function(module, exports, __webpack_require__) { +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js") +var Buffer = buffer.Buffer -var eos; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} -var _require$codes = (__webpack_require__(/*! ../../../errors */ "./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js").codes), - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } } -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer } -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = __webpack_require__(/*! ./end-of-stream */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; - // request.destroy just do .end - .abort is what we want - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} -function call(fn) { - fn(); -} -function pipe(from, to) { - return from.pipe(to); -} -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) } -module.exports = pipeline; - -/***/ }), - -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/state.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/state.js ***! - \*************************************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) -var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/browserify-sign/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE); -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) } -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) } - return Math.floor(hwm); + } else { + buf.fill(0) } - - // Default value - return state.objectMode ? 16 : 16 * 1024; + return buf } -module.exports = { - getHighWaterMark: getHighWaterMark -}; - -/***/ }), -/***/ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***! - \**********************************************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} -module.exports = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter; +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} /***/ }), @@ -48375,89 +46682,465 @@ exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ "./node_ exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js"); exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_transform.js"); exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_passthrough.js"); -exports.finished = __webpack_require__(/*! ./lib/internal/streams/end-of-stream.js */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"); -exports.pipeline = __webpack_require__(/*! ./lib/internal/streams/pipeline.js */ "./node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/pipeline.js"); /***/ }), -/***/ "./node_modules/browserify-zlib/lib/binding.js": -/*!*****************************************************!*\ - !*** ./node_modules/browserify-zlib/lib/binding.js ***! - \*****************************************************/ +/***/ "./node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js ***! + \****************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -/* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; - -/* eslint camelcase: "off" */ - -var assert = __webpack_require__(/*! assert */ "./node_modules/assert/build/assert.js"); +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -var Zstream = __webpack_require__(/*! pako/lib/zlib/zstream */ "./node_modules/pako/lib/zlib/zstream.js"); -var zlib_deflate = __webpack_require__(/*! pako/lib/zlib/deflate.js */ "./node_modules/pako/lib/zlib/deflate.js"); -var zlib_inflate = __webpack_require__(/*! pako/lib/zlib/inflate.js */ "./node_modules/pako/lib/zlib/inflate.js"); -var constants = __webpack_require__(/*! pako/lib/zlib/constants */ "./node_modules/pako/lib/zlib/constants.js"); -for (var key in constants) { - exports[key] = constants[key]; -} -// zlib modes -exports.NONE = 0; -exports.DEFLATE = 1; -exports.INFLATE = 2; -exports.GZIP = 3; -exports.GUNZIP = 4; -exports.DEFLATERAW = 5; -exports.INFLATERAW = 6; -exports.UNZIP = 7; +/**/ -var GZIP_HEADER_ID1 = 0x1f; -var GZIP_HEADER_ID2 = 0x8b; +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.js").Buffer); +/**/ -/** - * Emulate Node's zlib C++ layer for use by the JS layer in index.js - */ -function Zlib(mode) { - if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) { - throw new TypeError('Bad argument'); +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; } +}; - this.dictionary = null; - this.err = 0; - this.flush = 0; - this.init_done = false; - this.level = 0; - this.memLevel = 0; - this.mode = mode; - this.strategy = 0; - this.windowBits = 0; - this.write_in_progress = false; - this.pending_close = false; - this.gzip_id_bytes_read = 0; -} - -Zlib.prototype.close = function () { - if (this.write_in_progress) { - this.pending_close = true; - return; +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } } +}; - this.pending_close = false; - - assert(this.init_done, 'close before init'); - assert(this.mode <= exports.UNZIP); +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} - if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) { - zlib_deflate.deflateEnd(this.strm); - } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) { - zlib_inflate.inflateEnd(this.strm); +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} - this.mode = exports.NONE; - - this.dictionary = null; +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} + +/***/ }), + +/***/ "./node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.js ***! + \****************************************************************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js") +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + + +/***/ }), + +/***/ "./node_modules/browserify-zlib/lib/binding.js": +/*!*****************************************************!*\ + !*** ./node_modules/browserify-zlib/lib/binding.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; + +/* eslint camelcase: "off" */ + +var assert = __webpack_require__(/*! assert */ "./node_modules/assert/build/assert.js"); + +var Zstream = __webpack_require__(/*! pako/lib/zlib/zstream */ "./node_modules/pako/lib/zlib/zstream.js"); +var zlib_deflate = __webpack_require__(/*! pako/lib/zlib/deflate.js */ "./node_modules/pako/lib/zlib/deflate.js"); +var zlib_inflate = __webpack_require__(/*! pako/lib/zlib/inflate.js */ "./node_modules/pako/lib/zlib/inflate.js"); +var constants = __webpack_require__(/*! pako/lib/zlib/constants */ "./node_modules/pako/lib/zlib/constants.js"); + +for (var key in constants) { + exports[key] = constants[key]; +} + +// zlib modes +exports.NONE = 0; +exports.DEFLATE = 1; +exports.INFLATE = 2; +exports.GZIP = 3; +exports.GUNZIP = 4; +exports.DEFLATERAW = 5; +exports.INFLATERAW = 6; +exports.UNZIP = 7; + +var GZIP_HEADER_ID1 = 0x1f; +var GZIP_HEADER_ID2 = 0x8b; + +/** + * Emulate Node's zlib C++ layer for use by the JS layer in index.js + */ +function Zlib(mode) { + if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) { + throw new TypeError('Bad argument'); + } + + this.dictionary = null; + this.err = 0; + this.flush = 0; + this.init_done = false; + this.level = 0; + this.memLevel = 0; + this.mode = mode; + this.strategy = 0; + this.windowBits = 0; + this.write_in_progress = false; + this.pending_close = false; + this.gzip_id_bytes_read = 0; +} + +Zlib.prototype.close = function () { + if (this.write_in_progress) { + this.pending_close = true; + return; + } + + this.pending_close = false; + + assert(this.init_done, 'close before init'); + assert(this.mode <= exports.UNZIP); + + if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) { + zlib_deflate.deflateEnd(this.strm); + } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) { + zlib_inflate.inflateEnd(this.strm); + } + + this.mode = exports.NONE; + + this.dictionary = null; }; Zlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) { @@ -49448,6 +48131,7 @@ module.exports = function xor (a, b) { /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /*! * The buffer module from node.js, for the browser. * @@ -51811,6 +50495,221 @@ CipherBase.prototype._toString = function (value, enc, fin) { module.exports = CipherBase +/***/ }), + +/***/ "./node_modules/console-browserify/index.js": +/*!**************************************************!*\ + !*** ./node_modules/console-browserify/index.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/*global window, global*/ +var util = __webpack_require__(/*! util */ "./node_modules/util/util.js") +var assert = __webpack_require__(/*! assert */ "./node_modules/assert/build/assert.js") +function now() { return new Date().getTime() } + +var slice = Array.prototype.slice +var console +var times = {} + +if (typeof __webpack_require__.g !== "undefined" && __webpack_require__.g.console) { + console = __webpack_require__.g.console +} else if (typeof window !== "undefined" && window.console) { + console = window.console +} else { + console = {} +} + +var functions = [ + [log, "log"], + [info, "info"], + [warn, "warn"], + [error, "error"], + [time, "time"], + [timeEnd, "timeEnd"], + [trace, "trace"], + [dir, "dir"], + [consoleAssert, "assert"] +] + +for (var i = 0; i < functions.length; i++) { + var tuple = functions[i] + var f = tuple[0] + var name = tuple[1] + + if (!console[name]) { + console[name] = f + } +} + +module.exports = console + +function log() {} + +function info() { + console.log.apply(console, arguments) +} + +function warn() { + console.log.apply(console, arguments) +} + +function error() { + console.warn.apply(console, arguments) +} + +function time(label) { + times[label] = now() +} + +function timeEnd(label) { + var time = times[label] + if (!time) { + throw new Error("No such label: " + label) + } + + delete times[label] + var duration = now() - time + console.log(label + ": " + duration + "ms") +} + +function trace() { + var err = new Error() + err.name = "Trace" + err.message = util.format.apply(null, arguments) + console.error(err.stack) +} + +function dir(object) { + console.log(util.inspect(object) + "\n") +} + +function consoleAssert(expression) { + if (!expression) { + var arr = slice.call(arguments, 1) + assert.ok(false, util.format.apply(null, arr)) + } +} + + +/***/ }), + +/***/ "./node_modules/core-util-is/lib/util.js": +/*!***********************************************!*\ + !*** ./node_modules/core-util-is/lib/util.js ***! + \***********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +/* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + /***/ }), /***/ "./node_modules/cosmjs-types/binary.js": @@ -102391,569 +101290,6 @@ exports.constants = { } -/***/ }), - -/***/ "./node_modules/debug/src/browser.js": -/*!*******************************************!*\ - !*** ./node_modules/debug/src/browser.js ***! - \*******************************************/ -/***/ (function(module, exports, __webpack_require__) { - -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && "object" !== 'undefined' && 'env' in ({"env":{"NODE_ENV":"production"}})) { - r = ({"NODE_ENV":"production"}).DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = __webpack_require__(/*! ./common */ "./node_modules/debug/src/common.js")(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; - - -/***/ }), - -/***/ "./node_modules/debug/src/common.js": -/*!******************************************!*\ - !*** ./node_modules/debug/src/common.js ***! - \******************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js"); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; - - /***/ }), /***/ "./node_modules/define-data-property/index.js": @@ -110281,6 +108617,10 @@ function getLength(buf, p) { return false; } + if(buf[p.place] === 0x00) { + return false; + } + var val = 0; for (var i = 0, off = p.place; i < octetLen; i++, off++) { val <<= 8; @@ -110329,6 +108669,9 @@ Signature.prototype._importDER = function _importDER(data, enc) { if (rlen === false) { return false; } + if ((data[p.place] & 128) !== 0) { + return false; + } var r = data.slice(p.place, rlen + p.place); p.place += rlen; if (data[p.place++] !== 0x02) { @@ -110341,6 +108684,9 @@ Signature.prototype._importDER = function _importDER(data, enc) { if (data.length !== slen + p.place) { return false; } + if ((data[p.place] & 128) !== 0) { + return false; + } var s = data.slice(p.place, slen + p.place); if (r[0] === 0) { if (r[1] & 0x80) { @@ -110472,6 +108818,9 @@ EDDSA.prototype.sign = function sign(message, secret) { EDDSA.prototype.verify = function verify(message, sig, pub) { message = parseBytes(message); sig = this.makeSignature(sig); + if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) { + return false; + } var key = this.keyFromPublic(pub); var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); var SG = this.g.mul(sig.S()); @@ -110676,6 +109025,7 @@ function Signature(eddsa, sig) { sig = parseBytes(sig); if (Array.isArray(sig)) { + assert(sig.length === eddsa.encodingLength * 2, 'Signature has invalid size'); sig = { R: sig.slice(0, eddsa.encodingLength), S: sig.slice(eddsa.encodingLength), @@ -111535,12 +109885,15 @@ utils.encode = minUtils.encode; // Represent num in a w-NAF form function getNAF(num, w, bits) { var naf = new Array(Math.max(num.bitLength(), bits) + 1); - naf.fill(0); + var i; + for (i = 0; i < naf.length; i += 1) { + naf[i] = 0; + } var ws = 1 << (w + 1); var k = num.clone(); - for (var i = 0; i < naf.length; i++) { + for (i = 0; i < naf.length; i++) { var z; var mod = k.andln(ws - 1); if (k.isOdd()) { @@ -119505,31 +117858,31 @@ exports.randomBytes = randomBytes; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "__assign": function() { return /* binding */ __assign; }, -/* harmony export */ "__asyncDelegator": function() { return /* binding */ __asyncDelegator; }, -/* harmony export */ "__asyncGenerator": function() { return /* binding */ __asyncGenerator; }, -/* harmony export */ "__asyncValues": function() { return /* binding */ __asyncValues; }, -/* harmony export */ "__await": function() { return /* binding */ __await; }, -/* harmony export */ "__awaiter": function() { return /* binding */ __awaiter; }, -/* harmony export */ "__classPrivateFieldGet": function() { return /* binding */ __classPrivateFieldGet; }, -/* harmony export */ "__classPrivateFieldIn": function() { return /* binding */ __classPrivateFieldIn; }, -/* harmony export */ "__classPrivateFieldSet": function() { return /* binding */ __classPrivateFieldSet; }, -/* harmony export */ "__createBinding": function() { return /* binding */ __createBinding; }, -/* harmony export */ "__decorate": function() { return /* binding */ __decorate; }, -/* harmony export */ "__exportStar": function() { return /* binding */ __exportStar; }, -/* harmony export */ "__extends": function() { return /* binding */ __extends; }, -/* harmony export */ "__generator": function() { return /* binding */ __generator; }, -/* harmony export */ "__importDefault": function() { return /* binding */ __importDefault; }, -/* harmony export */ "__importStar": function() { return /* binding */ __importStar; }, -/* harmony export */ "__makeTemplateObject": function() { return /* binding */ __makeTemplateObject; }, -/* harmony export */ "__metadata": function() { return /* binding */ __metadata; }, -/* harmony export */ "__param": function() { return /* binding */ __param; }, -/* harmony export */ "__read": function() { return /* binding */ __read; }, -/* harmony export */ "__rest": function() { return /* binding */ __rest; }, -/* harmony export */ "__spread": function() { return /* binding */ __spread; }, -/* harmony export */ "__spreadArray": function() { return /* binding */ __spreadArray; }, -/* harmony export */ "__spreadArrays": function() { return /* binding */ __spreadArrays; }, -/* harmony export */ "__values": function() { return /* binding */ __values; } +/* harmony export */ __assign: function() { return /* binding */ __assign; }, +/* harmony export */ __asyncDelegator: function() { return /* binding */ __asyncDelegator; }, +/* harmony export */ __asyncGenerator: function() { return /* binding */ __asyncGenerator; }, +/* harmony export */ __asyncValues: function() { return /* binding */ __asyncValues; }, +/* harmony export */ __await: function() { return /* binding */ __await; }, +/* harmony export */ __awaiter: function() { return /* binding */ __awaiter; }, +/* harmony export */ __classPrivateFieldGet: function() { return /* binding */ __classPrivateFieldGet; }, +/* harmony export */ __classPrivateFieldIn: function() { return /* binding */ __classPrivateFieldIn; }, +/* harmony export */ __classPrivateFieldSet: function() { return /* binding */ __classPrivateFieldSet; }, +/* harmony export */ __createBinding: function() { return /* binding */ __createBinding; }, +/* harmony export */ __decorate: function() { return /* binding */ __decorate; }, +/* harmony export */ __exportStar: function() { return /* binding */ __exportStar; }, +/* harmony export */ __extends: function() { return /* binding */ __extends; }, +/* harmony export */ __generator: function() { return /* binding */ __generator; }, +/* harmony export */ __importDefault: function() { return /* binding */ __importDefault; }, +/* harmony export */ __importStar: function() { return /* binding */ __importStar; }, +/* harmony export */ __makeTemplateObject: function() { return /* binding */ __makeTemplateObject; }, +/* harmony export */ __metadata: function() { return /* binding */ __metadata; }, +/* harmony export */ __param: function() { return /* binding */ __param; }, +/* harmony export */ __read: function() { return /* binding */ __read; }, +/* harmony export */ __rest: function() { return /* binding */ __rest; }, +/* harmony export */ __spread: function() { return /* binding */ __spread; }, +/* harmony export */ __spreadArray: function() { return /* binding */ __spreadArray; }, +/* harmony export */ __spreadArrays: function() { return /* binding */ __spreadArrays; }, +/* harmony export */ __values: function() { return /* binding */ __values; } /* harmony export */ }); /****************************************************************************** Copyright (c) Microsoft Corporation. @@ -119787,9 +118140,10 @@ function __classPrivateFieldIn(state, receiver) { /*!***************************************!*\ !*** ./node_modules/events/events.js ***! \***************************************/ -/***/ (function(module) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -120346,658 +118700,32 @@ module.exports = EVP_BytesToKey /***/ }), -/***/ "./node_modules/follow-redirects/debug.js": -/*!************************************************!*\ - !*** ./node_modules/follow-redirects/debug.js ***! - \************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -var debug; - -module.exports = function () { - if (!debug) { - try { - /* eslint global-require: off */ - debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")("follow-redirects"); - } - catch (error) { /* */ } - if (typeof debug !== "function") { - debug = function () { /* */ }; - } - } - debug.apply(null, arguments); -}; - - -/***/ }), - -/***/ "./node_modules/follow-redirects/index.js": -/*!************************************************!*\ - !*** ./node_modules/follow-redirects/index.js ***! - \************************************************/ +/***/ "./node_modules/follow-redirects/nope.js": +/*!***********************************************!*\ + !*** ./node_modules/follow-redirects/nope.js ***! + \***********************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var url = __webpack_require__(/*! url */ "./node_modules/url/url.js"); -var URL = url.URL; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); +// follow-redirects absolutely must not be used in the browser. +// Neither should the `http` and `https` modules it replaces, yet here we are. var http = __webpack_require__(/*! http */ "./node_modules/stream-http/index.js"); var https = __webpack_require__(/*! https */ "./node_modules/https-browserify/index.js"); -var Writable = (__webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js").Writable); -var assert = __webpack_require__(/*! assert */ "./node_modules/assert/build/assert.js"); -var debug = __webpack_require__(/*! ./debug */ "./node_modules/follow-redirects/debug.js"); - -// Create handlers that pass events from native requests -var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; -var eventHandlers = Object.create(null); -events.forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); - -var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError -); -// Error types with codes -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); - -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); - } - - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - self._processResponse(response); - }; - - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); - -RedirectableRequest.prototype.abort = function () { - abortRequest(this._currentRequest); - this.emit("abort"); -}; - -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } - - // Validate input and shift parameters if necessary - if (!isString(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } -}; - -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (isFunction(data)) { - callback = data; - data = encoding = null; - } - else if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } -}; - -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; - -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; - -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - var self = this; - - // Destroys the socket on timeout - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - - // Sets up a timer to trigger a timeout event - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); - } - self._timeout = setTimeout(function () { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - - // Stops a timeout from triggering - function clearTimer() { - // Clear the timeout - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; - } - - // Clean up all attached listeners - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); - } - } - - // Attach callback if passed - if (callback) { - this.on("timeout", callback); - } - - // Start the timer if or when the socket is opened - if (this.socket) { - startTimer(this.socket); - } - else { - this._currentRequest.once("socket", startTimer); - } - - // Clean up on events - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - - return this; -}; - -// Proxy all other public ClientRequest methods -[ - "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); - -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); - -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; - } - - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } -}; - - -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - - // Create the native request and set up its event handlers - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - - // RFC7230§5.3.1: When making a request directly to an origin server, […] - // a client MUST send only the absolute path […] as the request-target. - this._currentUrl = /^\//.test(this._options.path) ? - url.format(this._options) : - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._options.path; - - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - /* istanbul ignore else */ - if (request === self._currentRequest) { - // Report any write errors - /* istanbul ignore if */ - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - /* istanbul ignore else */ - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } - } - }()); - } -}; - -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); - } - - // RFC7231§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. - - // If the response is not a redirect; return it as-is - var location = response.headers.location; - if (!location || this._options.followRedirects === false || - statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - - // Clean up - this._requestBodyBuffers = []; - return; - } - - // The response is a redirect, so abort the current request - abortRequest(this._currentRequest); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); - - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - - // Store the request headers if applicable - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host"), - }, this._options.headers); - } - - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - - // Drop the Host header, as the redirect might lead to a different host - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - - // If the redirect is relative, carry over the host of the last request - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : - url.format(Object.assign(currentUrlParts, { host: currentHost })); - - // Determine the URL of the redirection - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); - return; - } - // Create the redirected request - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); +// eslint-disable-next-line no-undef +var browser = typeof window !== "undefined" && typeof window.document !== "undefined"; - // Drop confidential headers when redirecting to a less secure protocol - // or to a different domain that is not a superdomain - if (redirectUrlParts.protocol !== currentUrlParts.protocol && - redirectUrlParts.protocol !== "https:" || - redirectUrlParts.host !== currentHost && - !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); - } - - // Evaluate the beforeRedirect callback - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode: statusCode, - }; - var requestDetails = { - url: currentUrl, - method: method, - headers: requestHeaders, - }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } - catch (err) { - this.emit("error", err); - return; - } - this._sanitizeOptions(this._options); - } - - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); - } +module.exports = { + http: http, + https: https, + wrap: browser && function (module) { + // eslint-disable-next-line + console.warn("Exclude follow-redirects from browser builds."); + return module; + }, }; -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; - - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters - if (isString(input)) { - var parsed; - try { - parsed = urlToOptions(new URL(input)); - } - catch (err) { - /* istanbul ignore next */ - parsed = url.parse(input); - } - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - input = parsed; - } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); - } - else { - callback = options; - options = input; - input = { protocol: protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; - } - - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } - - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} - -/* istanbul ignore next */ -function noop() { /* empty */ } - -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; -} - -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return (lastValue === null || typeof lastValue === "undefined") ? - undefined : String(lastValue).trim(); -} - -function createErrorType(code, message, baseClass) { - // Create constructor - function CustomError(properties) { - Error.captureStackTrace(this, this.constructor); - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - - // Attach constructor and set default properties - CustomError.prototype = new (baseClass || Error)(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - return CustomError; -} - -function abortRequest(request) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.abort(); -} - -function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); -} - -function isString(value) { - return typeof value === "string" || value instanceof String; -} - -function isFunction(value) { - return typeof value === "function"; -} - -function isBuffer(value) { - return typeof value === "object" && ("length" in value); -} - -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; +/* istanbul ignore file */ /***/ }), @@ -124660,7 +122388,7 @@ module.exports = { -var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE); +var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes).ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { @@ -124862,7 +122590,7 @@ module.exports = pipeline; "use strict"; -var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE); +var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/hash-base/node_modules/readable-stream/errors-browser.js").codes).ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } @@ -126889,6 +124617,21 @@ module.exports = function isTypedArray(value) { }; +/***/ }), + +/***/ "./node_modules/isarray/index.js": +/*!***************************************!*\ + !*** ./node_modules/isarray/index.js ***! + \***************************************/ +/***/ (function(module) { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + /***/ }), /***/ "./node_modules/isomorphic-ws/browser.js": @@ -149320,178 +147063,6 @@ utils.encode = function encode(arr, enc) { }; -/***/ }), - -/***/ "./node_modules/ms/index.js": -/*!**********************************!*\ - !*** ./node_modules/ms/index.js ***! - \**********************************/ -/***/ (function(module) { - -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} - - /***/ }), /***/ "./node_modules/object-is/implementation.js": @@ -155634,124 +153205,125 @@ module.exports = ZStream; // Fedor, you are amazing. -var asn1 = __webpack_require__(/*! asn1.js */ "./node_modules/asn1.js/lib/asn1.js") -exports.certificate = __webpack_require__(/*! ./certificate */ "./node_modules/parse-asn1/certificate.js") +var asn1 = __webpack_require__(/*! asn1.js */ "./node_modules/asn1.js/lib/asn1.js"); + +exports.certificate = __webpack_require__(/*! ./certificate */ "./node_modules/parse-asn1/certificate.js"); var RSAPrivateKey = asn1.define('RSAPrivateKey', function () { - this.seq().obj( - this.key('version').int(), - this.key('modulus').int(), - this.key('publicExponent').int(), - this.key('privateExponent').int(), - this.key('prime1').int(), - this.key('prime2').int(), - this.key('exponent1').int(), - this.key('exponent2').int(), - this.key('coefficient').int() - ) -}) -exports.RSAPrivateKey = RSAPrivateKey + this.seq().obj( + this.key('version')['int'](), + this.key('modulus')['int'](), + this.key('publicExponent')['int'](), + this.key('privateExponent')['int'](), + this.key('prime1')['int'](), + this.key('prime2')['int'](), + this.key('exponent1')['int'](), + this.key('exponent2')['int'](), + this.key('coefficient')['int']() + ); +}); +exports.RSAPrivateKey = RSAPrivateKey; var RSAPublicKey = asn1.define('RSAPublicKey', function () { - this.seq().obj( - this.key('modulus').int(), - this.key('publicExponent').int() - ) -}) -exports.RSAPublicKey = RSAPublicKey - -var PublicKey = asn1.define('SubjectPublicKeyInfo', function () { - this.seq().obj( - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPublicKey').bitstr() - ) -}) -exports.PublicKey = PublicKey + this.seq().obj( + this.key('modulus')['int'](), + this.key('publicExponent')['int']() + ); +}); +exports.RSAPublicKey = RSAPublicKey; var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () { - this.seq().obj( - this.key('algorithm').objid(), - this.key('none').null_().optional(), - this.key('curve').objid().optional(), - this.key('params').seq().obj( - this.key('p').int(), - this.key('q').int(), - this.key('g').int() - ).optional() - ) -}) + this.seq().obj( + this.key('algorithm').objid(), + this.key('none').null_().optional(), + this.key('curve').objid().optional(), + this.key('params').seq().obj( + this.key('p')['int'](), + this.key('q')['int'](), + this.key('g')['int']() + ).optional() + ); +}); + +var PublicKey = asn1.define('SubjectPublicKeyInfo', function () { + this.seq().obj( + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPublicKey').bitstr() + ); +}); +exports.PublicKey = PublicKey; var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () { - this.seq().obj( - this.key('version').int(), - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPrivateKey').octstr() - ) -}) -exports.PrivateKey = PrivateKeyInfo + this.seq().obj( + this.key('version')['int'](), + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPrivateKey').octstr() + ); +}); +exports.PrivateKey = PrivateKeyInfo; var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () { - this.seq().obj( - this.key('algorithm').seq().obj( - this.key('id').objid(), - this.key('decrypt').seq().obj( - this.key('kde').seq().obj( - this.key('id').objid(), - this.key('kdeparams').seq().obj( - this.key('salt').octstr(), - this.key('iters').int() - ) - ), - this.key('cipher').seq().obj( - this.key('algo').objid(), - this.key('iv').octstr() - ) - ) - ), - this.key('subjectPrivateKey').octstr() - ) -}) + this.seq().obj( + this.key('algorithm').seq().obj( + this.key('id').objid(), + this.key('decrypt').seq().obj( + this.key('kde').seq().obj( + this.key('id').objid(), + this.key('kdeparams').seq().obj( + this.key('salt').octstr(), + this.key('iters')['int']() + ) + ), + this.key('cipher').seq().obj( + this.key('algo').objid(), + this.key('iv').octstr() + ) + ) + ), + this.key('subjectPrivateKey').octstr() + ); +}); -exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo +exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo; var DSAPrivateKey = asn1.define('DSAPrivateKey', function () { - this.seq().obj( - this.key('version').int(), - this.key('p').int(), - this.key('q').int(), - this.key('g').int(), - this.key('pub_key').int(), - this.key('priv_key').int() - ) -}) -exports.DSAPrivateKey = DSAPrivateKey + this.seq().obj( + this.key('version')['int'](), + this.key('p')['int'](), + this.key('q')['int'](), + this.key('g')['int'](), + this.key('pub_key')['int'](), + this.key('priv_key')['int']() + ); +}); +exports.DSAPrivateKey = DSAPrivateKey; exports.DSAparam = asn1.define('DSAparam', function () { - this.int() -}) - -var ECPrivateKey = asn1.define('ECPrivateKey', function () { - this.seq().obj( - this.key('version').int(), - this.key('privateKey').octstr(), - this.key('parameters').optional().explicit(0).use(ECParameters), - this.key('publicKey').optional().explicit(1).bitstr() - ) -}) -exports.ECPrivateKey = ECPrivateKey + this['int'](); +}); var ECParameters = asn1.define('ECParameters', function () { - this.choice({ - namedCurve: this.objid() - }) -}) + this.choice({ + namedCurve: this.objid() + }); +}); + +var ECPrivateKey = asn1.define('ECPrivateKey', function () { + this.seq().obj( + this.key('version')['int'](), + this.key('privateKey').octstr(), + this.key('parameters').optional().explicit(0).use(ECParameters), + this.key('publicKey').optional().explicit(1).bitstr() + ); +}); +exports.ECPrivateKey = ECPrivateKey; exports.signature = asn1.define('signature', function () { - this.seq().obj( - this.key('r').int(), - this.key('s').int() - ) -}) + this.seq().obj( + this.key('r')['int'](), + this.key('s')['int']() + ); +}); /***/ }), @@ -155768,90 +153340,90 @@ exports.signature = asn1.define('signature', function () { -var asn = __webpack_require__(/*! asn1.js */ "./node_modules/asn1.js/lib/asn1.js") +var asn = __webpack_require__(/*! asn1.js */ "./node_modules/asn1.js/lib/asn1.js"); var Time = asn.define('Time', function () { - this.choice({ - utcTime: this.utctime(), - generalTime: this.gentime() - }) -}) + this.choice({ + utcTime: this.utctime(), + generalTime: this.gentime() + }); +}); var AttributeTypeValue = asn.define('AttributeTypeValue', function () { - this.seq().obj( - this.key('type').objid(), - this.key('value').any() - ) -}) + this.seq().obj( + this.key('type').objid(), + this.key('value').any() + ); +}); var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () { - this.seq().obj( - this.key('algorithm').objid(), - this.key('parameters').optional(), - this.key('curve').objid().optional() - ) -}) + this.seq().obj( + this.key('algorithm').objid(), + this.key('parameters').optional(), + this.key('curve').objid().optional() + ); +}); var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () { - this.seq().obj( - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPublicKey').bitstr() - ) -}) + this.seq().obj( + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPublicKey').bitstr() + ); +}); var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () { - this.setof(AttributeTypeValue) -}) + this.setof(AttributeTypeValue); +}); var RDNSequence = asn.define('RDNSequence', function () { - this.seqof(RelativeDistinguishedName) -}) + this.seqof(RelativeDistinguishedName); +}); var Name = asn.define('Name', function () { - this.choice({ - rdnSequence: this.use(RDNSequence) - }) -}) + this.choice({ + rdnSequence: this.use(RDNSequence) + }); +}); var Validity = asn.define('Validity', function () { - this.seq().obj( - this.key('notBefore').use(Time), - this.key('notAfter').use(Time) - ) -}) + this.seq().obj( + this.key('notBefore').use(Time), + this.key('notAfter').use(Time) + ); +}); var Extension = asn.define('Extension', function () { - this.seq().obj( - this.key('extnID').objid(), - this.key('critical').bool().def(false), - this.key('extnValue').octstr() - ) -}) + this.seq().obj( + this.key('extnID').objid(), + this.key('critical').bool().def(false), + this.key('extnValue').octstr() + ); +}); var TBSCertificate = asn.define('TBSCertificate', function () { - this.seq().obj( - this.key('version').explicit(0).int().optional(), - this.key('serialNumber').int(), - this.key('signature').use(AlgorithmIdentifier), - this.key('issuer').use(Name), - this.key('validity').use(Validity), - this.key('subject').use(Name), - this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo), - this.key('issuerUniqueID').implicit(1).bitstr().optional(), - this.key('subjectUniqueID').implicit(2).bitstr().optional(), - this.key('extensions').explicit(3).seqof(Extension).optional() - ) -}) + this.seq().obj( + this.key('version').explicit(0)['int']().optional(), + this.key('serialNumber')['int'](), + this.key('signature').use(AlgorithmIdentifier), + this.key('issuer').use(Name), + this.key('validity').use(Validity), + this.key('subject').use(Name), + this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo), + this.key('issuerUniqueID').implicit(1).bitstr().optional(), + this.key('subjectUniqueID').implicit(2).bitstr().optional(), + this.key('extensions').explicit(3).seqof(Extension).optional() + ); +}); var X509Certificate = asn.define('X509Certificate', function () { - this.seq().obj( - this.key('tbsCertificate').use(TBSCertificate), - this.key('signatureAlgorithm').use(AlgorithmIdentifier), - this.key('signatureValue').bitstr() - ) -}) + this.seq().obj( + this.key('tbsCertificate').use(TBSCertificate), + this.key('signatureAlgorithm').use(AlgorithmIdentifier), + this.key('signatureValue').bitstr() + ); +}); -module.exports = X509Certificate +module.exports = X509Certificate; /***/ }), @@ -155862,37 +153434,40 @@ module.exports = X509Certificate \********************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; + + // adapted from https://github.com/apatil/pemstrip -var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m -var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m -var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m -var evp = __webpack_require__(/*! evp_bytestokey */ "./node_modules/evp_bytestokey/index.js") -var ciphers = __webpack_require__(/*! browserify-aes */ "./node_modules/browserify-aes/browser.js") -var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer) +var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m; +var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m; +var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m; +var evp = __webpack_require__(/*! evp_bytestokey */ "./node_modules/evp_bytestokey/index.js"); +var ciphers = __webpack_require__(/*! browserify-aes */ "./node_modules/browserify-aes/browser.js"); +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer); module.exports = function (okey, password) { - var key = okey.toString() - var match = key.match(findProc) - var decrypted - if (!match) { - var match2 = key.match(fullRegex) - decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ''), 'base64') - } else { - var suite = 'aes' + match[1] - var iv = Buffer.from(match[2], 'hex') - var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64') - var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key - var out = [] - var cipher = ciphers.createDecipheriv(suite, cipherKey, iv) - out.push(cipher.update(cipherText)) - out.push(cipher.final()) - decrypted = Buffer.concat(out) - } - var tag = key.match(startRegex)[1] - return { - tag: tag, - data: decrypted - } -} + var key = okey.toString(); + var match = key.match(findProc); + var decrypted; + if (!match) { + var match2 = key.match(fullRegex); + decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ''), 'base64'); + } else { + var suite = 'aes' + match[1]; + var iv = Buffer.from(match[2], 'hex'); + var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64'); + var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key; + var out = []; + var cipher = ciphers.createDecipheriv(suite, cipherKey, iv); + out.push(cipher.update(cipherText)); + out.push(cipher['final']()); + decrypted = Buffer.concat(out); + } + var tag = key.match(startRegex)[1]; + return { + tag: tag, + data: decrypted + }; +}; /***/ }), @@ -155903,113 +153478,118 @@ module.exports = function (okey, password) { \******************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var asn1 = __webpack_require__(/*! ./asn1 */ "./node_modules/parse-asn1/asn1.js") -var aesid = __webpack_require__(/*! ./aesid.json */ "./node_modules/parse-asn1/aesid.json") -var fixProc = __webpack_require__(/*! ./fixProc */ "./node_modules/parse-asn1/fixProc.js") -var ciphers = __webpack_require__(/*! browserify-aes */ "./node_modules/browserify-aes/browser.js") -var compat = __webpack_require__(/*! pbkdf2 */ "./node_modules/pbkdf2/browser.js") -var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer) -module.exports = parseKeys - -function parseKeys (buffer) { - var password - if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) { - password = buffer.passphrase - buffer = buffer.key - } - if (typeof buffer === 'string') { - buffer = Buffer.from(buffer) - } - - var stripped = fixProc(buffer, password) - - var type = stripped.tag - var data = stripped.data - var subtype, ndata - switch (type) { - case 'CERTIFICATE': - ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo - // falls through - case 'PUBLIC KEY': - if (!ndata) { - ndata = asn1.PublicKey.decode(data, 'der') - } - subtype = ndata.algorithm.algorithm.join('.') - switch (subtype) { - case '1.2.840.113549.1.1.1': - return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der') - case '1.2.840.10045.2.1': - ndata.subjectPrivateKey = ndata.subjectPublicKey - return { - type: 'ec', - data: ndata - } - case '1.2.840.10040.4.1': - ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der') - return { - type: 'dsa', - data: ndata.algorithm.params - } - default: throw new Error('unknown key id ' + subtype) - } - // throw new Error('unknown key type ' + type) - case 'ENCRYPTED PRIVATE KEY': - data = asn1.EncryptedPrivateKey.decode(data, 'der') - data = decrypt(data, password) - // falls through - case 'PRIVATE KEY': - ndata = asn1.PrivateKey.decode(data, 'der') - subtype = ndata.algorithm.algorithm.join('.') - switch (subtype) { - case '1.2.840.113549.1.1.1': - return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der') - case '1.2.840.10045.2.1': - return { - curve: ndata.algorithm.curve, - privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey - } - case '1.2.840.10040.4.1': - ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der') - return { - type: 'dsa', - params: ndata.algorithm.params - } - default: throw new Error('unknown key id ' + subtype) - } - // throw new Error('unknown key type ' + type) - case 'RSA PUBLIC KEY': - return asn1.RSAPublicKey.decode(data, 'der') - case 'RSA PRIVATE KEY': - return asn1.RSAPrivateKey.decode(data, 'der') - case 'DSA PRIVATE KEY': - return { - type: 'dsa', - params: asn1.DSAPrivateKey.decode(data, 'der') - } - case 'EC PRIVATE KEY': - data = asn1.ECPrivateKey.decode(data, 'der') - return { - curve: data.parameters.value, - privateKey: data.privateKey - } - default: throw new Error('unknown key type ' + type) - } -} -parseKeys.signature = asn1.signature -function decrypt (data, password) { - var salt = data.algorithm.decrypt.kde.kdeparams.salt - var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10) - var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')] - var iv = data.algorithm.decrypt.cipher.iv - var cipherText = data.subjectPrivateKey - var keylen = parseInt(algo.split('-')[1], 10) / 8 - var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1') - var cipher = ciphers.createDecipheriv(algo, key, iv) - var out = [] - out.push(cipher.update(cipherText)) - out.push(cipher.final()) - return Buffer.concat(out) +"use strict"; + + +var asn1 = __webpack_require__(/*! ./asn1 */ "./node_modules/parse-asn1/asn1.js"); +var aesid = __webpack_require__(/*! ./aesid.json */ "./node_modules/parse-asn1/aesid.json"); +var fixProc = __webpack_require__(/*! ./fixProc */ "./node_modules/parse-asn1/fixProc.js"); +var ciphers = __webpack_require__(/*! browserify-aes */ "./node_modules/browserify-aes/browser.js"); +var compat = __webpack_require__(/*! pbkdf2 */ "./node_modules/pbkdf2/browser.js"); +var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer); + +function decrypt(data, password) { + var salt = data.algorithm.decrypt.kde.kdeparams.salt; + var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10); + var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]; + var iv = data.algorithm.decrypt.cipher.iv; + var cipherText = data.subjectPrivateKey; + var keylen = parseInt(algo.split('-')[1], 10) / 8; + var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1'); + var cipher = ciphers.createDecipheriv(algo, key, iv); + var out = []; + out.push(cipher.update(cipherText)); + out.push(cipher['final']()); + return Buffer.concat(out); +} + +function parseKeys(buffer) { + var password; + if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) { + password = buffer.passphrase; + buffer = buffer.key; + } + if (typeof buffer === 'string') { + buffer = Buffer.from(buffer); + } + + var stripped = fixProc(buffer, password); + + var type = stripped.tag; + var data = stripped.data; + var subtype, ndata; + switch (type) { + case 'CERTIFICATE': + ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo; + // falls through + case 'PUBLIC KEY': + if (!ndata) { + ndata = asn1.PublicKey.decode(data, 'der'); + } + subtype = ndata.algorithm.algorithm.join('.'); + switch (subtype) { + case '1.2.840.113549.1.1.1': + return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der'); + case '1.2.840.10045.2.1': + ndata.subjectPrivateKey = ndata.subjectPublicKey; + return { + type: 'ec', + data: ndata + }; + case '1.2.840.10040.4.1': + ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der'); + return { + type: 'dsa', + data: ndata.algorithm.params + }; + default: throw new Error('unknown key id ' + subtype); + } + // throw new Error('unknown key type ' + type) + case 'ENCRYPTED PRIVATE KEY': + data = asn1.EncryptedPrivateKey.decode(data, 'der'); + data = decrypt(data, password); + // falls through + case 'PRIVATE KEY': + ndata = asn1.PrivateKey.decode(data, 'der'); + subtype = ndata.algorithm.algorithm.join('.'); + switch (subtype) { + case '1.2.840.113549.1.1.1': + return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der'); + case '1.2.840.10045.2.1': + return { + curve: ndata.algorithm.curve, + privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey + }; + case '1.2.840.10040.4.1': + ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der'); + return { + type: 'dsa', + params: ndata.algorithm.params + }; + default: throw new Error('unknown key id ' + subtype); + } + // throw new Error('unknown key type ' + type) + case 'RSA PUBLIC KEY': + return asn1.RSAPublicKey.decode(data, 'der'); + case 'RSA PRIVATE KEY': + return asn1.RSAPrivateKey.decode(data, 'der'); + case 'DSA PRIVATE KEY': + return { + type: 'dsa', + params: asn1.DSAPrivateKey.decode(data, 'der') + }; + case 'EC PRIVATE KEY': + data = asn1.ECPrivateKey.decode(data, 'der'); + return { + curve: data.parameters.value, + privateKey: data.privateKey + }; + default: throw new Error('unknown key type ' + type); + } } +parseKeys.signature = asn1.signature; + +module.exports = parseKeys; /***/ }), @@ -156368,6 +153948,62 @@ module.exports = [ ]; +/***/ }), + +/***/ "./node_modules/process-nextick-args/index.js": +/*!****************************************************!*\ + !*** ./node_modules/process-nextick-args/index.js ***! + \****************************************************/ +/***/ (function(module) { + +"use strict"; + + +if ( false || + !({"env":{"NODE_ENV":"production"}}).version || + ({"env":{"NODE_ENV":"production"}}).version.indexOf('v0.') === 0 || + ({"env":{"NODE_ENV":"production"}}).version.indexOf('v1.') === 0 && ({"env":{"NODE_ENV":"production"}}).version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = ({"env":{"NODE_ENV":"production"}}) +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return ({"env":{"NODE_ENV":"production"}}).nextTick(fn); + case 2: + return ({"env":{"NODE_ENV":"production"}}).nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return ({"env":{"NODE_ENV":"production"}}).nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return ({"env":{"NODE_ENV":"production"}}).nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return ({"env":{"NODE_ENV":"production"}}).nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + + + /***/ }), /***/ "./node_modules/protobufjs/index.js": @@ -169037,94 +166673,6 @@ SafeBuffer.allocUnsafeSlow = function (size) { } -/***/ }), - -/***/ "./node_modules/safer-buffer/safer.js": -/*!********************************************!*\ - !*** ./node_modules/safer-buffer/safer.js ***! - \********************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* eslint-disable node/no-deprecated-api */ - - - -var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js") -var Buffer = buffer.Buffer - -var safer = {} - -var key - -for (key in buffer) { - if (!buffer.hasOwnProperty(key)) continue - if (key === 'SlowBuffer' || key === 'Buffer') continue - safer[key] = buffer[key] -} - -var Safer = safer.Buffer = {} -for (key in Buffer) { - if (!Buffer.hasOwnProperty(key)) continue - if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue - Safer[key] = Buffer[key] -} - -safer.Buffer.prototype = Buffer.prototype - -if (!Safer.from || Safer.from === Uint8Array.from) { - Safer.from = function (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) - } - if (value && typeof value.length === 'undefined') { - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) - } - return Buffer(value, encodingOrOffset, length) - } -} - -if (!Safer.alloc) { - Safer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) - } - if (size < 0 || size >= 2 * (1 << 30)) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - var buf = Buffer(size) - if (!fill || fill.length === 0) { - buf.fill(0) - } else if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - return buf - } -} - -if (!safer.kStringMaxLength) { - try { - safer.kStringMaxLength = ({"env":{"NODE_ENV":"production"}}).binding('buffer').kStringMaxLength - } catch (e) { - // we can't determine kStringMaxLength in environments where process.binding - // is unsupported, so let's not set it - } -} - -if (!safer.constants) { - safer.constants = { - MAX_LENGTH: safer.kMaxLength - } - if (safer.kStringMaxLength) { - safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength - } -} - -module.exports = safer - - /***/ }), /***/ "./node_modules/set-function-length/index.js": @@ -172903,7 +170451,7 @@ module.exports = { -var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE); +var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes).ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { @@ -173105,7 +170653,7 @@ module.exports = pipeline; "use strict"; -var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE); +var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js").codes).ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } @@ -176597,7 +174145,7 @@ module.exports = { -var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-http/node_modules/readable-stream/errors-browser.js").codes.ERR_STREAM_PREMATURE_CLOSE); +var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-http/node_modules/readable-stream/errors-browser.js").codes).ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { @@ -176799,7 +174347,7 @@ module.exports = pipeline; "use strict"; -var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-http/node_modules/readable-stream/errors-browser.js").codes.ERR_INVALID_OPT_VALUE); +var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/stream-http/node_modules/readable-stream/errors-browser.js").codes).ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } @@ -183740,10 +181288,10 @@ exports.ValidatorUpdates = { /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset.ts": -/*!**************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset.ts ***! - \**************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/affiliates.ts": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/affiliates.ts ***! + \***********************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -183772,71 +181320,161 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Asset = void 0; +exports.AffiliateWhitelist_Tier = exports.AffiliateWhitelist = exports.AffiliateTiers_Tier = exports.AffiliateTiers = void 0; const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseAsset() { +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +function createBaseAffiliateTiers() { return { - id: 0, - symbol: "", - denom: "", - denomExponent: 0, - hasMarket: false, - marketId: 0, - atomicResolution: 0 + tiers: [] }; } -exports.Asset = { +exports.AffiliateTiers = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); - } - if (message.symbol !== "") { - writer.uint32(18).string(message.symbol); - } - if (message.denom !== "") { - writer.uint32(26).string(message.denom); + for (const v of message.tiers) { + exports.AffiliateTiers_Tier.encode(v, writer.uint32(10).fork()).ldelim(); } - if (message.denomExponent !== 0) { - writer.uint32(32).sint32(message.denomExponent); + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateTiers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tiers.push(exports.AffiliateTiers_Tier.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.hasMarket === true) { - writer.uint32(40).bool(message.hasMarket); + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseAffiliateTiers(); + message.tiers = ((_a = object.tiers) === null || _a === void 0 ? void 0 : _a.map(e => exports.AffiliateTiers_Tier.fromPartial(e))) || []; + return message; + } +}; +function createBaseAffiliateTiers_Tier() { + return { + reqReferredVolumeQuoteQuantums: helpers_1.Long.UZERO, + reqStakedWholeCoins: 0, + takerFeeSharePpm: 0 + }; +} +exports.AffiliateTiers_Tier = { + encode(message, writer = _m0.Writer.create()) { + if (!message.reqReferredVolumeQuoteQuantums.isZero()) { + writer.uint32(8).uint64(message.reqReferredVolumeQuoteQuantums); } - if (message.marketId !== 0) { - writer.uint32(48).uint32(message.marketId); + if (message.reqStakedWholeCoins !== 0) { + writer.uint32(16).uint32(message.reqStakedWholeCoins); } - if (message.atomicResolution !== 0) { - writer.uint32(56).sint32(message.atomicResolution); + if (message.takerFeeSharePpm !== 0) { + writer.uint32(24).uint32(message.takerFeeSharePpm); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAsset(); + const message = createBaseAffiliateTiers_Tier(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.reqReferredVolumeQuoteQuantums = reader.uint64(); break; case 2: - message.symbol = reader.string(); + message.reqStakedWholeCoins = reader.uint32(); break; case 3: - message.denom = reader.string(); + message.takerFeeSharePpm = reader.uint32(); break; - case 4: - message.denomExponent = reader.sint32(); + default: + reader.skipType(tag & 7); break; - case 5: - message.hasMarket = reader.bool(); + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseAffiliateTiers_Tier(); + message.reqReferredVolumeQuoteQuantums = object.reqReferredVolumeQuoteQuantums !== undefined && object.reqReferredVolumeQuoteQuantums !== null ? helpers_1.Long.fromValue(object.reqReferredVolumeQuoteQuantums) : helpers_1.Long.UZERO; + message.reqStakedWholeCoins = (_a = object.reqStakedWholeCoins) !== null && _a !== void 0 ? _a : 0; + message.takerFeeSharePpm = (_b = object.takerFeeSharePpm) !== null && _b !== void 0 ? _b : 0; + return message; + } +}; +function createBaseAffiliateWhitelist() { + return { + tiers: [] + }; +} +exports.AffiliateWhitelist = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.tiers) { + exports.AffiliateWhitelist_Tier.encode(v, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateWhitelist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tiers.push(exports.AffiliateWhitelist_Tier.decode(reader, reader.uint32())); break; - case 6: - message.marketId = reader.uint32(); + default: + reader.skipType(tag & 7); break; - case 7: - message.atomicResolution = reader.sint32(); + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseAffiliateWhitelist(); + message.tiers = ((_a = object.tiers) === null || _a === void 0 ? void 0 : _a.map(e => exports.AffiliateWhitelist_Tier.fromPartial(e))) || []; + return message; + } +}; +function createBaseAffiliateWhitelist_Tier() { + return { + addresses: [], + takerFeeSharePpm: 0 + }; +} +exports.AffiliateWhitelist_Tier = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.addresses) { + writer.uint32(10).string(v); + } + if (message.takerFeeSharePpm !== 0) { + writer.uint32(16).uint32(message.takerFeeSharePpm); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateWhitelist_Tier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + case 2: + message.takerFeeSharePpm = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -183846,26 +181484,729 @@ exports.Asset = { return message; }, fromPartial(object) { - var _a, _b, _c, _d, _e, _f, _g; - const message = createBaseAsset(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; - message.symbol = (_b = object.symbol) !== null && _b !== void 0 ? _b : ""; - message.denom = (_c = object.denom) !== null && _c !== void 0 ? _c : ""; - message.denomExponent = (_d = object.denomExponent) !== null && _d !== void 0 ? _d : 0; - message.hasMarket = (_e = object.hasMarket) !== null && _e !== void 0 ? _e : false; - message.marketId = (_f = object.marketId) !== null && _f !== void 0 ? _f : 0; - message.atomicResolution = (_g = object.atomicResolution) !== null && _g !== void 0 ? _g : 0; + var _a, _b; + const message = createBaseAffiliateWhitelist_Tier(); + message.addresses = ((_a = object.addresses) === null || _a === void 0 ? void 0 : _a.map(e => e)) || []; + message.takerFeeSharePpm = (_b = object.takerFeeSharePpm) !== null && _b !== void 0 ? _b : 0; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8u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DM0MsTUFBTTtnQkFFUjtvQkFDRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztvQkFDekIsTUFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLE1BQTRDOztRQUN0RCxNQUFNLE9BQU8sR0FBRyxpQ0FBaUMsRUFBRSxDQUFDO1FBQ3BELE9BQU8sQ0FBQyxTQUFTLEdBQUcsQ0FBQSxNQUFBLE1BQU0sQ0FBQyxTQUFTLDBDQUFFLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxLQUFJLEVBQUUsQ0FBQztRQUN4RCxPQUFPLENBQUMsZ0JBQWdCLEdBQUcsTUFBQSxNQUFNLENBQUMsZ0JBQWdCLG1DQUFJLENBQUMsQ0FBQztRQUN4RCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis.ts": -/*!****************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis.ts ***! - \****************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/query.ts": +/*!******************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/query.ts ***! + \******************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AffiliateWhitelistResponse = exports.AffiliateWhitelistRequest = exports.AllAffiliateTiersResponse = exports.AllAffiliateTiersRequest = exports.ReferredByResponse = exports.ReferredByRequest = exports.AffiliateInfoResponse = exports.AffiliateInfoRequest = void 0; +const affiliates_1 = __webpack_require__(/*! ./affiliates */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/affiliates.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseAffiliateInfoRequest() { + return { + address: "" + }; +} +exports.AffiliateInfoRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseAffiliateInfoRequest(); + message.address = (_a = object.address) !== null && _a !== void 0 ? _a : ""; + return message; + } +}; +function createBaseAffiliateInfoResponse() { + return { + isWhitelisted: false, + tier: 0, + feeSharePpm: 0, + referredVolume: new Uint8Array(), + stakedAmount: new Uint8Array() + }; +} +exports.AffiliateInfoResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.isWhitelisted === true) { + writer.uint32(8).bool(message.isWhitelisted); + } + if (message.tier !== 0) { + writer.uint32(16).uint32(message.tier); + } + if (message.feeSharePpm !== 0) { + writer.uint32(24).uint32(message.feeSharePpm); + } + if (message.referredVolume.length !== 0) { + writer.uint32(34).bytes(message.referredVolume); + } + if (message.stakedAmount.length !== 0) { + writer.uint32(42).bytes(message.stakedAmount); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isWhitelisted = reader.bool(); + break; + case 2: + message.tier = reader.uint32(); + break; + case 3: + message.feeSharePpm = reader.uint32(); + break; + case 4: + message.referredVolume = reader.bytes(); + break; + case 5: + message.stakedAmount = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d, _e; + const message = createBaseAffiliateInfoResponse(); + message.isWhitelisted = (_a = object.isWhitelisted) !== null && _a !== void 0 ? _a : false; + message.tier = (_b = object.tier) !== null && _b !== void 0 ? _b : 0; + message.feeSharePpm = (_c = object.feeSharePpm) !== null && _c !== void 0 ? _c : 0; + message.referredVolume = (_d = object.referredVolume) !== null && _d !== void 0 ? _d : new Uint8Array(); + message.stakedAmount = (_e = object.stakedAmount) !== null && _e !== void 0 ? _e : new Uint8Array(); + return message; + } +}; +function createBaseReferredByRequest() { + return { + address: "" + }; +} +exports.ReferredByRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReferredByRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseReferredByRequest(); + message.address = (_a = object.address) !== null && _a !== void 0 ? _a : ""; + return message; + } +}; +function createBaseReferredByResponse() { + return { + affiliateAddress: "" + }; +} +exports.ReferredByResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.affiliateAddress !== "") { + writer.uint32(10).string(message.affiliateAddress); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReferredByResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.affiliateAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseReferredByResponse(); + message.affiliateAddress = (_a = object.affiliateAddress) !== null && _a !== void 0 ? _a : ""; + return message; + } +}; +function createBaseAllAffiliateTiersRequest() { + return {}; +} +exports.AllAffiliateTiersRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllAffiliateTiersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseAllAffiliateTiersRequest(); + return message; + } +}; +function createBaseAllAffiliateTiersResponse() { + return { + tiers: undefined + }; +} +exports.AllAffiliateTiersResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.tiers !== undefined) { + affiliates_1.AffiliateTiers.encode(message.tiers, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllAffiliateTiersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tiers = affiliates_1.AffiliateTiers.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseAllAffiliateTiersResponse(); + message.tiers = object.tiers !== undefined && object.tiers !== null ? affiliates_1.AffiliateTiers.fromPartial(object.tiers) : undefined; + return message; + } +}; +function createBaseAffiliateWhitelistRequest() { + return {}; +} +exports.AffiliateWhitelistRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateWhitelistRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseAffiliateWhitelistRequest(); + return message; + } +}; +function createBaseAffiliateWhitelistResponse() { + return { + whitelist: undefined + }; +} +exports.AffiliateWhitelistResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.whitelist !== undefined) { + affiliates_1.AffiliateWhitelist.encode(message.whitelist, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAffiliateWhitelistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.whitelist = affiliates_1.AffiliateWhitelist.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseAffiliateWhitelistResponse(); + message.whitelist = object.whitelist !== undefined && object.whitelist !== null ? affiliates_1.AffiliateWhitelist.fromPartial(object.whitelist) : undefined; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi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M7b0JBQ0osT0FBTyxDQUFDLFNBQVMsR0FBRywrQkFBa0IsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDO29CQUN2RSxNQUFNO2dCQUVSO29CQUNFLE1BQU0sQ0FBQyxRQUFRLENBQUMsR0FBRyxHQUFHLENBQUMsQ0FBQyxDQUFDO29CQUN6QixNQUFNO2FBQ1Q7U0FDRjtRQUVELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7SUFFRCxXQUFXLENBQUMsTUFBK0M7UUFDekQsTUFBTSxPQUFPLEdBQUcsb0NBQW9DLEVBQUUsQ0FBQztRQUN2RCxPQUFPLENBQUMsU0FBUyxHQUFHLE1BQU0sQ0FBQyxTQUFTLEtBQUssU0FBUyxJQUFJLE1BQU0sQ0FBQyxTQUFTLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQywrQkFBa0IsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDL0ksT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/tx.ts": +/*!***************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/tx.ts ***! + \***************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MsgUpdateAffiliateWhitelistResponse = exports.MsgUpdateAffiliateWhitelist = exports.MsgUpdateAffiliateTiersResponse = exports.MsgUpdateAffiliateTiers = exports.MsgRegisterAffiliateResponse = exports.MsgRegisterAffiliate = void 0; +const affiliates_1 = __webpack_require__(/*! ./affiliates */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/affiliates.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseMsgRegisterAffiliate() { + return { + referee: "", + affiliate: "" + }; +} +exports.MsgRegisterAffiliate = { + encode(message, writer = _m0.Writer.create()) { + if (message.referee !== "") { + writer.uint32(10).string(message.referee); + } + if (message.affiliate !== "") { + writer.uint32(18).string(message.affiliate); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAffiliate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.referee = reader.string(); + break; + case 2: + message.affiliate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseMsgRegisterAffiliate(); + message.referee = (_a = object.referee) !== null && _a !== void 0 ? _a : ""; + message.affiliate = (_b = object.affiliate) !== null && _b !== void 0 ? _b : ""; + return message; + } +}; +function createBaseMsgRegisterAffiliateResponse() { + return {}; +} +exports.MsgRegisterAffiliateResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAffiliateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgRegisterAffiliateResponse(); + return message; + } +}; +function createBaseMsgUpdateAffiliateTiers() { + return { + authority: "", + tiers: undefined + }; +} +exports.MsgUpdateAffiliateTiers = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.tiers !== undefined) { + affiliates_1.AffiliateTiers.encode(message.tiers, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAffiliateTiers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.tiers = affiliates_1.AffiliateTiers.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgUpdateAffiliateTiers(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.tiers = object.tiers !== undefined && object.tiers !== null ? affiliates_1.AffiliateTiers.fromPartial(object.tiers) : undefined; + return message; + } +}; +function createBaseMsgUpdateAffiliateTiersResponse() { + return {}; +} +exports.MsgUpdateAffiliateTiersResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAffiliateTiersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgUpdateAffiliateTiersResponse(); + return message; + } +}; +function createBaseMsgUpdateAffiliateWhitelist() { + return { + authority: "", + whitelist: undefined + }; +} +exports.MsgUpdateAffiliateWhitelist = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.whitelist !== undefined) { + affiliates_1.AffiliateWhitelist.encode(message.whitelist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAffiliateWhitelist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.whitelist = affiliates_1.AffiliateWhitelist.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgUpdateAffiliateWhitelist(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.whitelist = object.whitelist !== undefined && object.whitelist !== null ? affiliates_1.AffiliateWhitelist.fromPartial(object.whitelist) : undefined; + return message; + } +}; +function createBaseMsgUpdateAffiliateWhitelistResponse() { + return {}; +} +exports.MsgUpdateAffiliateWhitelistResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAffiliateWhitelistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgUpdateAffiliateWhitelistResponse(); + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2V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2hFLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset.ts": +/*!**************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset.ts ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Asset = void 0; +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseAsset() { + return { + id: 0, + symbol: "", + denom: "", + denomExponent: 0, + hasMarket: false, + marketId: 0, + atomicResolution: 0 + }; +} +exports.Asset = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.denom !== "") { + writer.uint32(26).string(message.denom); + } + if (message.denomExponent !== 0) { + writer.uint32(32).sint32(message.denomExponent); + } + if (message.hasMarket === true) { + writer.uint32(40).bool(message.hasMarket); + } + if (message.marketId !== 0) { + writer.uint32(48).uint32(message.marketId); + } + if (message.atomicResolution !== 0) { + writer.uint32(56).sint32(message.atomicResolution); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.denom = reader.string(); + break; + case 4: + message.denomExponent = reader.sint32(); + break; + case 5: + message.hasMarket = reader.bool(); + break; + case 6: + message.marketId = reader.uint32(); + break; + case 7: + message.atomicResolution = reader.sint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f, _g; + const message = createBaseAsset(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + message.symbol = (_b = object.symbol) !== null && _b !== void 0 ? _b : ""; + message.denom = (_c = object.denom) !== null && _c !== void 0 ? _c : ""; + message.denomExponent = (_d = object.denomExponent) !== null && _d !== void 0 ? _d : 0; + message.hasMarket = (_e = object.hasMarket) !== null && _e !== void 0 ? _e : false; + message.marketId = (_f = object.marketId) !== null && _f !== void 0 ? _f : 0; + message.atomicResolution = (_g = object.atomicResolution) !== null && _g !== void 0 ? _g : 0; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvYXNzZXRzL2Fzc2V0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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DbEMsT0FBTyxDQUFDLEVBQUUsR0FBRyxNQUFBLE1BQU0sQ0FBQyxFQUFFLG1DQUFJLENBQUMsQ0FBQztRQUM1QixPQUFPLENBQUMsTUFBTSxHQUFHLE1BQUEsTUFBTSxDQUFDLE1BQU0sbUNBQUksRUFBRSxDQUFDO1FBQ3JDLE9BQU8sQ0FBQyxLQUFLLEdBQUcsTUFBQSxNQUFNLENBQUMsS0FBSyxtQ0FBSSxFQUFFLENBQUM7UUFDbkMsT0FBTyxDQUFDLGFBQWEsR0FBRyxNQUFBLE1BQU0sQ0FBQyxhQUFhLG1DQUFJLENBQUMsQ0FBQztRQUNsRCxPQUFPLENBQUMsU0FBUyxHQUFHLE1BQUEsTUFBTSxDQUFDLFNBQVMsbUNBQUksS0FBSyxDQUFDO1FBQzlDLE9BQU8sQ0FBQyxRQUFRLEdBQUcsTUFBQSxNQUFNLENBQUMsUUFBUSxtQ0FBSSxDQUFDLENBQUM7UUFDeEMsT0FBTyxDQUFDLGdCQUFnQixHQUFHLE1BQUEsTUFBTSxDQUFDLGdCQUFnQixtQ0FBSSxDQUFDLENBQUM7UUFDeEQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis.ts": +/*!****************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis.ts ***! + \****************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -185721,6 +184062,204 @@ exports.EquityTierLimit = { /***/ }), +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/liquidations.ts": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/liquidations.ts ***! + \*******************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SubaccountOpenPositionInfo = exports.SubaccountLiquidationInfo = exports.PerpetualLiquidationInfo = void 0; +const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +function createBasePerpetualLiquidationInfo() { + return { + subaccountId: undefined, + perpetualId: 0 + }; +} +exports.PerpetualLiquidationInfo = { + encode(message, writer = _m0.Writer.create()) { + if (message.subaccountId !== undefined) { + subaccount_1.SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.perpetualId !== 0) { + writer.uint32(16).uint32(message.perpetualId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualLiquidationInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = subaccount_1.SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.perpetualId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBasePerpetualLiquidationInfo(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.SubaccountId.fromPartial(object.subaccountId) : undefined; + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; + return message; + } +}; +function createBaseSubaccountLiquidationInfo() { + return { + perpetualsLiquidated: [], + notionalLiquidated: helpers_1.Long.UZERO, + quantumsInsuranceLost: helpers_1.Long.UZERO + }; +} +exports.SubaccountLiquidationInfo = { + encode(message, writer = _m0.Writer.create()) { + writer.uint32(10).fork(); + for (const v of message.perpetualsLiquidated) { + writer.uint32(v); + } + writer.ldelim(); + if (!message.notionalLiquidated.isZero()) { + writer.uint32(16).uint64(message.notionalLiquidated); + } + if (!message.quantumsInsuranceLost.isZero()) { + writer.uint32(24).uint64(message.quantumsInsuranceLost); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountLiquidationInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.perpetualsLiquidated.push(reader.uint32()); + } + } + else { + message.perpetualsLiquidated.push(reader.uint32()); + } + break; + case 2: + message.notionalLiquidated = reader.uint64(); + break; + case 3: + message.quantumsInsuranceLost = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseSubaccountLiquidationInfo(); + message.perpetualsLiquidated = ((_a = object.perpetualsLiquidated) === null || _a === void 0 ? void 0 : _a.map(e => e)) || []; + message.notionalLiquidated = object.notionalLiquidated !== undefined && object.notionalLiquidated !== null ? helpers_1.Long.fromValue(object.notionalLiquidated) : helpers_1.Long.UZERO; + message.quantumsInsuranceLost = object.quantumsInsuranceLost !== undefined && object.quantumsInsuranceLost !== null ? helpers_1.Long.fromValue(object.quantumsInsuranceLost) : helpers_1.Long.UZERO; + return message; + } +}; +function createBaseSubaccountOpenPositionInfo() { + return { + perpetualId: 0, + subaccountsWithLongPosition: [], + subaccountsWithShortPosition: [] + }; +} +exports.SubaccountOpenPositionInfo = { + encode(message, writer = _m0.Writer.create()) { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + for (const v of message.subaccountsWithLongPosition) { + subaccount_1.SubaccountId.encode(v, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.subaccountsWithShortPosition) { + subaccount_1.SubaccountId.encode(v, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOpenPositionInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.subaccountsWithLongPosition.push(subaccount_1.SubaccountId.decode(reader, reader.uint32())); + break; + case 3: + message.subaccountsWithShortPosition.push(subaccount_1.SubaccountId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseSubaccountOpenPositionInfo(); + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; + message.subaccountsWithLongPosition = ((_b = object.subaccountsWithLongPosition) === null || _b === void 0 ? void 0 : _b.map(e => subaccount_1.SubaccountId.fromPartial(e))) || []; + message.subaccountsWithShortPosition = ((_c = object.subaccountsWithShortPosition) === null || _c === void 0 ? void 0 : _c.map(e => subaccount_1.SubaccountId.fromPartial(e))) || []; + return message; + } +}; +//# sourceMapp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RVIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyw0QkFBNEIsQ0FBQyxJQUFJLENBQUMseUJBQVksQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDLENBQUM7b0JBQ3hGLE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUErQzs7UUFDekQsTUFBTSxPQUFPLEdBQUcsb0NBQW9DLEVBQUUsQ0FBQztRQUN2RCxPQUFPLENBQUMsV0FBVyxHQUFHLE1BQUEsTUFBTSxDQUFDLFdBQVcsbUNBQUksQ0FBQyxDQUFDO1FBQzlDLE9BQU8sQ0FBQywyQkFBMkIsR0FBRyxDQUFBLE1BQUEsTUFBTSxDQUFDLDJCQUEyQiwwQ0FBRSxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyx5QkFBWSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFJLEVBQUUsQ0FBQztRQUN0SCxPQUFPLENBQUMsNEJBQTRCLEdBQUcsQ0FBQSxNQUFBLE1BQU0sQ0FBQyw0QkFBNEIsMENBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMseUJBQVksQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSSxFQUFFLENBQUM7UUFDeEgsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + /***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/liquidations_config.ts": /*!**************************************************************************************************!*\ !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/liquidations_config.ts ***! @@ -186713,8 +185252,9 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TransactionOrdering = exports.Order = exports.ConditionalOrderPlacement = exports.LongTermOrderPlacement = exports.StatefulOrderTimeSliceValue = exports.OrderFillState = exports.PotentiallyPrunableOrders = exports.OrdersFilledDuringLatestBlock = exports.OrderId = exports.order_ConditionTypeToJSON = exports.order_ConditionTypeFromJSON = exports.Order_ConditionTypeSDKType = exports.Order_ConditionType = exports.order_TimeInForceToJSON = exports.order_TimeInForceFromJSON = exports.Order_TimeInForceSDKType = exports.Order_TimeInForce = exports.order_SideToJSON = exports.order_SideFromJSON = exports.Order_SideSDKType = exports.Order_Side = void 0; +exports.StreamLiquidationOrder = exports.TransactionOrdering = exports.Order = exports.ConditionalOrderPlacement = exports.LongTermOrderPlacement = exports.StatefulOrderTimeSliceValue = exports.OrderFillState = exports.PotentiallyPrunableOrders = exports.OrdersFilledDuringLatestBlock = exports.OrderId = exports.order_ConditionTypeToJSON = exports.order_ConditionTypeFromJSON = exports.Order_ConditionTypeSDKType = exports.Order_ConditionType = exports.order_TimeInForceToJSON = exports.order_TimeInForceFromJSON = exports.Order_TimeInForceSDKType = exports.Order_TimeInForce = exports.order_SideToJSON = exports.order_SideFromJSON = exports.Order_SideSDKType = exports.Order_Side = void 0; const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); +const liquidations_1 = __webpack_require__(/*! ./liquidations */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/liquidations.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); /** @@ -186792,9 +185332,8 @@ var Order_TimeInForce; */ Order_TimeInForce[Order_TimeInForce["TIME_IN_FORCE_POST_ONLY"] = 2] = "TIME_IN_FORCE_POST_ONLY"; /** - * TIME_IN_FORCE_FILL_OR_KILL - TIME_IN_FORCE_FILL_OR_KILL enforces that an order will either be filled - * completely and immediately by maker orders on the book or canceled if the - * entire amount can‘t be matched. + * TIME_IN_FORCE_FILL_OR_KILL - TIME_IN_FORCE_FILL_OR_KILL has been deprecated and will be removed in + * future versions. */ Order_TimeInForce[Order_TimeInForce["TIME_IN_FORCE_FILL_OR_KILL"] = 3] = "TIME_IN_FORCE_FILL_OR_KILL"; Order_TimeInForce[Order_TimeInForce["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; @@ -187357,7 +185896,75 @@ exports.TransactionOrdering = { return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvY2xvYi9vcmRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDBEQUE4RTtBQUM5RSx3REFBMEM7QUFDMUMsMkNBQWtEO0FBQ2xEOzs7O0dBSUc7QUFFSCxJQUFZLFVBVVg7QUFWRCxXQUFZLFVBQVU7SUFDcEIsMEVBQTBFO0lBQzFFLG1FQUFvQixDQUFBO0lBRXBCLDREQUE0RDtJQUM1RCxtREFBWSxDQUFBO0lBRVosK0RBQStEO0lBQy9ELHFEQUFhLENBQUE7SUFDYiw0REFBaUIsQ0FBQTtBQUNuQixDQUFDLEVBVlcsVUFBVSxHQUFWLGtCQUFVLEtBQVYsa0JBQVUsUUFVckI7QUFDWSxRQUFBLGlCQUFpQixHQUFHLFVBQ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QUM7UUFFaEQsT0FBTyxNQUFNLENBQUMsR0FBRyxHQUFHLEdBQUcsRUFBRTtZQUN2QixNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7WUFFNUIsUUFBUSxHQUFHLEtBQUssQ0FBQyxFQUFFO2dCQUNqQixLQUFLLENBQUM7b0JBQ0osT0FBTyxDQUFDLFdBQVcsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7b0JBQ3RDLE1BQU07Z0JBRVIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7b0JBQzNDLE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUF3Qzs7UUFDbEQsTUFBTSxPQUFPLEdBQUcsNkJBQTZCLEVBQUUsQ0FBQztRQUNoRCxPQUFPLENBQUMsV0FBVyxHQUFHLE1BQUEsTUFBTSxDQUFDLFdBQVcsbUNBQUksQ0FBQyxDQUFDO1FBQzlDLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyxNQUFBLE1BQU0sQ0FBQyxnQkFBZ0IsbUNBQUksQ0FBQyxDQUFDO1FBQ3hELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= +function createBaseStreamLiquidationOrder() { + return { + liquidationInfo: undefined, + clobPairId: 0, + isBuy: false, + quantums: helpers_1.Long.UZERO, + subticks: helpers_1.Long.UZERO + }; +} +exports.StreamLiquidationOrder = { + encode(message, writer = _m0.Writer.create()) { + if (message.liquidationInfo !== undefined) { + liquidations_1.PerpetualLiquidationInfo.encode(message.liquidationInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.clobPairId !== 0) { + writer.uint32(16).uint32(message.clobPairId); + } + if (message.isBuy === true) { + writer.uint32(24).bool(message.isBuy); + } + if (!message.quantums.isZero()) { + writer.uint32(32).uint64(message.quantums); + } + if (!message.subticks.isZero()) { + writer.uint32(40).uint64(message.subticks); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamLiquidationOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidationInfo = liquidations_1.PerpetualLiquidationInfo.decode(reader, reader.uint32()); + break; + case 2: + message.clobPairId = reader.uint32(); + break; + case 3: + message.isBuy = reader.bool(); + break; + case 4: + message.quantums = reader.uint64(); + break; + case 5: + message.subticks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseStreamLiquidationOrder(); + message.liquidationInfo = object.liquidationInfo !== undefined && object.liquidationInfo !== null ? liquidations_1.PerpetualLiquidationInfo.fromPartial(object.liquidationInfo) : undefined; + message.clobPairId = (_a = object.clobPairId) !== null && _a !== void 0 ? _a : 0; + message.isBuy = (_b = object.isBuy) !== null && _b !== void 0 ? _b : false; + message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; + message.subticks = object.subticks !== undefined && object.subticks !== null ? helpers_1.Long.fromValue(object.subticks) : helpers_1.Long.UZERO; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvY2xvYi9vcmRlci50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0FBQyxRQUFRLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLEtBQUssQ0FBQztRQUM1SCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), @@ -187448,6 +186055,11 @@ var OrderRemoval_RemovalReason; * was fully filled and should therefore be removed from state. */ OrderRemoval_RemovalReason[OrderRemoval_RemovalReason["REMOVAL_REASON_FULLY_FILLED"] = 7] = "REMOVAL_REASON_FULLY_FILLED"; + /** + * REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS - REMOVAL_REASON_FULLY_FILLED represents a removal of an order that + * would lead to the subaccount violating isolated subaccount constraints. + */ + OrderRemoval_RemovalReason[OrderRemoval_RemovalReason["REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS"] = 8] = "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS"; OrderRemoval_RemovalReason[OrderRemoval_RemovalReason["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; })(OrderRemoval_RemovalReason = exports.OrderRemoval_RemovalReason || (exports.OrderRemoval_RemovalReason = {})); exports.OrderRemoval_RemovalReasonSDKType = OrderRemoval_RemovalReason; @@ -187477,6 +186089,9 @@ function orderRemoval_RemovalReasonFromJSON(object) { case 7: case "REMOVAL_REASON_FULLY_FILLED": return OrderRemoval_RemovalReason.REMOVAL_REASON_FULLY_FILLED; + case 8: + case "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS": + return OrderRemoval_RemovalReason.REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS; case -1: case "UNRECOGNIZED": default: @@ -187502,6 +186117,8 @@ function orderRemoval_RemovalReasonToJSON(object) { return "REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK"; case OrderRemoval_RemovalReason.REMOVAL_REASON_FULLY_FILLED: return "REMOVAL_REASON_FULLY_FILLED"; + case OrderRemoval_RemovalReason.REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS: + return "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS"; case OrderRemoval_RemovalReason.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -187552,7 +186169,7 @@ exports.OrderRemoval = { return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXJfcmVtb3ZhbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvY2xvYi9vcmRlcl9yZW1vdmFscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLG1DQUFrRDtBQUNsRCx3REFBMEM7QUFFMUMsSUFBWSwwQkEyRFg7QUEzREQsV0FBWSwwQkFBMEI7SUFDcEM7Ozs7T0FJRztJQUNILHVIQUE4QixDQUFBO0lBRTlCOzs7O09BSUc7SUFDSCx1SUFBc0MsQ0FBQTtJQUV0Qzs7Ozs7T0FLRztJQUNILHVJQUFzQyxDQUFBO0lBRXRDOzs7O09BSUc7SUFDSCxtS0FBb0QsQ0FBQTtJQUVwRDs7OztPQUlHO0lBQ0gscUlBQXFDLENBQUE7SUFFckM7Ozs7O09BS0c7SUFDSCxtTEFBNEQsQ0FBQTtJQUU1RDs7Ozs7T0FLRztJQUNILHFLQUFxRCxDQUFBO0lBRXJEOzs7T0FHRztJQUNILHlIQUErQixDQUFBO0lBQy9CLDRGQUFpQixDQUFB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UFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLE1BQWlDOztRQUMzQyxNQUFNLE9BQU8sR0FBRyxzQkFBc0IsRUFBRSxDQUFDO1FBQ3pDLE9BQU8sQ0FBQyxPQUFPLEdBQUcsTUFBTSxDQUFDLE9BQU8sS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLE9BQU8sS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGVBQU8sQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDNUgsT0FBTyxDQUFDLGFBQWEsR0FBRyxNQUFBLE1BQU0sQ0FBQyxhQUFhLG1DQUFJLENBQUMsQ0FBQztRQUNsRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), @@ -187588,14 +186205,18 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StreamOrderbookUpdatesResponse = exports.StreamOrderbookUpdatesRequest = exports.QueryLiquidationsConfigurationResponse = exports.QueryLiquidationsConfigurationRequest = exports.QueryBlockRateLimitConfigurationResponse = exports.QueryBlockRateLimitConfigurationRequest = exports.QueryEquityTierLimitConfigurationResponse = exports.QueryEquityTierLimitConfigurationRequest = exports.MevNodeToNodeCalculationResponse_MevAndVolumePerClob = exports.MevNodeToNodeCalculationResponse = exports.MevNodeToNodeCalculationRequest = exports.QueryClobPairAllResponse = exports.QueryAllClobPairRequest = exports.QueryClobPairResponse = exports.QueryGetClobPairRequest = void 0; +exports.StreamTakerOrderStatus = exports.StreamTakerOrder = exports.StreamOrderbookFill = exports.StreamOrderbookUpdate = exports.StreamUpdate = exports.StreamOrderbookUpdatesResponse = exports.StreamOrderbookUpdatesRequest = exports.QueryLiquidationsConfigurationResponse = exports.QueryLiquidationsConfigurationRequest = exports.QueryStatefulOrderResponse = exports.QueryStatefulOrderRequest = exports.QueryBlockRateLimitConfigurationResponse = exports.QueryBlockRateLimitConfigurationRequest = exports.QueryEquityTierLimitConfigurationResponse = exports.QueryEquityTierLimitConfigurationRequest = exports.MevNodeToNodeCalculationResponse_MevAndVolumePerClob = exports.MevNodeToNodeCalculationResponse = exports.MevNodeToNodeCalculationRequest = exports.QueryClobPairAllResponse = exports.QueryAllClobPairRequest = exports.QueryClobPairResponse = exports.QueryGetClobPairRequest = void 0; const pagination_1 = __webpack_require__(/*! ../../cosmos/base/query/v1beta1/pagination */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts"); const mev_1 = __webpack_require__(/*! ./mev */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/mev.ts"); +const order_1 = __webpack_require__(/*! ./order */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/order.ts"); +const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); const clob_pair_1 = __webpack_require__(/*! ./clob_pair */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/clob_pair.ts"); const equity_tier_limit_config_1 = __webpack_require__(/*! ./equity_tier_limit_config */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/equity_tier_limit_config.ts"); const block_rate_limit_config_1 = __webpack_require__(/*! ./block_rate_limit_config */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/block_rate_limit_config.ts"); const liquidations_config_1 = __webpack_require__(/*! ./liquidations_config */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/liquidations_config.ts"); +const streaming_1 = __webpack_require__(/*! ../subaccounts/streaming */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/streaming.ts"); const off_chain_updates_1 = __webpack_require__(/*! ../indexer/off_chain_updates/off_chain_updates */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/off_chain_updates/off_chain_updates.ts"); +const matches_1 = __webpack_require__(/*! ./matches */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/matches.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); function createBaseQueryGetClobPairRequest() { @@ -188001,6 +186622,93 @@ exports.QueryBlockRateLimitConfigurationResponse = { return message; } }; +function createBaseQueryStatefulOrderRequest() { + return { + orderId: undefined + }; +} +exports.QueryStatefulOrderRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.orderId !== undefined) { + order_1.OrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatefulOrderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = order_1.OrderId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryStatefulOrderRequest(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? order_1.OrderId.fromPartial(object.orderId) : undefined; + return message; + } +}; +function createBaseQueryStatefulOrderResponse() { + return { + orderPlacement: undefined, + fillAmount: helpers_1.Long.UZERO, + triggered: false + }; +} +exports.QueryStatefulOrderResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.orderPlacement !== undefined) { + order_1.LongTermOrderPlacement.encode(message.orderPlacement, writer.uint32(10).fork()).ldelim(); + } + if (!message.fillAmount.isZero()) { + writer.uint32(16).uint64(message.fillAmount); + } + if (message.triggered === true) { + writer.uint32(24).bool(message.triggered); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatefulOrderResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderPlacement = order_1.LongTermOrderPlacement.decode(reader, reader.uint32()); + break; + case 2: + message.fillAmount = reader.uint64(); + break; + case 3: + message.triggered = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryStatefulOrderResponse(); + message.orderPlacement = object.orderPlacement !== undefined && object.orderPlacement !== null ? order_1.LongTermOrderPlacement.fromPartial(object.orderPlacement) : undefined; + message.fillAmount = object.fillAmount !== undefined && object.fillAmount !== null ? helpers_1.Long.fromValue(object.fillAmount) : helpers_1.Long.UZERO; + message.triggered = (_a = object.triggered) !== null && _a !== void 0 ? _a : false; + return message; + } +}; function createBaseQueryLiquidationsConfigurationRequest() { return {}; } @@ -188064,7 +186772,8 @@ exports.QueryLiquidationsConfigurationResponse = { }; function createBaseStreamOrderbookUpdatesRequest() { return { - clobPairId: [] + clobPairId: [], + subaccountIds: [] }; } exports.StreamOrderbookUpdatesRequest = { @@ -188074,6 +186783,9 @@ exports.StreamOrderbookUpdatesRequest = { writer.uint32(v); } writer.ldelim(); + for (const v of message.subaccountIds) { + subaccount_1.SubaccountId.encode(v, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input, length) { @@ -188094,6 +186806,9 @@ exports.StreamOrderbookUpdatesRequest = { message.clobPairId.push(reader.uint32()); } break; + case 2: + message.subaccountIds.push(subaccount_1.SubaccountId.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -188102,40 +186817,214 @@ exports.StreamOrderbookUpdatesRequest = { return message; }, fromPartial(object) { - var _a; + var _a, _b; const message = createBaseStreamOrderbookUpdatesRequest(); message.clobPairId = ((_a = object.clobPairId) === null || _a === void 0 ? void 0 : _a.map(e => e)) || []; + message.subaccountIds = ((_b = object.subaccountIds) === null || _b === void 0 ? void 0 : _b.map(e => subaccount_1.SubaccountId.fromPartial(e))) || []; return message; } }; function createBaseStreamOrderbookUpdatesResponse() { return { - updates: [], - snapshot: false + updates: [] }; } exports.StreamOrderbookUpdatesResponse = { encode(message, writer = _m0.Writer.create()) { for (const v of message.updates) { - off_chain_updates_1.OffChainUpdateV1.encode(v, writer.uint32(10).fork()).ldelim(); + exports.StreamUpdate.encode(v, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookUpdatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(exports.StreamUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseStreamOrderbookUpdatesResponse(); + message.updates = ((_a = object.updates) === null || _a === void 0 ? void 0 : _a.map(e => exports.StreamUpdate.fromPartial(e))) || []; + return message; + } +}; +function createBaseStreamUpdate() { + return { + blockHeight: 0, + execMode: 0, + orderbookUpdate: undefined, + orderFill: undefined, + takerOrder: undefined, + subaccountUpdate: undefined + }; +} +exports.StreamUpdate = { + encode(message, writer = _m0.Writer.create()) { + if (message.blockHeight !== 0) { + writer.uint32(8).uint32(message.blockHeight); + } + if (message.execMode !== 0) { + writer.uint32(16).uint32(message.execMode); + } + if (message.orderbookUpdate !== undefined) { + exports.StreamOrderbookUpdate.encode(message.orderbookUpdate, writer.uint32(26).fork()).ldelim(); + } + if (message.orderFill !== undefined) { + exports.StreamOrderbookFill.encode(message.orderFill, writer.uint32(34).fork()).ldelim(); + } + if (message.takerOrder !== undefined) { + exports.StreamTakerOrder.encode(message.takerOrder, writer.uint32(42).fork()).ldelim(); + } + if (message.subaccountUpdate !== undefined) { + streaming_1.StreamSubaccountUpdate.encode(message.subaccountUpdate, writer.uint32(50).fork()).ldelim(); } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint32(); + break; + case 2: + message.execMode = reader.uint32(); + break; + case 3: + message.orderbookUpdate = exports.StreamOrderbookUpdate.decode(reader, reader.uint32()); + break; + case 4: + message.orderFill = exports.StreamOrderbookFill.decode(reader, reader.uint32()); + break; + case 5: + message.takerOrder = exports.StreamTakerOrder.decode(reader, reader.uint32()); + break; + case 6: + message.subaccountUpdate = streaming_1.StreamSubaccountUpdate.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseStreamUpdate(); + message.blockHeight = (_a = object.blockHeight) !== null && _a !== void 0 ? _a : 0; + message.execMode = (_b = object.execMode) !== null && _b !== void 0 ? _b : 0; + message.orderbookUpdate = object.orderbookUpdate !== undefined && object.orderbookUpdate !== null ? exports.StreamOrderbookUpdate.fromPartial(object.orderbookUpdate) : undefined; + message.orderFill = object.orderFill !== undefined && object.orderFill !== null ? exports.StreamOrderbookFill.fromPartial(object.orderFill) : undefined; + message.takerOrder = object.takerOrder !== undefined && object.takerOrder !== null ? exports.StreamTakerOrder.fromPartial(object.takerOrder) : undefined; + message.subaccountUpdate = object.subaccountUpdate !== undefined && object.subaccountUpdate !== null ? streaming_1.StreamSubaccountUpdate.fromPartial(object.subaccountUpdate) : undefined; + return message; + } +}; +function createBaseStreamOrderbookUpdate() { + return { + snapshot: false, + updates: [] + }; +} +exports.StreamOrderbookUpdate = { + encode(message, writer = _m0.Writer.create()) { if (message.snapshot === true) { - writer.uint32(16).bool(message.snapshot); + writer.uint32(8).bool(message.snapshot); + } + for (const v of message.updates) { + off_chain_updates_1.OffChainUpdateV1.encode(v, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStreamOrderbookUpdatesResponse(); + const message = createBaseStreamOrderbookUpdate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: + message.snapshot = reader.bool(); + break; + case 2: message.updates.push(off_chain_updates_1.OffChainUpdateV1.decode(reader, reader.uint32())); break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseStreamOrderbookUpdate(); + message.snapshot = (_a = object.snapshot) !== null && _a !== void 0 ? _a : false; + message.updates = ((_b = object.updates) === null || _b === void 0 ? void 0 : _b.map(e => off_chain_updates_1.OffChainUpdateV1.fromPartial(e))) || []; + return message; + } +}; +function createBaseStreamOrderbookFill() { + return { + clobMatch: undefined, + orders: [], + fillAmounts: [] + }; +} +exports.StreamOrderbookFill = { + encode(message, writer = _m0.Writer.create()) { + if (message.clobMatch !== undefined) { + matches_1.ClobMatch.encode(message.clobMatch, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.orders) { + order_1.Order.encode(v, writer.uint32(18).fork()).ldelim(); + } + writer.uint32(26).fork(); + for (const v of message.fillAmounts) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookFill(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clobMatch = matches_1.ClobMatch.decode(reader, reader.uint32()); + break; case 2: - message.snapshot = reader.bool(); + message.orders.push(order_1.Order.decode(reader, reader.uint32())); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fillAmounts.push(reader.uint64()); + } + } + else { + message.fillAmounts.push(reader.uint64()); + } break; default: reader.skipType(tag & 7); @@ -188146,13 +187035,117 @@ exports.StreamOrderbookUpdatesResponse = { }, fromPartial(object) { var _a, _b; - const message = createBaseStreamOrderbookUpdatesResponse(); - message.updates = ((_a = object.updates) === null || _a === void 0 ? void 0 : _a.map(e => off_chain_updates_1.OffChainUpdateV1.fromPartial(e))) || []; - message.snapshot = (_b = object.snapshot) !== null && _b !== void 0 ? _b : false; + const message = createBaseStreamOrderbookFill(); + message.clobMatch = object.clobMatch !== undefined && object.clobMatch !== null ? matches_1.ClobMatch.fromPartial(object.clobMatch) : undefined; + message.orders = ((_a = object.orders) === null || _a === void 0 ? void 0 : _a.map(e => order_1.Order.fromPartial(e))) || []; + message.fillAmounts = ((_b = object.fillAmounts) === null || _b === void 0 ? void 0 : _b.map(e => helpers_1.Long.fromValue(e))) || []; + return message; + } +}; +function createBaseStreamTakerOrder() { + return { + order: undefined, + liquidationOrder: undefined, + takerOrderStatus: undefined + }; +} +exports.StreamTakerOrder = { + encode(message, writer = _m0.Writer.create()) { + if (message.order !== undefined) { + order_1.Order.encode(message.order, writer.uint32(10).fork()).ldelim(); + } + if (message.liquidationOrder !== undefined) { + order_1.StreamLiquidationOrder.encode(message.liquidationOrder, writer.uint32(18).fork()).ldelim(); + } + if (message.takerOrderStatus !== undefined) { + exports.StreamTakerOrderStatus.encode(message.takerOrderStatus, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamTakerOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.order = order_1.Order.decode(reader, reader.uint32()); + break; + case 2: + message.liquidationOrder = order_1.StreamLiquidationOrder.decode(reader, reader.uint32()); + break; + case 3: + message.takerOrderStatus = exports.StreamTakerOrderStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseStreamTakerOrder(); + message.order = object.order !== undefined && object.order !== null ? order_1.Order.fromPartial(object.order) : undefined; + message.liquidationOrder = object.liquidationOrder !== undefined && object.liquidationOrder !== null ? order_1.StreamLiquidationOrder.fromPartial(object.liquidationOrder) : undefined; + message.takerOrderStatus = object.takerOrderStatus !== undefined && object.takerOrderStatus !== null ? exports.StreamTakerOrderStatus.fromPartial(object.takerOrderStatus) : undefined; + return message; + } +}; +function createBaseStreamTakerOrderStatus() { + return { + orderStatus: 0, + remainingQuantums: helpers_1.Long.UZERO, + optimisticallyFilledQuantums: helpers_1.Long.UZERO + }; +} +exports.StreamTakerOrderStatus = { + encode(message, writer = _m0.Writer.create()) { + if (message.orderStatus !== 0) { + writer.uint32(8).uint32(message.orderStatus); + } + if (!message.remainingQuantums.isZero()) { + writer.uint32(16).uint64(message.remainingQuantums); + } + if (!message.optimisticallyFilledQuantums.isZero()) { + writer.uint32(24).uint64(message.optimisticallyFilledQuantums); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamTakerOrderStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderStatus = reader.uint32(); + break; + case 2: + message.remainingQuantums = reader.uint64(); + break; + case 3: + message.optimisticallyFilledQuantums = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseStreamTakerOrderStatus(); + message.orderStatus = (_a = object.orderStatus) !== null && _a !== void 0 ? _a : 0; + message.remainingQuantums = object.remainingQuantums !== undefined && object.remainingQuantums !== null ? helpers_1.Long.fromValue(object.remainingQuantums) : helpers_1.Long.UZERO; + message.optimisticallyFilledQuantums = object.optimisticallyFilledQuantums !== undefined && object.optimisticallyFilledQuantums !== null ? helpers_1.Long.fromValue(object.optimisticallyFilledQuantums) : helpers_1.Long.UZERO; return message; } }; -//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xLQUFLLENBQUM7UUFDaEssT0FBTyxDQUFDLDRCQUE0QixHQUFHLE1BQU0sQ0FBQyw0QkFBNEIsS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLDRCQUE0QixLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsNEJBQTRCLENBQUMsQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLEtBQUssQ0FBQztRQUM1TSxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), @@ -189445,8 +188438,9 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OffChainUpdateV1 = exports.OrderUpdateV1 = exports.OrderRemoveV1 = exports.OrderPlaceV1 = exports.orderRemoveV1_OrderRemovalStatusToJSON = exports.orderRemoveV1_OrderRemovalStatusFromJSON = exports.OrderRemoveV1_OrderRemovalStatusSDKType = exports.OrderRemoveV1_OrderRemovalStatus = exports.orderPlaceV1_OrderPlacementStatusToJSON = exports.orderPlaceV1_OrderPlacementStatusFromJSON = exports.OrderPlaceV1_OrderPlacementStatusSDKType = exports.OrderPlaceV1_OrderPlacementStatus = void 0; +exports.OffChainUpdateV1 = exports.OrderReplaceV1 = exports.OrderUpdateV1 = exports.OrderRemoveV1 = exports.OrderPlaceV1 = exports.orderRemoveV1_OrderRemovalStatusToJSON = exports.orderRemoveV1_OrderRemovalStatusFromJSON = exports.OrderRemoveV1_OrderRemovalStatusSDKType = exports.OrderRemoveV1_OrderRemovalStatus = exports.orderPlaceV1_OrderPlacementStatusToJSON = exports.orderPlaceV1_OrderPlacementStatusFromJSON = exports.OrderPlaceV1_OrderPlacementStatusSDKType = exports.OrderPlaceV1_OrderPlacementStatus = void 0; const clob_1 = __webpack_require__(/*! ../protocol/v1/clob */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/clob.ts"); +const timestamp_1 = __webpack_require__(/*! ../../../google/protobuf/timestamp */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/google/protobuf/timestamp.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); const helpers_1 = __webpack_require__(/*! ../../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); /** @@ -189585,7 +188579,8 @@ exports.orderRemoveV1_OrderRemovalStatusToJSON = orderRemoveV1_OrderRemovalStatu function createBaseOrderPlaceV1() { return { order: undefined, - placementStatus: 0 + placementStatus: 0, + timeStamp: undefined }; } exports.OrderPlaceV1 = { @@ -189596,6 +188591,9 @@ exports.OrderPlaceV1 = { if (message.placementStatus !== 0) { writer.uint32(16).int32(message.placementStatus); } + if (message.timeStamp !== undefined) { + timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.timeStamp), writer.uint32(26).fork()).ldelim(); + } return writer; }, decode(input, length) { @@ -189611,6 +188609,9 @@ exports.OrderPlaceV1 = { case 2: message.placementStatus = reader.int32(); break; + case 3: + message.timeStamp = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -189619,10 +188620,11 @@ exports.OrderPlaceV1 = { return message; }, fromPartial(object) { - var _a; + var _a, _b; const message = createBaseOrderPlaceV1(); message.order = object.order !== undefined && object.order !== null ? clob_1.IndexerOrder.fromPartial(object.order) : undefined; message.placementStatus = (_a = object.placementStatus) !== null && _a !== void 0 ? _a : 0; + message.timeStamp = (_b = object.timeStamp) !== null && _b !== void 0 ? _b : undefined; return message; } }; @@ -189630,7 +188632,8 @@ function createBaseOrderRemoveV1() { return { removedOrderId: undefined, reason: 0, - removalStatus: 0 + removalStatus: 0, + timeStamp: undefined }; } exports.OrderRemoveV1 = { @@ -189644,6 +188647,9 @@ exports.OrderRemoveV1 = { if (message.removalStatus !== 0) { writer.uint32(24).int32(message.removalStatus); } + if (message.timeStamp !== undefined) { + timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.timeStamp), writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input, length) { @@ -189662,6 +188668,9 @@ exports.OrderRemoveV1 = { case 3: message.removalStatus = reader.int32(); break; + case 4: + message.timeStamp = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -189670,11 +188679,12 @@ exports.OrderRemoveV1 = { return message; }, fromPartial(object) { - var _a, _b; + var _a, _b, _c; const message = createBaseOrderRemoveV1(); message.removedOrderId = object.removedOrderId !== undefined && object.removedOrderId !== null ? clob_1.IndexerOrderId.fromPartial(object.removedOrderId) : undefined; message.reason = (_a = object.reason) !== null && _a !== void 0 ? _a : 0; message.removalStatus = (_b = object.removalStatus) !== null && _b !== void 0 ? _b : 0; + message.timeStamp = (_c = object.timeStamp) !== null && _c !== void 0 ? _c : undefined; return message; } }; @@ -189721,410 +188731,48 @@ exports.OrderUpdateV1 = { return message; } }; -function createBaseOffChainUpdateV1() { +function createBaseOrderReplaceV1() { return { - orderPlace: undefined, - orderRemove: undefined, - orderUpdate: undefined - }; -} -exports.OffChainUpdateV1 = { - encode(message, writer = _m0.Writer.create()) { - if (message.orderPlace !== undefined) { - exports.OrderPlaceV1.encode(message.orderPlace, writer.uint32(10).fork()).ldelim(); - } - if (message.orderRemove !== undefined) { - exports.OrderRemoveV1.encode(message.orderRemove, writer.uint32(18).fork()).ldelim(); - } - if (message.orderUpdate !== undefined) { - exports.OrderUpdateV1.encode(message.orderUpdate, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOffChainUpdateV1(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.orderPlace = exports.OrderPlaceV1.decode(reader, reader.uint32()); - break; - case 2: - message.orderRemove = exports.OrderRemoveV1.decode(reader, reader.uint32()); - break; - case 3: - message.orderUpdate = exports.OrderUpdateV1.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object) { - const message = createBaseOffChainUpdateV1(); - message.orderPlace = object.orderPlace !== undefined && object.orderPlace !== null ? exports.OrderPlaceV1.fromPartial(object.orderPlace) : undefined; - message.orderRemove = object.orderRemove !== undefined && object.orderRemove !== null ? exports.OrderRemoveV1.fromPartial(object.orderRemove) : undefined; - message.orderUpdate = object.orderUpdate !== undefined && object.orderUpdate !== null ? exports.OrderUpdateV1.fromPartial(object.orderUpdate) : undefined; - return message; - } -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2ZmX2NoYWluX3VwZGF0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvaW5kZXhlci9vZmZfY2hhaW5fdXBkYXRlcy9vZmZfY2hhaW5fdXBkYXRlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDhDQUErRztBQUUvRyx3REFBMEM7QUFDMUMsOENBQXFEO0FBQ3JEOzs7R0FHRztBQUVILElBQVksaUNBeUJYO0FBekJELFdBQVksaUNBQWlDO0lBQzNDLHNGQUFzRjtJQUN0RixxSkFBc0MsQ0FBQTtJQUV0Qzs7Ozs7Ozs7O09BU0c7SUFDSCxtS0FBNkMsQ0FBQTtJQUU3Qzs7Ozs7O09BTUc7SUFDSCwySUFBaUMsQ0FBQTtJQUNqQywwR0FBaUIsQ0FBQTtBQUNuQixDQUFDLEVBekJXLGlDQUFpQyxHQUFqQyx5Q0FB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LLFNBQVMsSUFBSSxNQUFNLENBQUMsVUFBVSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsb0JBQVksQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDN0ksT0FBTyxDQUFDLFdBQVcsR0FBRyxNQUFNLENBQUMsV0FBVyxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsV0FBVyxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMscUJBQWEsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDbEosT0FBTyxDQUFDLFdBQVcsR0FBRyxNQUFNLENBQUMsV0FBVyxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsV0FBVyxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMscUJBQWEsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDbEosT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/clob.ts": -/*!**************************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/clob.ts ***! - \**************************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IndexerOrder = exports.IndexerOrderId = exports.clobPairStatusToJSON = exports.clobPairStatusFromJSON = exports.ClobPairStatusSDKType = exports.ClobPairStatus = exports.indexerOrder_ConditionTypeToJSON = exports.indexerOrder_ConditionTypeFromJSON = exports.IndexerOrder_ConditionTypeSDKType = exports.IndexerOrder_ConditionType = exports.indexerOrder_TimeInForceToJSON = exports.indexerOrder_TimeInForceFromJSON = exports.IndexerOrder_TimeInForceSDKType = exports.IndexerOrder_TimeInForce = exports.indexerOrder_SideToJSON = exports.indexerOrder_SideFromJSON = exports.IndexerOrder_SideSDKType = exports.IndexerOrder_Side = void 0; -const subaccount_1 = __webpack_require__(/*! ./subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/subaccount.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -const helpers_1 = __webpack_require__(/*! ../../../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); -/** - * Represents the side of the orderbook the order will be placed on. - * Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be - * placed on the orderbook. - */ -var IndexerOrder_Side; -(function (IndexerOrder_Side) { - /** SIDE_UNSPECIFIED - Default value. This value is invalid and unused. */ - IndexerOrder_Side[IndexerOrder_Side["SIDE_UNSPECIFIED"] = 0] = "SIDE_UNSPECIFIED"; - /** SIDE_BUY - SIDE_BUY is used to represent a BUY order. */ - IndexerOrder_Side[IndexerOrder_Side["SIDE_BUY"] = 1] = "SIDE_BUY"; - /** SIDE_SELL - SIDE_SELL is used to represent a SELL order. */ - IndexerOrder_Side[IndexerOrder_Side["SIDE_SELL"] = 2] = "SIDE_SELL"; - IndexerOrder_Side[IndexerOrder_Side["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; -})(IndexerOrder_Side = exports.IndexerOrder_Side || (exports.IndexerOrder_Side = {})); -exports.IndexerOrder_SideSDKType = IndexerOrder_Side; -function indexerOrder_SideFromJSON(object) { - switch (object) { - case 0: - case "SIDE_UNSPECIFIED": - return IndexerOrder_Side.SIDE_UNSPECIFIED; - case 1: - case "SIDE_BUY": - return IndexerOrder_Side.SIDE_BUY; - case 2: - case "SIDE_SELL": - return IndexerOrder_Side.SIDE_SELL; - case -1: - case "UNRECOGNIZED": - default: - return IndexerOrder_Side.UNRECOGNIZED; - } -} -exports.indexerOrder_SideFromJSON = indexerOrder_SideFromJSON; -function indexerOrder_SideToJSON(object) { - switch (object) { - case IndexerOrder_Side.SIDE_UNSPECIFIED: - return "SIDE_UNSPECIFIED"; - case IndexerOrder_Side.SIDE_BUY: - return "SIDE_BUY"; - case IndexerOrder_Side.SIDE_SELL: - return "SIDE_SELL"; - case IndexerOrder_Side.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} -exports.indexerOrder_SideToJSON = indexerOrder_SideToJSON; -/** - * TimeInForce indicates how long an order will remain active before it - * is executed or expires. - */ -var IndexerOrder_TimeInForce; -(function (IndexerOrder_TimeInForce) { - /** - * TIME_IN_FORCE_UNSPECIFIED - TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an - * order will first match with existing orders on the book, and any - * remaining size will be added to the book as a maker order. - */ - IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_UNSPECIFIED"] = 0] = "TIME_IN_FORCE_UNSPECIFIED"; - /** - * TIME_IN_FORCE_IOC - TIME_IN_FORCE_IOC enforces that an order only be matched with - * maker orders on the book. If the order has remaining size after - * matching with existing orders on the book, the remaining size - * is not placed on the book. - */ - IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_IOC"] = 1] = "TIME_IN_FORCE_IOC"; - /** - * TIME_IN_FORCE_POST_ONLY - TIME_IN_FORCE_POST_ONLY enforces that an order only be placed - * on the book as a maker order. Note this means that validators will cancel - * any newly-placed post only orders that would cross with other maker - * orders. - */ - IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_POST_ONLY"] = 2] = "TIME_IN_FORCE_POST_ONLY"; - /** - * TIME_IN_FORCE_FILL_OR_KILL - TIME_IN_FORCE_FILL_OR_KILL enforces that an order will either be filled - * completely and immediately by maker orders on the book or canceled if the - * entire amount can‘t be matched. - */ - IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_FILL_OR_KILL"] = 3] = "TIME_IN_FORCE_FILL_OR_KILL"; - IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; -})(IndexerOrder_TimeInForce = exports.IndexerOrder_TimeInForce || (exports.IndexerOrder_TimeInForce = {})); -exports.IndexerOrder_TimeInForceSDKType = IndexerOrder_TimeInForce; -function indexerOrder_TimeInForceFromJSON(object) { - switch (object) { - case 0: - case "TIME_IN_FORCE_UNSPECIFIED": - return IndexerOrder_TimeInForce.TIME_IN_FORCE_UNSPECIFIED; - case 1: - case "TIME_IN_FORCE_IOC": - return IndexerOrder_TimeInForce.TIME_IN_FORCE_IOC; - case 2: - case "TIME_IN_FORCE_POST_ONLY": - return IndexerOrder_TimeInForce.TIME_IN_FORCE_POST_ONLY; - case 3: - case "TIME_IN_FORCE_FILL_OR_KILL": - return IndexerOrder_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL; - case -1: - case "UNRECOGNIZED": - default: - return IndexerOrder_TimeInForce.UNRECOGNIZED; - } -} -exports.indexerOrder_TimeInForceFromJSON = indexerOrder_TimeInForceFromJSON; -function indexerOrder_TimeInForceToJSON(object) { - switch (object) { - case IndexerOrder_TimeInForce.TIME_IN_FORCE_UNSPECIFIED: - return "TIME_IN_FORCE_UNSPECIFIED"; - case IndexerOrder_TimeInForce.TIME_IN_FORCE_IOC: - return "TIME_IN_FORCE_IOC"; - case IndexerOrder_TimeInForce.TIME_IN_FORCE_POST_ONLY: - return "TIME_IN_FORCE_POST_ONLY"; - case IndexerOrder_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL: - return "TIME_IN_FORCE_FILL_OR_KILL"; - case IndexerOrder_TimeInForce.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} -exports.indexerOrder_TimeInForceToJSON = indexerOrder_TimeInForceToJSON; -var IndexerOrder_ConditionType; -(function (IndexerOrder_ConditionType) { - /** - * CONDITION_TYPE_UNSPECIFIED - CONDITION_TYPE_UNSPECIFIED represents the default behavior where an - * order will be placed immediately on the orderbook. - */ - IndexerOrder_ConditionType[IndexerOrder_ConditionType["CONDITION_TYPE_UNSPECIFIED"] = 0] = "CONDITION_TYPE_UNSPECIFIED"; - /** - * CONDITION_TYPE_STOP_LOSS - CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will - * trigger when the oracle price moves at or above the trigger price for - * buys, and at or below the trigger price for sells. - */ - IndexerOrder_ConditionType[IndexerOrder_ConditionType["CONDITION_TYPE_STOP_LOSS"] = 1] = "CONDITION_TYPE_STOP_LOSS"; - /** - * CONDITION_TYPE_TAKE_PROFIT - CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit - * order will trigger when the oracle price moves at or below the trigger - * price for buys and at or above the trigger price for sells. - */ - IndexerOrder_ConditionType[IndexerOrder_ConditionType["CONDITION_TYPE_TAKE_PROFIT"] = 2] = "CONDITION_TYPE_TAKE_PROFIT"; - IndexerOrder_ConditionType[IndexerOrder_ConditionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; -})(IndexerOrder_ConditionType = exports.IndexerOrder_ConditionType || (exports.IndexerOrder_ConditionType = {})); -exports.IndexerOrder_ConditionTypeSDKType = IndexerOrder_ConditionType; -function indexerOrder_ConditionTypeFromJSON(object) { - switch (object) { - case 0: - case "CONDITION_TYPE_UNSPECIFIED": - return IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED; - case 1: - case "CONDITION_TYPE_STOP_LOSS": - return IndexerOrder_ConditionType.CONDITION_TYPE_STOP_LOSS; - case 2: - case "CONDITION_TYPE_TAKE_PROFIT": - return IndexerOrder_ConditionType.CONDITION_TYPE_TAKE_PROFIT; - case -1: - case "UNRECOGNIZED": - default: - return IndexerOrder_ConditionType.UNRECOGNIZED; - } -} -exports.indexerOrder_ConditionTypeFromJSON = indexerOrder_ConditionTypeFromJSON; -function indexerOrder_ConditionTypeToJSON(object) { - switch (object) { - case IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED: - return "CONDITION_TYPE_UNSPECIFIED"; - case IndexerOrder_ConditionType.CONDITION_TYPE_STOP_LOSS: - return "CONDITION_TYPE_STOP_LOSS"; - case IndexerOrder_ConditionType.CONDITION_TYPE_TAKE_PROFIT: - return "CONDITION_TYPE_TAKE_PROFIT"; - case IndexerOrder_ConditionType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} -exports.indexerOrder_ConditionTypeToJSON = indexerOrder_ConditionTypeToJSON; -/** - * Status of the CLOB. - * Defined in clob.clob_pair - */ -var ClobPairStatus; -(function (ClobPairStatus) { - /** CLOB_PAIR_STATUS_UNSPECIFIED - Default value. This value is invalid and unused. */ - ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_UNSPECIFIED"] = 0] = "CLOB_PAIR_STATUS_UNSPECIFIED"; - /** - * CLOB_PAIR_STATUS_ACTIVE - CLOB_PAIR_STATUS_ACTIVE behavior is unfinalized. - * TODO(DEC-600): update this documentation. - */ - ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_ACTIVE"] = 1] = "CLOB_PAIR_STATUS_ACTIVE"; - /** - * CLOB_PAIR_STATUS_PAUSED - CLOB_PAIR_STATUS_PAUSED behavior is unfinalized. - * TODO(DEC-600): update this documentation. - */ - ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_PAUSED"] = 2] = "CLOB_PAIR_STATUS_PAUSED"; - /** - * CLOB_PAIR_STATUS_CANCEL_ONLY - CLOB_PAIR_STATUS_CANCEL_ONLY behavior is unfinalized. - * TODO(DEC-600): update this documentation. - */ - ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_CANCEL_ONLY"] = 3] = "CLOB_PAIR_STATUS_CANCEL_ONLY"; - /** - * CLOB_PAIR_STATUS_POST_ONLY - CLOB_PAIR_STATUS_POST_ONLY behavior is unfinalized. - * TODO(DEC-600): update this documentation. - */ - ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_POST_ONLY"] = 4] = "CLOB_PAIR_STATUS_POST_ONLY"; - /** - * CLOB_PAIR_STATUS_INITIALIZING - CLOB_PAIR_STATUS_INITIALIZING represents a newly-added clob pair. - * Clob pairs in this state only accept orders which are - * both short-term and post-only. - */ - ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_INITIALIZING"] = 5] = "CLOB_PAIR_STATUS_INITIALIZING"; - /** - * CLOB_PAIR_STATUS_FINAL_SETTLEMENT - CLOB_PAIR_STATUS_FINAL_SETTLEMENT represents a clob pair that has been - * deactivated. Clob pairs in this state do not accept new orders and trading - * is blocked. All open positions are closed and open stateful orders canceled - * by the protocol when the clob pair transitions to this status. All - * short-term orders are left to expire. - */ - ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_FINAL_SETTLEMENT"] = 6] = "CLOB_PAIR_STATUS_FINAL_SETTLEMENT"; - ClobPairStatus[ClobPairStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; -})(ClobPairStatus = exports.ClobPairStatus || (exports.ClobPairStatus = {})); -exports.ClobPairStatusSDKType = ClobPairStatus; -function clobPairStatusFromJSON(object) { - switch (object) { - case 0: - case "CLOB_PAIR_STATUS_UNSPECIFIED": - return ClobPairStatus.CLOB_PAIR_STATUS_UNSPECIFIED; - case 1: - case "CLOB_PAIR_STATUS_ACTIVE": - return ClobPairStatus.CLOB_PAIR_STATUS_ACTIVE; - case 2: - case "CLOB_PAIR_STATUS_PAUSED": - return ClobPairStatus.CLOB_PAIR_STATUS_PAUSED; - case 3: - case "CLOB_PAIR_STATUS_CANCEL_ONLY": - return ClobPairStatus.CLOB_PAIR_STATUS_CANCEL_ONLY; - case 4: - case "CLOB_PAIR_STATUS_POST_ONLY": - return ClobPairStatus.CLOB_PAIR_STATUS_POST_ONLY; - case 5: - case "CLOB_PAIR_STATUS_INITIALIZING": - return ClobPairStatus.CLOB_PAIR_STATUS_INITIALIZING; - case 6: - case "CLOB_PAIR_STATUS_FINAL_SETTLEMENT": - return ClobPairStatus.CLOB_PAIR_STATUS_FINAL_SETTLEMENT; - case -1: - case "UNRECOGNIZED": - default: - return ClobPairStatus.UNRECOGNIZED; - } -} -exports.clobPairStatusFromJSON = clobPairStatusFromJSON; -function clobPairStatusToJSON(object) { - switch (object) { - case ClobPairStatus.CLOB_PAIR_STATUS_UNSPECIFIED: - return "CLOB_PAIR_STATUS_UNSPECIFIED"; - case ClobPairStatus.CLOB_PAIR_STATUS_ACTIVE: - return "CLOB_PAIR_STATUS_ACTIVE"; - case ClobPairStatus.CLOB_PAIR_STATUS_PAUSED: - return "CLOB_PAIR_STATUS_PAUSED"; - case ClobPairStatus.CLOB_PAIR_STATUS_CANCEL_ONLY: - return "CLOB_PAIR_STATUS_CANCEL_ONLY"; - case ClobPairStatus.CLOB_PAIR_STATUS_POST_ONLY: - return "CLOB_PAIR_STATUS_POST_ONLY"; - case ClobPairStatus.CLOB_PAIR_STATUS_INITIALIZING: - return "CLOB_PAIR_STATUS_INITIALIZING"; - case ClobPairStatus.CLOB_PAIR_STATUS_FINAL_SETTLEMENT: - return "CLOB_PAIR_STATUS_FINAL_SETTLEMENT"; - case ClobPairStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} -exports.clobPairStatusToJSON = clobPairStatusToJSON; -function createBaseIndexerOrderId() { - return { - subaccountId: undefined, - clientId: 0, - orderFlags: 0, - clobPairId: 0 + oldOrderId: undefined, + order: undefined, + placementStatus: 0, + timeStamp: undefined }; } -exports.IndexerOrderId = { +exports.OrderReplaceV1 = { encode(message, writer = _m0.Writer.create()) { - if (message.subaccountId !== undefined) { - subaccount_1.IndexerSubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + if (message.oldOrderId !== undefined) { + clob_1.IndexerOrderId.encode(message.oldOrderId, writer.uint32(10).fork()).ldelim(); } - if (message.clientId !== 0) { - writer.uint32(21).fixed32(message.clientId); + if (message.order !== undefined) { + clob_1.IndexerOrder.encode(message.order, writer.uint32(18).fork()).ldelim(); } - if (message.orderFlags !== 0) { - writer.uint32(24).uint32(message.orderFlags); + if (message.placementStatus !== 0) { + writer.uint32(24).int32(message.placementStatus); } - if (message.clobPairId !== 0) { - writer.uint32(32).uint32(message.clobPairId); + if (message.timeStamp !== undefined) { + timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.timeStamp), writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIndexerOrderId(); + const message = createBaseOrderReplaceV1(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.subaccountId = subaccount_1.IndexerSubaccountId.decode(reader, reader.uint32()); + message.oldOrderId = clob_1.IndexerOrderId.decode(reader, reader.uint32()); break; case 2: - message.clientId = reader.fixed32(); + message.order = clob_1.IndexerOrder.decode(reader, reader.uint32()); break; case 3: - message.orderFlags = reader.uint32(); + message.placementStatus = reader.int32(); break; case 4: - message.clobPairId = reader.uint32(); + message.timeStamp = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -190134,106 +188782,57 @@ exports.IndexerOrderId = { return message; }, fromPartial(object) { - var _a, _b, _c; - const message = createBaseIndexerOrderId(); - message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.IndexerSubaccountId.fromPartial(object.subaccountId) : undefined; - message.clientId = (_a = object.clientId) !== null && _a !== void 0 ? _a : 0; - message.orderFlags = (_b = object.orderFlags) !== null && _b !== void 0 ? _b : 0; - message.clobPairId = (_c = object.clobPairId) !== null && _c !== void 0 ? _c : 0; + var _a, _b; + const message = createBaseOrderReplaceV1(); + message.oldOrderId = object.oldOrderId !== undefined && object.oldOrderId !== null ? clob_1.IndexerOrderId.fromPartial(object.oldOrderId) : undefined; + message.order = object.order !== undefined && object.order !== null ? clob_1.IndexerOrder.fromPartial(object.order) : undefined; + message.placementStatus = (_a = object.placementStatus) !== null && _a !== void 0 ? _a : 0; + message.timeStamp = (_b = object.timeStamp) !== null && _b !== void 0 ? _b : undefined; return message; } }; -function createBaseIndexerOrder() { +function createBaseOffChainUpdateV1() { return { - orderId: undefined, - side: 0, - quantums: helpers_1.Long.UZERO, - subticks: helpers_1.Long.UZERO, - goodTilBlock: undefined, - goodTilBlockTime: undefined, - timeInForce: 0, - reduceOnly: false, - clientMetadata: 0, - conditionType: 0, - conditionalOrderTriggerSubticks: helpers_1.Long.UZERO + orderPlace: undefined, + orderRemove: undefined, + orderUpdate: undefined, + orderReplace: undefined }; } -exports.IndexerOrder = { +exports.OffChainUpdateV1 = { encode(message, writer = _m0.Writer.create()) { - if (message.orderId !== undefined) { - exports.IndexerOrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); - } - if (message.side !== 0) { - writer.uint32(16).int32(message.side); - } - if (!message.quantums.isZero()) { - writer.uint32(24).uint64(message.quantums); - } - if (!message.subticks.isZero()) { - writer.uint32(32).uint64(message.subticks); - } - if (message.goodTilBlock !== undefined) { - writer.uint32(40).uint32(message.goodTilBlock); - } - if (message.goodTilBlockTime !== undefined) { - writer.uint32(53).fixed32(message.goodTilBlockTime); - } - if (message.timeInForce !== 0) { - writer.uint32(56).int32(message.timeInForce); - } - if (message.reduceOnly === true) { - writer.uint32(64).bool(message.reduceOnly); + if (message.orderPlace !== undefined) { + exports.OrderPlaceV1.encode(message.orderPlace, writer.uint32(10).fork()).ldelim(); } - if (message.clientMetadata !== 0) { - writer.uint32(72).uint32(message.clientMetadata); + if (message.orderRemove !== undefined) { + exports.OrderRemoveV1.encode(message.orderRemove, writer.uint32(18).fork()).ldelim(); } - if (message.conditionType !== 0) { - writer.uint32(80).int32(message.conditionType); + if (message.orderUpdate !== undefined) { + exports.OrderUpdateV1.encode(message.orderUpdate, writer.uint32(26).fork()).ldelim(); } - if (!message.conditionalOrderTriggerSubticks.isZero()) { - writer.uint32(88).uint64(message.conditionalOrderTriggerSubticks); + if (message.orderReplace !== undefined) { + exports.OrderReplaceV1.encode(message.orderReplace, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIndexerOrder(); + const message = createBaseOffChainUpdateV1(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.orderId = exports.IndexerOrderId.decode(reader, reader.uint32()); + message.orderPlace = exports.OrderPlaceV1.decode(reader, reader.uint32()); break; case 2: - message.side = reader.int32(); + message.orderRemove = exports.OrderRemoveV1.decode(reader, reader.uint32()); break; case 3: - message.quantums = reader.uint64(); + message.orderUpdate = exports.OrderUpdateV1.decode(reader, reader.uint32()); break; case 4: - message.subticks = reader.uint64(); - break; - case 5: - message.goodTilBlock = reader.uint32(); - break; - case 6: - message.goodTilBlockTime = reader.fixed32(); - break; - case 7: - message.timeInForce = reader.int32(); - break; - case 8: - message.reduceOnly = reader.bool(); - break; - case 9: - message.clientMetadata = reader.uint32(); - break; - case 10: - message.conditionType = reader.int32(); - break; - case 11: - message.conditionalOrderTriggerSubticks = reader.uint64(); + message.orderReplace = exports.OrderReplaceV1.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -190243,30 +188842,509 @@ exports.IndexerOrder = { return message; }, fromPartial(object) { - var _a, _b, _c, _d, _e, _f, _g; - const message = createBaseIndexerOrder(); - message.orderId = object.orderId !== undefined && object.orderId !== null ? exports.IndexerOrderId.fromPartial(object.orderId) : undefined; - message.side = (_a = object.side) !== null && _a !== void 0 ? _a : 0; - message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; - message.subticks = object.subticks !== undefined && object.subticks !== null ? helpers_1.Long.fromValue(object.subticks) : helpers_1.Long.UZERO; - message.goodTilBlock = (_b = object.goodTilBlock) !== null && _b !== void 0 ? _b : undefined; - message.goodTilBlockTime = (_c = object.goodTilBlockTime) !== null && _c !== void 0 ? _c : undefined; - message.timeInForce = (_d = object.timeInForce) !== null && _d !== void 0 ? _d : 0; - message.reduceOnly = (_e = object.reduceOnly) !== null && _e !== void 0 ? _e : false; - message.clientMetadata = (_f = object.clientMetadata) !== null && _f !== void 0 ? _f : 0; - message.conditionType = (_g = object.conditionType) !== null && _g !== void 0 ? _g : 0; - message.conditionalOrderTriggerSubticks = object.conditionalOrderTriggerSubticks !== undefined && object.conditionalOrderTriggerSubticks !== null ? helpers_1.Long.fromValue(object.conditionalOrderTriggerSubticks) : helpers_1.Long.UZERO; + const message = createBaseOffChainUpdateV1(); + message.orderPlace = object.orderPlace !== undefined && object.orderPlace !== null ? exports.OrderPlaceV1.fromPartial(object.orderPlace) : undefined; + message.orderRemove = object.orderRemove !== undefined && object.orderRemove !== null ? exports.OrderRemoveV1.fromPartial(object.orderRemove) : undefined; + message.orderUpdate = object.orderUpdate !== undefined && object.orderUpdate !== null ? exports.OrderUpdateV1.fromPartial(object.orderUpdate) : undefined; + message.orderReplace = object.orderReplace !== undefined && object.orderReplace !== null ? exports.OrderReplaceV1.fromPartial(object.orderReplace) : undefined; return message; } }; -//# sourceMappingURL=data:application/json;base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7UUFDbEosT0FBTyxDQUFDLFdBQVcsR0FBRyxNQUFNLENBQUMsV0FBVyxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsV0FBVyxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMscUJBQWEsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDbEosT0FBTyxDQUFDLFlBQVksR0FBRyxNQUFNLENBQUMsWUFBWSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsWUFBWSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsc0JBQWMsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDdkosT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/subaccount.ts": -/*!********************************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/subaccount.ts ***! - \********************************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/clob.ts": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/clob.ts ***! + \**************************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IndexerOrder = exports.IndexerOrderId = exports.clobPairStatusToJSON = exports.clobPairStatusFromJSON = exports.ClobPairStatusSDKType = exports.ClobPairStatus = exports.indexerOrder_ConditionTypeToJSON = exports.indexerOrder_ConditionTypeFromJSON = exports.IndexerOrder_ConditionTypeSDKType = exports.IndexerOrder_ConditionType = exports.indexerOrder_TimeInForceToJSON = exports.indexerOrder_TimeInForceFromJSON = exports.IndexerOrder_TimeInForceSDKType = exports.IndexerOrder_TimeInForce = exports.indexerOrder_SideToJSON = exports.indexerOrder_SideFromJSON = exports.IndexerOrder_SideSDKType = exports.IndexerOrder_Side = void 0; +const subaccount_1 = __webpack_require__(/*! ./subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/subaccount.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +const helpers_1 = __webpack_require__(/*! ../../../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +/** + * Represents the side of the orderbook the order will be placed on. + * Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be + * placed on the orderbook. + */ +var IndexerOrder_Side; +(function (IndexerOrder_Side) { + /** SIDE_UNSPECIFIED - Default value. This value is invalid and unused. */ + IndexerOrder_Side[IndexerOrder_Side["SIDE_UNSPECIFIED"] = 0] = "SIDE_UNSPECIFIED"; + /** SIDE_BUY - SIDE_BUY is used to represent a BUY order. */ + IndexerOrder_Side[IndexerOrder_Side["SIDE_BUY"] = 1] = "SIDE_BUY"; + /** SIDE_SELL - SIDE_SELL is used to represent a SELL order. */ + IndexerOrder_Side[IndexerOrder_Side["SIDE_SELL"] = 2] = "SIDE_SELL"; + IndexerOrder_Side[IndexerOrder_Side["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(IndexerOrder_Side = exports.IndexerOrder_Side || (exports.IndexerOrder_Side = {})); +exports.IndexerOrder_SideSDKType = IndexerOrder_Side; +function indexerOrder_SideFromJSON(object) { + switch (object) { + case 0: + case "SIDE_UNSPECIFIED": + return IndexerOrder_Side.SIDE_UNSPECIFIED; + case 1: + case "SIDE_BUY": + return IndexerOrder_Side.SIDE_BUY; + case 2: + case "SIDE_SELL": + return IndexerOrder_Side.SIDE_SELL; + case -1: + case "UNRECOGNIZED": + default: + return IndexerOrder_Side.UNRECOGNIZED; + } +} +exports.indexerOrder_SideFromJSON = indexerOrder_SideFromJSON; +function indexerOrder_SideToJSON(object) { + switch (object) { + case IndexerOrder_Side.SIDE_UNSPECIFIED: + return "SIDE_UNSPECIFIED"; + case IndexerOrder_Side.SIDE_BUY: + return "SIDE_BUY"; + case IndexerOrder_Side.SIDE_SELL: + return "SIDE_SELL"; + case IndexerOrder_Side.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.indexerOrder_SideToJSON = indexerOrder_SideToJSON; +/** + * TimeInForce indicates how long an order will remain active before it + * is executed or expires. + */ +var IndexerOrder_TimeInForce; +(function (IndexerOrder_TimeInForce) { + /** + * TIME_IN_FORCE_UNSPECIFIED - TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an + * order will first match with existing orders on the book, and any + * remaining size will be added to the book as a maker order. + */ + IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_UNSPECIFIED"] = 0] = "TIME_IN_FORCE_UNSPECIFIED"; + /** + * TIME_IN_FORCE_IOC - TIME_IN_FORCE_IOC enforces that an order only be matched with + * maker orders on the book. If the order has remaining size after + * matching with existing orders on the book, the remaining size + * is not placed on the book. + */ + IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_IOC"] = 1] = "TIME_IN_FORCE_IOC"; + /** + * TIME_IN_FORCE_POST_ONLY - TIME_IN_FORCE_POST_ONLY enforces that an order only be placed + * on the book as a maker order. Note this means that validators will cancel + * any newly-placed post only orders that would cross with other maker + * orders. + */ + IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_POST_ONLY"] = 2] = "TIME_IN_FORCE_POST_ONLY"; + /** + * TIME_IN_FORCE_FILL_OR_KILL - TIME_IN_FORCE_FILL_OR_KILL enforces that an order will either be filled + * completely and immediately by maker orders on the book or canceled if the + * entire amount can‘t be matched. + */ + IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["TIME_IN_FORCE_FILL_OR_KILL"] = 3] = "TIME_IN_FORCE_FILL_OR_KILL"; + IndexerOrder_TimeInForce[IndexerOrder_TimeInForce["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(IndexerOrder_TimeInForce = exports.IndexerOrder_TimeInForce || (exports.IndexerOrder_TimeInForce = {})); +exports.IndexerOrder_TimeInForceSDKType = IndexerOrder_TimeInForce; +function indexerOrder_TimeInForceFromJSON(object) { + switch (object) { + case 0: + case "TIME_IN_FORCE_UNSPECIFIED": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_UNSPECIFIED; + case 1: + case "TIME_IN_FORCE_IOC": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_IOC; + case 2: + case "TIME_IN_FORCE_POST_ONLY": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_POST_ONLY; + case 3: + case "TIME_IN_FORCE_FILL_OR_KILL": + return IndexerOrder_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL; + case -1: + case "UNRECOGNIZED": + default: + return IndexerOrder_TimeInForce.UNRECOGNIZED; + } +} +exports.indexerOrder_TimeInForceFromJSON = indexerOrder_TimeInForceFromJSON; +function indexerOrder_TimeInForceToJSON(object) { + switch (object) { + case IndexerOrder_TimeInForce.TIME_IN_FORCE_UNSPECIFIED: + return "TIME_IN_FORCE_UNSPECIFIED"; + case IndexerOrder_TimeInForce.TIME_IN_FORCE_IOC: + return "TIME_IN_FORCE_IOC"; + case IndexerOrder_TimeInForce.TIME_IN_FORCE_POST_ONLY: + return "TIME_IN_FORCE_POST_ONLY"; + case IndexerOrder_TimeInForce.TIME_IN_FORCE_FILL_OR_KILL: + return "TIME_IN_FORCE_FILL_OR_KILL"; + case IndexerOrder_TimeInForce.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.indexerOrder_TimeInForceToJSON = indexerOrder_TimeInForceToJSON; +var IndexerOrder_ConditionType; +(function (IndexerOrder_ConditionType) { + /** + * CONDITION_TYPE_UNSPECIFIED - CONDITION_TYPE_UNSPECIFIED represents the default behavior where an + * order will be placed immediately on the orderbook. + */ + IndexerOrder_ConditionType[IndexerOrder_ConditionType["CONDITION_TYPE_UNSPECIFIED"] = 0] = "CONDITION_TYPE_UNSPECIFIED"; + /** + * CONDITION_TYPE_STOP_LOSS - CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will + * trigger when the oracle price moves at or above the trigger price for + * buys, and at or below the trigger price for sells. + */ + IndexerOrder_ConditionType[IndexerOrder_ConditionType["CONDITION_TYPE_STOP_LOSS"] = 1] = "CONDITION_TYPE_STOP_LOSS"; + /** + * CONDITION_TYPE_TAKE_PROFIT - CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit + * order will trigger when the oracle price moves at or below the trigger + * price for buys and at or above the trigger price for sells. + */ + IndexerOrder_ConditionType[IndexerOrder_ConditionType["CONDITION_TYPE_TAKE_PROFIT"] = 2] = "CONDITION_TYPE_TAKE_PROFIT"; + IndexerOrder_ConditionType[IndexerOrder_ConditionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(IndexerOrder_ConditionType = exports.IndexerOrder_ConditionType || (exports.IndexerOrder_ConditionType = {})); +exports.IndexerOrder_ConditionTypeSDKType = IndexerOrder_ConditionType; +function indexerOrder_ConditionTypeFromJSON(object) { + switch (object) { + case 0: + case "CONDITION_TYPE_UNSPECIFIED": + return IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED; + case 1: + case "CONDITION_TYPE_STOP_LOSS": + return IndexerOrder_ConditionType.CONDITION_TYPE_STOP_LOSS; + case 2: + case "CONDITION_TYPE_TAKE_PROFIT": + return IndexerOrder_ConditionType.CONDITION_TYPE_TAKE_PROFIT; + case -1: + case "UNRECOGNIZED": + default: + return IndexerOrder_ConditionType.UNRECOGNIZED; + } +} +exports.indexerOrder_ConditionTypeFromJSON = indexerOrder_ConditionTypeFromJSON; +function indexerOrder_ConditionTypeToJSON(object) { + switch (object) { + case IndexerOrder_ConditionType.CONDITION_TYPE_UNSPECIFIED: + return "CONDITION_TYPE_UNSPECIFIED"; + case IndexerOrder_ConditionType.CONDITION_TYPE_STOP_LOSS: + return "CONDITION_TYPE_STOP_LOSS"; + case IndexerOrder_ConditionType.CONDITION_TYPE_TAKE_PROFIT: + return "CONDITION_TYPE_TAKE_PROFIT"; + case IndexerOrder_ConditionType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.indexerOrder_ConditionTypeToJSON = indexerOrder_ConditionTypeToJSON; +/** + * Status of the CLOB. + * Defined in clob.clob_pair + */ +var ClobPairStatus; +(function (ClobPairStatus) { + /** CLOB_PAIR_STATUS_UNSPECIFIED - Default value. This value is invalid and unused. */ + ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_UNSPECIFIED"] = 0] = "CLOB_PAIR_STATUS_UNSPECIFIED"; + /** + * CLOB_PAIR_STATUS_ACTIVE - CLOB_PAIR_STATUS_ACTIVE behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_ACTIVE"] = 1] = "CLOB_PAIR_STATUS_ACTIVE"; + /** + * CLOB_PAIR_STATUS_PAUSED - CLOB_PAIR_STATUS_PAUSED behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_PAUSED"] = 2] = "CLOB_PAIR_STATUS_PAUSED"; + /** + * CLOB_PAIR_STATUS_CANCEL_ONLY - CLOB_PAIR_STATUS_CANCEL_ONLY behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_CANCEL_ONLY"] = 3] = "CLOB_PAIR_STATUS_CANCEL_ONLY"; + /** + * CLOB_PAIR_STATUS_POST_ONLY - CLOB_PAIR_STATUS_POST_ONLY behavior is unfinalized. + * TODO(DEC-600): update this documentation. + */ + ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_POST_ONLY"] = 4] = "CLOB_PAIR_STATUS_POST_ONLY"; + /** + * CLOB_PAIR_STATUS_INITIALIZING - CLOB_PAIR_STATUS_INITIALIZING represents a newly-added clob pair. + * Clob pairs in this state only accept orders which are + * both short-term and post-only. + */ + ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_INITIALIZING"] = 5] = "CLOB_PAIR_STATUS_INITIALIZING"; + /** + * CLOB_PAIR_STATUS_FINAL_SETTLEMENT - CLOB_PAIR_STATUS_FINAL_SETTLEMENT represents a clob pair that has been + * deactivated. Clob pairs in this state do not accept new orders and trading + * is blocked. All open positions are closed and open stateful orders canceled + * by the protocol when the clob pair transitions to this status. All + * short-term orders are left to expire. + */ + ClobPairStatus[ClobPairStatus["CLOB_PAIR_STATUS_FINAL_SETTLEMENT"] = 6] = "CLOB_PAIR_STATUS_FINAL_SETTLEMENT"; + ClobPairStatus[ClobPairStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(ClobPairStatus = exports.ClobPairStatus || (exports.ClobPairStatus = {})); +exports.ClobPairStatusSDKType = ClobPairStatus; +function clobPairStatusFromJSON(object) { + switch (object) { + case 0: + case "CLOB_PAIR_STATUS_UNSPECIFIED": + return ClobPairStatus.CLOB_PAIR_STATUS_UNSPECIFIED; + case 1: + case "CLOB_PAIR_STATUS_ACTIVE": + return ClobPairStatus.CLOB_PAIR_STATUS_ACTIVE; + case 2: + case "CLOB_PAIR_STATUS_PAUSED": + return ClobPairStatus.CLOB_PAIR_STATUS_PAUSED; + case 3: + case "CLOB_PAIR_STATUS_CANCEL_ONLY": + return ClobPairStatus.CLOB_PAIR_STATUS_CANCEL_ONLY; + case 4: + case "CLOB_PAIR_STATUS_POST_ONLY": + return ClobPairStatus.CLOB_PAIR_STATUS_POST_ONLY; + case 5: + case "CLOB_PAIR_STATUS_INITIALIZING": + return ClobPairStatus.CLOB_PAIR_STATUS_INITIALIZING; + case 6: + case "CLOB_PAIR_STATUS_FINAL_SETTLEMENT": + return ClobPairStatus.CLOB_PAIR_STATUS_FINAL_SETTLEMENT; + case -1: + case "UNRECOGNIZED": + default: + return ClobPairStatus.UNRECOGNIZED; + } +} +exports.clobPairStatusFromJSON = clobPairStatusFromJSON; +function clobPairStatusToJSON(object) { + switch (object) { + case ClobPairStatus.CLOB_PAIR_STATUS_UNSPECIFIED: + return "CLOB_PAIR_STATUS_UNSPECIFIED"; + case ClobPairStatus.CLOB_PAIR_STATUS_ACTIVE: + return "CLOB_PAIR_STATUS_ACTIVE"; + case ClobPairStatus.CLOB_PAIR_STATUS_PAUSED: + return "CLOB_PAIR_STATUS_PAUSED"; + case ClobPairStatus.CLOB_PAIR_STATUS_CANCEL_ONLY: + return "CLOB_PAIR_STATUS_CANCEL_ONLY"; + case ClobPairStatus.CLOB_PAIR_STATUS_POST_ONLY: + return "CLOB_PAIR_STATUS_POST_ONLY"; + case ClobPairStatus.CLOB_PAIR_STATUS_INITIALIZING: + return "CLOB_PAIR_STATUS_INITIALIZING"; + case ClobPairStatus.CLOB_PAIR_STATUS_FINAL_SETTLEMENT: + return "CLOB_PAIR_STATUS_FINAL_SETTLEMENT"; + case ClobPairStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.clobPairStatusToJSON = clobPairStatusToJSON; +function createBaseIndexerOrderId() { + return { + subaccountId: undefined, + clientId: 0, + orderFlags: 0, + clobPairId: 0 + }; +} +exports.IndexerOrderId = { + encode(message, writer = _m0.Writer.create()) { + if (message.subaccountId !== undefined) { + subaccount_1.IndexerSubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== 0) { + writer.uint32(21).fixed32(message.clientId); + } + if (message.orderFlags !== 0) { + writer.uint32(24).uint32(message.orderFlags); + } + if (message.clobPairId !== 0) { + writer.uint32(32).uint32(message.clobPairId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerOrderId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subaccountId = subaccount_1.IndexerSubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.fixed32(); + break; + case 3: + message.orderFlags = reader.uint32(); + break; + case 4: + message.clobPairId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseIndexerOrderId(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.IndexerSubaccountId.fromPartial(object.subaccountId) : undefined; + message.clientId = (_a = object.clientId) !== null && _a !== void 0 ? _a : 0; + message.orderFlags = (_b = object.orderFlags) !== null && _b !== void 0 ? _b : 0; + message.clobPairId = (_c = object.clobPairId) !== null && _c !== void 0 ? _c : 0; + return message; + } +}; +function createBaseIndexerOrder() { + return { + orderId: undefined, + side: 0, + quantums: helpers_1.Long.UZERO, + subticks: helpers_1.Long.UZERO, + goodTilBlock: undefined, + goodTilBlockTime: undefined, + timeInForce: 0, + reduceOnly: false, + clientMetadata: 0, + conditionType: 0, + conditionalOrderTriggerSubticks: helpers_1.Long.UZERO + }; +} +exports.IndexerOrder = { + encode(message, writer = _m0.Writer.create()) { + if (message.orderId !== undefined) { + exports.IndexerOrderId.encode(message.orderId, writer.uint32(10).fork()).ldelim(); + } + if (message.side !== 0) { + writer.uint32(16).int32(message.side); + } + if (!message.quantums.isZero()) { + writer.uint32(24).uint64(message.quantums); + } + if (!message.subticks.isZero()) { + writer.uint32(32).uint64(message.subticks); + } + if (message.goodTilBlock !== undefined) { + writer.uint32(40).uint32(message.goodTilBlock); + } + if (message.goodTilBlockTime !== undefined) { + writer.uint32(53).fixed32(message.goodTilBlockTime); + } + if (message.timeInForce !== 0) { + writer.uint32(56).int32(message.timeInForce); + } + if (message.reduceOnly === true) { + writer.uint32(64).bool(message.reduceOnly); + } + if (message.clientMetadata !== 0) { + writer.uint32(72).uint32(message.clientMetadata); + } + if (message.conditionType !== 0) { + writer.uint32(80).int32(message.conditionType); + } + if (!message.conditionalOrderTriggerSubticks.isZero()) { + writer.uint32(88).uint64(message.conditionalOrderTriggerSubticks); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexerOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.orderId = exports.IndexerOrderId.decode(reader, reader.uint32()); + break; + case 2: + message.side = reader.int32(); + break; + case 3: + message.quantums = reader.uint64(); + break; + case 4: + message.subticks = reader.uint64(); + break; + case 5: + message.goodTilBlock = reader.uint32(); + break; + case 6: + message.goodTilBlockTime = reader.fixed32(); + break; + case 7: + message.timeInForce = reader.int32(); + break; + case 8: + message.reduceOnly = reader.bool(); + break; + case 9: + message.clientMetadata = reader.uint32(); + break; + case 10: + message.conditionType = reader.int32(); + break; + case 11: + message.conditionalOrderTriggerSubticks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f, _g; + const message = createBaseIndexerOrder(); + message.orderId = object.orderId !== undefined && object.orderId !== null ? exports.IndexerOrderId.fromPartial(object.orderId) : undefined; + message.side = (_a = object.side) !== null && _a !== void 0 ? _a : 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; + message.subticks = object.subticks !== undefined && object.subticks !== null ? helpers_1.Long.fromValue(object.subticks) : helpers_1.Long.UZERO; + message.goodTilBlock = (_b = object.goodTilBlock) !== null && _b !== void 0 ? _b : undefined; + message.goodTilBlockTime = (_c = object.goodTilBlockTime) !== null && _c !== void 0 ? _c : undefined; + message.timeInForce = (_d = object.timeInForce) !== null && _d !== void 0 ? _d : 0; + message.reduceOnly = (_e = object.reduceOnly) !== null && _e !== void 0 ? _e : false; + message.clientMetadata = (_f = object.clientMetadata) !== null && _f !== void 0 ? _f : 0; + message.conditionType = (_g = object.conditionType) !== null && _g !== void 0 ? _g : 0; + message.conditionalOrderTriggerSubticks = object.conditionalOrderTriggerSubticks !== undefined && object.conditionalOrderTriggerSubticks !== null ? helpers_1.Long.fromValue(object.conditionalOrderTriggerSubticks) : helpers_1.Long.UZERO; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xvYi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9AZHlkeHByb3RvY29sL3Y0LXByb3RvL3NyYy9jb2RlZ2VuL2R5ZHhwcm90b2NvbC9pbmRleGVyL3Byb3RvY29sL3YxL2Nsb2IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSw2Q0FBK0U7QUFDL0Usd0RBQTBDO0FBQzFDLGlEQUF3RDtBQUN4RDs7OztHQUlHO0FBRUgsSUFBWSxpQkFVWDtBQVZELFdBQVksaUJBQWlCO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QUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/subaccount.ts": +/*!********************************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/indexer/protocol/v1/subaccount.ts ***! + \********************************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -190454,14 +189532,3413 @@ exports.IndexerAssetPosition = { return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ViYWNjb3VudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9AZHlkeHByb3RvY29sL3Y0LXByb3RvL3NyYy9jb2RlZ2VuL2R5ZHhwcm90b2NvbC9pbmRleGVyL3Byb3RvY29sL3YxL3N1YmFjY291bnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSx3REFBMEM7QUFDMUMsaURBQXdEO0FBc0Z4RCxTQUFTLDZCQUE2QjtJQUNwQyxPQUFPO1FBQ0wsS0FBSyxFQUFFLEVBQUU7UUFDVCxNQUFNLEVBQUUsQ0FBQztLQUNWLENBQUM7QUFDSixDQUFDO0FBRVksUUFBQSxtQkFBbUIsR0FBRztJQUNqQyxNQUFNLENBQUMsT0FBNEIsRUFBRSxTQUFxQixHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUMzRSxJQUFJLE9BQU8sQ0FBQyxLQUFLLEtBQUssRUFBRSxFQUFFO1lBQ3hCLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ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QUFPLENBQUMsUUFBUSxHQUFHLE1BQUEsTUFBTSxDQUFDLFFBQVEsbUNBQUksSUFBSSxVQUFVLEVBQUUsQ0FBQztRQUN2RCxPQUFPLENBQUMsS0FBSyxHQUFHLE1BQU0sQ0FBQyxLQUFLLEtBQUssU0FBUyxJQUFJLE1BQU0sQ0FBQyxLQUFLLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLEtBQUssQ0FBQztRQUNoSCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/params.ts": +/*!****************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/params.ts ***! + \****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ListingVaultDepositParams = void 0; +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseListingVaultDepositParams() { + return { + newVaultDepositAmount: new Uint8Array(), + mainVaultDepositAmount: new Uint8Array(), + numBlocksToLockShares: 0 + }; +} +exports.ListingVaultDepositParams = { + encode(message, writer = _m0.Writer.create()) { + if (message.newVaultDepositAmount.length !== 0) { + writer.uint32(10).bytes(message.newVaultDepositAmount); + } + if (message.mainVaultDepositAmount.length !== 0) { + writer.uint32(18).bytes(message.mainVaultDepositAmount); + } + if (message.numBlocksToLockShares !== 0) { + writer.uint32(24).uint32(message.numBlocksToLockShares); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListingVaultDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newVaultDepositAmount = reader.bytes(); + break; + case 2: + message.mainVaultDepositAmount = reader.bytes(); + break; + case 3: + message.numBlocksToLockShares = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseListingVaultDepositParams(); + message.newVaultDepositAmount = (_a = object.newVaultDepositAmount) !== null && _a !== void 0 ? _a : new Uint8Array(); + message.mainVaultDepositAmount = (_b = object.mainVaultDepositAmount) !== null && _b !== void 0 ? _b : new Uint8Array(); + message.numBlocksToLockShares = (_c = object.numBlocksToLockShares) !== null && _c !== void 0 ? _c : 0; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL2xpc3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LENBQUM7UUFDdEQsT0FBTyxDQUFDLHFCQUFxQixHQUFHLE1BQUEsTUFBTSxDQUFDLHFCQUFxQixtQ0FBSSxJQUFJLFVBQVUsRUFBRSxDQUFDO1FBQ2pGLE9BQU8sQ0FBQyxzQkFBc0IsR0FBRyxNQUFBLE1BQU0sQ0FBQyxzQkFBc0IsbUNBQUksSUFBSSxVQUFVLEVBQUUsQ0FBQztRQUNuRixPQUFPLENBQUMscUJBQXFCLEdBQUcsTUFBQSxNQUFNLENBQUMscUJBQXFCLG1DQUFJLENBQUMsQ0FBQztRQUNsRSxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/query.ts": +/*!***************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/query.ts ***! + \***************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.QueryListingVaultDepositParamsResponse = exports.QueryListingVaultDepositParams = exports.QueryMarketsHardCapResponse = exports.QueryMarketsHardCap = void 0; +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/params.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseQueryMarketsHardCap() { + return {}; +} +exports.QueryMarketsHardCap = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketsHardCap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryMarketsHardCap(); + return message; + } +}; +function createBaseQueryMarketsHardCapResponse() { + return { + hardCap: 0 + }; +} +exports.QueryMarketsHardCapResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.hardCap !== 0) { + writer.uint32(8).uint32(message.hardCap); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketsHardCapResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hardCap = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryMarketsHardCapResponse(); + message.hardCap = (_a = object.hardCap) !== null && _a !== void 0 ? _a : 0; + return message; + } +}; +function createBaseQueryListingVaultDepositParams() { + return {}; +} +exports.QueryListingVaultDepositParams = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryListingVaultDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryListingVaultDepositParams(); + return message; + } +}; +function createBaseQueryListingVaultDepositParamsResponse() { + return { + params: undefined + }; +} +exports.QueryListingVaultDepositParamsResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.params !== undefined) { + params_1.ListingVaultDepositParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryListingVaultDepositParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = params_1.ListingVaultDepositParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryListingVaultDepositParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? params_1.ListingVaultDepositParams.fromPartial(object.params) : undefined; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvbGlzdGluZy9xdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHFDQUF1RjtBQUN2Rix3REFBMEM7QUFvQzFDLFNBQVMsNkJBQTZCO0lBQ3BDLE9BQU8sRUFBRSxDQUFDO0FBQ1osQ0FBQztBQUVZLFFBQUEsbUJBQW1CLEdBQUc7SUFDakMsTUFBTSxDQUFDLENBQXNCLEVBQUUsU0FBcUIsR0FBRyxDQUFDLE1BQU0sQ0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RyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsR0FBRyxHQUFHLE1BQU0sQ0FBQztRQUNsRSxNQUFNLE9BQU8sR0FBRyxnREFBZ0QsRUFBRSxDQUFDO1FBRW5FLE9BQU8sTUFBTSxDQUFDLEdBQUcsR0FBRyxHQUFHLEVBQUU7WUFDdkIsTUFBTSxHQUFHLEdBQUcsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDO1lBRTVCLFFBQVEsR0FBRyxLQUFLLENBQUMsRUFBRTtnQkFDakIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyxNQUFNLEdBQUcsa0NBQXlCLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRSxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQztvQkFDM0UsTUFBTTtnQkFFUjtvQkFDRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztvQkFDekIsTUFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLE1BQTJEO1FBQ3JFLE1BQU0sT0FBTyxHQUFHLGdEQUFnRCxFQUFFLENBQUM7UUFDbkUsT0FBTyxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUMsTUFBTSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsTUFBTSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsa0NBQXlCLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQzFJLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx.ts": +/*!************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx.ts ***! + \************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MsgSetListingVaultDepositParamsResponse = exports.MsgSetListingVaultDepositParams = exports.MsgCreateMarketPermissionlessResponse = exports.MsgCreateMarketPermissionless = exports.MsgSetMarketsHardCapResponse = exports.MsgSetMarketsHardCap = void 0; +const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/params.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseMsgSetMarketsHardCap() { + return { + authority: "", + hardCapForMarkets: 0 + }; +} +exports.MsgSetMarketsHardCap = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.hardCapForMarkets !== 0) { + writer.uint32(16).uint32(message.hardCapForMarkets); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketsHardCap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.hardCapForMarkets = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseMsgSetMarketsHardCap(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.hardCapForMarkets = (_b = object.hardCapForMarkets) !== null && _b !== void 0 ? _b : 0; + return message; + } +}; +function createBaseMsgSetMarketsHardCapResponse() { + return {}; +} +exports.MsgSetMarketsHardCapResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMarketsHardCapResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgSetMarketsHardCapResponse(); + return message; + } +}; +function createBaseMsgCreateMarketPermissionless() { + return { + ticker: "", + subaccountId: undefined + }; +} +exports.MsgCreateMarketPermissionless = { + encode(message, writer = _m0.Writer.create()) { + if (message.ticker !== "") { + writer.uint32(10).string(message.ticker); + } + if (message.subaccountId !== undefined) { + subaccount_1.SubaccountId.encode(message.subaccountId, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateMarketPermissionless(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ticker = reader.string(); + break; + case 2: + message.subaccountId = subaccount_1.SubaccountId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgCreateMarketPermissionless(); + message.ticker = (_a = object.ticker) !== null && _a !== void 0 ? _a : ""; + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.SubaccountId.fromPartial(object.subaccountId) : undefined; + return message; + } +}; +function createBaseMsgCreateMarketPermissionlessResponse() { + return {}; +} +exports.MsgCreateMarketPermissionlessResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateMarketPermissionlessResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgCreateMarketPermissionlessResponse(); + return message; + } +}; +function createBaseMsgSetListingVaultDepositParams() { + return { + authority: "", + params: undefined + }; +} +exports.MsgSetListingVaultDepositParams = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + params_1.ListingVaultDepositParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetListingVaultDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = params_1.ListingVaultDepositParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgSetListingVaultDepositParams(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.params = object.params !== undefined && object.params !== null ? params_1.ListingVaultDepositParams.fromPartial(object.params) : undefined; + return message; + } +}; +function createBaseMsgSetListingVaultDepositParamsResponse() { + return {}; +} +exports.MsgSetListingVaultDepositParamsResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetListingVaultDepositParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgSetListingVaultDepositParamsResponse(); + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvbGlzdGluZy90eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDBEQUE4RTtBQUM5RSxxQ0FBdUY7QUFDdkYsd0RBQTBDO0FBOEYxQyxTQUFTLDhCQUE4QjtJQUNyQyxPQUFPO1FBQ0wsU0FBUyxFQUFFLEVBQUU7UUFDYixpQkFBaUIsRUFBRSxDQUFDO0tBQ3JCLENBQUM7QUFDSixDQUFDO0FBRVksUUFBQSxvQkFBb0IsR0FBRztJQUNsQyxNQUFNLENBQUMsT0FBNkIsRUFBRSxTQUFxQixHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUM1RSxJQUFJLE9BQU8sQ0FBQyxTQUFTLEtBQUssRUFBRSxFQUFFO1lBQzVCLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQzt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NLENBQUMsR0FBRyxHQUFHLEdBQUcsRUFBRTtZQUN2QixNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7WUFFNUIsUUFBUSxHQUFHLEtBQUssQ0FBQyxFQUFFO2dCQUNqQjtvQkFDRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztvQkFDekIsTUFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLENBQXVEO1FBQ2pFLE1BQU0sT0FBTyxHQUFHLGlEQUFpRCxFQUFFLENBQUM7UUFDcEUsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts ***! + \*******************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Params = void 0; +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseParams() { + return { + fundingRateClampFactorPpm: 0, + premiumVoteClampFactorPpm: 0, + minNumVotesPerSample: 0 + }; +} +exports.Params = { + encode(message, writer = _m0.Writer.create()) { + if (message.fundingRateClampFactorPpm !== 0) { + writer.uint32(8).uint32(message.fundingRateClampFactorPpm); + } + if (message.premiumVoteClampFactorPpm !== 0) { + writer.uint32(16).uint32(message.premiumVoteClampFactorPpm); + } + if (message.minNumVotesPerSample !== 0) { + writer.uint32(24).uint32(message.minNumVotesPerSample); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fundingRateClampFactorPpm = reader.uint32(); + break; + case 2: + message.premiumVoteClampFactorPpm = reader.uint32(); + break; + case 3: + message.minNumVotesPerSample = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c; + const message = createBaseParams(); + message.fundingRateClampFactorPpm = (_a = object.fundingRateClampFactorPpm) !== null && _a !== void 0 ? _a : 0; + message.premiumVoteClampFactorPpm = (_b = object.premiumVoteClampFactorPpm) !== null && _b !== void 0 ? _b : 0; + message.minNumVotesPerSample = (_c = object.minNumVotesPerSample) !== null && _c !== void 0 ? _c : 0; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZH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TUFBQSxNQUFNLENBQUMseUJBQXlCLG1DQUFJLENBQUMsQ0FBQztRQUMxRSxPQUFPLENBQUMseUJBQXlCLEdBQUcsTUFBQSxNQUFNLENBQUMseUJBQXlCLG1DQUFJLENBQUMsQ0FBQztRQUMxRSxPQUFPLENBQUMsb0JBQW9CLEdBQUcsTUFBQSxNQUFNLENBQUMsb0JBQW9CLG1DQUFJLENBQUMsQ0FBQztRQUNoRSxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts ***! + \**********************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LiquidityTier = exports.PremiumStore = exports.MarketPremiums = exports.PerpetualParams = exports.Perpetual = exports.perpetualMarketTypeToJSON = exports.perpetualMarketTypeFromJSON = exports.PerpetualMarketTypeSDKType = exports.PerpetualMarketType = void 0; +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +var PerpetualMarketType; +(function (PerpetualMarketType) { + /** PERPETUAL_MARKET_TYPE_UNSPECIFIED - Unspecified market type. */ + PerpetualMarketType[PerpetualMarketType["PERPETUAL_MARKET_TYPE_UNSPECIFIED"] = 0] = "PERPETUAL_MARKET_TYPE_UNSPECIFIED"; + /** PERPETUAL_MARKET_TYPE_CROSS - Market type for cross margin perpetual markets. */ + PerpetualMarketType[PerpetualMarketType["PERPETUAL_MARKET_TYPE_CROSS"] = 1] = "PERPETUAL_MARKET_TYPE_CROSS"; + /** PERPETUAL_MARKET_TYPE_ISOLATED - Market type for isolated margin perpetual markets. */ + PerpetualMarketType[PerpetualMarketType["PERPETUAL_MARKET_TYPE_ISOLATED"] = 2] = "PERPETUAL_MARKET_TYPE_ISOLATED"; + PerpetualMarketType[PerpetualMarketType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(PerpetualMarketType = exports.PerpetualMarketType || (exports.PerpetualMarketType = {})); +exports.PerpetualMarketTypeSDKType = PerpetualMarketType; +function perpetualMarketTypeFromJSON(object) { + switch (object) { + case 0: + case "PERPETUAL_MARKET_TYPE_UNSPECIFIED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED; + case 1: + case "PERPETUAL_MARKET_TYPE_CROSS": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS; + case 2: + case "PERPETUAL_MARKET_TYPE_ISOLATED": + return PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED; + case -1: + case "UNRECOGNIZED": + default: + return PerpetualMarketType.UNRECOGNIZED; + } +} +exports.perpetualMarketTypeFromJSON = perpetualMarketTypeFromJSON; +function perpetualMarketTypeToJSON(object) { + switch (object) { + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED: + return "PERPETUAL_MARKET_TYPE_UNSPECIFIED"; + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS: + return "PERPETUAL_MARKET_TYPE_CROSS"; + case PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED: + return "PERPETUAL_MARKET_TYPE_ISOLATED"; + case PerpetualMarketType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +exports.perpetualMarketTypeToJSON = perpetualMarketTypeToJSON; +function createBasePerpetual() { + return { + params: undefined, + fundingIndex: new Uint8Array(), + openInterest: new Uint8Array() + }; +} +exports.Perpetual = { + encode(message, writer = _m0.Writer.create()) { + if (message.params !== undefined) { + exports.PerpetualParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.fundingIndex.length !== 0) { + writer.uint32(18).bytes(message.fundingIndex); + } + if (message.openInterest.length !== 0) { + writer.uint32(26).bytes(message.openInterest); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetual(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = exports.PerpetualParams.decode(reader, reader.uint32()); + break; + case 2: + message.fundingIndex = reader.bytes(); + break; + case 3: + message.openInterest = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBasePerpetual(); + message.params = object.params !== undefined && object.params !== null ? exports.PerpetualParams.fromPartial(object.params) : undefined; + message.fundingIndex = (_a = object.fundingIndex) !== null && _a !== void 0 ? _a : new Uint8Array(); + message.openInterest = (_b = object.openInterest) !== null && _b !== void 0 ? _b : new Uint8Array(); + return message; + } +}; +function createBasePerpetualParams() { + return { + id: 0, + ticker: "", + marketId: 0, + atomicResolution: 0, + defaultFundingPpm: 0, + liquidityTier: 0, + marketType: 0 + }; +} +exports.PerpetualParams = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.ticker !== "") { + writer.uint32(18).string(message.ticker); + } + if (message.marketId !== 0) { + writer.uint32(24).uint32(message.marketId); + } + if (message.atomicResolution !== 0) { + writer.uint32(32).sint32(message.atomicResolution); + } + if (message.defaultFundingPpm !== 0) { + writer.uint32(40).sint32(message.defaultFundingPpm); + } + if (message.liquidityTier !== 0) { + writer.uint32(48).uint32(message.liquidityTier); + } + if (message.marketType !== 0) { + writer.uint32(56).int32(message.marketType); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePerpetualParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.ticker = reader.string(); + break; + case 3: + message.marketId = reader.uint32(); + break; + case 4: + message.atomicResolution = reader.sint32(); + break; + case 5: + message.defaultFundingPpm = reader.sint32(); + break; + case 6: + message.liquidityTier = reader.uint32(); + break; + case 7: + message.marketType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f, _g; + const message = createBasePerpetualParams(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + message.ticker = (_b = object.ticker) !== null && _b !== void 0 ? _b : ""; + message.marketId = (_c = object.marketId) !== null && _c !== void 0 ? _c : 0; + message.atomicResolution = (_d = object.atomicResolution) !== null && _d !== void 0 ? _d : 0; + message.defaultFundingPpm = (_e = object.defaultFundingPpm) !== null && _e !== void 0 ? _e : 0; + message.liquidityTier = (_f = object.liquidityTier) !== null && _f !== void 0 ? _f : 0; + message.marketType = (_g = object.marketType) !== null && _g !== void 0 ? _g : 0; + return message; + } +}; +function createBaseMarketPremiums() { + return { + perpetualId: 0, + premiums: [] + }; +} +exports.MarketPremiums = { + encode(message, writer = _m0.Writer.create()) { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + writer.uint32(18).fork(); + for (const v of message.premiums) { + writer.sint32(v); + } + writer.ldelim(); + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketPremiums(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.premiums.push(reader.sint32()); + } + } + else { + message.premiums.push(reader.sint32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseMarketPremiums(); + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; + message.premiums = ((_b = object.premiums) === null || _b === void 0 ? void 0 : _b.map(e => e)) || []; + return message; + } +}; +function createBasePremiumStore() { + return { + allMarketPremiums: [], + numPremiums: 0 + }; +} +exports.PremiumStore = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.allMarketPremiums) { + exports.MarketPremiums.encode(v, writer.uint32(10).fork()).ldelim(); + } + if (message.numPremiums !== 0) { + writer.uint32(16).uint32(message.numPremiums); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePremiumStore(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allMarketPremiums.push(exports.MarketPremiums.decode(reader, reader.uint32())); + break; + case 2: + message.numPremiums = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBasePremiumStore(); + message.allMarketPremiums = ((_a = object.allMarketPremiums) === null || _a === void 0 ? void 0 : _a.map(e => exports.MarketPremiums.fromPartial(e))) || []; + message.numPremiums = (_b = object.numPremiums) !== null && _b !== void 0 ? _b : 0; + return message; + } +}; +function createBaseLiquidityTier() { + return { + id: 0, + name: "", + initialMarginPpm: 0, + maintenanceFractionPpm: 0, + basePositionNotional: helpers_1.Long.UZERO, + impactNotional: helpers_1.Long.UZERO, + openInterestLowerCap: helpers_1.Long.UZERO, + openInterestUpperCap: helpers_1.Long.UZERO + }; +} +exports.LiquidityTier = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.initialMarginPpm !== 0) { + writer.uint32(24).uint32(message.initialMarginPpm); + } + if (message.maintenanceFractionPpm !== 0) { + writer.uint32(32).uint32(message.maintenanceFractionPpm); + } + if (!message.basePositionNotional.isZero()) { + writer.uint32(40).uint64(message.basePositionNotional); + } + if (!message.impactNotional.isZero()) { + writer.uint32(48).uint64(message.impactNotional); + } + if (!message.openInterestLowerCap.isZero()) { + writer.uint32(56).uint64(message.openInterestLowerCap); + } + if (!message.openInterestUpperCap.isZero()) { + writer.uint32(64).uint64(message.openInterestUpperCap); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidityTier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.initialMarginPpm = reader.uint32(); + break; + case 4: + message.maintenanceFractionPpm = reader.uint32(); + break; + case 5: + message.basePositionNotional = reader.uint64(); + break; + case 6: + message.impactNotional = reader.uint64(); + break; + case 7: + message.openInterestLowerCap = reader.uint64(); + break; + case 8: + message.openInterestUpperCap = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d; + const message = createBaseLiquidityTier(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + message.name = (_b = object.name) !== null && _b !== void 0 ? _b : ""; + message.initialMarginPpm = (_c = object.initialMarginPpm) !== null && _c !== void 0 ? _c : 0; + message.maintenanceFractionPpm = (_d = object.maintenanceFractionPpm) !== null && _d !== void 0 ? _d : 0; + message.basePositionNotional = object.basePositionNotional !== undefined && object.basePositionNotional !== null ? helpers_1.Long.fromValue(object.basePositionNotional) : helpers_1.Long.UZERO; + message.impactNotional = object.impactNotional !== undefined && object.impactNotional !== null ? helpers_1.Long.fromValue(object.impactNotional) : helpers_1.Long.UZERO; + message.openInterestLowerCap = object.openInterestLowerCap !== undefined && object.openInterestLowerCap !== null ? helpers_1.Long.fromValue(object.openInterestLowerCap) : helpers_1.Long.UZERO; + message.openInterestUpperCap = object.openInterestUpperCap !== undefined && object.openInterestUpperCap !== null ? helpers_1.Long.fromValue(object.openInterestUpperCap) : helpers_1.Long.UZERO; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVycGV0dWFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3BlcnBldHVhbHMvcGVycGV0dWFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsd0RBQTBDO0FBQzFDLDJDQUFrRDtBQUNsRCxJQUFZLG1CQVVYO0FBVkQsV0FBWSxtQkFBbUI7SUFDN0IsbUVBQW1FO0lBQ25FLHVIQUFxQyxDQUFBO0lBRXJDLG9GQUFvRjtJQUNwRiwyR0FBK0IsQ0FBQTtJQUUvQiwwRkFBMEY7SUFDMUYsaUhBQWtDLENBQUE7SUFDbEMsOEVBQWlCLENBQUE7QUFDbkIsQ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sS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLG9CQUFvQixLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsb0JBQW9CLENBQUMsQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLEtBQUssQ0FBQztRQUM1SyxPQUFPLENBQUMsY0FBYyxHQUFHLE1BQU0sQ0FBQyxjQUFjLEtBQUssU0FBUyxJQUFJLE1BQU0sQ0FBQyxjQUFjLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLEtBQUssQ0FBQztRQUNwSixPQUFPLENBQUMsb0JBQW9CLEdBQUcsTUFBTSxDQUFDLG9CQUFvQixLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsb0JBQW9CLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsS0FBSyxDQUFDO1FBQzVLLE9BQU8sQ0FBQyxvQkFBb0IsR0FBRyxNQUFNLENBQUMsb0JBQW9CLEtBQUssU0FBUyxJQUFJLE1BQU0sQ0FBQyxvQkFBb0IsS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLG9CQUFvQixDQUFDLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxLQUFLLENBQUM7UUFDNUssT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/query.ts": +/*!******************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/query.ts ***! + \******************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryPremiumSamplesResponse = exports.QueryPremiumSamplesRequest = exports.QueryPremiumVotesResponse = exports.QueryPremiumVotesRequest = exports.QueryAllLiquidityTiersResponse = exports.QueryAllLiquidityTiersRequest = exports.QueryAllPerpetualsResponse = exports.QueryAllPerpetualsRequest = exports.QueryPerpetualResponse = exports.QueryPerpetualRequest = void 0; +const pagination_1 = __webpack_require__(/*! ../../cosmos/base/query/v1beta1/pagination */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts"); +const perpetual_1 = __webpack_require__(/*! ./perpetual */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts"); +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseQueryPerpetualRequest() { + return { + id: 0 + }; +} +exports.QueryPerpetualRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryPerpetualRequest(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + return message; + } +}; +function createBaseQueryPerpetualResponse() { + return { + perpetual: undefined + }; +} +exports.QueryPerpetualResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.perpetual !== undefined) { + perpetual_1.Perpetual.encode(message.perpetual, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPerpetualResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetual = perpetual_1.Perpetual.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryPerpetualResponse(); + message.perpetual = object.perpetual !== undefined && object.perpetual !== null ? perpetual_1.Perpetual.fromPartial(object.perpetual) : undefined; + return message; + } +}; +function createBaseQueryAllPerpetualsRequest() { + return { + pagination: undefined + }; +} +exports.QueryAllPerpetualsRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.pagination !== undefined) { + pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPerpetualsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryAllPerpetualsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryAllPerpetualsResponse() { + return { + perpetual: [], + pagination: undefined + }; +} +exports.QueryAllPerpetualsResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.perpetual) { + perpetual_1.Perpetual.encode(v, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPerpetualsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetual.push(perpetual_1.Perpetual.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryAllPerpetualsResponse(); + message.perpetual = ((_a = object.perpetual) === null || _a === void 0 ? void 0 : _a.map(e => perpetual_1.Perpetual.fromPartial(e))) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryAllLiquidityTiersRequest() { + return { + pagination: undefined + }; +} +exports.QueryAllLiquidityTiersRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.pagination !== undefined) { + pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllLiquidityTiersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryAllLiquidityTiersRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryAllLiquidityTiersResponse() { + return { + liquidityTiers: [], + pagination: undefined + }; +} +exports.QueryAllLiquidityTiersResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.liquidityTiers) { + perpetual_1.LiquidityTier.encode(v, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllLiquidityTiersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidityTiers.push(perpetual_1.LiquidityTier.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryAllLiquidityTiersResponse(); + message.liquidityTiers = ((_a = object.liquidityTiers) === null || _a === void 0 ? void 0 : _a.map(e => perpetual_1.LiquidityTier.fromPartial(e))) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryPremiumVotesRequest() { + return {}; +} +exports.QueryPremiumVotesRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumVotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryPremiumVotesRequest(); + return message; + } +}; +function createBaseQueryPremiumVotesResponse() { + return { + premiumVotes: undefined + }; +} +exports.QueryPremiumVotesResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.premiumVotes !== undefined) { + perpetual_1.PremiumStore.encode(message.premiumVotes, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.premiumVotes = perpetual_1.PremiumStore.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryPremiumVotesResponse(); + message.premiumVotes = object.premiumVotes !== undefined && object.premiumVotes !== null ? perpetual_1.PremiumStore.fromPartial(object.premiumVotes) : undefined; + return message; + } +}; +function createBaseQueryPremiumSamplesRequest() { + return {}; +} +exports.QueryPremiumSamplesRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumSamplesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryPremiumSamplesRequest(); + return message; + } +}; +function createBaseQueryPremiumSamplesResponse() { + return { + premiumSamples: undefined + }; +} +exports.QueryPremiumSamplesResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.premiumSamples !== undefined) { + perpetual_1.PremiumStore.encode(message.premiumSamples, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPremiumSamplesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.premiumSamples = perpetual_1.PremiumStore.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryPremiumSamplesResponse(); + message.premiumSamples = object.premiumSamples !== undefined && object.premiumSamples !== null ? perpetual_1.PremiumStore.fromPartial(object.premiumSamples) : undefined; + return message; + } +}; +function createBaseQueryParamsRequest() { + return {}; +} +exports.QueryParamsRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryParamsRequest(); + return message; + } +}; +function createBaseQueryParamsResponse() { + return { + params: undefined + }; +} +exports.QueryParamsResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.params !== undefined) { + params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = params_1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcGVycGV0dWFscy9xdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDJFQUFnSTtBQUNoSSwyQ0FBa0k7QUFDbEkscUNBQWlEO0FBQ2pELHdEQUEwQztBQTRJMUMsU0FBUywrQkFBK0I7SUFDdEMsT0FBTztRQUNMLEVBQUUsRUFBRSxDQUFDO0tBQ04sQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBLHFCQUFxQixHQUFHO0lBQ25DLE1BQU0sQ0FBQyxPQUE4QixFQUFFLFNBQXFCLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQzdFLElBQUksT0FBTyxDQUFDLEVBQUUsS0FBSyxDQUFDLEVBQUU7WUFDcEIsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO1NBQ3JDO1FBRUQsT0FBTyxNQUFNLENBQUM7SUFDaEIsQ0FBQztJQUVELE1BQU0sQ0FBQyxLQUE4QixFQUFFLE1BQWU7UUFDcEQsTUFBTSxNQUFNLEdBQUcsS0FBSyxZQUFZLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsSUFBSSxHQUFHLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQzNFLEl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v4-proto/src/codegen/dydxprotocol/perpetuals/tx.ts": +/*!***************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx.ts ***! + \***************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MsgUpdateParamsResponse = exports.MsgUpdateParams = exports.MsgAddPremiumVotesResponse = exports.MsgAddPremiumVotes = exports.FundingPremium = exports.MsgUpdatePerpetualParamsResponse = exports.MsgUpdatePerpetualParams = exports.MsgSetLiquidityTierResponse = exports.MsgSetLiquidityTier = exports.MsgCreatePerpetualResponse = exports.MsgCreatePerpetual = void 0; +const perpetual_1 = __webpack_require__(/*! ./perpetual */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts"); +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseMsgCreatePerpetual() { + return { + authority: "", + params: undefined + }; +} +exports.MsgCreatePerpetual = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + perpetual_1.PerpetualParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePerpetual(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = perpetual_1.PerpetualParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgCreatePerpetual(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.params = object.params !== undefined && object.params !== null ? perpetual_1.PerpetualParams.fromPartial(object.params) : undefined; + return message; + } +}; +function createBaseMsgCreatePerpetualResponse() { + return {}; +} +exports.MsgCreatePerpetualResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePerpetualResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgCreatePerpetualResponse(); + return message; + } +}; +function createBaseMsgSetLiquidityTier() { + return { + authority: "", + liquidityTier: undefined + }; +} +exports.MsgSetLiquidityTier = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.liquidityTier !== undefined) { + perpetual_1.LiquidityTier.encode(message.liquidityTier, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLiquidityTier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.liquidityTier = perpetual_1.LiquidityTier.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgSetLiquidityTier(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.liquidityTier = object.liquidityTier !== undefined && object.liquidityTier !== null ? perpetual_1.LiquidityTier.fromPartial(object.liquidityTier) : undefined; + return message; + } +}; +function createBaseMsgSetLiquidityTierResponse() { + return {}; +} +exports.MsgSetLiquidityTierResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLiquidityTierResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgSetLiquidityTierResponse(); + return message; + } +}; +function createBaseMsgUpdatePerpetualParams() { + return { + authority: "", + perpetualParams: undefined + }; +} +exports.MsgUpdatePerpetualParams = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.perpetualParams !== undefined) { + perpetual_1.PerpetualParams.encode(message.perpetualParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePerpetualParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.perpetualParams = perpetual_1.PerpetualParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgUpdatePerpetualParams(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.perpetualParams = object.perpetualParams !== undefined && object.perpetualParams !== null ? perpetual_1.PerpetualParams.fromPartial(object.perpetualParams) : undefined; + return message; + } +}; +function createBaseMsgUpdatePerpetualParamsResponse() { + return {}; +} +exports.MsgUpdatePerpetualParamsResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePerpetualParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgUpdatePerpetualParamsResponse(); + return message; + } +}; +function createBaseFundingPremium() { + return { + perpetualId: 0, + premiumPpm: 0 + }; +} +exports.FundingPremium = { + encode(message, writer = _m0.Writer.create()) { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (message.premiumPpm !== 0) { + writer.uint32(16).int32(message.premiumPpm); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFundingPremium(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + case 2: + message.premiumPpm = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseFundingPremium(); + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; + message.premiumPpm = (_b = object.premiumPpm) !== null && _b !== void 0 ? _b : 0; + return message; + } +}; +function createBaseMsgAddPremiumVotes() { + return { + votes: [] + }; +} +exports.MsgAddPremiumVotes = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.votes) { + exports.FundingPremium.encode(v, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddPremiumVotes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(exports.FundingPremium.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgAddPremiumVotes(); + message.votes = ((_a = object.votes) === null || _a === void 0 ? void 0 : _a.map(e => exports.FundingPremium.fromPartial(e))) || []; + return message; + } +}; +function createBaseMsgAddPremiumVotesResponse() { + return {}; +} +exports.MsgAddPremiumVotesResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddPremiumVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgAddPremiumVotesResponse(); + return message; + } +}; +function createBaseMsgUpdateParams() { + return { + authority: "", + params: undefined + }; +} +exports.MsgUpdateParams = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + params_1.Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = params_1.Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgUpdateParams(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; + return message; + } +}; +function createBaseMsgUpdateParamsResponse() { + return {}; +} +exports.MsgUpdateParamsResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgUpdateParamsResponse(); + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcGVycGV0dWFscy90eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDJDQUEyRztBQUMzRyxxQ0FBaUQ7QUFDakQsd0RBQTBDO0FBOEoxQyxTQUFTLDRCQUE0QjtJQUNuQyxPQUFPO1FBQ0wsU0FBUyxFQUFFLEVBQUU7UUFDYixNQUFNLEVBQUUsU0FBUztLQUNsQixDQUFDO0FBQ0osQ0FBQztBQUVZLFFBQUEsa0JBQWtCLEdBQUc7SUFDaEMsTUFBTSxDQUFDLE9BQTJCLEVBQUUsU0FBcUIsR0FBRyxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUU7UUFDMUUsSUFBSSxPQUFPLENBQUMsU0FBUyxLQUFLLEVBQUUsRUFBRTtZQUM1QixNQU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SxPQUFPLEdBQUcsaUNBQWlDLEVBQUUsQ0FBQztRQUNwRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts ***! + \*********************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MarketParam = void 0; +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseMarketParam() { + return { + id: 0, + pair: "", + exponent: 0, + minExchanges: 0, + minPriceChangePpm: 0, + exchangeConfigJson: "" + }; +} +exports.MarketParam = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.pair !== "") { + writer.uint32(18).string(message.pair); + } + if (message.exponent !== 0) { + writer.uint32(24).sint32(message.exponent); + } + if (message.minExchanges !== 0) { + writer.uint32(32).uint32(message.minExchanges); + } + if (message.minPriceChangePpm !== 0) { + writer.uint32(40).uint32(message.minPriceChangePpm); + } + if (message.exchangeConfigJson !== "") { + writer.uint32(50).string(message.exchangeConfigJson); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.pair = reader.string(); + break; + case 3: + message.exponent = reader.sint32(); + break; + case 4: + message.minExchanges = reader.uint32(); + break; + case 5: + message.minPriceChangePpm = reader.uint32(); + break; + case 6: + message.exchangeConfigJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f; + const message = createBaseMarketParam(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + message.pair = (_b = object.pair) !== null && _b !== void 0 ? _b : ""; + message.exponent = (_c = object.exponent) !== null && _c !== void 0 ? _c : 0; + message.minExchanges = (_d = object.minExchanges) !== null && _d !== void 0 ? _d : 0; + message.minPriceChangePpm = (_e = object.minPriceChangePpm) !== null && _e !== void 0 ? _e : 0; + message.exchangeConfigJson = (_f = object.exchangeConfigJson) !== null && _f !== void 0 ? _f : ""; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2V0X3BhcmFtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3ByaWNlcy9tYXJrZXRfcGFyYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7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sWUFBWSxHQUFHLE1BQUEsTUFBTSxDQUFDLFlBQVksbUNBQUksQ0FBQyxDQUFDO1FBQ2hELE9BQU8sQ0FBQyxpQkFBaUIsR0FBRyxNQUFBLE1BQU0sQ0FBQyxpQkFBaUIsbUNBQUksQ0FBQyxDQUFDO1FBQzFELE9BQU8sQ0FBQyxrQkFBa0IsR0FBRyxNQUFBLE1BQU0sQ0FBQyxrQkFBa0IsbUNBQUksRUFBRSxDQUFDO1FBQzdELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_price.ts": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_price.ts ***! + \*********************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MarketPrice = void 0; +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseMarketPrice() { + return { + id: 0, + exponent: 0, + price: helpers_1.Long.UZERO + }; +} +exports.MarketPrice = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.exponent !== 0) { + writer.uint32(16).sint32(message.exponent); + } + if (!message.price.isZero()) { + writer.uint32(24).uint64(message.price); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.exponent = reader.sint32(); + break; + case 3: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseMarketPrice(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + message.exponent = (_b = object.exponent) !== null && _b !== void 0 ? _b : 0; + message.price = object.price !== undefined && object.price !== null ? helpers_1.Long.fromValue(object.price) : helpers_1.Long.UZERO; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2V0X3ByaWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3ByaWNlcy9tYXJrZXRfcHJpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBa0Q7QUFDbEQsd0RBQTBDO0FBMkIxQyxTQUFTLHFCQUFxQjtJQUM1QixPQ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UFLLEdBQUcsTUFBTSxDQUFDLEtBQUssS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLEtBQUssS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsS0FBSyxDQUFDO1FBQ2hILE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/query.ts": +/*!**************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/query.ts ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.QueryAllMarketParamsResponse = exports.QueryAllMarketParamsRequest = exports.QueryMarketParamResponse = exports.QueryMarketParamRequest = exports.QueryAllMarketPricesResponse = exports.QueryAllMarketPricesRequest = exports.QueryMarketPriceResponse = exports.QueryMarketPriceRequest = void 0; +const pagination_1 = __webpack_require__(/*! ../../cosmos/base/query/v1beta1/pagination */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts"); +const market_price_1 = __webpack_require__(/*! ./market_price */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_price.ts"); +const market_param_1 = __webpack_require__(/*! ./market_param */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseQueryMarketPriceRequest() { + return { + id: 0 + }; +} +exports.QueryMarketPriceRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryMarketPriceRequest(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + return message; + } +}; +function createBaseQueryMarketPriceResponse() { + return { + marketPrice: undefined + }; +} +exports.QueryMarketPriceResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.marketPrice !== undefined) { + market_price_1.MarketPrice.encode(message.marketPrice, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketPrice = market_price_1.MarketPrice.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryMarketPriceResponse(); + message.marketPrice = object.marketPrice !== undefined && object.marketPrice !== null ? market_price_1.MarketPrice.fromPartial(object.marketPrice) : undefined; + return message; + } +}; +function createBaseQueryAllMarketPricesRequest() { + return { + pagination: undefined + }; +} +exports.QueryAllMarketPricesRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.pagination !== undefined) { + pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryAllMarketPricesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryAllMarketPricesResponse() { + return { + marketPrices: [], + pagination: undefined + }; +} +exports.QueryAllMarketPricesResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.marketPrices) { + market_price_1.MarketPrice.encode(v, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketPrices.push(market_price_1.MarketPrice.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryAllMarketPricesResponse(); + message.marketPrices = ((_a = object.marketPrices) === null || _a === void 0 ? void 0 : _a.map(e => market_price_1.MarketPrice.fromPartial(e))) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryMarketParamRequest() { + return { + id: 0 + }; +} +exports.QueryMarketParamRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketParamRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryMarketParamRequest(); + message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + return message; + } +}; +function createBaseQueryMarketParamResponse() { + return { + marketParam: undefined + }; +} +exports.QueryMarketParamResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.marketParam !== undefined) { + market_param_1.MarketParam.encode(message.marketParam, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMarketParamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketParam = market_param_1.MarketParam.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryMarketParamResponse(); + message.marketParam = object.marketParam !== undefined && object.marketParam !== null ? market_param_1.MarketParam.fromPartial(object.marketParam) : undefined; + return message; + } +}; +function createBaseQueryAllMarketParamsRequest() { + return { + pagination: undefined + }; +} +exports.QueryAllMarketParamsRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.pagination !== undefined) { + pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryAllMarketParamsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryAllMarketParamsResponse() { + return { + marketParams: [], + pagination: undefined + }; +} +exports.QueryAllMarketParamsResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.marketParams) { + market_param_1.MarketParam.encode(v, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllMarketParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketParams.push(market_param_1.MarketParam.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryAllMarketParamsResponse(); + message.marketParams = ((_a = object.marketParams) === null || _a === void 0 ? void 0 : _a.map(e => market_param_1.MarketParam.fromPartial(e))) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + return message; + } +}; +//# sourceMappingURL=data:application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), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx.ts": +/*!***********************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx.ts ***! + \***********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MsgUpdateMarketParamResponse = exports.MsgUpdateMarketParam = exports.MsgUpdateMarketPricesResponse = exports.MsgUpdateMarketPrices_MarketPrice = exports.MsgUpdateMarketPrices = exports.MsgCreateOracleMarketResponse = exports.MsgCreateOracleMarket = void 0; +const market_param_1 = __webpack_require__(/*! ./market_param */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +function createBaseMsgCreateOracleMarket() { + return { + authority: "", + params: undefined + }; +} +exports.MsgCreateOracleMarket = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + market_param_1.MarketParam.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateOracleMarket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = market_param_1.MarketParam.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgCreateOracleMarket(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.params = object.params !== undefined && object.params !== null ? market_param_1.MarketParam.fromPartial(object.params) : undefined; + return message; + } +}; +function createBaseMsgCreateOracleMarketResponse() { + return {}; +} +exports.MsgCreateOracleMarketResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateOracleMarketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgCreateOracleMarketResponse(); + return message; + } +}; +function createBaseMsgUpdateMarketPrices() { + return { + marketPriceUpdates: [] + }; +} +exports.MsgUpdateMarketPrices = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.marketPriceUpdates) { + exports.MsgUpdateMarketPrices_MarketPrice.encode(v, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketPrices(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketPriceUpdates.push(exports.MsgUpdateMarketPrices_MarketPrice.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgUpdateMarketPrices(); + message.marketPriceUpdates = ((_a = object.marketPriceUpdates) === null || _a === void 0 ? void 0 : _a.map(e => exports.MsgUpdateMarketPrices_MarketPrice.fromPartial(e))) || []; + return message; + } +}; +function createBaseMsgUpdateMarketPrices_MarketPrice() { + return { + marketId: 0, + price: helpers_1.Long.UZERO + }; +} +exports.MsgUpdateMarketPrices_MarketPrice = { + encode(message, writer = _m0.Writer.create()) { + if (message.marketId !== 0) { + writer.uint32(8).uint32(message.marketId); + } + if (!message.price.isZero()) { + writer.uint32(16).uint64(message.price); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketPrices_MarketPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.marketId = reader.uint32(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgUpdateMarketPrices_MarketPrice(); + message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : 0; + message.price = object.price !== undefined && object.price !== null ? helpers_1.Long.fromValue(object.price) : helpers_1.Long.UZERO; + return message; + } +}; +function createBaseMsgUpdateMarketPricesResponse() { + return {}; +} +exports.MsgUpdateMarketPricesResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgUpdateMarketPricesResponse(); + return message; + } +}; +function createBaseMsgUpdateMarketParam() { + return { + authority: "", + marketParam: undefined + }; +} +exports.MsgUpdateMarketParam = { + encode(message, writer = _m0.Writer.create()) { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.marketParam !== undefined) { + market_param_1.MarketParam.encode(message.marketParam, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.marketParam = market_param_1.MarketParam.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseMsgUpdateMarketParam(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.marketParam = object.marketParam !== undefined && object.marketParam !== null ? market_param_1.MarketParam.fromPartial(object.marketParam) : undefined; + return message; + } +}; +function createBaseMsgUpdateMarketParamResponse() { + return {}; +} +exports.MsgUpdateMarketParamResponse = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateMarketParamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseMsgUpdateMarketParamResponse(); + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by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LLFlBQVksR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxJQUFJLEdBQUcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDM0UsSUFBSSxHQUFHLEdBQUcsTUFBTSxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLEdBQUcsR0FBRyxNQUFNLENBQUM7UUFDbEUsTUFBTSxPQUFPLEdBQUcsc0NBQXNDLEVBQUUsQ0FBQztRQUV6RCxPQUFPLE1BQU0sQ0FBQyxHQUFHLEdBQUcsR0FBRyxFQUFFO1lBQ3ZCLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUU1QixRQUFRLEdBQUcsS0FBSyxDQUFDLEVBQUU7Z0JBQ2pCO29CQUNFLE1BQU0sQ0FBQyxRQUFRLENBQUMsR0FBRyxHQUFHLENBQUMsQ0FBQyxDQUFDO29CQUN6QixNQUFNO2FBQ1Q7U0FDRjtRQUVELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7SUFFRCxXQUFXLENBQUMsQ0FBNEM7UUFDdEQsTUFBTSxPQUFPLEdBQUcsc0NBQXNDLEVBQUUsQ0FBQztRQUN6RCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/capacity.ts": +/*!********************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/capacity.ts ***! + \********************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LimiterCapacity = exports.DenomCapacity = void 0; +const limit_params_1 = __webpack_require__(/*! ./limit_params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseDenomCapacity() { + return { + denom: "", + capacityList: [] + }; +} +exports.DenomCapacity = { + encode(message, writer = _m0.Writer.create()) { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + for (const v of message.capacityList) { + writer.uint32(18).bytes(v); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomCapacity(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.capacityList.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseDenomCapacity(); + message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : ""; + message.capacityList = ((_b = object.capacityList) === null || _b === void 0 ? void 0 : _b.map(e => e)) || []; + return message; + } +}; +function createBaseLimiterCapacity() { + return { + limiter: undefined, + capacity: new Uint8Array() + }; +} +exports.LimiterCapacity = { + encode(message, writer = _m0.Writer.create()) { + if (message.limiter !== undefined) { + limit_params_1.Limiter.encode(message.limiter, writer.uint32(10).fork()).ldelim(); + } + if (message.capacity.length !== 0) { + writer.uint32(18).bytes(message.capacity); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimiterCapacity(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limiter = limit_params_1.Limiter.decode(reader, reader.uint32()); + break; + case 2: + message.capacity = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseLimiterCapacity(); + message.limiter = object.limiter !== undefined && object.limiter !== null ? limit_params_1.Limiter.fromPartial(object.limiter) : undefined; + message.capacity = (_a = object.capacity) !== null && _a !== void 0 ? _a : new Uint8Array(); + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FwYWNpdHkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcmF0ZWxpbWl0L2NhcGFjaXR5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsaURBQXlEO0FBQ3pELHdEQUEwQztBQXFDMUMsU0FBUyx1QkFBdUI7SUFDOUIsT0FBTztRQUNMLEtBQUssRUFBRSxFQUFFO1FBQ1QsWUFBWSxFQUFFLEVBQUU7S0FDakIsQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBL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FLENBQUMsQ0FBQztvQkFDMUQsTUFBTTtnQkFFUixLQUFLLENBQUM7b0JBQ0osT0FBTyxDQUFDLFFBQVEsR0FBRyxNQUFNLENBQUMsS0FBSyxFQUFFLENBQUM7b0JBQ2xDLE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUFvQzs7UUFDOUMsTUFBTSxPQUFPLEdBQUcseUJBQXlCLEVBQUUsQ0FBQztRQUM1QyxPQUFPLENBQUMsT0FBTyxHQUFHLE1BQU0sQ0FBQyxPQUFPLEtBQUssU0FBUyxJQUFJLE1BQU0sQ0FBQyxPQUFPLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxzQkFBTyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztRQUM1SCxPQUFPLENBQUMsUUFBUSxHQUFHLE1BQUEsTUFBTSxDQUFDLFFBQVEsbUNBQUksSUFBSSxVQUFVLEVBQUUsQ0FBQztRQUN2RCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts": +/*!************************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts ***! + \************************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Limiter = exports.LimitParams = void 0; +const duration_1 = __webpack_require__(/*! ../../google/protobuf/duration */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/google/protobuf/duration.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseLimitParams() { + return { + denom: "", + limiters: [] + }; +} +exports.LimitParams = { + encode(message, writer = _m0.Writer.create()) { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + for (const v of message.limiters) { + exports.Limiter.encode(v, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimitParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.limiters.push(exports.Limiter.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseLimitParams(); + message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : ""; + message.limiters = ((_b = object.limiters) === null || _b === void 0 ? void 0 : _b.map(e => exports.Limiter.fromPartial(e))) || []; + return message; + } +}; +function createBaseLimiter() { + return { + period: undefined, + baselineMinimum: new Uint8Array(), + baselineTvlPpm: 0 + }; +} +exports.Limiter = { + encode(message, writer = _m0.Writer.create()) { + if (message.period !== undefined) { + duration_1.Duration.encode(message.period, writer.uint32(10).fork()).ldelim(); + } + if (message.baselineMinimum.length !== 0) { + writer.uint32(26).bytes(message.baselineMinimum); + } + if (message.baselineTvlPpm !== 0) { + writer.uint32(32).uint32(message.baselineTvlPpm); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimiter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.period = duration_1.Duration.decode(reader, reader.uint32()); + break; + case 3: + message.baselineMinimum = reader.bytes(); + break; + case 4: + message.baselineTvlPpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b; + const message = createBaseLimiter(); + message.period = object.period !== undefined && object.period !== null ? duration_1.Duration.fromPartial(object.period) : undefined; + message.baselineMinimum = (_a = object.baselineMinimum) !== null && _a !== void 0 ? _a : new Uint8Array(); + message.baselineTvlPpm = (_b = object.baselineTvlPpm) !== null && _b !== void 0 ? _b : 0; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGltaXRfcGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3JhdGVsaW1pdC9saW1pdF9wYXJhbXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSw2REFBMkU7QUFDM0Usd0RBQTBDO0FBc0QxQyxTQU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UFJLENBQUMsQ0FBQyxDQUFDLG1CQUFRLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQ3pILE9BQU8sQ0FBQyxlQUFlLEdBQUcsTUFBQSxNQUFNLENBQUMsZUFBZSxtQ0FBSSxJQUFJLFVBQVUsRUFBRSxDQUFDO1FBQ3JFLE9BQU8sQ0FBQyxjQUFjLEdBQUcsTUFBQSxNQUFNLENBQUMsY0FBYyxtQ0FBSSxDQUFDLENBQUM7UUFDcEQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/pending_send_packet.ts": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/pending_send_packet.ts ***! + \*******************************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PendingSendPacket = void 0; +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBasePendingSendPacket() { + return { + channelId: "", + sequence: helpers_1.Long.UZERO + }; +} +exports.PendingSendPacket = { + encode(message, writer = _m0.Writer.create()) { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (!message.sequence.isZero()) { + writer.uint32(16).uint64(message.sequence); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePendingSendPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBasePendingSendPacket(); + message.channelId = (_a = object.channelId) !== null && _a !== void 0 ? _a : ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? helpers_1.Long.fromValue(object.sequence) : helpers_1.Long.UZERO; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVuZGluZ19zZW5kX3BhY2tldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9AZHlkeHByb3RvY29sL3Y0LXByb3RvL3NyYy9jb2RlZ2VuL2R5ZHhwcm90b2NvbC9yYXRlbGltaXQvcGVuZGluZ19zZW5kX3BhY2tldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDJDQUFrRDtBQUNsRCx3REFBMEM7QUFvQjFDLFNBQVMsMkJBQTJCO0lBQ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EdBQUcsR0FBRyxFQUFFO1lBQ3ZCLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUU1QixRQUFRLEdBQUcsS0FBSyxDQUFDLEVBQUU7Z0JBQ2pCLEtBQUssQ0FBQztvQkFDSixPQUFPLENBQUMsU0FBUyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQztvQkFDcEMsTUFBTTtnQkFFUixLQUFLLENBQUM7b0JBQ0osT0FBTyxDQUFDLFFBQVEsR0FBSSxNQUFNLENBQUMsTUFBTSxFQUFXLENBQUM7b0JBQzdDLE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUFzQzs7UUFDaEQsTUFBTSxPQUFPLEdBQUcsMkJBQTJCLEVBQUUsQ0FBQztRQUM5QyxPQUFPLENBQUMsU0FBUyxHQUFHLE1BQUEsTUFBTSxDQUFDLFNBQVMsbUNBQUksRUFBRSxDQUFDO1FBQzNDLE9BQU8sQ0FBQyxRQUFRLEdBQUcsTUFBTSxDQUFDLFFBQVEsS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLFFBQVEsS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsS0FBSyxDQUFDO1FBQzVILE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/query.ts": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/query.ts ***! + \*****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.QueryAllPendingSendPacketsResponse = exports.QueryAllPendingSendPacketsRequest = exports.QueryCapacityByDenomResponse = exports.QueryCapacityByDenomRequest = exports.ListLimitParamsResponse = exports.ListLimitParamsRequest = void 0; +const limit_params_1 = __webpack_require__(/*! ./limit_params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts"); +const capacity_1 = __webpack_require__(/*! ./capacity */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/capacity.ts"); +const pending_send_packet_1 = __webpack_require__(/*! ./pending_send_packet */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/pending_send_packet.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseListLimitParamsRequest() { + return {}; +} +exports.ListLimitParamsRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListLimitParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseListLimitParamsRequest(); + return message; + } +}; +function createBaseListLimitParamsResponse() { + return { + limitParamsList: [] + }; +} +exports.ListLimitParamsResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.limitParamsList) { + limit_params_1.LimitParams.encode(v, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListLimitParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limitParamsList.push(limit_params_1.LimitParams.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseListLimitParamsResponse(); + message.limitParamsList = ((_a = object.limitParamsList) === null || _a === void 0 ? void 0 : _a.map(e => limit_params_1.LimitParams.fromPartial(e))) || []; + return message; + } +}; +function createBaseQueryCapacityByDenomRequest() { + return { + denom: "" + }; +} +exports.QueryCapacityByDenomRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCapacityByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryCapacityByDenomRequest(); + message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : ""; + return message; + } +}; +function createBaseQueryCapacityByDenomResponse() { + return { + limiterCapacityList: [] + }; +} +exports.QueryCapacityByDenomResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.limiterCapacityList) { + capacity_1.LimiterCapacity.encode(v, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCapacityByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limiterCapacityList.push(capacity_1.LimiterCapacity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryCapacityByDenomResponse(); + message.limiterCapacityList = ((_a = object.limiterCapacityList) === null || _a === void 0 ? void 0 : _a.map(e => capacity_1.LimiterCapacity.fromPartial(e))) || []; + return message; + } +}; +function createBaseQueryAllPendingSendPacketsRequest() { + return {}; +} +exports.QueryAllPendingSendPacketsRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPendingSendPacketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryAllPendingSendPacketsRequest(); + return message; + } +}; +function createBaseQueryAllPendingSendPacketsResponse() { + return { + pendingSendPackets: [] + }; +} +exports.QueryAllPendingSendPacketsResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.pendingSendPackets) { + pending_send_packet_1.PendingSendPacket.encode(v, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPendingSendPacketsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pendingSendPackets.push(pending_send_packet_1.PendingSendPacket.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryAllPendingSendPacketsResponse(); + message.pendingSendPackets = ((_a = object.pendingSendPackets) === null || _a === void 0 ? void 0 : _a.map(e => pending_send_packet_1.PendingSendPacket.fromPartial(e))) || []; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcmF0ZWxpbWl0L3F1ZXJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsaURBQWlFO0FBQ2pFLHlDQUFxRTtBQUNyRSwrREFBb0Y7QUFDcEYsd0RBQTBDO0FBbUYxQyxTQUFTLGdDQUFnQztJQUN2QyxPQUFPLEVBQUUsQ0FBQztBQUNaLENBQUM7QUFFWSxRQUFBLHNCQUFzQixHQUFHO0lBQ3BDLE1BQU0sQ0FBQyxDQUF5QixFQUFFLFNBQXFCLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQ3hFLE9BQU8sTUFBTSxDQUFDO0lBQ2hCLENBQUM7SUFFRCxNQUFNLENBQUMsS0FBOEIsRUFBRSxNQUFlO1FBQ3BELE1BQU0sTUFBTSxHQUFHLEtBQUssWUFBWSxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLElBQUks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LE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxHQUFHLEdBQUcsTUFBTSxDQUFDO1FBQ2xFLE1BQU0sT0FBTyxHQUFHLDRDQUE0QyxFQUFFLENBQUM7UUFFL0QsT0FBTyxNQUFNLENBQUMsR0FBRyxHQUFHLEdBQUcsRUFBRTtZQUN2QixNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7WUFFNUIsUUFBUSxHQUFHLEtBQUssQ0FBQyxFQUFFO2dCQUNqQixLQUFLLENBQUM7b0JBQ0osT0FBTyxDQUFDLGtCQUFrQixDQUFDLElBQUksQ0FBQyx1Q0FBaUIsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDLENBQUM7b0JBQ25GLE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUF1RDs7UUFDakUsTUFBTSxPQUFPLEdBQUcsNENBQTRDLEVBQUUsQ0FBQztRQUMvRCxPQUFPLENBQUMsa0JBQWtCLEdBQUcsQ0FBQSxNQUFBLE1BQU0sQ0FBQyxrQkFBa0IsMENBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsdUNBQWlCLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUksRUFBRSxDQUFDO1FBQ3pHLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/params.ts": +/*!****************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/params.ts ***! + \****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Params = void 0; +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseParams() { + return { + treasuryAccount: "", + denom: "", + denomExponent: 0, + marketId: 0, + feeMultiplierPpm: 0 + }; +} +exports.Params = { + encode(message, writer = _m0.Writer.create()) { + if (message.treasuryAccount !== "") { + writer.uint32(10).string(message.treasuryAccount); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.denomExponent !== 0) { + writer.uint32(24).sint32(message.denomExponent); + } + if (message.marketId !== 0) { + writer.uint32(32).uint32(message.marketId); + } + if (message.feeMultiplierPpm !== 0) { + writer.uint32(40).uint32(message.feeMultiplierPpm); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.treasuryAccount = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.denomExponent = reader.sint32(); + break; + case 4: + message.marketId = reader.uint32(); + break; + case 5: + message.feeMultiplierPpm = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d, _e; + const message = createBaseParams(); + message.treasuryAccount = (_a = object.treasuryAccount) !== null && _a !== void 0 ? _a : ""; + message.denom = (_b = object.denom) !== null && _b !== void 0 ? _b : ""; + message.denomExponent = (_c = object.denomExponent) !== null && _c !== void 0 ? _c : 0; + message.marketId = (_d = object.marketId) !== null && _d !== void 0 ? _d : 0; + message.feeMultiplierPpm = (_e = object.feeMultiplierPpm) !== null && _e !== void 0 ? _e : 0; + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3Jld2FyZHMvcGFyYW1zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsd0RBQTBDO0FBc0MxQyxTQUFTLGdCQUFnQjtJQUN2QixPQUFPO1FBQ0wsZUFBZSxFQUFFLEVBQUU7UUFDbkIsS0FBSyxFQUFFLEVBQUU7UUFDVCxhQUFhLEVBQUUsQ0FBQztRQUNoQixRQUFRLEVBQUUsQ0FBQztRQUNYLGdCQUFnQixFQUFFLENBQUM7S0FDcEIsQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBLE1BQU0sR0FBRztJQUNwQixNQUFNLENBQUMsT0FBZSxFQUFFLFNBQXFCLEdBQ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pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUEyQjs7UUFDckMsTUFBTSxPQUFPLEdBQUcsZ0JBQWdCLEVBQUUsQ0FBQztRQUNuQyxPQUFPLENBQUMsZUFBZSxHQUFHLE1BQUEsTUFBTSxDQUFDLGVBQWUsbUNBQUksRUFBRSxDQUFDO1FBQ3ZELE9BQU8sQ0FBQyxLQUFLLEdBQUcsTUFBQSxNQUFNLENBQUMsS0FBSyxtQ0FBSSxFQUFFLENBQUM7UUFDbkMsT0FBTyxDQUFDLGFBQWEsR0FBRyxNQUFBLE1BQU0sQ0FBQyxhQUFhLG1DQUFJLENBQUMsQ0FBQztRQUNsRCxPQUFPLENBQUMsUUFBUSxHQUFHLE1BQUEsTUFBTSxDQUFDLFFBQVEsbUNBQUksQ0FBQyxDQUFDO1FBQ3hDLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyxNQUFBLE1BQU0sQ0FBQyxnQkFBZ0IsbUNBQUksQ0FBQyxDQUFDO1FBQ3hELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts": -/*!*******************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts ***! - \*******************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/query.ts": +/*!***************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/query.ts ***! + \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -190490,43 +192967,56 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Params = void 0; +exports.QueryParamsResponse = exports.QueryParamsRequest = void 0; +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/params.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseParams() { +function createBaseQueryParamsRequest() { + return {}; +} +exports.QueryParamsRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryParamsRequest(); + return message; + } +}; +function createBaseQueryParamsResponse() { return { - fundingRateClampFactorPpm: 0, - premiumVoteClampFactorPpm: 0, - minNumVotesPerSample: 0 + params: undefined }; } -exports.Params = { +exports.QueryParamsResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.fundingRateClampFactorPpm !== 0) { - writer.uint32(8).uint32(message.fundingRateClampFactorPpm); - } - if (message.premiumVoteClampFactorPpm !== 0) { - writer.uint32(16).uint32(message.premiumVoteClampFactorPpm); - } - if (message.minNumVotesPerSample !== 0) { - writer.uint32(24).uint32(message.minNumVotesPerSample); + if (message.params !== undefined) { + params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.fundingRateClampFactorPpm = reader.uint32(); - break; - case 2: - message.premiumVoteClampFactorPpm = reader.uint32(); - break; - case 3: - message.minNumVotesPerSample = reader.uint32(); + message.params = params_1.Params.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -190536,22 +193026,19 @@ exports.Params = { return message; }, fromPartial(object) { - var _a, _b, _c; - const message = createBaseParams(); - message.fundingRateClampFactorPpm = (_a = object.fundingRateClampFactorPpm) !== null && _a !== void 0 ? _a : 0; - message.premiumVoteClampFactorPpm = (_b = object.premiumVoteClampFactorPpm) !== null && _b !== void 0 ? _b : 0; - message.minNumVotesPerSample = (_c = object.minNumVotesPerSample) !== null && _c !== void 0 ? _c : 0; + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3BlcnBldHVhbHMvcGFyYW1zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsd0RBQTBDO0FBaUMxQyxTQUFTLGdCQUFnQjtJQUN2QixPQUFPO1FBQ0wseUJBQXlCLEVBQUUsQ0FBQztRQUM1Qix5QkFBeUIsRUFBRSxDQUFDO1FBQzVCLG9CQUFvQixFQUFFLENBQUM7S0FDeEIsQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBLE1BQU0sR0FBRztJQUNwQixNQUFNLENBQUMsT0FBZSxFQUFFLFNBQXFCLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQzlELElBQUksT0FBTyxDQUFDLHlCQUF5QixLQUFLLENBQUMsRUFBRTtZQUMzQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMseUJBQXlCLENBQUMsQ0FB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QUFDLE1BQU0sRUFBRSxDQUFDO1lBRTVCLFFBQVEsR0FBRyxLQUFLLENBQUMsRUFBRTtnQkFDakIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyxNQUFNLEdBQUcsZUFBTSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7b0JBQ3hELE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUF3QztRQUNsRCxNQUFNLE9BQU8sR0FBRyw2QkFBNkIsRUFBRSxDQUFDO1FBQ2hELE9BQU8sQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDLE1BQU0sS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLE1BQU0sS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGVBQU0sQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDdkgsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts": -/*!**********************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts ***! - \**********************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts": +/*!******************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts ***! + \******************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -190580,87 +193067,53 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LiquidityTier = exports.PremiumStore = exports.MarketPremiums = exports.PerpetualParams = exports.Perpetual = exports.perpetualMarketTypeToJSON = exports.perpetualMarketTypeFromJSON = exports.PerpetualMarketTypeSDKType = exports.PerpetualMarketType = void 0; -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +exports.MsgSendFromModuleToAccount = exports.MsgWithdrawFromSubaccount = exports.MsgDepositToSubaccount = exports.Transfer = void 0; +const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); +const coin_1 = __webpack_require__(/*! ../../cosmos/base/v1beta1/coin */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/v1beta1/coin.ts"); const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); -var PerpetualMarketType; -(function (PerpetualMarketType) { - /** PERPETUAL_MARKET_TYPE_UNSPECIFIED - Unspecified market type. */ - PerpetualMarketType[PerpetualMarketType["PERPETUAL_MARKET_TYPE_UNSPECIFIED"] = 0] = "PERPETUAL_MARKET_TYPE_UNSPECIFIED"; - /** PERPETUAL_MARKET_TYPE_CROSS - Market type for cross margin perpetual markets. */ - PerpetualMarketType[PerpetualMarketType["PERPETUAL_MARKET_TYPE_CROSS"] = 1] = "PERPETUAL_MARKET_TYPE_CROSS"; - /** PERPETUAL_MARKET_TYPE_ISOLATED - Market type for isolated margin perpetual markets. */ - PerpetualMarketType[PerpetualMarketType["PERPETUAL_MARKET_TYPE_ISOLATED"] = 2] = "PERPETUAL_MARKET_TYPE_ISOLATED"; - PerpetualMarketType[PerpetualMarketType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; -})(PerpetualMarketType = exports.PerpetualMarketType || (exports.PerpetualMarketType = {})); -exports.PerpetualMarketTypeSDKType = PerpetualMarketType; -function perpetualMarketTypeFromJSON(object) { - switch (object) { - case 0: - case "PERPETUAL_MARKET_TYPE_UNSPECIFIED": - return PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED; - case 1: - case "PERPETUAL_MARKET_TYPE_CROSS": - return PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS; - case 2: - case "PERPETUAL_MARKET_TYPE_ISOLATED": - return PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED; - case -1: - case "UNRECOGNIZED": - default: - return PerpetualMarketType.UNRECOGNIZED; - } -} -exports.perpetualMarketTypeFromJSON = perpetualMarketTypeFromJSON; -function perpetualMarketTypeToJSON(object) { - switch (object) { - case PerpetualMarketType.PERPETUAL_MARKET_TYPE_UNSPECIFIED: - return "PERPETUAL_MARKET_TYPE_UNSPECIFIED"; - case PerpetualMarketType.PERPETUAL_MARKET_TYPE_CROSS: - return "PERPETUAL_MARKET_TYPE_CROSS"; - case PerpetualMarketType.PERPETUAL_MARKET_TYPE_ISOLATED: - return "PERPETUAL_MARKET_TYPE_ISOLATED"; - case PerpetualMarketType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} -exports.perpetualMarketTypeToJSON = perpetualMarketTypeToJSON; -function createBasePerpetual() { +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseTransfer() { return { - params: undefined, - fundingIndex: new Uint8Array(), - openInterest: new Uint8Array() + sender: undefined, + recipient: undefined, + assetId: 0, + amount: helpers_1.Long.UZERO }; } -exports.Perpetual = { +exports.Transfer = { encode(message, writer = _m0.Writer.create()) { - if (message.params !== undefined) { - exports.PerpetualParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + if (message.sender !== undefined) { + subaccount_1.SubaccountId.encode(message.sender, writer.uint32(10).fork()).ldelim(); } - if (message.fundingIndex.length !== 0) { - writer.uint32(18).bytes(message.fundingIndex); + if (message.recipient !== undefined) { + subaccount_1.SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim(); } - if (message.openInterest.length !== 0) { - writer.uint32(26).bytes(message.openInterest); + if (message.assetId !== 0) { + writer.uint32(24).uint32(message.assetId); + } + if (!message.amount.isZero()) { + writer.uint32(32).uint64(message.amount); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePerpetual(); + const message = createBaseTransfer(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.params = exports.PerpetualParams.decode(reader, reader.uint32()); + message.sender = subaccount_1.SubaccountId.decode(reader, reader.uint32()); break; case 2: - message.fundingIndex = reader.bytes(); + message.recipient = subaccount_1.SubaccountId.decode(reader, reader.uint32()); break; case 3: - message.openInterest = reader.bytes(); + message.assetId = reader.uint32(); + break; + case 4: + message.amount = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -190670,77 +193123,57 @@ exports.Perpetual = { return message; }, fromPartial(object) { - var _a, _b; - const message = createBasePerpetual(); - message.params = object.params !== undefined && object.params !== null ? exports.PerpetualParams.fromPartial(object.params) : undefined; - message.fundingIndex = (_a = object.fundingIndex) !== null && _a !== void 0 ? _a : new Uint8Array(); - message.openInterest = (_b = object.openInterest) !== null && _b !== void 0 ? _b : new Uint8Array(); + var _a; + const message = createBaseTransfer(); + message.sender = object.sender !== undefined && object.sender !== null ? subaccount_1.SubaccountId.fromPartial(object.sender) : undefined; + message.recipient = object.recipient !== undefined && object.recipient !== null ? subaccount_1.SubaccountId.fromPartial(object.recipient) : undefined; + message.assetId = (_a = object.assetId) !== null && _a !== void 0 ? _a : 0; + message.amount = object.amount !== undefined && object.amount !== null ? helpers_1.Long.fromValue(object.amount) : helpers_1.Long.UZERO; return message; } }; -function createBasePerpetualParams() { +function createBaseMsgDepositToSubaccount() { return { - id: 0, - ticker: "", - marketId: 0, - atomicResolution: 0, - defaultFundingPpm: 0, - liquidityTier: 0, - marketType: 0 + sender: "", + recipient: undefined, + assetId: 0, + quantums: helpers_1.Long.UZERO }; } -exports.PerpetualParams = { +exports.MsgDepositToSubaccount = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); - } - if (message.ticker !== "") { - writer.uint32(18).string(message.ticker); - } - if (message.marketId !== 0) { - writer.uint32(24).uint32(message.marketId); - } - if (message.atomicResolution !== 0) { - writer.uint32(32).sint32(message.atomicResolution); + if (message.sender !== "") { + writer.uint32(10).string(message.sender); } - if (message.defaultFundingPpm !== 0) { - writer.uint32(40).sint32(message.defaultFundingPpm); + if (message.recipient !== undefined) { + subaccount_1.SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim(); } - if (message.liquidityTier !== 0) { - writer.uint32(48).uint32(message.liquidityTier); + if (message.assetId !== 0) { + writer.uint32(24).uint32(message.assetId); } - if (message.marketType !== 0) { - writer.uint32(56).int32(message.marketType); + if (!message.quantums.isZero()) { + writer.uint32(32).uint64(message.quantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePerpetualParams(); + const message = createBaseMsgDepositToSubaccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.sender = reader.string(); break; case 2: - message.ticker = reader.string(); + message.recipient = subaccount_1.SubaccountId.decode(reader, reader.uint32()); break; case 3: - message.marketId = reader.uint32(); + message.assetId = reader.uint32(); break; case 4: - message.atomicResolution = reader.sint32(); - break; - case 5: - message.defaultFundingPpm = reader.sint32(); - break; - case 6: - message.liquidityTier = reader.uint32(); - break; - case 7: - message.marketType = reader.int32(); + message.quantums = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -190750,100 +193183,57 @@ exports.PerpetualParams = { return message; }, fromPartial(object) { - var _a, _b, _c, _d, _e, _f, _g; - const message = createBasePerpetualParams(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; - message.ticker = (_b = object.ticker) !== null && _b !== void 0 ? _b : ""; - message.marketId = (_c = object.marketId) !== null && _c !== void 0 ? _c : 0; - message.atomicResolution = (_d = object.atomicResolution) !== null && _d !== void 0 ? _d : 0; - message.defaultFundingPpm = (_e = object.defaultFundingPpm) !== null && _e !== void 0 ? _e : 0; - message.liquidityTier = (_f = object.liquidityTier) !== null && _f !== void 0 ? _f : 0; - message.marketType = (_g = object.marketType) !== null && _g !== void 0 ? _g : 0; + var _a, _b; + const message = createBaseMsgDepositToSubaccount(); + message.sender = (_a = object.sender) !== null && _a !== void 0 ? _a : ""; + message.recipient = object.recipient !== undefined && object.recipient !== null ? subaccount_1.SubaccountId.fromPartial(object.recipient) : undefined; + message.assetId = (_b = object.assetId) !== null && _b !== void 0 ? _b : 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; return message; } }; -function createBaseMarketPremiums() { +function createBaseMsgWithdrawFromSubaccount() { return { - perpetualId: 0, - premiums: [] + sender: undefined, + recipient: "", + assetId: 0, + quantums: helpers_1.Long.UZERO }; } -exports.MarketPremiums = { +exports.MsgWithdrawFromSubaccount = { encode(message, writer = _m0.Writer.create()) { - if (message.perpetualId !== 0) { - writer.uint32(8).uint32(message.perpetualId); - } - writer.uint32(18).fork(); - for (const v of message.premiums) { - writer.sint32(v); + if (message.sender !== undefined) { + subaccount_1.SubaccountId.encode(message.sender, writer.uint32(18).fork()).ldelim(); } - writer.ldelim(); - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMarketPremiums(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.perpetualId = reader.uint32(); - break; - case 2: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.premiums.push(reader.sint32()); - } - } - else { - message.premiums.push(reader.sint32()); - } - break; - default: - reader.skipType(tag & 7); - break; - } + if (message.recipient !== "") { + writer.uint32(10).string(message.recipient); } - return message; - }, - fromPartial(object) { - var _a, _b; - const message = createBaseMarketPremiums(); - message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; - message.premiums = ((_b = object.premiums) === null || _b === void 0 ? void 0 : _b.map(e => e)) || []; - return message; - } -}; -function createBasePremiumStore() { - return { - allMarketPremiums: [], - numPremiums: 0 - }; -} -exports.PremiumStore = { - encode(message, writer = _m0.Writer.create()) { - for (const v of message.allMarketPremiums) { - exports.MarketPremiums.encode(v, writer.uint32(10).fork()).ldelim(); + if (message.assetId !== 0) { + writer.uint32(24).uint32(message.assetId); } - if (message.numPremiums !== 0) { - writer.uint32(16).uint32(message.numPremiums); + if (!message.quantums.isZero()) { + writer.uint32(32).uint64(message.quantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePremiumStore(); + const message = createBaseMsgWithdrawFromSubaccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 2: + message.sender = subaccount_1.SubaccountId.decode(reader, reader.uint32()); + break; case 1: - message.allMarketPremiums.push(exports.MarketPremiums.decode(reader, reader.uint32())); + message.recipient = reader.string(); break; - case 2: - message.numPremiums = reader.uint32(); + case 3: + message.assetId = reader.uint32(); + break; + case 4: + message.quantums = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -190854,82 +193244,56 @@ exports.PremiumStore = { }, fromPartial(object) { var _a, _b; - const message = createBasePremiumStore(); - message.allMarketPremiums = ((_a = object.allMarketPremiums) === null || _a === void 0 ? void 0 : _a.map(e => exports.MarketPremiums.fromPartial(e))) || []; - message.numPremiums = (_b = object.numPremiums) !== null && _b !== void 0 ? _b : 0; + const message = createBaseMsgWithdrawFromSubaccount(); + message.sender = object.sender !== undefined && object.sender !== null ? subaccount_1.SubaccountId.fromPartial(object.sender) : undefined; + message.recipient = (_a = object.recipient) !== null && _a !== void 0 ? _a : ""; + message.assetId = (_b = object.assetId) !== null && _b !== void 0 ? _b : 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; return message; } }; -function createBaseLiquidityTier() { +function createBaseMsgSendFromModuleToAccount() { return { - id: 0, - name: "", - initialMarginPpm: 0, - maintenanceFractionPpm: 0, - basePositionNotional: helpers_1.Long.UZERO, - impactNotional: helpers_1.Long.UZERO, - openInterestLowerCap: helpers_1.Long.UZERO, - openInterestUpperCap: helpers_1.Long.UZERO + authority: "", + senderModuleName: "", + recipient: "", + coin: undefined }; } -exports.LiquidityTier = { +exports.MsgSendFromModuleToAccount = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); - } - if (message.name !== "") { - writer.uint32(18).string(message.name); - } - if (message.initialMarginPpm !== 0) { - writer.uint32(24).uint32(message.initialMarginPpm); - } - if (message.maintenanceFractionPpm !== 0) { - writer.uint32(32).uint32(message.maintenanceFractionPpm); - } - if (!message.basePositionNotional.isZero()) { - writer.uint32(40).uint64(message.basePositionNotional); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (!message.impactNotional.isZero()) { - writer.uint32(48).uint64(message.impactNotional); + if (message.senderModuleName !== "") { + writer.uint32(18).string(message.senderModuleName); } - if (!message.openInterestLowerCap.isZero()) { - writer.uint32(56).uint64(message.openInterestLowerCap); + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); } - if (!message.openInterestUpperCap.isZero()) { - writer.uint32(64).uint64(message.openInterestUpperCap); + if (message.coin !== undefined) { + coin_1.Coin.encode(message.coin, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidityTier(); + const message = createBaseMsgSendFromModuleToAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.authority = reader.string(); break; case 2: - message.name = reader.string(); + message.senderModuleName = reader.string(); break; case 3: - message.initialMarginPpm = reader.uint32(); + message.recipient = reader.string(); break; case 4: - message.maintenanceFractionPpm = reader.uint32(); - break; - case 5: - message.basePositionNotional = reader.uint64(); - break; - case 6: - message.impactNotional = reader.uint64(); - break; - case 7: - message.openInterestLowerCap = reader.uint64(); - break; - case 8: - message.openInterestUpperCap = reader.uint64(); + message.coin = coin_1.Coin.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -190939,27 +193303,23 @@ exports.LiquidityTier = { return message; }, fromPartial(object) { - var _a, _b, _c, _d; - const message = createBaseLiquidityTier(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; - message.name = (_b = object.name) !== null && _b !== void 0 ? _b : ""; - message.initialMarginPpm = (_c = object.initialMarginPpm) !== null && _c !== void 0 ? _c : 0; - message.maintenanceFractionPpm = (_d = object.maintenanceFractionPpm) !== null && _d !== void 0 ? _d : 0; - message.basePositionNotional = object.basePositionNotional !== undefined && object.basePositionNotional !== null ? helpers_1.Long.fromValue(object.basePositionNotional) : helpers_1.Long.UZERO; - message.impactNotional = object.impactNotional !== undefined && object.impactNotional !== null ? helpers_1.Long.fromValue(object.impactNotional) : helpers_1.Long.UZERO; - message.openInterestLowerCap = object.openInterestLowerCap !== undefined && object.openInterestLowerCap !== null ? helpers_1.Long.fromValue(object.openInterestLowerCap) : helpers_1.Long.UZERO; - message.openInterestUpperCap = object.openInterestUpperCap !== undefined && object.openInterestUpperCap !== null ? helpers_1.Long.fromValue(object.openInterestUpperCap) : helpers_1.Long.UZERO; + var _a, _b, _c; + const message = createBaseMsgSendFromModuleToAccount(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.senderModuleName = (_b = object.senderModuleName) !== null && _b !== void 0 ? _b : ""; + message.recipient = (_c = object.recipient) !== null && _c !== void 0 ? _c : ""; + message.coin = object.coin !== undefined && object.coin !== null ? coin_1.Coin.fromPartial(object.coin) : undefined; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVycGV0dWFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3BlcnBldHVhbHMvcGVycGV0dWFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsd0RBQTBDO0FBQzFDLDJDQUFrRDtBQUNsRCxJQUFZLG1CQVVYO0FBVkQsV0FBWSxtQkFBbUI7SUFDN0IsbUVBQW1FO0lBQ25FLHVIQUFxQyxDQUFBO0lBRXJDLG9GQUFvRjtJQUNwRiwyR0FBK0IsQ0FBQTtJQUUvQiwwRkFBMEY7SUFDMUYsaUhBQWtDLENBQUE7SUFDbEMsOEVBQWlCLENBQUE7QUFDbkIsQ0FBQyxFQVZXLG1CQUFtQixHQUFuQiwyQkFBbUIsS0FBbkIsMkJBQW1CLFFBVTlCO0FBQ1ksUUFBQSwwQkFBMEIsR0FBRyxtQkFBbUIsQ0FBQztBQUM5RCxTQUFnQiwyQkFBMkIsQ0FBQyxNQUFXO0lBQ3JELFFBQVEsTUFBTSxFQUFFO1FBQ2QsS0FBSyxDQUFDLENBQUM7UUFDUCxLQUFLLG1DQUFtQztZQUN0QyxPQUFPLG1CQUFtQixDQUFDLGlDQUFpQyxDQUFDO1FBRS9ELEtBQUssQ0FBQyxDQUFDO1FBQ1AsS0FBSyw2QkFBNkI7WUFDaEMsT0FBTyxtQkFBbUIsQ0FBQywyQkFBMkIsQ0FBQztRQUV6RCxLQUFLLENBQUMsQ0FBQztR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QUFDO1FBQzNDLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyxNQUFBLE1BQU0sQ0FBQyxnQkFBZ0IsbUNBQUksRUFBRSxDQUFDO1FBQ3pELE9BQU8sQ0FBQyxTQUFTLEdBQUcsTUFBQSxNQUFNLENBQUMsU0FBUyxtQ0FBSSxFQUFFLENBQUM7UUFDM0MsT0FBTyxDQUFDLElBQUksR0FBRyxNQUFNLENBQUMsSUFBSSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsSUFBSSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsV0FBSSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQztRQUM3RyxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/query.ts": -/*!******************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/query.ts ***! - \******************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx.ts": +/*!************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx.ts ***! + \************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -190988,32 +193348,30 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryPremiumSamplesResponse = exports.QueryPremiumSamplesRequest = exports.QueryPremiumVotesResponse = exports.QueryPremiumVotesRequest = exports.QueryAllLiquidityTiersResponse = exports.QueryAllLiquidityTiersRequest = exports.QueryAllPerpetualsResponse = exports.QueryAllPerpetualsRequest = exports.QueryPerpetualResponse = exports.QueryPerpetualRequest = void 0; -const pagination_1 = __webpack_require__(/*! ../../cosmos/base/query/v1beta1/pagination */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts"); -const perpetual_1 = __webpack_require__(/*! ./perpetual */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts"); -const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts"); +exports.MsgSendFromModuleToAccountResponse = exports.MsgWithdrawFromSubaccountResponse = exports.MsgDepositToSubaccountResponse = exports.MsgCreateTransferResponse = exports.MsgCreateTransfer = void 0; +const transfer_1 = __webpack_require__(/*! ./transfer */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseQueryPerpetualRequest() { +function createBaseMsgCreateTransfer() { return { - id: 0 + transfer: undefined }; } -exports.QueryPerpetualRequest = { +exports.MsgCreateTransfer = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); + if (message.transfer !== undefined) { + transfer_1.Transfer.encode(message.transfer, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPerpetualRequest(); + const message = createBaseMsgCreateTransfer(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.transfer = transfer_1.Transfer.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -191023,34 +193381,25 @@ exports.QueryPerpetualRequest = { return message; }, fromPartial(object) { - var _a; - const message = createBaseQueryPerpetualRequest(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + const message = createBaseMsgCreateTransfer(); + message.transfer = object.transfer !== undefined && object.transfer !== null ? transfer_1.Transfer.fromPartial(object.transfer) : undefined; return message; } }; -function createBaseQueryPerpetualResponse() { - return { - perpetual: undefined - }; +function createBaseMsgCreateTransferResponse() { + return {}; } -exports.QueryPerpetualResponse = { - encode(message, writer = _m0.Writer.create()) { - if (message.perpetual !== undefined) { - perpetual_1.Perpetual.encode(message.perpetual, writer.uint32(10).fork()).ldelim(); - } +exports.MsgCreateTransferResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPerpetualResponse(); + const message = createBaseMsgCreateTransferResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.perpetual = perpetual_1.Perpetual.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -191058,34 +193407,25 @@ exports.QueryPerpetualResponse = { } return message; }, - fromPartial(object) { - const message = createBaseQueryPerpetualResponse(); - message.perpetual = object.perpetual !== undefined && object.perpetual !== null ? perpetual_1.Perpetual.fromPartial(object.perpetual) : undefined; + fromPartial(_) { + const message = createBaseMsgCreateTransferResponse(); return message; } }; -function createBaseQueryAllPerpetualsRequest() { - return { - pagination: undefined - }; +function createBaseMsgDepositToSubaccountResponse() { + return {}; } -exports.QueryAllPerpetualsRequest = { - encode(message, writer = _m0.Writer.create()) { - if (message.pagination !== undefined) { - pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } +exports.MsgDepositToSubaccountResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllPerpetualsRequest(); + const message = createBaseMsgDepositToSubaccountResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -191093,41 +193433,25 @@ exports.QueryAllPerpetualsRequest = { } return message; }, - fromPartial(object) { - const message = createBaseQueryAllPerpetualsRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; + fromPartial(_) { + const message = createBaseMsgDepositToSubaccountResponse(); return message; } }; -function createBaseQueryAllPerpetualsResponse() { - return { - perpetual: [], - pagination: undefined - }; +function createBaseMsgWithdrawFromSubaccountResponse() { + return {}; } -exports.QueryAllPerpetualsResponse = { - encode(message, writer = _m0.Writer.create()) { - for (const v of message.perpetual) { - perpetual_1.Perpetual.encode(v, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } +exports.MsgWithdrawFromSubaccountResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllPerpetualsResponse(); + const message = createBaseMsgWithdrawFromSubaccountResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.perpetual.push(perpetual_1.Perpetual.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -191135,36 +193459,25 @@ exports.QueryAllPerpetualsResponse = { } return message; }, - fromPartial(object) { - var _a; - const message = createBaseQueryAllPerpetualsResponse(); - message.perpetual = ((_a = object.perpetual) === null || _a === void 0 ? void 0 : _a.map(e => perpetual_1.Perpetual.fromPartial(e))) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + fromPartial(_) { + const message = createBaseMsgWithdrawFromSubaccountResponse(); return message; } }; -function createBaseQueryAllLiquidityTiersRequest() { - return { - pagination: undefined - }; +function createBaseMsgSendFromModuleToAccountResponse() { + return {}; } -exports.QueryAllLiquidityTiersRequest = { - encode(message, writer = _m0.Writer.create()) { - if (message.pagination !== undefined) { - pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } +exports.MsgSendFromModuleToAccountResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllLiquidityTiersRequest(); + const message = createBaseMsgSendFromModuleToAccountResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -191172,40 +193485,71 @@ exports.QueryAllLiquidityTiersRequest = { } return message; }, - fromPartial(object) { - const message = createBaseQueryAllLiquidityTiersRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; + fromPartial(_) { + const message = createBaseMsgSendFromModuleToAccountResponse(); return message; } }; -function createBaseQueryAllLiquidityTiersResponse() { +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc2VuZGluZy90eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHlDQUF1RDtBQUN2RCx3REFBMEM7QUF3RDFDLFNBQVMsMkJBQTJCO0lBQ2xDLE9BQU87UUFDTCxRQUFRLEVBQUUsU0FBUztLQUNwQixDQUFDO0FBQ0osQ0FBQztBQUVZLFFBQUEsaUJBQWlCLEdBQUc7SUFDL0Is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E1BQU0sS0FBSyxTQUFTLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxHQUFHLEdBQUcsTUFBTSxDQUFDO1FBQ2xFLE1BQU0sT0FBTyxHQUFHLDRDQUE0QyxFQUFFLENBQUM7UUFFL0QsT0FBTyxNQUFNLENBQUMsR0FBRyxHQUFHLEdBQUcsRUFBRTtZQUN2QixNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7WUFFNUIsUUFBUSxHQUFHLEtBQUssQ0FBQyxFQUFFO2dCQUNqQjtvQkFDRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztvQkFDekIsTUFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLENBQWtEO1FBQzVELE1BQU0sT0FBTyxHQUFHLDRDQUE0QyxFQUFFLENBQUM7UUFDL0QsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/params.ts": +/*!**************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/params.ts ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Params = void 0; +const duration_1 = __webpack_require__(/*! ../../google/protobuf/duration */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/google/protobuf/duration.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseParams() { return { - liquidityTiers: [], - pagination: undefined + windowDuration: undefined }; } -exports.QueryAllLiquidityTiersResponse = { +exports.Params = { encode(message, writer = _m0.Writer.create()) { - for (const v of message.liquidityTiers) { - perpetual_1.LiquidityTier.encode(v, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + if (message.windowDuration !== undefined) { + duration_1.Duration.encode(message.windowDuration, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllLiquidityTiersResponse(); + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.liquidityTiers.push(perpetual_1.LiquidityTier.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); + message.windowDuration = duration_1.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -191215,24 +193559,62 @@ exports.QueryAllLiquidityTiersResponse = { return message; }, fromPartial(object) { - var _a; - const message = createBaseQueryAllLiquidityTiersResponse(); - message.liquidityTiers = ((_a = object.liquidityTiers) === null || _a === void 0 ? void 0 : _a.map(e => perpetual_1.LiquidityTier.fromPartial(e))) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + const message = createBaseParams(); + message.windowDuration = object.windowDuration !== undefined && object.windowDuration !== null ? duration_1.Duration.fromPartial(object.windowDuration) : undefined; return message; } }; -function createBaseQueryPremiumVotesRequest() { +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3N0YXRzL3BhcmFtcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDZEQUEyRTtBQUMzRSx3REFBMEM7QUFjMUMsU0FBUyxnQkFBZ0I7SUFDdkIsT0FBTztRQUNMLGNBQWMsRUFBRSxTQUFTO0tBQzFCLENBQUM7QUFDSixDQUFDO0FBRVksUUFBQSxNQUFNLEdBQUc7SUFDcEIsTUFBTSxDQUFDLE9BQWUsRUFBRSxTQUFxQixHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUM5RCxJQUFJLE9BQU8sQ0FBQyxjQUFjLEtBQUssU0FBUyxFQUFFO1lBQ3hDLG1CQUFRLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxjQUFjLEVBQUUsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDO1NBQzVFO1FBRUQsT0FBTyxNQUFNLENBQUM7SUFDaEIsQ0FBQztJQUVELE1BQU0sQ0FBQyxLQUE4QixF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DQUFDLG1CQUFRLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQ3pKLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/query.ts": +/*!*************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/query.ts ***! + \*************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.QueryUserStatsResponse = exports.QueryUserStatsRequest = exports.QueryGlobalStatsResponse = exports.QueryGlobalStatsRequest = exports.QueryStatsMetadataResponse = exports.QueryStatsMetadataRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = void 0; +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/params.ts"); +const stats_1 = __webpack_require__(/*! ./stats */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/stats.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseQueryParamsRequest() { return {}; } -exports.QueryPremiumVotesRequest = { +exports.QueryParamsRequest = { encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPremiumVotesRequest(); + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -191244,31 +193626,31 @@ exports.QueryPremiumVotesRequest = { return message; }, fromPartial(_) { - const message = createBaseQueryPremiumVotesRequest(); + const message = createBaseQueryParamsRequest(); return message; } }; -function createBaseQueryPremiumVotesResponse() { +function createBaseQueryParamsResponse() { return { - premiumVotes: undefined + params: undefined }; } -exports.QueryPremiumVotesResponse = { +exports.QueryParamsResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.premiumVotes !== undefined) { - perpetual_1.PremiumStore.encode(message.premiumVotes, writer.uint32(10).fork()).ldelim(); + if (message.params !== undefined) { + params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPremiumVotesResponse(); + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.premiumVotes = perpetual_1.PremiumStore.decode(reader, reader.uint32()); + message.params = params_1.Params.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -191278,22 +193660,22 @@ exports.QueryPremiumVotesResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryPremiumVotesResponse(); - message.premiumVotes = object.premiumVotes !== undefined && object.premiumVotes !== null ? perpetual_1.PremiumStore.fromPartial(object.premiumVotes) : undefined; + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; return message; } }; -function createBaseQueryPremiumSamplesRequest() { +function createBaseQueryStatsMetadataRequest() { return {}; } -exports.QueryPremiumSamplesRequest = { +exports.QueryStatsMetadataRequest = { encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPremiumSamplesRequest(); + const message = createBaseQueryStatsMetadataRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -191305,31 +193687,31 @@ exports.QueryPremiumSamplesRequest = { return message; }, fromPartial(_) { - const message = createBaseQueryPremiumSamplesRequest(); + const message = createBaseQueryStatsMetadataRequest(); return message; } }; -function createBaseQueryPremiumSamplesResponse() { +function createBaseQueryStatsMetadataResponse() { return { - premiumSamples: undefined + metadata: undefined }; } -exports.QueryPremiumSamplesResponse = { +exports.QueryStatsMetadataResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.premiumSamples !== undefined) { - perpetual_1.PremiumStore.encode(message.premiumSamples, writer.uint32(10).fork()).ldelim(); + if (message.metadata !== undefined) { + stats_1.StatsMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPremiumSamplesResponse(); + const message = createBaseQueryStatsMetadataResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.premiumSamples = perpetual_1.PremiumStore.decode(reader, reader.uint32()); + message.metadata = stats_1.StatsMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -191339,22 +193721,22 @@ exports.QueryPremiumSamplesResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryPremiumSamplesResponse(); - message.premiumSamples = object.premiumSamples !== undefined && object.premiumSamples !== null ? perpetual_1.PremiumStore.fromPartial(object.premiumSamples) : undefined; + const message = createBaseQueryStatsMetadataResponse(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? stats_1.StatsMetadata.fromPartial(object.metadata) : undefined; return message; } }; -function createBaseQueryParamsRequest() { +function createBaseQueryGlobalStatsRequest() { return {}; } -exports.QueryParamsRequest = { +exports.QueryGlobalStatsRequest = { encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const message = createBaseQueryGlobalStatsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -191366,31 +193748,31 @@ exports.QueryParamsRequest = { return message; }, fromPartial(_) { - const message = createBaseQueryParamsRequest(); + const message = createBaseQueryGlobalStatsRequest(); return message; } }; -function createBaseQueryParamsResponse() { +function createBaseQueryGlobalStatsResponse() { return { - params: undefined + stats: undefined }; } -exports.QueryParamsResponse = { +exports.QueryGlobalStatsResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.params !== undefined) { - params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + if (message.stats !== undefined) { + stats_1.GlobalStats.encode(message.stats, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const message = createBaseQueryGlobalStatsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.params = params_1.Params.decode(reader, reader.uint32()); + message.stats = stats_1.GlobalStats.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -191400,79 +193782,32 @@ exports.QueryParamsResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryParamsResponse(); - message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; + const message = createBaseQueryGlobalStatsResponse(); + message.stats = object.stats !== undefined && object.stats !== null ? stats_1.GlobalStats.fromPartial(object.stats) : undefined; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcGVycGV0dWFscy9xdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDJFQUFnSTtBQUNoSSwyQ0FBa0k7QUFDbEkscUNBQWlEO0FBQ2pELHdEQUEwQztBQTRJMUMsU0FBUywrQkFBK0I7SUFDdEMsT0FBTztRQUNMLEVBQUUsRUFBRSxDQUFDO0tBQ04sQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBLHFCQUFxQixHQUFHO0lBQ25DLE1BQU0sQ0FBQyxPQUE4QixFQUFFLFNBQXFCLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQzdFLElBQUksT0FBTyxDQUFDLEVBQUUsS0FBSyxDQUFDLEVBQUU7WUFDcEIsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO1NBQ3JDO1FBRUQsT0FBTyxNQUFNLENBQUM7SUFDaEIsQ0FBQztJQUVELE1BQU0sQ0FBQyxLQUE4QixFQUFFLE1BQWU7UUFDcEQsTUFBTSxNQUFNLEdBQUcsS0FBSyxZQUFZLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsSUFBSSxHQUFHLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQy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"./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx.ts": -/*!***************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx.ts ***! - \***************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MsgUpdateParamsResponse = exports.MsgUpdateParams = exports.MsgAddPremiumVotesResponse = exports.MsgAddPremiumVotes = exports.FundingPremium = exports.MsgUpdatePerpetualParamsResponse = exports.MsgUpdatePerpetualParams = exports.MsgSetLiquidityTierResponse = exports.MsgSetLiquidityTier = exports.MsgCreatePerpetualResponse = exports.MsgCreatePerpetual = void 0; -const perpetual_1 = __webpack_require__(/*! ./perpetual */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual.ts"); -const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/params.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseMsgCreatePerpetual() { +function createBaseQueryUserStatsRequest() { return { - authority: "", - params: undefined + user: "" }; } -exports.MsgCreatePerpetual = { +exports.QueryUserStatsRequest = { encode(message, writer = _m0.Writer.create()) { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - if (message.params !== undefined) { - perpetual_1.PerpetualParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + if (message.user !== "") { + writer.uint32(10).string(message.user); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreatePerpetual(); + const message = createBaseQueryUserStatsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string(); - break; - case 2: - message.params = perpetual_1.PerpetualParams.decode(reader, reader.uint32()); + message.user = reader.string(); break; default: reader.skipType(tag & 7); @@ -191483,26 +193818,33 @@ exports.MsgCreatePerpetual = { }, fromPartial(object) { var _a; - const message = createBaseMsgCreatePerpetual(); - message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; - message.params = object.params !== undefined && object.params !== null ? perpetual_1.PerpetualParams.fromPartial(object.params) : undefined; + const message = createBaseQueryUserStatsRequest(); + message.user = (_a = object.user) !== null && _a !== void 0 ? _a : ""; return message; } }; -function createBaseMsgCreatePerpetualResponse() { - return {}; +function createBaseQueryUserStatsResponse() { + return { + stats: undefined + }; } -exports.MsgCreatePerpetualResponse = { - encode(_, writer = _m0.Writer.create()) { +exports.QueryUserStatsResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.stats !== undefined) { + stats_1.UserStats.encode(message.stats, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreatePerpetualResponse(); + const message = createBaseQueryUserStatsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.stats = stats_1.UserStats.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -191510,39 +193852,73 @@ exports.MsgCreatePerpetualResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgCreatePerpetualResponse(); + fromPartial(object) { + const message = createBaseQueryUserStatsResponse(); + message.stats = object.stats !== undefined && object.stats !== null ? stats_1.UserStats.fromPartial(object.stats) : undefined; return message; } }; -function createBaseMsgSetLiquidityTier() { +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc3RhdHMvcXVlcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxxQ0FBaUQ7QUFDakQsbUNBQTRIO0FBQzVILHdEQUEwQztBQW9GMUMsU0FBUyw0QkFBNEI7SUFDbkMsT0FBTyxFQUFFLENBQUM7QUFDWixDQUFDO0FBRVksUUFBQSxrQkFBa0IsR0FBRztJQUNoQyxNQUFNLENBQUMsQ0FBcUIsRUFBRSxTQUFxQixHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUNwRSxPQUFPLE1BQU0sQ0FBQztJQUNoQixDQUFDO0lBRUQsTUFBTSxDQUFDLEtBQThCLEVBQUUsTUFBZTtRQUNwRCxNQUFNLE1BQU0sR0FBRyxLQUFLLFlBQVksR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxJQUFJLEdBQUcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDM0UsSUFBSSxHQUFHLEdB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JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUEyQztRQUNyRCxNQUFNLE9BQU8sR0FBRyxnQ0FBZ0MsRUFBRSxDQUFDO1FBQ25ELE9BQU8sQ0FBQyxLQUFLLEdBQUcsTUFBTSxDQUFDLEtBQUssS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLEtBQUssS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGlCQUFTLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQ3RILE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/stats.ts": +/*!*************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/stats.ts ***! + \*************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CachedStakeAmount = exports.UserStats = exports.GlobalStats = exports.EpochStats_UserWithStats = exports.EpochStats = exports.StatsMetadata = exports.BlockStats_Fill = exports.BlockStats = void 0; +const timestamp_1 = __webpack_require__(/*! ../../google/protobuf/timestamp */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/google/protobuf/timestamp.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +function createBaseBlockStats() { return { - authority: "", - liquidityTier: undefined + fills: [] }; } -exports.MsgSetLiquidityTier = { +exports.BlockStats = { encode(message, writer = _m0.Writer.create()) { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - if (message.liquidityTier !== undefined) { - perpetual_1.LiquidityTier.encode(message.liquidityTier, writer.uint32(18).fork()).ldelim(); + for (const v of message.fills) { + exports.BlockStats_Fill.encode(v, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetLiquidityTier(); + const message = createBaseBlockStats(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string(); - break; - case 2: - message.liquidityTier = perpetual_1.LiquidityTier.decode(reader, reader.uint32()); + message.fills.push(exports.BlockStats_Fill.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -191553,66 +193929,46 @@ exports.MsgSetLiquidityTier = { }, fromPartial(object) { var _a; - const message = createBaseMsgSetLiquidityTier(); - message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; - message.liquidityTier = object.liquidityTier !== undefined && object.liquidityTier !== null ? perpetual_1.LiquidityTier.fromPartial(object.liquidityTier) : undefined; - return message; - } -}; -function createBaseMsgSetLiquidityTierResponse() { - return {}; -} -exports.MsgSetLiquidityTierResponse = { - encode(_, writer = _m0.Writer.create()) { - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetLiquidityTierResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_) { - const message = createBaseMsgSetLiquidityTierResponse(); + const message = createBaseBlockStats(); + message.fills = ((_a = object.fills) === null || _a === void 0 ? void 0 : _a.map(e => exports.BlockStats_Fill.fromPartial(e))) || []; return message; } }; -function createBaseMsgUpdatePerpetualParams() { +function createBaseBlockStats_Fill() { return { - authority: "", - perpetualParams: undefined + taker: "", + maker: "", + notional: helpers_1.Long.UZERO }; } -exports.MsgUpdatePerpetualParams = { +exports.BlockStats_Fill = { encode(message, writer = _m0.Writer.create()) { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); + if (message.taker !== "") { + writer.uint32(10).string(message.taker); } - if (message.perpetualParams !== undefined) { - perpetual_1.PerpetualParams.encode(message.perpetualParams, writer.uint32(18).fork()).ldelim(); + if (message.maker !== "") { + writer.uint32(18).string(message.maker); + } + if (!message.notional.isZero()) { + writer.uint32(24).uint64(message.notional); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdatePerpetualParams(); + const message = createBaseBlockStats_Fill(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string(); + message.taker = reader.string(); break; case 2: - message.perpetualParams = perpetual_1.PerpetualParams.decode(reader, reader.uint32()); + message.maker = reader.string(); + break; + case 3: + message.notional = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -191622,27 +193978,36 @@ exports.MsgUpdatePerpetualParams = { return message; }, fromPartial(object) { - var _a; - const message = createBaseMsgUpdatePerpetualParams(); - message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; - message.perpetualParams = object.perpetualParams !== undefined && object.perpetualParams !== null ? perpetual_1.PerpetualParams.fromPartial(object.perpetualParams) : undefined; + var _a, _b; + const message = createBaseBlockStats_Fill(); + message.taker = (_a = object.taker) !== null && _a !== void 0 ? _a : ""; + message.maker = (_b = object.maker) !== null && _b !== void 0 ? _b : ""; + message.notional = object.notional !== undefined && object.notional !== null ? helpers_1.Long.fromValue(object.notional) : helpers_1.Long.UZERO; return message; } }; -function createBaseMsgUpdatePerpetualParamsResponse() { - return {}; +function createBaseStatsMetadata() { + return { + trailingEpoch: 0 + }; } -exports.MsgUpdatePerpetualParamsResponse = { - encode(_, writer = _m0.Writer.create()) { +exports.StatsMetadata = { + encode(message, writer = _m0.Writer.create()) { + if (message.trailingEpoch !== 0) { + writer.uint32(8).uint32(message.trailingEpoch); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdatePerpetualParamsResponse(); + const message = createBaseStatsMetadata(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.trailingEpoch = reader.uint32(); + break; default: reader.skipType(tag & 7); break; @@ -191650,39 +194015,41 @@ exports.MsgUpdatePerpetualParamsResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgUpdatePerpetualParamsResponse(); + fromPartial(object) { + var _a; + const message = createBaseStatsMetadata(); + message.trailingEpoch = (_a = object.trailingEpoch) !== null && _a !== void 0 ? _a : 0; return message; } }; -function createBaseFundingPremium() { +function createBaseEpochStats() { return { - perpetualId: 0, - premiumPpm: 0 + epochEndTime: undefined, + stats: [] }; } -exports.FundingPremium = { +exports.EpochStats = { encode(message, writer = _m0.Writer.create()) { - if (message.perpetualId !== 0) { - writer.uint32(8).uint32(message.perpetualId); + if (message.epochEndTime !== undefined) { + timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.epochEndTime), writer.uint32(10).fork()).ldelim(); } - if (message.premiumPpm !== 0) { - writer.uint32(16).int32(message.premiumPpm); + for (const v of message.stats) { + exports.EpochStats_UserWithStats.encode(v, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFundingPremium(); + const message = createBaseEpochStats(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.perpetualId = reader.uint32(); + message.epochEndTime = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32())); break; case 2: - message.premiumPpm = reader.int32(); + message.stats.push(exports.EpochStats_UserWithStats.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -191693,33 +194060,40 @@ exports.FundingPremium = { }, fromPartial(object) { var _a, _b; - const message = createBaseFundingPremium(); - message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; - message.premiumPpm = (_b = object.premiumPpm) !== null && _b !== void 0 ? _b : 0; + const message = createBaseEpochStats(); + message.epochEndTime = (_a = object.epochEndTime) !== null && _a !== void 0 ? _a : undefined; + message.stats = ((_b = object.stats) === null || _b === void 0 ? void 0 : _b.map(e => exports.EpochStats_UserWithStats.fromPartial(e))) || []; return message; } }; -function createBaseMsgAddPremiumVotes() { +function createBaseEpochStats_UserWithStats() { return { - votes: [] + user: "", + stats: undefined }; } -exports.MsgAddPremiumVotes = { +exports.EpochStats_UserWithStats = { encode(message, writer = _m0.Writer.create()) { - for (const v of message.votes) { - exports.FundingPremium.encode(v, writer.uint32(10).fork()).ldelim(); + if (message.user !== "") { + writer.uint32(10).string(message.user); + } + if (message.stats !== undefined) { + exports.UserStats.encode(message.stats, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAddPremiumVotes(); + const message = createBaseEpochStats_UserWithStats(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.votes.push(exports.FundingPremium.decode(reader, reader.uint32())); + message.user = reader.string(); + break; + case 2: + message.stats = exports.UserStats.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -191730,25 +194104,34 @@ exports.MsgAddPremiumVotes = { }, fromPartial(object) { var _a; - const message = createBaseMsgAddPremiumVotes(); - message.votes = ((_a = object.votes) === null || _a === void 0 ? void 0 : _a.map(e => exports.FundingPremium.fromPartial(e))) || []; + const message = createBaseEpochStats_UserWithStats(); + message.user = (_a = object.user) !== null && _a !== void 0 ? _a : ""; + message.stats = object.stats !== undefined && object.stats !== null ? exports.UserStats.fromPartial(object.stats) : undefined; return message; } }; -function createBaseMsgAddPremiumVotesResponse() { - return {}; +function createBaseGlobalStats() { + return { + notionalTraded: helpers_1.Long.UZERO + }; } -exports.MsgAddPremiumVotesResponse = { - encode(_, writer = _m0.Writer.create()) { +exports.GlobalStats = { + encode(message, writer = _m0.Writer.create()) { + if (!message.notionalTraded.isZero()) { + writer.uint32(8).uint64(message.notionalTraded); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgAddPremiumVotesResponse(); + const message = createBaseGlobalStats(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.notionalTraded = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -191756,39 +194139,40 @@ exports.MsgAddPremiumVotesResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgAddPremiumVotesResponse(); + fromPartial(object) { + const message = createBaseGlobalStats(); + message.notionalTraded = object.notionalTraded !== undefined && object.notionalTraded !== null ? helpers_1.Long.fromValue(object.notionalTraded) : helpers_1.Long.UZERO; return message; } }; -function createBaseMsgUpdateParams() { +function createBaseUserStats() { return { - authority: "", - params: undefined + takerNotional: helpers_1.Long.UZERO, + makerNotional: helpers_1.Long.UZERO }; } -exports.MsgUpdateParams = { +exports.UserStats = { encode(message, writer = _m0.Writer.create()) { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); + if (!message.takerNotional.isZero()) { + writer.uint32(8).uint64(message.takerNotional); } - if (message.params !== undefined) { - params_1.Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + if (!message.makerNotional.isZero()) { + writer.uint32(16).uint64(message.makerNotional); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateParams(); + const message = createBaseUserStats(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string(); + message.takerNotional = reader.uint64(); break; case 2: - message.params = params_1.Params.decode(reader, reader.uint32()); + message.makerNotional = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -191798,27 +194182,41 @@ exports.MsgUpdateParams = { return message; }, fromPartial(object) { - var _a; - const message = createBaseMsgUpdateParams(); - message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; - message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; + const message = createBaseUserStats(); + message.takerNotional = object.takerNotional !== undefined && object.takerNotional !== null ? helpers_1.Long.fromValue(object.takerNotional) : helpers_1.Long.UZERO; + message.makerNotional = object.makerNotional !== undefined && object.makerNotional !== null ? helpers_1.Long.fromValue(object.makerNotional) : helpers_1.Long.UZERO; return message; } }; -function createBaseMsgUpdateParamsResponse() { - return {}; +function createBaseCachedStakeAmount() { + return { + stakedAmount: new Uint8Array(), + cachedAt: helpers_1.Long.ZERO + }; } -exports.MsgUpdateParamsResponse = { - encode(_, writer = _m0.Writer.create()) { +exports.CachedStakeAmount = { + encode(message, writer = _m0.Writer.create()) { + if (message.stakedAmount.length !== 0) { + writer.uint32(10).bytes(message.stakedAmount); + } + if (!message.cachedAt.isZero()) { + writer.uint32(16).int64(message.cachedAt); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateParamsResponse(); + const message = createBaseCachedStakeAmount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.stakedAmount = reader.bytes(); + break; + case 2: + message.cachedAt = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -191826,19 +194224,22 @@ exports.MsgUpdateParamsResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgUpdateParamsResponse(); + fromPartial(object) { + var _a; + const message = createBaseCachedStakeAmount(); + message.stakedAmount = (_a = object.stakedAmount) !== null && _a !== void 0 ? _a : new Uint8Array(); + message.cachedAt = object.cachedAt !== undefined && object.cachedAt !== null ? helpers_1.Long.fromValue(object.cachedAt) : helpers_1.Long.ZERO; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcGVycGV0dWFscy90eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDJDQUEyRztBQUMzRyxxQ0FBaUQ7QUFDakQsd0RBQTBDO0FBOEoxQyxTQUFTLDRCQUE0QjtJQUNuQyxPQUFPO1FBQ0wsU0FBUyxFQUFFLEVBQUU7UUFDYixNQUFNLEVBQUUsU0FBUztLQUNsQixDQUFDO0FBQ0osQ0FBQztBQUVZLFFBQUEsa0JBQWtCLEdBQUc7SUFDaE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FNO2FBQ1Q7U0FDRjtRQUVELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7SUFFRCxXQUFXLENBQUMsTUFBc0M7O1FBQ2hELE1BQU0sT0FBTyxHQUFHLDJCQUEyQixFQUFFLENBQUM7UUFDOUMsT0FBTyxDQUFDLFlBQVksR0FBRyxNQUFBLE1BQU0sQ0FBQyxZQUFZLG1DQUFJLElBQUksVUFBVSxFQUFFLENBQUM7UUFDL0QsT0FBTyxDQUFDLFFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsUUFBUSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxJQUFJLENBQUM7UUFDM0gsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts": -/*!*********************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts ***! - \*********************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/asset_position.ts": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/asset_position.ts ***! + \****************************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -191867,64 +194268,44 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MarketParam = void 0; +exports.AssetPosition = void 0; +const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseMarketParam() { +function createBaseAssetPosition() { return { - id: 0, - pair: "", - exponent: 0, - minExchanges: 0, - minPriceChangePpm: 0, - exchangeConfigJson: "" + assetId: 0, + quantums: new Uint8Array(), + index: helpers_1.Long.UZERO }; } -exports.MarketParam = { +exports.AssetPosition = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); - } - if (message.pair !== "") { - writer.uint32(18).string(message.pair); - } - if (message.exponent !== 0) { - writer.uint32(24).sint32(message.exponent); - } - if (message.minExchanges !== 0) { - writer.uint32(32).uint32(message.minExchanges); + if (message.assetId !== 0) { + writer.uint32(8).uint32(message.assetId); } - if (message.minPriceChangePpm !== 0) { - writer.uint32(40).uint32(message.minPriceChangePpm); + if (message.quantums.length !== 0) { + writer.uint32(18).bytes(message.quantums); } - if (message.exchangeConfigJson !== "") { - writer.uint32(50).string(message.exchangeConfigJson); + if (!message.index.isZero()) { + writer.uint32(24).uint64(message.index); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMarketParam(); + const message = createBaseAssetPosition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.assetId = reader.uint32(); break; case 2: - message.pair = reader.string(); + message.quantums = reader.bytes(); break; case 3: - message.exponent = reader.sint32(); - break; - case 4: - message.minExchanges = reader.uint32(); - break; - case 5: - message.minPriceChangePpm = reader.uint32(); - break; - case 6: - message.exchangeConfigJson = reader.string(); + message.index = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -191934,25 +194315,22 @@ exports.MarketParam = { return message; }, fromPartial(object) { - var _a, _b, _c, _d, _e, _f; - const message = createBaseMarketParam(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; - message.pair = (_b = object.pair) !== null && _b !== void 0 ? _b : ""; - message.exponent = (_c = object.exponent) !== null && _c !== void 0 ? _c : 0; - message.minExchanges = (_d = object.minExchanges) !== null && _d !== void 0 ? _d : 0; - message.minPriceChangePpm = (_e = object.minPriceChangePpm) !== null && _e !== void 0 ? _e : 0; - message.exchangeConfigJson = (_f = object.exchangeConfigJson) !== null && _f !== void 0 ? _f : ""; + var _a, _b; + const message = createBaseAssetPosition(); + message.assetId = (_a = object.assetId) !== null && _a !== void 0 ? _a : 0; + message.quantums = (_b = object.quantums) !== null && _b !== void 0 ? _b : new Uint8Array(); + message.index = object.index !== undefined && object.index !== null ? helpers_1.Long.fromValue(object.index) : helpers_1.Long.UZERO; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2V0X3BhcmFtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3ByaWNlcy9tYXJrZXRfcGFyYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSx3REFBMEM7QUEwRDFDLFNBQVMscUJBQXFCO0lBQzVCLE9BQU87UUFDTCxFQUFFLEVBQUUsQ0FBQztRQUNMLElBQUksRUFBRSxFQUFFO1FBQ1IsUUFBUSxFQUFFLENBQUM7UUFDWCxZQUFZLEVBQUUsQ0FBQztRQUNmLGlCQUFpQixFQUFFLENBQUM7UUFDcEIsa0JBQWtCLEVBQUUsRUFBRTtLQUN2QixDQUFDO0FBQ0osQ0FBQztBQUVZLFFBQUEsV0FBVyxHQUFHO0lBQ3pCLE1BQU0sQ0FBQyxPQUFvQixFQUFFLFNBQXFCLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQ25FLElBQUksT0FBTyxDQUFDLEVBQUUsS0FBSy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sT0FBTyxDQUFDO0lBQ2pCLENBQUM7SUFFRCxXQUFXLENBQUMsTUFBa0M7O1FBQzVDLE1BQU0sT0FBTyxHQUFHLHVCQUF1QixFQUFFLENBQUM7UUFDMUMsT0FBTyxDQUFDLE9BQU8sR0FBRyxNQUFBLE1BQU0sQ0FBQyxPQUFPLG1DQUFJLENBQUMsQ0FBQztRQUN0QyxPQUFPLENBQUMsUUFBUSxHQUFHLE1BQUEsTUFBTSxDQUFDLFFBQVEsbUNBQUksSUFBSSxVQUFVLEVBQUUsQ0FBQztRQUN2RCxPQUFPLENBQUMsS0FBSyxHQUFHLE1BQU0sQ0FBQyxLQUFLLEtBQUssU0FBUyxJQUFJLE1BQU0sQ0FBQyxLQUFLLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLEtBQUssQ0FBQztRQUNoSCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_price.ts": -/*!*********************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_price.ts ***! - \*********************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/perpetual_position.ts": +/*!********************************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/perpetual_position.ts ***! + \********************************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -191981,44 +194359,50 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MarketPrice = void 0; -const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); +exports.PerpetualPosition = void 0; const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseMarketPrice() { +function createBasePerpetualPosition() { return { - id: 0, - exponent: 0, - price: helpers_1.Long.UZERO + perpetualId: 0, + quantums: new Uint8Array(), + fundingIndex: new Uint8Array(), + quoteBalance: new Uint8Array() }; } -exports.MarketPrice = { +exports.PerpetualPosition = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); } - if (message.exponent !== 0) { - writer.uint32(16).sint32(message.exponent); + if (message.quantums.length !== 0) { + writer.uint32(18).bytes(message.quantums); } - if (!message.price.isZero()) { - writer.uint32(24).uint64(message.price); + if (message.fundingIndex.length !== 0) { + writer.uint32(26).bytes(message.fundingIndex); + } + if (message.quoteBalance.length !== 0) { + writer.uint32(34).bytes(message.quoteBalance); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMarketPrice(); + const message = createBasePerpetualPosition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.perpetualId = reader.uint32(); break; case 2: - message.exponent = reader.sint32(); + message.quantums = reader.bytes(); break; case 3: - message.price = reader.uint64(); + message.fundingIndex = reader.bytes(); + break; + case 4: + message.quoteBalance = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -192028,22 +194412,23 @@ exports.MarketPrice = { return message; }, fromPartial(object) { - var _a, _b; - const message = createBaseMarketPrice(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; - message.exponent = (_b = object.exponent) !== null && _b !== void 0 ? _b : 0; - message.price = object.price !== undefined && object.price !== null ? helpers_1.Long.fromValue(object.price) : helpers_1.Long.UZERO; + var _a, _b, _c, _d; + const message = createBasePerpetualPosition(); + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; + message.quantums = (_b = object.quantums) !== null && _b !== void 0 ? _b : new Uint8Array(); + message.fundingIndex = (_c = object.fundingIndex) !== null && _c !== void 0 ? _c : new Uint8Array(); + message.quoteBalance = (_d = object.quoteBalance) !== null && _d !== void 0 ? _d : new Uint8Array(); return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2V0X3ByaWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3ByaWNlcy9tYXJrZXRfcHJpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBa0Q7QUFDbEQsd0RBQTBDO0FBMkIxQyxTQUFTLHFCQUFxQjtJQUM1QixPQUFPO1FBQ0wsRUFBRSxFQUFFLENBQUM7UUFDTCxRQUFRLEVBQUUsQ0FBQztRQUNYLEtBQUssRUFBRSxjQUFJLENBQUMsS0FBSztLQUNsQixDQUFDO0FBQ0osQ0FBQztBQUVZLFFBQUEsV0FBVyxHQUFHO0lBQ3pCLE1BQU0sQ0FBQyxPQUFvQixFQUFFLFNBQXFCLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQ25FLElBQUksT0FBTyxDQUFDLEVBQUUsS0FBSyxDQUFDLEVBQUU7WUFDcEIsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO1NBQ3JDO1FBRUQsSUFBSSxPQUFPLENBQUMsUUFBUSxLQUFLLENBQUMsRUFBRTtZQU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sQ0FBQztvQkFDdEMsTUFBTTtnQkFFUixLQUFLLENBQUM7b0JBQ0osT0FBTyxDQUFDLFlBQVksR0FBRyxNQUFNLENBQUMsS0FBSyxFQUFFLENBQUM7b0JBQ3RDLE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUFzQzs7UUFDaEQsTUFBTSxPQUFPLEdBQUcsMkJBQTJCLEVBQUUsQ0FBQztRQUM5QyxPQUFPLENBQUMsV0FBVyxHQUFHLE1BQUEsTUFBTSxDQUFDLFdBQVcsbUNBQUksQ0FBQyxDQUFDO1FBQzlDLE9BQU8sQ0FBQyxRQUFRLEdBQUcsTUFBQSxNQUFNLENBQUMsUUFBUSxtQ0FBSSxJQUFJLFVBQVUsRUFBRSxDQUFDO1FBQ3ZELE9BQU8sQ0FBQyxZQUFZLEdBQUcsTUFBQSxNQUFNLENBQUMsWUFBWSxtQ0FBSSxJQUFJLFVBQVUsRUFBRSxDQUFDO1FBQy9ELE9BQU8sQ0FBQyxZQUFZLEdBQUcsTUFBQSxNQUFNLENBQUMsWUFBWSxtQ0FBSSxJQUFJLFVBQVUsRUFBRSxDQUFDO1FBQy9ELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/query.ts": -/*!**************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/query.ts ***! - \**************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/query.ts": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/query.ts ***! + \*******************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -192072,32 +194457,38 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.QueryAllMarketParamsResponse = exports.QueryAllMarketParamsRequest = exports.QueryMarketParamResponse = exports.QueryMarketParamRequest = exports.QueryAllMarketPricesResponse = exports.QueryAllMarketPricesRequest = exports.QueryMarketPriceResponse = exports.QueryMarketPriceRequest = void 0; +exports.QueryCollateralPoolAddressResponse = exports.QueryCollateralPoolAddressRequest = exports.QueryGetWithdrawalAndTransfersBlockedInfoResponse = exports.QueryGetWithdrawalAndTransfersBlockedInfoRequest = exports.QuerySubaccountAllResponse = exports.QueryAllSubaccountRequest = exports.QuerySubaccountResponse = exports.QueryGetSubaccountRequest = void 0; const pagination_1 = __webpack_require__(/*! ../../cosmos/base/query/v1beta1/pagination */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts"); -const market_price_1 = __webpack_require__(/*! ./market_price */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_price.ts"); -const market_param_1 = __webpack_require__(/*! ./market_param */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts"); +const subaccount_1 = __webpack_require__(/*! ./subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseQueryMarketPriceRequest() { +function createBaseQueryGetSubaccountRequest() { return { - id: 0 + owner: "", + number: 0 }; } -exports.QueryMarketPriceRequest = { +exports.QueryGetSubaccountRequest = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMarketPriceRequest(); + const message = createBaseQueryGetSubaccountRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.owner = reader.string(); + break; + case 2: + message.number = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -192107,33 +194498,34 @@ exports.QueryMarketPriceRequest = { return message; }, fromPartial(object) { - var _a; - const message = createBaseQueryMarketPriceRequest(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + var _a, _b; + const message = createBaseQueryGetSubaccountRequest(); + message.owner = (_a = object.owner) !== null && _a !== void 0 ? _a : ""; + message.number = (_b = object.number) !== null && _b !== void 0 ? _b : 0; return message; } }; -function createBaseQueryMarketPriceResponse() { +function createBaseQuerySubaccountResponse() { return { - marketPrice: undefined + subaccount: undefined }; } -exports.QueryMarketPriceResponse = { +exports.QuerySubaccountResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.marketPrice !== undefined) { - market_price_1.MarketPrice.encode(message.marketPrice, writer.uint32(10).fork()).ldelim(); + if (message.subaccount !== undefined) { + subaccount_1.Subaccount.encode(message.subaccount, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMarketPriceResponse(); + const message = createBaseQuerySubaccountResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.marketPrice = market_price_1.MarketPrice.decode(reader, reader.uint32()); + message.subaccount = subaccount_1.Subaccount.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -192143,17 +194535,17 @@ exports.QueryMarketPriceResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryMarketPriceResponse(); - message.marketPrice = object.marketPrice !== undefined && object.marketPrice !== null ? market_price_1.MarketPrice.fromPartial(object.marketPrice) : undefined; + const message = createBaseQuerySubaccountResponse(); + message.subaccount = object.subaccount !== undefined && object.subaccount !== null ? subaccount_1.Subaccount.fromPartial(object.subaccount) : undefined; return message; } }; -function createBaseQueryAllMarketPricesRequest() { +function createBaseQueryAllSubaccountRequest() { return { pagination: undefined }; } -exports.QueryAllMarketPricesRequest = { +exports.QueryAllSubaccountRequest = { encode(message, writer = _m0.Writer.create()) { if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -192163,7 +194555,7 @@ exports.QueryAllMarketPricesRequest = { decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllMarketPricesRequest(); + const message = createBaseQueryAllSubaccountRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -192178,21 +194570,21 @@ exports.QueryAllMarketPricesRequest = { return message; }, fromPartial(object) { - const message = createBaseQueryAllMarketPricesRequest(); + const message = createBaseQueryAllSubaccountRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; } }; -function createBaseQueryAllMarketPricesResponse() { +function createBaseQuerySubaccountAllResponse() { return { - marketPrices: [], + subaccount: [], pagination: undefined }; } -exports.QueryAllMarketPricesResponse = { +exports.QuerySubaccountAllResponse = { encode(message, writer = _m0.Writer.create()) { - for (const v of message.marketPrices) { - market_price_1.MarketPrice.encode(v, writer.uint32(10).fork()).ldelim(); + for (const v of message.subaccount) { + subaccount_1.Subaccount.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -192202,12 +194594,12 @@ exports.QueryAllMarketPricesResponse = { decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllMarketPricesResponse(); + const message = createBaseQuerySubaccountAllResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.marketPrices.push(market_price_1.MarketPrice.decode(reader, reader.uint32())); + message.subaccount.push(subaccount_1.Subaccount.decode(reader, reader.uint32())); break; case 2: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); @@ -192221,33 +194613,33 @@ exports.QueryAllMarketPricesResponse = { }, fromPartial(object) { var _a; - const message = createBaseQueryAllMarketPricesResponse(); - message.marketPrices = ((_a = object.marketPrices) === null || _a === void 0 ? void 0 : _a.map(e => market_price_1.MarketPrice.fromPartial(e))) || []; + const message = createBaseQuerySubaccountAllResponse(); + message.subaccount = ((_a = object.subaccount) === null || _a === void 0 ? void 0 : _a.map(e => subaccount_1.Subaccount.fromPartial(e))) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; return message; } }; -function createBaseQueryMarketParamRequest() { +function createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest() { return { - id: 0 + perpetualId: 0 }; } -exports.QueryMarketParamRequest = { +exports.QueryGetWithdrawalAndTransfersBlockedInfoRequest = { encode(message, writer = _m0.Writer.create()) { - if (message.id !== 0) { - writer.uint32(8).uint32(message.id); + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMarketParamRequest(); + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint32(); + message.perpetualId = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -192258,32 +194650,46 @@ exports.QueryMarketParamRequest = { }, fromPartial(object) { var _a; - const message = createBaseQueryMarketParamRequest(); - message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0; + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(); + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; return message; } }; -function createBaseQueryMarketParamResponse() { +function createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse() { return { - marketParam: undefined + negativeTncSubaccountSeenAtBlock: 0, + chainOutageSeenAtBlock: 0, + withdrawalsAndTransfersUnblockedAtBlock: 0 }; } -exports.QueryMarketParamResponse = { +exports.QueryGetWithdrawalAndTransfersBlockedInfoResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.marketParam !== undefined) { - market_param_1.MarketParam.encode(message.marketParam, writer.uint32(10).fork()).ldelim(); + if (message.negativeTncSubaccountSeenAtBlock !== 0) { + writer.uint32(8).uint32(message.negativeTncSubaccountSeenAtBlock); + } + if (message.chainOutageSeenAtBlock !== 0) { + writer.uint32(16).uint32(message.chainOutageSeenAtBlock); + } + if (message.withdrawalsAndTransfersUnblockedAtBlock !== 0) { + writer.uint32(24).uint32(message.withdrawalsAndTransfersUnblockedAtBlock); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMarketParamResponse(); + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.marketParam = market_param_1.MarketParam.decode(reader, reader.uint32()); + message.negativeTncSubaccountSeenAtBlock = reader.uint32(); + break; + case 2: + message.chainOutageSeenAtBlock = reader.uint32(); + break; + case 3: + message.withdrawalsAndTransfersUnblockedAtBlock = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -192293,32 +194699,35 @@ exports.QueryMarketParamResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryMarketParamResponse(); - message.marketParam = object.marketParam !== undefined && object.marketParam !== null ? market_param_1.MarketParam.fromPartial(object.marketParam) : undefined; + var _a, _b, _c; + const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(); + message.negativeTncSubaccountSeenAtBlock = (_a = object.negativeTncSubaccountSeenAtBlock) !== null && _a !== void 0 ? _a : 0; + message.chainOutageSeenAtBlock = (_b = object.chainOutageSeenAtBlock) !== null && _b !== void 0 ? _b : 0; + message.withdrawalsAndTransfersUnblockedAtBlock = (_c = object.withdrawalsAndTransfersUnblockedAtBlock) !== null && _c !== void 0 ? _c : 0; return message; } }; -function createBaseQueryAllMarketParamsRequest() { +function createBaseQueryCollateralPoolAddressRequest() { return { - pagination: undefined + perpetualId: 0 }; } -exports.QueryAllMarketParamsRequest = { +exports.QueryCollateralPoolAddressRequest = { encode(message, writer = _m0.Writer.create()) { - if (message.pagination !== undefined) { - pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllMarketParamsRequest(); + const message = createBaseQueryCollateralPoolAddressRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); + message.perpetualId = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -192328,39 +194737,33 @@ exports.QueryAllMarketParamsRequest = { return message; }, fromPartial(object) { - const message = createBaseQueryAllMarketParamsRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; + var _a; + const message = createBaseQueryCollateralPoolAddressRequest(); + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; return message; } }; -function createBaseQueryAllMarketParamsResponse() { +function createBaseQueryCollateralPoolAddressResponse() { return { - marketParams: [], - pagination: undefined + collateralPoolAddress: "" }; } -exports.QueryAllMarketParamsResponse = { +exports.QueryCollateralPoolAddressResponse = { encode(message, writer = _m0.Writer.create()) { - for (const v of message.marketParams) { - market_param_1.MarketParam.encode(v, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + if (message.collateralPoolAddress !== "") { + writer.uint32(10).string(message.collateralPoolAddress); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllMarketParamsResponse(); + const message = createBaseQueryCollateralPoolAddressResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.marketParams.push(market_param_1.MarketParam.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); + message.collateralPoolAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -192371,20 +194774,19 @@ exports.QueryAllMarketParamsResponse = { }, fromPartial(object) { var _a; - const message = createBaseQueryAllMarketParamsResponse(); - message.marketParams = ((_a = object.marketParams) === null || _a === void 0 ? void 0 : _a.map(e => market_param_1.MarketParam.fromPartial(e))) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + const message = createBaseQueryCollateralPoolAddressResponse(); + message.collateralPoolAddress = (_a = object.collateralPoolAddress) !== null && _a !== void 0 ? _a : ""; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcHJpY2VzL3F1ZXJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkVBQWdJO0FBQ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BQUcsR0FBRyxHQUFHLEVBQUU7WUFDdkIsTUFBTSxHQUFHLEdBQUcsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDO1lBRTVCLFFBQVEsR0FBRyxLQUFLLENBQUMsRUFBRTtnQkFDakIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyxxQkFBcUIsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7b0JBQ2hELE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUF1RDs7UUFDakUsTUFBTSxPQUFPLEdBQUcsNENBQTRDLEVBQUUsQ0FBQztRQUMvRCxPQUFPLENBQUMscUJBQXFCLEdBQUcsTUFBQSxNQUFNLENBQUMscUJBQXFCLG1DQUFJLEVBQUUsQ0FBQztRQUNuRSxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx.ts": -/*!***********************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx.ts ***! - \***********************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/streaming.ts": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/streaming.ts ***! + \***********************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -192413,68 +194815,53 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MsgUpdateMarketParamResponse = exports.MsgUpdateMarketParam = exports.MsgUpdateMarketPricesResponse = exports.MsgUpdateMarketPrices_MarketPrice = exports.MsgUpdateMarketPrices = exports.MsgCreateOracleMarketResponse = exports.MsgCreateOracleMarket = void 0; -const market_param_1 = __webpack_require__(/*! ./market_param */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/market_param.ts"); +exports.SubaccountAssetPosition = exports.SubaccountPerpetualPosition = exports.StreamSubaccountUpdate = void 0; +const subaccount_1 = __webpack_require__(/*! ./subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); -function createBaseMsgCreateOracleMarket() { +function createBaseStreamSubaccountUpdate() { return { - authority: "", - params: undefined + subaccountId: undefined, + updatedPerpetualPositions: [], + updatedAssetPositions: [], + snapshot: false }; } -exports.MsgCreateOracleMarket = { +exports.StreamSubaccountUpdate = { encode(message, writer = _m0.Writer.create()) { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); + if (message.subaccountId !== undefined) { + subaccount_1.SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); } - if (message.params !== undefined) { - market_param_1.MarketParam.encode(message.params, writer.uint32(18).fork()).ldelim(); + for (const v of message.updatedPerpetualPositions) { + exports.SubaccountPerpetualPosition.encode(v, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.updatedAssetPositions) { + exports.SubaccountAssetPosition.encode(v, writer.uint32(26).fork()).ldelim(); + } + if (message.snapshot === true) { + writer.uint32(32).bool(message.snapshot); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateOracleMarket(); + const message = createBaseStreamSubaccountUpdate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string(); + message.subaccountId = subaccount_1.SubaccountId.decode(reader, reader.uint32()); break; case 2: - message.params = market_param_1.MarketParam.decode(reader, reader.uint32()); + message.updatedPerpetualPositions.push(exports.SubaccountPerpetualPosition.decode(reader, reader.uint32())); break; - default: - reader.skipType(tag & 7); + case 3: + message.updatedAssetPositions.push(exports.SubaccountAssetPosition.decode(reader, reader.uint32())); + break; + case 4: + message.snapshot = reader.bool(); break; - } - } - return message; - }, - fromPartial(object) { - var _a; - const message = createBaseMsgCreateOracleMarket(); - message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; - message.params = object.params !== undefined && object.params !== null ? market_param_1.MarketParam.fromPartial(object.params) : undefined; - return message; - } -}; -function createBaseMsgCreateOracleMarketResponse() { - return {}; -} -exports.MsgCreateOracleMarketResponse = { - encode(_, writer = _m0.Writer.create()) { - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateOracleMarketResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { default: reader.skipType(tag & 7); break; @@ -192482,32 +194869,44 @@ exports.MsgCreateOracleMarketResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgCreateOracleMarketResponse(); + fromPartial(object) { + var _a, _b, _c; + const message = createBaseStreamSubaccountUpdate(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.SubaccountId.fromPartial(object.subaccountId) : undefined; + message.updatedPerpetualPositions = ((_a = object.updatedPerpetualPositions) === null || _a === void 0 ? void 0 : _a.map(e => exports.SubaccountPerpetualPosition.fromPartial(e))) || []; + message.updatedAssetPositions = ((_b = object.updatedAssetPositions) === null || _b === void 0 ? void 0 : _b.map(e => exports.SubaccountAssetPosition.fromPartial(e))) || []; + message.snapshot = (_c = object.snapshot) !== null && _c !== void 0 ? _c : false; return message; } }; -function createBaseMsgUpdateMarketPrices() { +function createBaseSubaccountPerpetualPosition() { return { - marketPriceUpdates: [] + perpetualId: 0, + quantums: helpers_1.Long.UZERO }; } -exports.MsgUpdateMarketPrices = { +exports.SubaccountPerpetualPosition = { encode(message, writer = _m0.Writer.create()) { - for (const v of message.marketPriceUpdates) { - exports.MsgUpdateMarketPrices_MarketPrice.encode(v, writer.uint32(10).fork()).ldelim(); + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + if (!message.quantums.isZero()) { + writer.uint32(16).uint64(message.quantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateMarketPrices(); + const message = createBaseSubaccountPerpetualPosition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.marketPriceUpdates.push(exports.MsgUpdateMarketPrices_MarketPrice.decode(reader, reader.uint32())); + message.perpetualId = reader.uint32(); + break; + case 2: + message.quantums = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -192518,39 +194917,40 @@ exports.MsgUpdateMarketPrices = { }, fromPartial(object) { var _a; - const message = createBaseMsgUpdateMarketPrices(); - message.marketPriceUpdates = ((_a = object.marketPriceUpdates) === null || _a === void 0 ? void 0 : _a.map(e => exports.MsgUpdateMarketPrices_MarketPrice.fromPartial(e))) || []; + const message = createBaseSubaccountPerpetualPosition(); + message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; return message; } }; -function createBaseMsgUpdateMarketPrices_MarketPrice() { +function createBaseSubaccountAssetPosition() { return { - marketId: 0, - price: helpers_1.Long.UZERO + assetId: 0, + quantums: helpers_1.Long.UZERO }; } -exports.MsgUpdateMarketPrices_MarketPrice = { +exports.SubaccountAssetPosition = { encode(message, writer = _m0.Writer.create()) { - if (message.marketId !== 0) { - writer.uint32(8).uint32(message.marketId); + if (message.assetId !== 0) { + writer.uint32(8).uint32(message.assetId); } - if (!message.price.isZero()) { - writer.uint32(16).uint64(message.price); + if (!message.quantums.isZero()) { + writer.uint32(16).uint64(message.quantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateMarketPrices_MarketPrice(); + const message = createBaseSubaccountAssetPosition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.marketId = reader.uint32(); + message.assetId = reader.uint32(); break; case 2: - message.price = reader.uint64(); + message.quantums = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -192561,66 +194961,80 @@ exports.MsgUpdateMarketPrices_MarketPrice = { }, fromPartial(object) { var _a; - const message = createBaseMsgUpdateMarketPrices_MarketPrice(); - message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : 0; - message.price = object.price !== undefined && object.price !== null ? helpers_1.Long.fromValue(object.price) : helpers_1.Long.UZERO; + const message = createBaseSubaccountAssetPosition(); + message.assetId = (_a = object.assetId) !== null && _a !== void 0 ? _a : 0; + message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; return message; } }; -function createBaseMsgUpdateMarketPricesResponse() { - return {}; -} -exports.MsgUpdateMarketPricesResponse = { - encode(_, writer = _m0.Writer.create()) { - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateMarketPricesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_) { - const message = createBaseMsgUpdateMarketPricesResponse(); - return message; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyZWFtaW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNv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UUFDdEMsT0FBTyxDQUFDLFFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsUUFBUSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxLQUFLLENBQUM7UUFDNUgsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== + +/***/ }), + +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts": +/*!************************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts ***! + \************************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; -function createBaseMsgUpdateMarketParam() { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Subaccount = exports.SubaccountId = void 0; +const asset_position_1 = __webpack_require__(/*! ./asset_position */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/asset_position.ts"); +const perpetual_position_1 = __webpack_require__(/*! ./perpetual_position */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/perpetual_position.ts"); +const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); +function createBaseSubaccountId() { return { - authority: "", - marketParam: undefined + owner: "", + number: 0 }; } -exports.MsgUpdateMarketParam = { +exports.SubaccountId = { encode(message, writer = _m0.Writer.create()) { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); + if (message.owner !== "") { + writer.uint32(10).string(message.owner); } - if (message.marketParam !== undefined) { - market_param_1.MarketParam.encode(message.marketParam, writer.uint32(18).fork()).ldelim(); + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateMarketParam(); + const message = createBaseSubaccountId(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string(); + message.owner = reader.string(); break; case 2: - message.marketParam = market_param_1.MarketParam.decode(reader, reader.uint32()); + message.number = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -192630,27 +195044,56 @@ exports.MsgUpdateMarketParam = { return message; }, fromPartial(object) { - var _a; - const message = createBaseMsgUpdateMarketParam(); - message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; - message.marketParam = object.marketParam !== undefined && object.marketParam !== null ? market_param_1.MarketParam.fromPartial(object.marketParam) : undefined; + var _a, _b; + const message = createBaseSubaccountId(); + message.owner = (_a = object.owner) !== null && _a !== void 0 ? _a : ""; + message.number = (_b = object.number) !== null && _b !== void 0 ? _b : 0; return message; } }; -function createBaseMsgUpdateMarketParamResponse() { - return {}; +function createBaseSubaccount() { + return { + id: undefined, + assetPositions: [], + perpetualPositions: [], + marginEnabled: false + }; } -exports.MsgUpdateMarketParamResponse = { - encode(_, writer = _m0.Writer.create()) { +exports.Subaccount = { + encode(message, writer = _m0.Writer.create()) { + if (message.id !== undefined) { + exports.SubaccountId.encode(message.id, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.assetPositions) { + asset_position_1.AssetPosition.encode(v, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.perpetualPositions) { + perpetual_position_1.PerpetualPosition.encode(v, writer.uint32(26).fork()).ldelim(); + } + if (message.marginEnabled === true) { + writer.uint32(32).bool(message.marginEnabled); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateMarketParamResponse(); + const message = createBaseSubaccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.id = exports.SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.assetPositions.push(asset_position_1.AssetPosition.decode(reader, reader.uint32())); + break; + case 3: + message.perpetualPositions.push(perpetual_position_1.PerpetualPosition.decode(reader, reader.uint32())); + break; + case 4: + message.marginEnabled = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -192658,19 +195101,24 @@ exports.MsgUpdateMarketParamResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgUpdateMarketParamResponse(); + fromPartial(object) { + var _a, _b, _c; + const message = createBaseSubaccount(); + message.id = object.id !== undefined && object.id !== null ? exports.SubaccountId.fromPartial(object.id) : undefined; + message.assetPositions = ((_a = object.assetPositions) === null || _a === void 0 ? void 0 : _a.map(e => asset_position_1.AssetPosition.fromPartial(e))) || []; + message.perpetualPositions = ((_b = object.perpetualPositions) === null || _b === void 0 ? void 0 : _b.map(e => perpetual_position_1.PerpetualPosition.fromPartial(e))) || []; + message.marginEnabled = (_c = object.marginEnabled) !== null && _c !== void 0 ? _c : false; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2VSb290Ij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R0FBRyxNQUFBLE1BQU0sQ0FBQyxhQUFhLG1DQUFJLEtBQUssQ0FBQztRQUN0RCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/capacity.ts": -/*!********************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/capacity.ts ***! - \********************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/params.ts": +/*!**************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/params.ts ***! + \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -192699,37 +195147,71 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LimiterCapacity = exports.DenomCapacity = void 0; -const limit_params_1 = __webpack_require__(/*! ./limit_params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts"); +exports.Params = exports.OperatorParams = exports.VaultParams = exports.QuotingParams = void 0; const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseDenomCapacity() { +function createBaseQuotingParams() { return { - denom: "", - capacityList: [] + layers: 0, + spreadMinPpm: 0, + spreadBufferPpm: 0, + skewFactorPpm: 0, + orderSizePctPpm: 0, + orderExpirationSeconds: 0, + activationThresholdQuoteQuantums: new Uint8Array() }; } -exports.DenomCapacity = { +exports.QuotingParams = { encode(message, writer = _m0.Writer.create()) { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); + if (message.layers !== 0) { + writer.uint32(8).uint32(message.layers); } - for (const v of message.capacityList) { - writer.uint32(18).bytes(v); + if (message.spreadMinPpm !== 0) { + writer.uint32(16).uint32(message.spreadMinPpm); + } + if (message.spreadBufferPpm !== 0) { + writer.uint32(24).uint32(message.spreadBufferPpm); + } + if (message.skewFactorPpm !== 0) { + writer.uint32(32).uint32(message.skewFactorPpm); + } + if (message.orderSizePctPpm !== 0) { + writer.uint32(40).uint32(message.orderSizePctPpm); + } + if (message.orderExpirationSeconds !== 0) { + writer.uint32(48).uint32(message.orderExpirationSeconds); + } + if (message.activationThresholdQuoteQuantums.length !== 0) { + writer.uint32(58).bytes(message.activationThresholdQuoteQuantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDenomCapacity(); + const message = createBaseQuotingParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.denom = reader.string(); + message.layers = reader.uint32(); break; case 2: - message.capacityList.push(reader.bytes()); + message.spreadMinPpm = reader.uint32(); + break; + case 3: + message.spreadBufferPpm = reader.uint32(); + break; + case 4: + message.skewFactorPpm = reader.uint32(); + break; + case 5: + message.orderSizePctPpm = reader.uint32(); + break; + case 6: + message.orderExpirationSeconds = reader.uint32(); + break; + case 7: + message.activationThresholdQuoteQuantums = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -192739,41 +195221,46 @@ exports.DenomCapacity = { return message; }, fromPartial(object) { - var _a, _b; - const message = createBaseDenomCapacity(); - message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : ""; - message.capacityList = ((_b = object.capacityList) === null || _b === void 0 ? void 0 : _b.map(e => e)) || []; + var _a, _b, _c, _d, _e, _f, _g; + const message = createBaseQuotingParams(); + message.layers = (_a = object.layers) !== null && _a !== void 0 ? _a : 0; + message.spreadMinPpm = (_b = object.spreadMinPpm) !== null && _b !== void 0 ? _b : 0; + message.spreadBufferPpm = (_c = object.spreadBufferPpm) !== null && _c !== void 0 ? _c : 0; + message.skewFactorPpm = (_d = object.skewFactorPpm) !== null && _d !== void 0 ? _d : 0; + message.orderSizePctPpm = (_e = object.orderSizePctPpm) !== null && _e !== void 0 ? _e : 0; + message.orderExpirationSeconds = (_f = object.orderExpirationSeconds) !== null && _f !== void 0 ? _f : 0; + message.activationThresholdQuoteQuantums = (_g = object.activationThresholdQuoteQuantums) !== null && _g !== void 0 ? _g : new Uint8Array(); return message; } }; -function createBaseLimiterCapacity() { +function createBaseVaultParams() { return { - limiter: undefined, - capacity: new Uint8Array() + status: 0, + quotingParams: undefined }; } -exports.LimiterCapacity = { +exports.VaultParams = { encode(message, writer = _m0.Writer.create()) { - if (message.limiter !== undefined) { - limit_params_1.Limiter.encode(message.limiter, writer.uint32(10).fork()).ldelim(); + if (message.status !== 0) { + writer.uint32(8).int32(message.status); } - if (message.capacity.length !== 0) { - writer.uint32(18).bytes(message.capacity); + if (message.quotingParams !== undefined) { + exports.QuotingParams.encode(message.quotingParams, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLimiterCapacity(); + const message = createBaseVaultParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.limiter = limit_params_1.Limiter.decode(reader, reader.uint32()); + message.status = reader.int32(); break; case 2: - message.capacity = reader.bytes(); + message.quotingParams = exports.QuotingParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -192784,20 +195271,140 @@ exports.LimiterCapacity = { }, fromPartial(object) { var _a; - const message = createBaseLimiterCapacity(); - message.limiter = object.limiter !== undefined && object.limiter !== null ? limit_params_1.Limiter.fromPartial(object.limiter) : undefined; - message.capacity = (_a = object.capacity) !== null && _a !== void 0 ? _a : new Uint8Array(); + const message = createBaseVaultParams(); + message.status = (_a = object.status) !== null && _a !== void 0 ? _a : 0; + message.quotingParams = object.quotingParams !== undefined && object.quotingParams !== null ? exports.QuotingParams.fromPartial(object.quotingParams) : undefined; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaW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UUFBUSxHQUFHLE1BQUEsTUFBTSxDQUFDLFFBQVEsbUNBQUksSUFBSSxVQUFVLEVBQUUsQ0FBQztRQUN2RCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 +function createBaseOperatorParams() { + return { + operator: "" + }; +} +exports.OperatorParams = { + encode(message, writer = _m0.Writer.create()) { + if (message.operator !== "") { + writer.uint32(10).string(message.operator); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOperatorParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseOperatorParams(); + message.operator = (_a = object.operator) !== null && _a !== void 0 ? _a : ""; + return message; + } +}; +function createBaseParams() { + return { + layers: 0, + spreadMinPpm: 0, + spreadBufferPpm: 0, + skewFactorPpm: 0, + orderSizePctPpm: 0, + orderExpirationSeconds: 0, + activationThresholdQuoteQuantums: new Uint8Array() + }; +} +exports.Params = { + encode(message, writer = _m0.Writer.create()) { + if (message.layers !== 0) { + writer.uint32(8).uint32(message.layers); + } + if (message.spreadMinPpm !== 0) { + writer.uint32(16).uint32(message.spreadMinPpm); + } + if (message.spreadBufferPpm !== 0) { + writer.uint32(24).uint32(message.spreadBufferPpm); + } + if (message.skewFactorPpm !== 0) { + writer.uint32(32).uint32(message.skewFactorPpm); + } + if (message.orderSizePctPpm !== 0) { + writer.uint32(40).uint32(message.orderSizePctPpm); + } + if (message.orderExpirationSeconds !== 0) { + writer.uint32(48).uint32(message.orderExpirationSeconds); + } + if (message.activationThresholdQuoteQuantums.length !== 0) { + writer.uint32(58).bytes(message.activationThresholdQuoteQuantums); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.layers = reader.uint32(); + break; + case 2: + message.spreadMinPpm = reader.uint32(); + break; + case 3: + message.spreadBufferPpm = reader.uint32(); + break; + case 4: + message.skewFactorPpm = reader.uint32(); + break; + case 5: + message.orderSizePctPpm = reader.uint32(); + break; + case 6: + message.orderExpirationSeconds = reader.uint32(); + break; + case 7: + message.activationThresholdQuoteQuantums = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a, _b, _c, _d, _e, _f, _g; + const message = createBaseParams(); + message.layers = (_a = object.layers) !== null && _a !== void 0 ? _a : 0; + message.spreadMinPpm = (_b = object.spreadMinPpm) !== null && _b !== void 0 ? _b : 0; + message.spreadBufferPpm = (_c = object.spreadBufferPpm) !== null && _c !== void 0 ? _c : 0; + message.skewFactorPpm = (_d = object.skewFactorPpm) !== null && _d !== void 0 ? _d : 0; + message.orderSizePctPpm = (_e = object.orderSizePctPpm) !== null && _e !== void 0 ? _e : 0; + message.orderExpirationSeconds = (_f = object.orderExpirationSeconds) !== null && _f !== void 0 ? _f : 0; + message.activationThresholdQuoteQuantums = (_g = object.activationThresholdQuoteQuantums) !== null && _g !== void 0 ? _g : new Uint8Array(); + return message; + } +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3ZhdWx0L3BhcmFtcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUNBLHdEQUEwQztBQWdJMUMsU0FBUyx1QkFBd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QUNuQyxPQUFPLENBQUMsTUFBTSxHQUFHLE1BQUEsTUFBTSxDQUFDLE1BQU0sbUNBQUksQ0FBQyxDQUFDO1FBQ3BDLE9BQU8sQ0FBQyxZQUFZLEdBQUcsTUFBQSxNQUFNLENBQUMsWUFBWSxtQ0FBSSxDQUFDLENBQUM7UUFDaEQsT0FBTyxDQUFDLGVBQWUsR0FBRyxNQUFBLE1BQU0sQ0FBQyxlQUFlLG1DQUFJLENBQUMsQ0FBQztRQUN0RCxPQUFPLENBQUMsYUFBYSxHQUFHLE1BQUEsTUFBTSxDQUFDLGFBQWEsbUNBQUksQ0FBQyxDQUFDO1FBQ2xELE9BQU8sQ0FBQyxlQUFlLEdBQUcsTUFBQSxNQUFNLENBQUMsZUFBZSxtQ0FBSSxDQUFDLENBQUM7UUFDdEQsT0FBTyxDQUFDLHNCQUFzQixHQUFHLE1BQUEsTUFBTSxDQUFDLHNCQUFzQixtQ0FBSSxDQUFDLENBQUM7UUFDcEUsT0FBTyxDQUFDLGdDQUFnQyxHQUFHLE1BQUEsTUFBTSxDQUFDLGdDQUFnQyxtQ0FBSSxJQUFJLFVBQVUsRUFBRSxDQUFDO1FBQ3ZHLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts": -/*!************************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts ***! - \************************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/query.ts": +/*!*************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/query.ts ***! + \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -192826,37 +195433,118 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Limiter = exports.LimitParams = void 0; -const duration_1 = __webpack_require__(/*! ../../google/protobuf/duration */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/google/protobuf/duration.ts"); +exports.QueryMegavaultWithdrawalInfoResponse = exports.QueryMegavaultWithdrawalInfoRequest = exports.QueryVaultParamsResponse = exports.QueryVaultParamsRequest = exports.QueryMegavaultAllOwnerSharesResponse = exports.QueryMegavaultAllOwnerSharesRequest = exports.QueryMegavaultOwnerSharesResponse = exports.QueryMegavaultOwnerSharesRequest = exports.QueryMegavaultTotalSharesResponse = exports.QueryMegavaultTotalSharesRequest = exports.QueryAllVaultsResponse = exports.QueryAllVaultsRequest = exports.QueryVaultResponse = exports.QueryVaultRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = void 0; +const vault_1 = __webpack_require__(/*! ./vault */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/vault.ts"); +const pagination_1 = __webpack_require__(/*! ../../cosmos/base/query/v1beta1/pagination */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts"); +const share_1 = __webpack_require__(/*! ./share */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/share.ts"); +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/params.ts"); +const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseLimitParams() { +function createBaseQueryParamsRequest() { + return {}; +} +exports.QueryParamsRequest = { + encode(_, writer = _m0.Writer.create()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_) { + const message = createBaseQueryParamsRequest(); + return message; + } +}; +function createBaseQueryParamsResponse() { return { - denom: "", - limiters: [] + params: undefined, + defaultQuotingParams: undefined, + operatorParams: undefined }; } -exports.LimitParams = { +exports.QueryParamsResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); + if (message.params !== undefined) { + params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - for (const v of message.limiters) { - exports.Limiter.encode(v, writer.uint32(18).fork()).ldelim(); + if (message.defaultQuotingParams !== undefined) { + params_1.QuotingParams.encode(message.defaultQuotingParams, writer.uint32(18).fork()).ldelim(); + } + if (message.operatorParams !== undefined) { + params_1.OperatorParams.encode(message.operatorParams, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLimitParams(); + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.denom = reader.string(); + message.params = params_1.Params.decode(reader, reader.uint32()); break; case 2: - message.limiters.push(exports.Limiter.decode(reader, reader.uint32())); + message.defaultQuotingParams = params_1.QuotingParams.decode(reader, reader.uint32()); + break; + case 3: + message.operatorParams = params_1.OperatorParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; + message.defaultQuotingParams = object.defaultQuotingParams !== undefined && object.defaultQuotingParams !== null ? params_1.QuotingParams.fromPartial(object.defaultQuotingParams) : undefined; + message.operatorParams = object.operatorParams !== undefined && object.operatorParams !== null ? params_1.OperatorParams.fromPartial(object.operatorParams) : undefined; + return message; + } +}; +function createBaseQueryVaultRequest() { + return { + type: 0, + number: 0 + }; +} +exports.QueryVaultRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVaultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.number = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -192867,47 +195555,78 @@ exports.LimitParams = { }, fromPartial(object) { var _a, _b; - const message = createBaseLimitParams(); - message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : ""; - message.limiters = ((_b = object.limiters) === null || _b === void 0 ? void 0 : _b.map(e => exports.Limiter.fromPartial(e))) || []; + const message = createBaseQueryVaultRequest(); + message.type = (_a = object.type) !== null && _a !== void 0 ? _a : 0; + message.number = (_b = object.number) !== null && _b !== void 0 ? _b : 0; return message; } }; -function createBaseLimiter() { +function createBaseQueryVaultResponse() { return { - period: undefined, - baselineMinimum: new Uint8Array(), - baselineTvlPpm: 0 + vaultId: undefined, + subaccountId: undefined, + equity: new Uint8Array(), + inventory: new Uint8Array(), + vaultParams: undefined, + mostRecentClientIds: [] }; } -exports.Limiter = { +exports.QueryVaultResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.period !== undefined) { - duration_1.Duration.encode(message.period, writer.uint32(10).fork()).ldelim(); + if (message.vaultId !== undefined) { + vault_1.VaultId.encode(message.vaultId, writer.uint32(10).fork()).ldelim(); } - if (message.baselineMinimum.length !== 0) { - writer.uint32(26).bytes(message.baselineMinimum); + if (message.subaccountId !== undefined) { + subaccount_1.SubaccountId.encode(message.subaccountId, writer.uint32(18).fork()).ldelim(); } - if (message.baselineTvlPpm !== 0) { - writer.uint32(32).uint32(message.baselineTvlPpm); + if (message.equity.length !== 0) { + writer.uint32(26).bytes(message.equity); + } + if (message.inventory.length !== 0) { + writer.uint32(34).bytes(message.inventory); + } + if (message.vaultParams !== undefined) { + params_1.VaultParams.encode(message.vaultParams, writer.uint32(42).fork()).ldelim(); + } + writer.uint32(50).fork(); + for (const v of message.mostRecentClientIds) { + writer.uint32(v); } + writer.ldelim(); return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLimiter(); + const message = createBaseQueryVaultResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.period = duration_1.Duration.decode(reader, reader.uint32()); + message.vaultId = vault_1.VaultId.decode(reader, reader.uint32()); + break; + case 2: + message.subaccountId = subaccount_1.SubaccountId.decode(reader, reader.uint32()); break; case 3: - message.baselineMinimum = reader.bytes(); + message.equity = reader.bytes(); break; case 4: - message.baselineTvlPpm = reader.uint32(); + message.inventory = reader.bytes(); + break; + case 5: + message.vaultParams = params_1.VaultParams.decode(reader, reader.uint32()); + break; + case 6: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.mostRecentClientIds.push(reader.uint32()); + } + } + else { + message.mostRecentClientIds.push(reader.uint32()); + } break; default: reader.skipType(tag & 7); @@ -192917,68 +195636,39 @@ exports.Limiter = { return message; }, fromPartial(object) { - var _a, _b; - const message = createBaseLimiter(); - message.period = object.period !== undefined && object.period !== null ? duration_1.Duration.fromPartial(object.period) : undefined; - message.baselineMinimum = (_a = object.baselineMinimum) !== null && _a !== void 0 ? _a : new Uint8Array(); - message.baselineTvlPpm = (_b = object.baselineTvlPpm) !== null && _b !== void 0 ? _b : 0; + var _a, _b, _c; + const message = createBaseQueryVaultResponse(); + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? vault_1.VaultId.fromPartial(object.vaultId) : undefined; + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.SubaccountId.fromPartial(object.subaccountId) : undefined; + message.equity = (_a = object.equity) !== null && _a !== void 0 ? _a : new Uint8Array(); + message.inventory = (_b = object.inventory) !== null && _b !== void 0 ? _b : new Uint8Array(); + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? params_1.VaultParams.fromPartial(object.vaultParams) : undefined; + message.mostRecentClientIds = ((_c = object.mostRecentClientIds) === null || _c === void 0 ? void 0 : _c.map(e => e)) || []; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGltaXRfcGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3JhdGVsaW1pdC9saW1pdF9wYXJhbXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSw2REFBMkU7QUFDM0Usd0RBQTBDO0FBc0QxQyxTQUFTLHFCQUFxQjtJQUM1QixPQUFPO1FBQ0wsS0FBSyxFQUFFLEVBQUU7UUFDVCxRQUFRLEVBQUUsRUFBRTtLQUNiLENBQUM7QUFDSixDQUFDO0FBRVksUUFBQSxXQUFXLEdBQUc7SUFDekIsTUFBTSxDQUFDLE9BQW9CLEVBQUUsU0FBcUIsR0FBRyxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUU7UUFDbkUsSUFBSSxPQUFPLENBQUMsS0FBSyxLQUFLLEVBQUUsRUFBRTtZQUN4QixNQUFNLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7U0FDekM7UUFFRCxLQUFLLE1BQU0sQ0FBQyxJQUFJLE9BQU8sQ0FBQyx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xNQUFNLEVBQUUsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7b0JBQzFELE1BQU07Z0JBRVIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyxlQUFlLEdBQUcsTUFBTSxDQUFDLEtBQUssRUFBRSxDQUFDO29CQUN6QyxNQUFNO2dCQUVSLEtBQUssQ0FBQztvQkFDSixPQUFPLENBQUMsY0FBYyxHQUFHLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQztvQkFDekMsTUFBTTtnQkFFUjtvQkFDRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztvQkFDekIsTUFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLE1BQTRCOztRQUN0QyxNQUFNLE9BQU8sR0FBRyxpQkFBaUIsRUFBRSxDQUFDO1FBQ3BDLE9BQU8sQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDLE1BQU0sS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLE1BQU0sS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLG1CQUFRLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQ3pILE9BQU8sQ0FBQyxlQUFlLEdBQUcsTUFBQSxNQUFNLENBQUMsZUFBZSxtQ0FBSSxJQUFJLFVBQVUsRUFBRSxDQUFDO1FBQ3JFLE9BQU8sQ0FBQyxjQUFjLEdBQUcsTUFBQSxNQUFNLENBQUMsY0FBYyxtQ0FBSSxDQUFDLENBQUM7UUFDcEQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/query.ts": -/*!*****************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/query.ts ***! - \*****************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.QueryCapacityByDenomResponse = exports.QueryCapacityByDenomRequest = exports.ListLimitParamsResponse = exports.ListLimitParamsRequest = void 0; -const limit_params_1 = __webpack_require__(/*! ./limit_params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/limit_params.ts"); -const capacity_1 = __webpack_require__(/*! ./capacity */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ratelimit/capacity.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseListLimitParamsRequest() { - return {}; +function createBaseQueryAllVaultsRequest() { + return { + pagination: undefined + }; } -exports.ListLimitParamsRequest = { - encode(_, writer = _m0.Writer.create()) { +exports.QueryAllVaultsRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.pagination !== undefined) { + pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLimitParamsRequest(); + const message = createBaseQueryAllVaultsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -192986,33 +195676,70 @@ exports.ListLimitParamsRequest = { } return message; }, - fromPartial(_) { - const message = createBaseListLimitParamsRequest(); + fromPartial(object) { + const message = createBaseQueryAllVaultsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; } }; -function createBaseListLimitParamsResponse() { +function createBaseQueryAllVaultsResponse() { return { - limitParamsList: [] + vaults: [], + pagination: undefined }; } -exports.ListLimitParamsResponse = { - encode(message, writer = _m0.Writer.create()) { - for (const v of message.limitParamsList) { - limit_params_1.LimitParams.encode(v, writer.uint32(10).fork()).ldelim(); - } +exports.QueryAllVaultsResponse = { + encode(message, writer = _m0.Writer.create()) { + for (const v of message.vaults) { + exports.QueryVaultResponse.encode(v, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllVaultsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaults.push(exports.QueryVaultResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object) { + var _a; + const message = createBaseQueryAllVaultsResponse(); + message.vaults = ((_a = object.vaults) === null || _a === void 0 ? void 0 : _a.map(e => exports.QueryVaultResponse.fromPartial(e))) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; + return message; + } +}; +function createBaseQueryMegavaultTotalSharesRequest() { + return {}; +} +exports.QueryMegavaultTotalSharesRequest = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLimitParamsResponse(); + const message = createBaseQueryMegavaultTotalSharesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.limitParamsList.push(limit_params_1.LimitParams.decode(reader, reader.uint32())); - break; default: reader.skipType(tag & 7); break; @@ -193020,34 +195747,32 @@ exports.ListLimitParamsResponse = { } return message; }, - fromPartial(object) { - var _a; - const message = createBaseListLimitParamsResponse(); - message.limitParamsList = ((_a = object.limitParamsList) === null || _a === void 0 ? void 0 : _a.map(e => limit_params_1.LimitParams.fromPartial(e))) || []; + fromPartial(_) { + const message = createBaseQueryMegavaultTotalSharesRequest(); return message; } }; -function createBaseQueryCapacityByDenomRequest() { +function createBaseQueryMegavaultTotalSharesResponse() { return { - denom: "" + totalShares: undefined }; } -exports.QueryCapacityByDenomRequest = { +exports.QueryMegavaultTotalSharesResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); + if (message.totalShares !== undefined) { + share_1.NumShares.encode(message.totalShares, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCapacityByDenomRequest(); + const message = createBaseQueryMegavaultTotalSharesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.denom = reader.string(); + message.totalShares = share_1.NumShares.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -193057,33 +195782,32 @@ exports.QueryCapacityByDenomRequest = { return message; }, fromPartial(object) { - var _a; - const message = createBaseQueryCapacityByDenomRequest(); - message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : ""; + const message = createBaseQueryMegavaultTotalSharesResponse(); + message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? share_1.NumShares.fromPartial(object.totalShares) : undefined; return message; } }; -function createBaseQueryCapacityByDenomResponse() { +function createBaseQueryMegavaultOwnerSharesRequest() { return { - limiterCapacityList: [] + address: "" }; } -exports.QueryCapacityByDenomResponse = { +exports.QueryMegavaultOwnerSharesRequest = { encode(message, writer = _m0.Writer.create()) { - for (const v of message.limiterCapacityList) { - capacity_1.LimiterCapacity.encode(v, writer.uint32(10).fork()).ldelim(); + if (message.address !== "") { + writer.uint32(10).string(message.address); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCapacityByDenomResponse(); + const message = createBaseQueryMegavaultOwnerSharesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.limiterCapacityList.push(capacity_1.LimiterCapacity.decode(reader, reader.uint32())); + message.address = reader.string(); break; default: reader.skipType(tag & 7); @@ -193094,98 +195818,60 @@ exports.QueryCapacityByDenomResponse = { }, fromPartial(object) { var _a; - const message = createBaseQueryCapacityByDenomResponse(); - message.limiterCapacityList = ((_a = object.limiterCapacityList) === null || _a === void 0 ? void 0 : _a.map(e => capacity_1.LimiterCapacity.fromPartial(e))) || []; + const message = createBaseQueryMegavaultOwnerSharesRequest(); + message.address = (_a = object.address) !== null && _a !== void 0 ? _a : ""; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90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FBQ2xFLE1BQU0sT0FBTyxHQUFHLHNDQUFzQyxFQUFFLENBQUM7UUFFekQsT0FBTyxNQUFNLENBQUMsR0FBRyxHQUFHLEdBQUcsRUFBRTtZQUN2QixNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7WUFFNUIsUUFBUSxHQUFHLEtBQUssQ0FBQyxFQUFFO2dCQUNqQixLQUFLLENBQUM7b0JBQ0osT0FBTyxDQUFDLG1CQUFtQixDQUFDLElBQUksQ0FBQywwQkFBZSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQztvQkFDbEYsTUFBTTtnQkFFUjtvQkFDRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztvQkFDekIsTUFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLE1BQWlEOztRQUMzRCxNQUFNLE9BQU8sR0FBRyxzQ0FBc0MsRUFBRSxDQUFDO1FBQ3pELE9BQU8sQ0FBQyxtQkFBbUIsR0FBRyxDQUFBLE1BQUEsTUFBTSxDQUFDLG1CQUFtQiwwQ0FBRSxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQywwQkFBZSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFJLEVBQUUsQ0FBQztRQUN6RyxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/params.ts": -/*!****************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/params.ts ***! - \****************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Params = void 0; -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseParams() { +function createBaseQueryMegavaultOwnerSharesResponse() { return { - treasuryAccount: "", - denom: "", - denomExponent: 0, - marketId: 0, - feeMultiplierPpm: 0 + address: "", + shares: undefined, + shareUnlocks: [], + equity: new Uint8Array(), + withdrawableEquity: new Uint8Array() }; } -exports.Params = { +exports.QueryMegavaultOwnerSharesResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.treasuryAccount !== "") { - writer.uint32(10).string(message.treasuryAccount); + if (message.address !== "") { + writer.uint32(10).string(message.address); } - if (message.denom !== "") { - writer.uint32(18).string(message.denom); + if (message.shares !== undefined) { + share_1.NumShares.encode(message.shares, writer.uint32(18).fork()).ldelim(); } - if (message.denomExponent !== 0) { - writer.uint32(24).sint32(message.denomExponent); + for (const v of message.shareUnlocks) { + share_1.ShareUnlock.encode(v, writer.uint32(26).fork()).ldelim(); } - if (message.marketId !== 0) { - writer.uint32(32).uint32(message.marketId); + if (message.equity.length !== 0) { + writer.uint32(34).bytes(message.equity); } - if (message.feeMultiplierPpm !== 0) { - writer.uint32(40).uint32(message.feeMultiplierPpm); + if (message.withdrawableEquity.length !== 0) { + writer.uint32(42).bytes(message.withdrawableEquity); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const message = createBaseQueryMegavaultOwnerSharesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.treasuryAccount = reader.string(); + message.address = reader.string(); break; case 2: - message.denom = reader.string(); + message.shares = share_1.NumShares.decode(reader, reader.uint32()); break; case 3: - message.denomExponent = reader.sint32(); + message.shareUnlocks.push(share_1.ShareUnlock.decode(reader, reader.uint32())); break; case 4: - message.marketId = reader.uint32(); + message.equity = reader.bytes(); break; case 5: - message.feeMultiplierPpm = reader.uint32(); + message.withdrawableEquity = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -193195,69 +195881,38 @@ exports.Params = { return message; }, fromPartial(object) { - var _a, _b, _c, _d, _e; - const message = createBaseParams(); - message.treasuryAccount = (_a = object.treasuryAccount) !== null && _a !== void 0 ? _a : ""; - message.denom = (_b = object.denom) !== null && _b !== void 0 ? _b : ""; - message.denomExponent = (_c = object.denomExponent) !== null && _c !== void 0 ? _c : 0; - message.marketId = (_d = object.marketId) !== null && _d !== void 0 ? _d : 0; - message.feeMultiplierPpm = (_e = object.feeMultiplierPpm) !== null && _e !== void 0 ? _e : 0; + var _a, _b, _c, _d; + const message = createBaseQueryMegavaultOwnerSharesResponse(); + message.address = (_a = object.address) !== null && _a !== void 0 ? _a : ""; + message.shares = object.shares !== undefined && object.shares !== null ? share_1.NumShares.fromPartial(object.shares) : undefined; + message.shareUnlocks = ((_b = object.shareUnlocks) === null || _b === void 0 ? void 0 : _b.map(e => share_1.ShareUnlock.fromPartial(e))) || []; + message.equity = (_c = object.equity) !== null && _c !== void 0 ? _c : new Uint8Array(); + message.withdrawableEquity = (_d = object.withdrawableEquity) !== null && _d !== void 0 ? _d : new Uint8Array(); return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3Jld2FyZHMvcGFyYW1zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsd0RBQTBDO0FBc0MxQyxTQUFTLGdCQUFnQjtJQUN2QixPQUFPO1FBQ0wsZUFBZSxFQUFFLEVBQUU7UUFDbkIsS0FBSyxFQUFFLEVBQUU7UUFDVCxhQUFhLEVBQUUsQ0FBQztRQUNoQixRQUFRLEVBQUUsQ0FBQztRQUNYLGdCQUFnQixFQUFFLENBQUM7S0FDcEIsQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBLE1BQU0sR0FBRztJQUNwQixNQUFNLENBQUMsT0FBZSxFQUFFLFNBQXFCLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1FBQzlELElBQUksT0FBTyxDQUFDLGVBQWUsS0FBSyxFQUFFLEVBQUU7WUFDbEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1NBQ25EO1FBRUQsSUFBSSxPQUFPLENBQUMsS0FBSyxLQUFLLEVBQUUsRUFBRTtZQUN4QixNQUFNLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7U0FDekM7UUFFRCxJQUFJLE9BQU8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ENBQUMsQ0FBQztRQUNsRCxPQUFPLENBQUMsUUFBUSxHQUFHLE1BQUEsTUFBTSxDQUFDLFFBQVEsbUNBQUksQ0FBQyxDQUFDO1FBQ3hDLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyxNQUFBLE1BQU0sQ0FBQyxnQkFBZ0IsbUNBQUksQ0FBQyxDQUFDO1FBQ3hELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/query.ts": -/*!***************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/query.ts ***! - \***************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.QueryParamsResponse = exports.QueryParamsRequest = void 0; -const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/rewards/params.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseQueryParamsRequest() { - return {}; +function createBaseQueryMegavaultAllOwnerSharesRequest() { + return { + pagination: undefined + }; } -exports.QueryParamsRequest = { - encode(_, writer = _m0.Writer.create()) { +exports.QueryMegavaultAllOwnerSharesRequest = { + encode(message, writer = _m0.Writer.create()) { + if (message.pagination !== undefined) { + pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const message = createBaseQueryMegavaultAllOwnerSharesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -193265,32 +195920,40 @@ exports.QueryParamsRequest = { } return message; }, - fromPartial(_) { - const message = createBaseQueryParamsRequest(); + fromPartial(object) { + const message = createBaseQueryMegavaultAllOwnerSharesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; } }; -function createBaseQueryParamsResponse() { +function createBaseQueryMegavaultAllOwnerSharesResponse() { return { - params: undefined + ownerShares: [], + pagination: undefined }; } -exports.QueryParamsResponse = { +exports.QueryMegavaultAllOwnerSharesResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.params !== undefined) { - params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + for (const v of message.ownerShares) { + share_1.OwnerShare.encode(v, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const message = createBaseQueryMegavaultAllOwnerSharesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.params = params_1.Params.decode(reader, reader.uint32()); + message.ownerShares.push(share_1.OwnerShare.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -193300,94 +195963,41 @@ exports.QueryParamsResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryParamsResponse(); - message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; + var _a; + const message = createBaseQueryMegavaultAllOwnerSharesResponse(); + message.ownerShares = ((_a = object.ownerShares) === null || _a === void 0 ? void 0 : _a.map(e => share_1.OwnerShare.fromPartial(e))) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvcmV3YXJkcy9xdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHFDQUFpRDtBQUNqRCx3REFBMEM7QUFtQjFDLFNBQVMsNEJBQTRCO0lBQ25DLE9BQU8sRUFBRSxDQUFDO0FBQ1osQ0FBQztBQUVZLFFBQUEsa0JBQWtCLEdBQUc7SUFDaEMsTUFBTSxDQUFDLENBQXFCLEVBQUUsU0FBcUIsR0FBRyxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUU7UUFDcEUsT0FBTyxNQUFNLENBQUM7SUFDaEIsQ0FBQztJQUVELE1BQU0sQ0FBQyxLQUE4QixFQUFFLE1BQWU7UUFDcEQ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RUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUF3QztRQUNsRCxNQUFNLE9BQU8sR0FBRyw2QkFBNkIsRUFBRSxDQUFDO1FBQ2hELE9BQU8sQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDLE1BQU0sS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLE1BQU0sS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGVBQU0sQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDdkgsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts": -/*!******************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts ***! - \******************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MsgSendFromModuleToAccount = exports.MsgWithdrawFromSubaccount = exports.MsgDepositToSubaccount = exports.Transfer = void 0; -const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); -const coin_1 = __webpack_require__(/*! ../../cosmos/base/v1beta1/coin */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/v1beta1/coin.ts"); -const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseTransfer() { +function createBaseQueryVaultParamsRequest() { return { - sender: undefined, - recipient: undefined, - assetId: 0, - amount: helpers_1.Long.UZERO + type: 0, + number: 0 }; } -exports.Transfer = { +exports.QueryVaultParamsRequest = { encode(message, writer = _m0.Writer.create()) { - if (message.sender !== undefined) { - subaccount_1.SubaccountId.encode(message.sender, writer.uint32(10).fork()).ldelim(); - } - if (message.recipient !== undefined) { - subaccount_1.SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim(); - } - if (message.assetId !== 0) { - writer.uint32(24).uint32(message.assetId); + if (message.type !== 0) { + writer.uint32(8).int32(message.type); } - if (!message.amount.isZero()) { - writer.uint32(32).uint64(message.amount); + if (message.number !== 0) { + writer.uint32(16).uint32(message.number); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTransfer(); + const message = createBaseQueryVaultParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = subaccount_1.SubaccountId.decode(reader, reader.uint32()); + message.type = reader.int32(); break; case 2: - message.recipient = subaccount_1.SubaccountId.decode(reader, reader.uint32()); - break; - case 3: - message.assetId = reader.uint32(); - break; - case 4: - message.amount = reader.uint64(); + message.number = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -193397,57 +196007,41 @@ exports.Transfer = { return message; }, fromPartial(object) { - var _a; - const message = createBaseTransfer(); - message.sender = object.sender !== undefined && object.sender !== null ? subaccount_1.SubaccountId.fromPartial(object.sender) : undefined; - message.recipient = object.recipient !== undefined && object.recipient !== null ? subaccount_1.SubaccountId.fromPartial(object.recipient) : undefined; - message.assetId = (_a = object.assetId) !== null && _a !== void 0 ? _a : 0; - message.amount = object.amount !== undefined && object.amount !== null ? helpers_1.Long.fromValue(object.amount) : helpers_1.Long.UZERO; + var _a, _b; + const message = createBaseQueryVaultParamsRequest(); + message.type = (_a = object.type) !== null && _a !== void 0 ? _a : 0; + message.number = (_b = object.number) !== null && _b !== void 0 ? _b : 0; return message; } }; -function createBaseMsgDepositToSubaccount() { +function createBaseQueryVaultParamsResponse() { return { - sender: "", - recipient: undefined, - assetId: 0, - quantums: helpers_1.Long.UZERO + vaultId: undefined, + vaultParams: undefined }; } -exports.MsgDepositToSubaccount = { +exports.QueryVaultParamsResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.recipient !== undefined) { - subaccount_1.SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim(); - } - if (message.assetId !== 0) { - writer.uint32(24).uint32(message.assetId); + if (message.vaultId !== undefined) { + vault_1.VaultId.encode(message.vaultId, writer.uint32(10).fork()).ldelim(); } - if (!message.quantums.isZero()) { - writer.uint32(32).uint64(message.quantums); + if (message.vaultParams !== undefined) { + params_1.VaultParams.encode(message.vaultParams, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDepositToSubaccount(); + const message = createBaseQueryVaultParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.vaultId = vault_1.VaultId.decode(reader, reader.uint32()); break; case 2: - message.recipient = subaccount_1.SubaccountId.decode(reader, reader.uint32()); - break; - case 3: - message.assetId = reader.uint32(); - break; - case 4: - message.quantums = reader.uint64(); + message.vaultParams = params_1.VaultParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -193457,57 +196051,33 @@ exports.MsgDepositToSubaccount = { return message; }, fromPartial(object) { - var _a, _b; - const message = createBaseMsgDepositToSubaccount(); - message.sender = (_a = object.sender) !== null && _a !== void 0 ? _a : ""; - message.recipient = object.recipient !== undefined && object.recipient !== null ? subaccount_1.SubaccountId.fromPartial(object.recipient) : undefined; - message.assetId = (_b = object.assetId) !== null && _b !== void 0 ? _b : 0; - message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; + const message = createBaseQueryVaultParamsResponse(); + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? vault_1.VaultId.fromPartial(object.vaultId) : undefined; + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? params_1.VaultParams.fromPartial(object.vaultParams) : undefined; return message; } }; -function createBaseMsgWithdrawFromSubaccount() { +function createBaseQueryMegavaultWithdrawalInfoRequest() { return { - sender: undefined, - recipient: "", - assetId: 0, - quantums: helpers_1.Long.UZERO + sharesToWithdraw: undefined }; } -exports.MsgWithdrawFromSubaccount = { +exports.QueryMegavaultWithdrawalInfoRequest = { encode(message, writer = _m0.Writer.create()) { - if (message.sender !== undefined) { - subaccount_1.SubaccountId.encode(message.sender, writer.uint32(18).fork()).ldelim(); - } - if (message.recipient !== "") { - writer.uint32(10).string(message.recipient); - } - if (message.assetId !== 0) { - writer.uint32(24).uint32(message.assetId); - } - if (!message.quantums.isZero()) { - writer.uint32(32).uint64(message.quantums); + if (message.sharesToWithdraw !== undefined) { + share_1.NumShares.encode(message.sharesToWithdraw, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawFromSubaccount(); + const message = createBaseQueryMegavaultWithdrawalInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.sender = subaccount_1.SubaccountId.decode(reader, reader.uint32()); - break; case 1: - message.recipient = reader.string(); - break; - case 3: - message.assetId = reader.uint32(); - break; - case 4: - message.quantums = reader.uint64(); + message.sharesToWithdraw = share_1.NumShares.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -193517,57 +196087,53 @@ exports.MsgWithdrawFromSubaccount = { return message; }, fromPartial(object) { - var _a, _b; - const message = createBaseMsgWithdrawFromSubaccount(); - message.sender = object.sender !== undefined && object.sender !== null ? subaccount_1.SubaccountId.fromPartial(object.sender) : undefined; - message.recipient = (_a = object.recipient) !== null && _a !== void 0 ? _a : ""; - message.assetId = (_b = object.assetId) !== null && _b !== void 0 ? _b : 0; - message.quantums = object.quantums !== undefined && object.quantums !== null ? helpers_1.Long.fromValue(object.quantums) : helpers_1.Long.UZERO; + const message = createBaseQueryMegavaultWithdrawalInfoRequest(); + message.sharesToWithdraw = object.sharesToWithdraw !== undefined && object.sharesToWithdraw !== null ? share_1.NumShares.fromPartial(object.sharesToWithdraw) : undefined; return message; } }; -function createBaseMsgSendFromModuleToAccount() { +function createBaseQueryMegavaultWithdrawalInfoResponse() { return { - authority: "", - senderModuleName: "", - recipient: "", - coin: undefined + sharesToWithdraw: undefined, + expectedQuoteQuantums: new Uint8Array(), + megavaultEquity: new Uint8Array(), + totalShares: undefined }; } -exports.MsgSendFromModuleToAccount = { +exports.QueryMegavaultWithdrawalInfoResponse = { encode(message, writer = _m0.Writer.create()) { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); + if (message.sharesToWithdraw !== undefined) { + share_1.NumShares.encode(message.sharesToWithdraw, writer.uint32(10).fork()).ldelim(); } - if (message.senderModuleName !== "") { - writer.uint32(18).string(message.senderModuleName); + if (message.expectedQuoteQuantums.length !== 0) { + writer.uint32(18).bytes(message.expectedQuoteQuantums); } - if (message.recipient !== "") { - writer.uint32(26).string(message.recipient); + if (message.megavaultEquity.length !== 0) { + writer.uint32(26).bytes(message.megavaultEquity); } - if (message.coin !== undefined) { - coin_1.Coin.encode(message.coin, writer.uint32(34).fork()).ldelim(); + if (message.totalShares !== undefined) { + share_1.NumShares.encode(message.totalShares, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSendFromModuleToAccount(); + const message = createBaseQueryMegavaultWithdrawalInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string(); + message.sharesToWithdraw = share_1.NumShares.decode(reader, reader.uint32()); break; case 2: - message.senderModuleName = reader.string(); + message.expectedQuoteQuantums = reader.bytes(); break; case 3: - message.recipient = reader.string(); + message.megavaultEquity = reader.bytes(); break; case 4: - message.coin = coin_1.Coin.decode(reader, reader.uint32()); + message.totalShares = share_1.NumShares.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -193577,23 +196143,23 @@ exports.MsgSendFromModuleToAccount = { return message; }, fromPartial(object) { - var _a, _b, _c; - const message = createBaseMsgSendFromModuleToAccount(); - message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; - message.senderModuleName = (_b = object.senderModuleName) !== null && _b !== void 0 ? _b : ""; - message.recipient = (_c = object.recipient) !== null && _c !== void 0 ? _c : ""; - message.coin = object.coin !== undefined && object.coin !== null ? coin_1.Coin.fromPartial(object.coin) : undefined; + var _a, _b; + const message = createBaseQueryMegavaultWithdrawalInfoResponse(); + message.sharesToWithdraw = object.sharesToWithdraw !== undefined && object.sharesToWithdraw !== null ? share_1.NumShares.fromPartial(object.sharesToWithdraw) : undefined; + message.expectedQuoteQuantums = (_a = object.expectedQuoteQuantums) !== null && _a !== void 0 ? _a : new Uint8Array(); + message.megavaultEquity = (_b = object.megavaultEquity) !== null && _b !== void 0 ? _b : new Uint8Array(); + message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? share_1.NumShares.fromPartial(object.totalShares) : undefined; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc2VuZGluZy90cmFuc2Zlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDBEQUE4RTtBQUM5RSx5REFBbUU7QUFDbkUsMkNBQWtEO0FBQ2xELHdEQUEwQztBQXNIMUMsU0FBUyxrQkFBa0I7SUFDekIsT0FBTztRQUNMLE1BQU0sRUFBRSxTQUFTO1FBQ2pCLFNBQVMsRUFBRSxTQUFTO1FBQ3BCLE9BQU8sRUFBRSxDQUFDO1FBQ1YsTUFBTSxFQUFFLGNBQUksQ0FBQyxLQUFLO0tBQ25CLENBQUM7QUFDSixDQUFDO0FBRVksUUFBQSxRQUFRLEdBQUc7SUFDdEIsTUFBTSxDQUFDLE9BQWlCLEVBQUUsU0FBcUIsR0FBRyxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUU7UUFDaEUsSUFBSSxPQUFPLENBQUMsTUFBTSxLQUFLLFNBQVMsRUFBRTtZQUNoQyx5QkFBWSxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUMsSUFBSSxFQUFFLENBQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztTQUN4RTtRQUVELElBQUksT0FBTyxDQUFDLF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BSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGlCQUFTLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQzlJLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx.ts": -/*!************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx.ts ***! - \************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/share.ts": +/*!*************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/share.ts ***! + \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -193622,30 +196188,29 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MsgSendFromModuleToAccountResponse = exports.MsgWithdrawFromSubaccountResponse = exports.MsgDepositToSubaccountResponse = exports.MsgCreateTransferResponse = exports.MsgCreateTransfer = void 0; -const transfer_1 = __webpack_require__(/*! ./transfer */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts"); +exports.ShareUnlock = exports.OwnerShareUnlocks = exports.OwnerShare = exports.NumShares = void 0; const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseMsgCreateTransfer() { +function createBaseNumShares() { return { - transfer: undefined + numShares: new Uint8Array() }; } -exports.MsgCreateTransfer = { +exports.NumShares = { encode(message, writer = _m0.Writer.create()) { - if (message.transfer !== undefined) { - transfer_1.Transfer.encode(message.transfer, writer.uint32(10).fork()).ldelim(); + if (message.numShares.length !== 0) { + writer.uint32(18).bytes(message.numShares); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateTransfer(); + const message = createBaseNumShares(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.transfer = transfer_1.Transfer.decode(reader, reader.uint32()); + case 2: + message.numShares = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -193655,51 +196220,41 @@ exports.MsgCreateTransfer = { return message; }, fromPartial(object) { - const message = createBaseMsgCreateTransfer(); - message.transfer = object.transfer !== undefined && object.transfer !== null ? transfer_1.Transfer.fromPartial(object.transfer) : undefined; + var _a; + const message = createBaseNumShares(); + message.numShares = (_a = object.numShares) !== null && _a !== void 0 ? _a : new Uint8Array(); return message; } }; -function createBaseMsgCreateTransferResponse() { - return {}; +function createBaseOwnerShare() { + return { + owner: "", + shares: undefined + }; } -exports.MsgCreateTransferResponse = { - encode(_, writer = _m0.Writer.create()) { - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateTransferResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } +exports.OwnerShare = { + encode(message, writer = _m0.Writer.create()) { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.shares !== undefined) { + exports.NumShares.encode(message.shares, writer.uint32(18).fork()).ldelim(); } - return message; - }, - fromPartial(_) { - const message = createBaseMsgCreateTransferResponse(); - return message; - } -}; -function createBaseMsgDepositToSubaccountResponse() { - return {}; -} -exports.MsgDepositToSubaccountResponse = { - encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDepositToSubaccountResponse(); + const message = createBaseOwnerShare(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.shares = exports.NumShares.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -193707,25 +196262,43 @@ exports.MsgDepositToSubaccountResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgDepositToSubaccountResponse(); + fromPartial(object) { + var _a; + const message = createBaseOwnerShare(); + message.owner = (_a = object.owner) !== null && _a !== void 0 ? _a : ""; + message.shares = object.shares !== undefined && object.shares !== null ? exports.NumShares.fromPartial(object.shares) : undefined; return message; } }; -function createBaseMsgWithdrawFromSubaccountResponse() { - return {}; +function createBaseOwnerShareUnlocks() { + return { + ownerAddress: "", + shareUnlocks: [] + }; } -exports.MsgWithdrawFromSubaccountResponse = { - encode(_, writer = _m0.Writer.create()) { +exports.OwnerShareUnlocks = { + encode(message, writer = _m0.Writer.create()) { + if (message.ownerAddress !== "") { + writer.uint32(10).string(message.ownerAddress); + } + for (const v of message.shareUnlocks) { + exports.ShareUnlock.encode(v, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdrawFromSubaccountResponse(); + const message = createBaseOwnerShareUnlocks(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.ownerAddress = reader.string(); + break; + case 2: + message.shareUnlocks.push(exports.ShareUnlock.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -193733,25 +196306,43 @@ exports.MsgWithdrawFromSubaccountResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgWithdrawFromSubaccountResponse(); + fromPartial(object) { + var _a, _b; + const message = createBaseOwnerShareUnlocks(); + message.ownerAddress = (_a = object.ownerAddress) !== null && _a !== void 0 ? _a : ""; + message.shareUnlocks = ((_b = object.shareUnlocks) === null || _b === void 0 ? void 0 : _b.map(e => exports.ShareUnlock.fromPartial(e))) || []; return message; } }; -function createBaseMsgSendFromModuleToAccountResponse() { - return {}; +function createBaseShareUnlock() { + return { + shares: undefined, + unlockBlockHeight: 0 + }; } -exports.MsgSendFromModuleToAccountResponse = { - encode(_, writer = _m0.Writer.create()) { +exports.ShareUnlock = { + encode(message, writer = _m0.Writer.create()) { + if (message.shares !== undefined) { + exports.NumShares.encode(message.shares, writer.uint32(10).fork()).ldelim(); + } + if (message.unlockBlockHeight !== 0) { + writer.uint32(16).uint32(message.unlockBlockHeight); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSendFromModuleToAccountResponse(); + const message = createBaseShareUnlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.shares = exports.NumShares.decode(reader, reader.uint32()); + break; + case 2: + message.unlockBlockHeight = reader.uint32(); + break; default: reader.skipType(tag & 7); break; @@ -193759,19 +196350,22 @@ exports.MsgSendFromModuleToAccountResponse = { } return message; }, - fromPartial(_) { - const message = createBaseMsgSendFromModuleToAccountResponse(); + fromPartial(object) { + var _a; + const message = createBaseShareUnlock(); + message.shares = object.shares !== undefined && object.shares !== null ? exports.NumShares.fromPartial(object.shares) : undefined; + message.unlockBlockHeight = (_a = object.unlockBlockHeight) !== null && _a !== void 0 ? _a : 0; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc2VuZGluZy90eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHlDQUF1RDtBQUN2RCx3REFBMEM7QUF3RDFDLFNBQVMsMkJBQTJCO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EMsT0FBTyxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUMsTUFBTSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsTUFBTSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsaUJBQVMsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7UUFDMUgsT0FBTyxDQUFDLGlCQUFpQixHQUFHLE1BQUEsTUFBTSxDQUFDLGlCQUFpQixtQ0FBSSxDQUFDLENBQUM7UUFDMUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/params.ts": -/*!**************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/params.ts ***! - \**************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/tx.ts": +/*!**********************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/tx.ts ***! + \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -193800,30 +196394,40 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Params = void 0; -const duration_1 = __webpack_require__(/*! ../../google/protobuf/duration */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/google/protobuf/duration.ts"); +exports.MsgRetrieveFromVaultResponse = exports.MsgRetrieveFromVault = exports.MsgAllocateToVaultResponse = exports.MsgAllocateToVault = exports.MsgUpdateOperatorParamsResponse = exports.MsgUpdateOperatorParams = exports.MsgUpdateParams = exports.MsgUnlockSharesResponse = exports.MsgUnlockShares = exports.MsgSetVaultParamsResponse = exports.MsgSetVaultParams = exports.MsgUpdateDefaultQuotingParamsResponse = exports.MsgUpdateDefaultQuotingParams = exports.MsgWithdrawFromMegavaultResponse = exports.MsgWithdrawFromMegavault = exports.MsgDepositToMegavaultResponse = exports.MsgDepositToMegavault = void 0; +const subaccount_1 = __webpack_require__(/*! ../subaccounts/subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); +const share_1 = __webpack_require__(/*! ./share */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/share.ts"); +const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/params.ts"); +const vault_1 = __webpack_require__(/*! ./vault */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/vault.ts"); const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseParams() { +function createBaseMsgDepositToMegavault() { return { - windowDuration: undefined + subaccountId: undefined, + quoteQuantums: new Uint8Array() }; } -exports.Params = { +exports.MsgDepositToMegavault = { encode(message, writer = _m0.Writer.create()) { - if (message.windowDuration !== undefined) { - duration_1.Duration.encode(message.windowDuration, writer.uint32(10).fork()).ldelim(); + if (message.subaccountId !== undefined) { + subaccount_1.SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.quoteQuantums.length !== 0) { + writer.uint32(18).bytes(message.quoteQuantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const message = createBaseMsgDepositToMegavault(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.windowDuration = duration_1.Duration.decode(reader, reader.uint32()); + message.subaccountId = subaccount_1.SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.quoteQuantums = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -193833,65 +196437,35 @@ exports.Params = { return message; }, fromPartial(object) { - const message = createBaseParams(); - message.windowDuration = object.windowDuration !== undefined && object.windowDuration !== null ? duration_1.Duration.fromPartial(object.windowDuration) : undefined; + var _a; + const message = createBaseMsgDepositToMegavault(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.SubaccountId.fromPartial(object.subaccountId) : undefined; + message.quoteQuantums = (_a = object.quoteQuantums) !== null && _a !== void 0 ? _a : new Uint8Array(); return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtcHJvdG8vc3JjL2NvZGVnZW4vZHlkeHByb3RvY29sL3N0YXRzL3BhcmFtcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDZEQUEyRTtBQUMzRSx3REFBMEM7QUFjMUMsU0FBUyxnQkFBZ0I7SUFDdkIsT0FBTztRQUNMLGNBQWMsRUFBRSxTQUFTO0tBQzFCLENBQUM7QUFDSixDQUFDO0FBRVksUUFBQSxNQUFNLEdBQUc7SUFDcEIsTUFBTSxDQUFDLE9BQWUsRUFBRSxTQUFxQixHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUM5RCxJQUFJLE9BQU8sQ0FBQyxjQUFjLEtBQUssU0FBUyxFQUFFO1lBQ3hDLG1CQUFRLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxjQUFjLEVBQUUsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDO1NBQzVFO1FBRUQsT0FBTyxNQUFNLENBQUM7SUFDaEIsQ0FBQztJQUVELE1BQU0sQ0FBQyxLQU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FBQyxDQUFDLG1CQUFRLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQ3pKLE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/query.ts": -/*!*************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/query.ts ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.QueryUserStatsResponse = exports.QueryUserStatsRequest = exports.QueryGlobalStatsResponse = exports.QueryGlobalStatsRequest = exports.QueryStatsMetadataResponse = exports.QueryStatsMetadataRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = void 0; -const params_1 = __webpack_require__(/*! ./params */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/params.ts"); -const stats_1 = __webpack_require__(/*! ./stats */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/stats.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseQueryParamsRequest() { - return {}; +function createBaseMsgDepositToMegavaultResponse() { + return { + mintedShares: undefined + }; } -exports.QueryParamsRequest = { - encode(_, writer = _m0.Writer.create()) { +exports.MsgDepositToMegavaultResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.mintedShares !== undefined) { + share_1.NumShares.encode(message.mintedShares, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const message = createBaseMsgDepositToMegavaultResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.mintedShares = share_1.NumShares.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -193899,32 +196473,47 @@ exports.QueryParamsRequest = { } return message; }, - fromPartial(_) { - const message = createBaseQueryParamsRequest(); + fromPartial(object) { + const message = createBaseMsgDepositToMegavaultResponse(); + message.mintedShares = object.mintedShares !== undefined && object.mintedShares !== null ? share_1.NumShares.fromPartial(object.mintedShares) : undefined; return message; } }; -function createBaseQueryParamsResponse() { +function createBaseMsgWithdrawFromMegavault() { return { - params: undefined + subaccountId: undefined, + shares: undefined, + minQuoteQuantums: new Uint8Array() }; } -exports.QueryParamsResponse = { +exports.MsgWithdrawFromMegavault = { encode(message, writer = _m0.Writer.create()) { - if (message.params !== undefined) { - params_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + if (message.subaccountId !== undefined) { + subaccount_1.SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); + } + if (message.shares !== undefined) { + share_1.NumShares.encode(message.shares, writer.uint32(18).fork()).ldelim(); + } + if (message.minQuoteQuantums.length !== 0) { + writer.uint32(26).bytes(message.minQuoteQuantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); + const message = createBaseMsgWithdrawFromMegavault(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.params = params_1.Params.decode(reader, reader.uint32()); + message.subaccountId = subaccount_1.SubaccountId.decode(reader, reader.uint32()); + break; + case 2: + message.shares = share_1.NumShares.decode(reader, reader.uint32()); + break; + case 3: + message.minQuoteQuantums = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -193934,25 +196523,36 @@ exports.QueryParamsResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryParamsResponse(); - message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; + var _a; + const message = createBaseMsgWithdrawFromMegavault(); + message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? subaccount_1.SubaccountId.fromPartial(object.subaccountId) : undefined; + message.shares = object.shares !== undefined && object.shares !== null ? share_1.NumShares.fromPartial(object.shares) : undefined; + message.minQuoteQuantums = (_a = object.minQuoteQuantums) !== null && _a !== void 0 ? _a : new Uint8Array(); return message; } }; -function createBaseQueryStatsMetadataRequest() { - return {}; +function createBaseMsgWithdrawFromMegavaultResponse() { + return { + quoteQuantums: new Uint8Array() + }; } -exports.QueryStatsMetadataRequest = { - encode(_, writer = _m0.Writer.create()) { +exports.MsgWithdrawFromMegavaultResponse = { + encode(message, writer = _m0.Writer.create()) { + if (message.quoteQuantums.length !== 0) { + writer.uint32(10).bytes(message.quoteQuantums); + } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryStatsMetadataRequest(); + const message = createBaseMsgWithdrawFromMegavaultResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.quoteQuantums = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -193960,32 +196560,41 @@ exports.QueryStatsMetadataRequest = { } return message; }, - fromPartial(_) { - const message = createBaseQueryStatsMetadataRequest(); + fromPartial(object) { + var _a; + const message = createBaseMsgWithdrawFromMegavaultResponse(); + message.quoteQuantums = (_a = object.quoteQuantums) !== null && _a !== void 0 ? _a : new Uint8Array(); return message; } }; -function createBaseQueryStatsMetadataResponse() { +function createBaseMsgUpdateDefaultQuotingParams() { return { - metadata: undefined + authority: "", + defaultQuotingParams: undefined }; } -exports.QueryStatsMetadataResponse = { +exports.MsgUpdateDefaultQuotingParams = { encode(message, writer = _m0.Writer.create()) { - if (message.metadata !== undefined) { - stats_1.StatsMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.defaultQuotingParams !== undefined) { + params_1.QuotingParams.encode(message.defaultQuotingParams, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryStatsMetadataResponse(); + const message = createBaseMsgUpdateDefaultQuotingParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.metadata = stats_1.StatsMetadata.decode(reader, reader.uint32()); + message.authority = reader.string(); + break; + case 2: + message.defaultQuotingParams = params_1.QuotingParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -193995,22 +196604,24 @@ exports.QueryStatsMetadataResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryStatsMetadataResponse(); - message.metadata = object.metadata !== undefined && object.metadata !== null ? stats_1.StatsMetadata.fromPartial(object.metadata) : undefined; + var _a; + const message = createBaseMsgUpdateDefaultQuotingParams(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.defaultQuotingParams = object.defaultQuotingParams !== undefined && object.defaultQuotingParams !== null ? params_1.QuotingParams.fromPartial(object.defaultQuotingParams) : undefined; return message; } }; -function createBaseQueryGlobalStatsRequest() { +function createBaseMsgUpdateDefaultQuotingParamsResponse() { return {}; } -exports.QueryGlobalStatsRequest = { +exports.MsgUpdateDefaultQuotingParamsResponse = { encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGlobalStatsRequest(); + const message = createBaseMsgUpdateDefaultQuotingParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -194022,31 +196633,45 @@ exports.QueryGlobalStatsRequest = { return message; }, fromPartial(_) { - const message = createBaseQueryGlobalStatsRequest(); + const message = createBaseMsgUpdateDefaultQuotingParamsResponse(); return message; } }; -function createBaseQueryGlobalStatsResponse() { +function createBaseMsgSetVaultParams() { return { - stats: undefined + authority: "", + vaultId: undefined, + vaultParams: undefined }; } -exports.QueryGlobalStatsResponse = { +exports.MsgSetVaultParams = { encode(message, writer = _m0.Writer.create()) { - if (message.stats !== undefined) { - stats_1.GlobalStats.encode(message.stats, writer.uint32(10).fork()).ldelim(); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.vaultId !== undefined) { + vault_1.VaultId.encode(message.vaultId, writer.uint32(18).fork()).ldelim(); + } + if (message.vaultParams !== undefined) { + params_1.VaultParams.encode(message.vaultParams, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGlobalStatsResponse(); + const message = createBaseMsgSetVaultParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.stats = stats_1.GlobalStats.decode(reader, reader.uint32()); + message.authority = reader.string(); + break; + case 2: + message.vaultId = vault_1.VaultId.decode(reader, reader.uint32()); + break; + case 3: + message.vaultParams = params_1.VaultParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -194056,33 +196681,28 @@ exports.QueryGlobalStatsResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryGlobalStatsResponse(); - message.stats = object.stats !== undefined && object.stats !== null ? stats_1.GlobalStats.fromPartial(object.stats) : undefined; + var _a; + const message = createBaseMsgSetVaultParams(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? vault_1.VaultId.fromPartial(object.vaultId) : undefined; + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? params_1.VaultParams.fromPartial(object.vaultParams) : undefined; return message; } }; -function createBaseQueryUserStatsRequest() { - return { - user: "" - }; +function createBaseMsgSetVaultParamsResponse() { + return {}; } -exports.QueryUserStatsRequest = { - encode(message, writer = _m0.Writer.create()) { - if (message.user !== "") { - writer.uint32(10).string(message.user); - } +exports.MsgSetVaultParamsResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUserStatsRequest(); + const message = createBaseMsgSetVaultParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.user = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -194090,34 +196710,39 @@ exports.QueryUserStatsRequest = { } return message; }, - fromPartial(object) { - var _a; - const message = createBaseQueryUserStatsRequest(); - message.user = (_a = object.user) !== null && _a !== void 0 ? _a : ""; + fromPartial(_) { + const message = createBaseMsgSetVaultParamsResponse(); return message; } }; -function createBaseQueryUserStatsResponse() { +function createBaseMsgUnlockShares() { return { - stats: undefined + authority: "", + ownerAddress: "" }; } -exports.QueryUserStatsResponse = { +exports.MsgUnlockShares = { encode(message, writer = _m0.Writer.create()) { - if (message.stats !== undefined) { - stats_1.UserStats.encode(message.stats, writer.uint32(10).fork()).ldelim(); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.ownerAddress !== "") { + writer.uint32(18).string(message.ownerAddress); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUserStatsResponse(); + const message = createBaseMsgUnlockShares(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.stats = stats_1.UserStats.decode(reader, reader.uint32()); + message.authority = reader.string(); + break; + case 2: + message.ownerAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -194127,72 +196752,34 @@ exports.QueryUserStatsResponse = { return message; }, fromPartial(object) { - const message = createBaseQueryUserStatsResponse(); - message.stats = object.stats !== undefined && object.stats !== null ? stats_1.UserStats.fromPartial(object.stats) : undefined; + var _a, _b; + const message = createBaseMsgUnlockShares(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.ownerAddress = (_b = object.ownerAddress) !== null && _b !== void 0 ? _b : ""; return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc3RhdHMvcXVlcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxxQ0FBaUQ7QUFDakQsbUNBQTRIO0FBQzVILHdEQUEwQztBQW9GMUMsU0FBUyw0QkFBNEI7SUFDbkMsT0FBTyxFQUFFLENBQUM7QUFDWixDQUFDO0FBRVksUUFBQSxrQkFBa0IsR0FBRztJQUNoQyxNQUFNLENBQUMsQ0FBcUIsRUFBRSxTQUFxQixHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUNwRSxPQUFPLE1BQU0sQ0FBQztJQUN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sR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7WUFFNUIsUUFBUSxHQUFHLEtBQUssQ0FBQyxFQUFFO2dCQUNqQixLQUFLLENBQUM7b0JBQ0osT0FBTyxDQUFDLEtBQUssR0FBRyxpQkFBUyxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7b0JBQzFELE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUEyQztRQUNyRCxNQUFNLE9BQU8sR0FBRyxnQ0FBZ0MsRUFBRSxDQUFDO1FBQ25ELE9BQU8sQ0FBQyxLQUFLLEdBQUcsTUFBTSxDQUFDLEtBQUssS0FBSyxTQUFTLElBQUksTUFBTSxDQUFDLEtBQUssS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLGlCQUFTLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO1FBQ3RILE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/stats.ts": -/*!*************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/stats.ts ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserStats = exports.GlobalStats = exports.EpochStats_UserWithStats = exports.EpochStats = exports.StatsMetadata = exports.BlockStats_Fill = exports.BlockStats = void 0; -const timestamp_1 = __webpack_require__(/*! ../../google/protobuf/timestamp */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/google/protobuf/timestamp.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); -function createBaseBlockStats() { +function createBaseMsgUnlockSharesResponse() { return { - fills: [] + unlockedShares: undefined }; } -exports.BlockStats = { +exports.MsgUnlockSharesResponse = { encode(message, writer = _m0.Writer.create()) { - for (const v of message.fills) { - exports.BlockStats_Fill.encode(v, writer.uint32(10).fork()).ldelim(); + if (message.unlockedShares !== undefined) { + share_1.NumShares.encode(message.unlockedShares, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockStats(); + const message = createBaseMsgUnlockSharesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.fills.push(exports.BlockStats_Fill.decode(reader, reader.uint32())); + message.unlockedShares = share_1.NumShares.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -194202,47 +196789,39 @@ exports.BlockStats = { return message; }, fromPartial(object) { - var _a; - const message = createBaseBlockStats(); - message.fills = ((_a = object.fills) === null || _a === void 0 ? void 0 : _a.map(e => exports.BlockStats_Fill.fromPartial(e))) || []; + const message = createBaseMsgUnlockSharesResponse(); + message.unlockedShares = object.unlockedShares !== undefined && object.unlockedShares !== null ? share_1.NumShares.fromPartial(object.unlockedShares) : undefined; return message; } }; -function createBaseBlockStats_Fill() { +function createBaseMsgUpdateParams() { return { - taker: "", - maker: "", - notional: helpers_1.Long.UZERO + authority: "", + params: undefined }; } -exports.BlockStats_Fill = { +exports.MsgUpdateParams = { encode(message, writer = _m0.Writer.create()) { - if (message.taker !== "") { - writer.uint32(10).string(message.taker); - } - if (message.maker !== "") { - writer.uint32(18).string(message.maker); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (!message.notional.isZero()) { - writer.uint32(24).uint64(message.notional); + if (message.params !== undefined) { + params_1.Params.encode(message.params, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockStats_Fill(); + const message = createBaseMsgUpdateParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.taker = reader.string(); + message.authority = reader.string(); break; case 2: - message.maker = reader.string(); - break; - case 3: - message.notional = reader.uint64(); + message.params = params_1.Params.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -194252,35 +196831,41 @@ exports.BlockStats_Fill = { return message; }, fromPartial(object) { - var _a, _b; - const message = createBaseBlockStats_Fill(); - message.taker = (_a = object.taker) !== null && _a !== void 0 ? _a : ""; - message.maker = (_b = object.maker) !== null && _b !== void 0 ? _b : ""; - message.notional = object.notional !== undefined && object.notional !== null ? helpers_1.Long.fromValue(object.notional) : helpers_1.Long.UZERO; + var _a; + const message = createBaseMsgUpdateParams(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.params = object.params !== undefined && object.params !== null ? params_1.Params.fromPartial(object.params) : undefined; return message; } }; -function createBaseStatsMetadata() { +function createBaseMsgUpdateOperatorParams() { return { - trailingEpoch: 0 + authority: "", + params: undefined }; } -exports.StatsMetadata = { +exports.MsgUpdateOperatorParams = { encode(message, writer = _m0.Writer.create()) { - if (message.trailingEpoch !== 0) { - writer.uint32(8).uint32(message.trailingEpoch); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + params_1.OperatorParams.encode(message.params, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStatsMetadata(); + const message = createBaseMsgUpdateOperatorParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.trailingEpoch = reader.uint32(); + message.authority = reader.string(); + break; + case 2: + message.params = params_1.OperatorParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -194291,40 +196876,26 @@ exports.StatsMetadata = { }, fromPartial(object) { var _a; - const message = createBaseStatsMetadata(); - message.trailingEpoch = (_a = object.trailingEpoch) !== null && _a !== void 0 ? _a : 0; + const message = createBaseMsgUpdateOperatorParams(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.params = object.params !== undefined && object.params !== null ? params_1.OperatorParams.fromPartial(object.params) : undefined; return message; } }; -function createBaseEpochStats() { - return { - epochEndTime: undefined, - stats: [] - }; +function createBaseMsgUpdateOperatorParamsResponse() { + return {}; } -exports.EpochStats = { - encode(message, writer = _m0.Writer.create()) { - if (message.epochEndTime !== undefined) { - timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.epochEndTime), writer.uint32(10).fork()).ldelim(); - } - for (const v of message.stats) { - exports.EpochStats_UserWithStats.encode(v, writer.uint32(18).fork()).ldelim(); - } +exports.MsgUpdateOperatorParamsResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEpochStats(); + const message = createBaseMsgUpdateOperatorParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.epochEndTime = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32())); - break; - case 2: - message.stats.push(exports.EpochStats_UserWithStats.decode(reader, reader.uint32())); - break; default: reader.skipType(tag & 7); break; @@ -194332,79 +196903,46 @@ exports.EpochStats = { } return message; }, - fromPartial(object) { - var _a, _b; - const message = createBaseEpochStats(); - message.epochEndTime = (_a = object.epochEndTime) !== null && _a !== void 0 ? _a : undefined; - message.stats = ((_b = object.stats) === null || _b === void 0 ? void 0 : _b.map(e => exports.EpochStats_UserWithStats.fromPartial(e))) || []; + fromPartial(_) { + const message = createBaseMsgUpdateOperatorParamsResponse(); return message; } }; -function createBaseEpochStats_UserWithStats() { +function createBaseMsgAllocateToVault() { return { - user: "", - stats: undefined + authority: "", + vaultId: undefined, + quoteQuantums: new Uint8Array() }; } -exports.EpochStats_UserWithStats = { +exports.MsgAllocateToVault = { encode(message, writer = _m0.Writer.create()) { - if (message.user !== "") { - writer.uint32(10).string(message.user); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.stats !== undefined) { - exports.UserStats.encode(message.stats, writer.uint32(18).fork()).ldelim(); + if (message.vaultId !== undefined) { + vault_1.VaultId.encode(message.vaultId, writer.uint32(18).fork()).ldelim(); + } + if (message.quoteQuantums.length !== 0) { + writer.uint32(26).bytes(message.quoteQuantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEpochStats_UserWithStats(); + const message = createBaseMsgAllocateToVault(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.user = reader.string(); + message.authority = reader.string(); break; case 2: - message.stats = exports.UserStats.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); + message.vaultId = vault_1.VaultId.decode(reader, reader.uint32()); break; - } - } - return message; - }, - fromPartial(object) { - var _a; - const message = createBaseEpochStats_UserWithStats(); - message.user = (_a = object.user) !== null && _a !== void 0 ? _a : ""; - message.stats = object.stats !== undefined && object.stats !== null ? exports.UserStats.fromPartial(object.stats) : undefined; - return message; - } -}; -function createBaseGlobalStats() { - return { - notionalTraded: helpers_1.Long.UZERO - }; -} -exports.GlobalStats = { - encode(message, writer = _m0.Writer.create()) { - if (!message.notionalTraded.isZero()) { - writer.uint32(8).uint64(message.notionalTraded); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGlobalStats(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.notionalTraded = reader.uint64(); + case 3: + message.quoteQuantums = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -194414,40 +196952,28 @@ exports.GlobalStats = { return message; }, fromPartial(object) { - const message = createBaseGlobalStats(); - message.notionalTraded = object.notionalTraded !== undefined && object.notionalTraded !== null ? helpers_1.Long.fromValue(object.notionalTraded) : helpers_1.Long.UZERO; + var _a, _b; + const message = createBaseMsgAllocateToVault(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? vault_1.VaultId.fromPartial(object.vaultId) : undefined; + message.quoteQuantums = (_b = object.quoteQuantums) !== null && _b !== void 0 ? _b : new Uint8Array(); return message; } }; -function createBaseUserStats() { - return { - takerNotional: helpers_1.Long.UZERO, - makerNotional: helpers_1.Long.UZERO - }; +function createBaseMsgAllocateToVaultResponse() { + return {}; } -exports.UserStats = { - encode(message, writer = _m0.Writer.create()) { - if (!message.takerNotional.isZero()) { - writer.uint32(8).uint64(message.takerNotional); - } - if (!message.makerNotional.isZero()) { - writer.uint32(16).uint64(message.makerNotional); - } +exports.MsgAllocateToVaultResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserStats(); + const message = createBaseMsgAllocateToVaultResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.takerNotional = reader.uint64(); - break; - case 2: - message.makerNotional = reader.uint64(); - break; default: reader.skipType(tag & 7); break; @@ -194455,87 +196981,46 @@ exports.UserStats = { } return message; }, - fromPartial(object) { - const message = createBaseUserStats(); - message.takerNotional = object.takerNotional !== undefined && object.takerNotional !== null ? helpers_1.Long.fromValue(object.takerNotional) : helpers_1.Long.UZERO; - message.makerNotional = object.makerNotional !== undefined && object.makerNotional !== null ? helpers_1.Long.fromValue(object.makerNotional) : helpers_1.Long.UZERO; + fromPartial(_) { + const message = createBaseMsgAllocateToVaultResponse(); return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc3RhdHMvc3RhdHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwrREFBNEQ7QUFDNUQsd0RBQTBDO0FBQzFDLDJDQUE4RTtBQW1HOUUsU0FBUyxvQkFBb0I7SUFDM0IsT0FBTztRQUNMLEtBQUssRUFBRSxFQUFFO0tBQ1YsQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFB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U8sQ0FBQyxhQUFhLEdBQUksTUFBTSxDQUFDLE1BQU0sRUFBVyxDQUFDO29CQUNsRCxNQUFNO2dCQUVSLEtBQUssQ0FBQztvQkFDSixPQUFPLENBQUMsYUFBYSxHQUFJLE1BQU0sQ0FBQyxNQUFNLEVBQVcsQ0FBQztvQkFDbEQsTUFBTTtnQkFFUjtvQkFDRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsQ0FBQztvQkFDekIsTUFBTTthQUNUO1NBQ0Y7UUFFRCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0lBRUQsV0FBVyxDQUFDLE1BQThCO1FBQ3hDLE1BQU0sT0FBTyxHQUFHLG1CQUFtQixFQUFFLENBQUM7UUFDdEMsT0FBTyxDQUFDLGFBQWEsR0FBRyxNQUFNLENBQUMsYUFBYSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsYUFBYSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxLQUFLLENBQUM7UUFDaEosT0FBTyxDQUFDLGFBQWEsR0FBRyxNQUFNLENBQUMsYUFBYSxLQUFLLFNBQVMsSUFBSSxNQUFNLENBQUMsYUFBYSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFDLGNBQUksQ0FBQyxLQUFLLENBQUM7UUFDaEosT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztDQUVGLENBQUMifQ== - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/asset_position.ts": -/*!****************************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/asset_position.ts ***! - \****************************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AssetPosition = void 0; -const helpers_1 = __webpack_require__(/*! ../../helpers */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/helpers.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseAssetPosition() { +function createBaseMsgRetrieveFromVault() { return { - assetId: 0, - quantums: new Uint8Array(), - index: helpers_1.Long.UZERO + authority: "", + vaultId: undefined, + quoteQuantums: new Uint8Array() }; } -exports.AssetPosition = { +exports.MsgRetrieveFromVault = { encode(message, writer = _m0.Writer.create()) { - if (message.assetId !== 0) { - writer.uint32(8).uint32(message.assetId); + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.quantums.length !== 0) { - writer.uint32(18).bytes(message.quantums); + if (message.vaultId !== undefined) { + vault_1.VaultId.encode(message.vaultId, writer.uint32(18).fork()).ldelim(); } - if (!message.index.isZero()) { - writer.uint32(24).uint64(message.index); + if (message.quoteQuantums.length !== 0) { + writer.uint32(26).bytes(message.quoteQuantums); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAssetPosition(); + const message = createBaseMsgRetrieveFromVault(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.assetId = reader.uint32(); + message.authority = reader.string(); break; case 2: - message.quantums = reader.bytes(); + message.vaultId = vault_1.VaultId.decode(reader, reader.uint32()); break; case 3: - message.index = reader.uint64(); + message.quoteQuantums = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -194546,87 +197031,27 @@ exports.AssetPosition = { }, fromPartial(object) { var _a, _b; - const message = createBaseAssetPosition(); - message.assetId = (_a = object.assetId) !== null && _a !== void 0 ? _a : 0; - message.quantums = (_b = object.quantums) !== null && _b !== void 0 ? _b : new Uint8Array(); - message.index = object.index !== undefined && object.index !== null ? helpers_1.Long.fromValue(object.index) : helpers_1.Long.UZERO; + const message = createBaseMsgRetrieveFromVault(); + message.authority = (_a = object.authority) !== null && _a !== void 0 ? _a : ""; + message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? vault_1.VaultId.fromPartial(object.vaultId) : undefined; + message.quoteQuantums = (_b = object.quoteQuantums) !== null && _b !== void 0 ? _b : new Uint8Array(); return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXRfcG9zaXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc3ViYWNjb3VudHMvYXNzZXRfcG9zaXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBa0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HQUFHLE1BQUEsTUFBTSxDQUFDLFFBQVEsbUNBQUksSUFBSSxVQUFVLEVBQUUsQ0FBQztRQUN2RCxPQUFPLENBQUMsS0FBSyxHQUFHLE1BQU0sQ0FBQyxLQUFLLEtBQUssU0FBUyxJQUFJLE1BQU0sQ0FBQyxLQUFLLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxjQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsY0FBSSxDQUFDLEtBQUssQ0FBQztRQUNoSCxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/perpetual_position.ts": -/*!********************************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/perpetual_position.ts ***! - \********************************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PerpetualPosition = void 0; -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBasePerpetualPosition() { - return { - perpetualId: 0, - quantums: new Uint8Array(), - fundingIndex: new Uint8Array() - }; +function createBaseMsgRetrieveFromVaultResponse() { + return {}; } -exports.PerpetualPosition = { - encode(message, writer = _m0.Writer.create()) { - if (message.perpetualId !== 0) { - writer.uint32(8).uint32(message.perpetualId); - } - if (message.quantums.length !== 0) { - writer.uint32(18).bytes(message.quantums); - } - if (message.fundingIndex.length !== 0) { - writer.uint32(26).bytes(message.fundingIndex); - } +exports.MsgRetrieveFromVaultResponse = { + encode(_, writer = _m0.Writer.create()) { return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePerpetualPosition(); + const message = createBaseMsgRetrieveFromVaultResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.perpetualId = reader.uint32(); - break; - case 2: - message.quantums = reader.bytes(); - break; - case 3: - message.fundingIndex = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -194634,23 +197059,19 @@ exports.PerpetualPosition = { } return message; }, - fromPartial(object) { - var _a, _b, _c; - const message = createBasePerpetualPosition(); - message.perpetualId = (_a = object.perpetualId) !== null && _a !== void 0 ? _a : 0; - message.quantums = (_b = object.quantums) !== null && _b !== void 0 ? _b : new Uint8Array(); - message.fundingIndex = (_c = object.fundingIndex) !== null && _c !== void 0 ? _c : new Uint8Array(); + fromPartial(_) { + const message = createBaseMsgRetrieveFromVaultResponse(); return message; } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVycGV0dWFsX3Bvc2l0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbm9kZV9tb2R1bGVzL0BkeWR4cHJvdG9jb2wvdjQtc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Q3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxDQUE0QztRQUN0RCxNQUFNLE9BQU8sR0FBRyxzQ0FBc0MsRUFBRSxDQUFDO1FBQ3pELE9BQU8sT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FFRixDQUFDIn0= /***/ }), -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/query.ts": -/*!*******************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/query.ts ***! - \*******************************************************************************************/ +/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/vault.ts": +/*!*************************************************************************************!*\ + !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/vault.ts ***! + \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -194679,296 +197100,116 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.QueryGetWithdrawalAndTransfersBlockedInfoResponse = exports.QueryGetWithdrawalAndTransfersBlockedInfoRequest = exports.QuerySubaccountAllResponse = exports.QueryAllSubaccountRequest = exports.QuerySubaccountResponse = exports.QueryGetSubaccountRequest = void 0; -const pagination_1 = __webpack_require__(/*! ../../cosmos/base/query/v1beta1/pagination */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts"); -const subaccount_1 = __webpack_require__(/*! ./subaccount */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts"); +exports.VaultId = exports.vaultStatusToJSON = exports.vaultStatusFromJSON = exports.VaultStatusSDKType = exports.VaultStatus = exports.vaultTypeToJSON = exports.vaultTypeFromJSON = exports.VaultTypeSDKType = exports.VaultType = void 0; const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseQueryGetSubaccountRequest() { - return { - owner: "", - number: 0 - }; -} -exports.QueryGetSubaccountRequest = { - encode(message, writer = _m0.Writer.create()) { - if (message.owner !== "") { - writer.uint32(10).string(message.owner); - } - if (message.number !== 0) { - writer.uint32(16).uint32(message.number); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetSubaccountRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.owner = reader.string(); - break; - case 2: - message.number = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object) { - var _a, _b; - const message = createBaseQueryGetSubaccountRequest(); - message.owner = (_a = object.owner) !== null && _a !== void 0 ? _a : ""; - message.number = (_b = object.number) !== null && _b !== void 0 ? _b : 0; - return message; - } -}; -function createBaseQuerySubaccountResponse() { - return { - subaccount: undefined - }; -} -exports.QuerySubaccountResponse = { - encode(message, writer = _m0.Writer.create()) { - if (message.subaccount !== undefined) { - subaccount_1.Subaccount.encode(message.subaccount, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySubaccountResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subaccount = subaccount_1.Subaccount.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object) { - const message = createBaseQuerySubaccountResponse(); - message.subaccount = object.subaccount !== undefined && object.subaccount !== null ? subaccount_1.Subaccount.fromPartial(object.subaccount) : undefined; - return message; +/** VaultType represents different types of vaults. */ +var VaultType; +(function (VaultType) { + /** VAULT_TYPE_UNSPECIFIED - Default value, invalid and unused. */ + VaultType[VaultType["VAULT_TYPE_UNSPECIFIED"] = 0] = "VAULT_TYPE_UNSPECIFIED"; + /** VAULT_TYPE_CLOB - Vault is associated with a CLOB pair. */ + VaultType[VaultType["VAULT_TYPE_CLOB"] = 1] = "VAULT_TYPE_CLOB"; + VaultType[VaultType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(VaultType = exports.VaultType || (exports.VaultType = {})); +exports.VaultTypeSDKType = VaultType; +function vaultTypeFromJSON(object) { + switch (object) { + case 0: + case "VAULT_TYPE_UNSPECIFIED": + return VaultType.VAULT_TYPE_UNSPECIFIED; + case 1: + case "VAULT_TYPE_CLOB": + return VaultType.VAULT_TYPE_CLOB; + case -1: + case "UNRECOGNIZED": + default: + return VaultType.UNRECOGNIZED; } -}; -function createBaseQueryAllSubaccountRequest() { - return { - pagination: undefined - }; } -exports.QueryAllSubaccountRequest = { - encode(message, writer = _m0.Writer.create()) { - if (message.pagination !== undefined) { - pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllSubaccountRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object) { - const message = createBaseQueryAllSubaccountRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; - return message; +exports.vaultTypeFromJSON = vaultTypeFromJSON; +function vaultTypeToJSON(object) { + switch (object) { + case VaultType.VAULT_TYPE_UNSPECIFIED: + return "VAULT_TYPE_UNSPECIFIED"; + case VaultType.VAULT_TYPE_CLOB: + return "VAULT_TYPE_CLOB"; + case VaultType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; } -}; -function createBaseQuerySubaccountAllResponse() { - return { - subaccount: [], - pagination: undefined - }; } -exports.QuerySubaccountAllResponse = { - encode(message, writer = _m0.Writer.create()) { - for (const v of message.subaccount) { - subaccount_1.Subaccount.encode(v, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySubaccountAllResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subaccount.push(subaccount_1.Subaccount.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object) { - var _a; - const message = createBaseQuerySubaccountAllResponse(); - message.subaccount = ((_a = object.subaccount) === null || _a === void 0 ? void 0 : _a.map(e => subaccount_1.Subaccount.fromPartial(e))) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; - return message; +exports.vaultTypeToJSON = vaultTypeToJSON; +/** VaultStatus represents the status of a vault. */ +var VaultStatus; +(function (VaultStatus) { + /** VAULT_STATUS_UNSPECIFIED - Default value, invalid and unused. */ + VaultStatus[VaultStatus["VAULT_STATUS_UNSPECIFIED"] = 0] = "VAULT_STATUS_UNSPECIFIED"; + /** + * VAULT_STATUS_DEACTIVATED - Don’t place orders. Does not count toward global vault balances. + * A vault can only be set to this status if its equity is non-positive. + */ + VaultStatus[VaultStatus["VAULT_STATUS_DEACTIVATED"] = 1] = "VAULT_STATUS_DEACTIVATED"; + /** VAULT_STATUS_STAND_BY - Don’t place orders. Does count towards global vault balances. */ + VaultStatus[VaultStatus["VAULT_STATUS_STAND_BY"] = 2] = "VAULT_STATUS_STAND_BY"; + /** VAULT_STATUS_QUOTING - Places orders on both sides of the book. */ + VaultStatus[VaultStatus["VAULT_STATUS_QUOTING"] = 3] = "VAULT_STATUS_QUOTING"; + /** VAULT_STATUS_CLOSE_ONLY - Only place orders that close the position. */ + VaultStatus[VaultStatus["VAULT_STATUS_CLOSE_ONLY"] = 4] = "VAULT_STATUS_CLOSE_ONLY"; + VaultStatus[VaultStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(VaultStatus = exports.VaultStatus || (exports.VaultStatus = {})); +exports.VaultStatusSDKType = VaultStatus; +function vaultStatusFromJSON(object) { + switch (object) { + case 0: + case "VAULT_STATUS_UNSPECIFIED": + return VaultStatus.VAULT_STATUS_UNSPECIFIED; + case 1: + case "VAULT_STATUS_DEACTIVATED": + return VaultStatus.VAULT_STATUS_DEACTIVATED; + case 2: + case "VAULT_STATUS_STAND_BY": + return VaultStatus.VAULT_STATUS_STAND_BY; + case 3: + case "VAULT_STATUS_QUOTING": + return VaultStatus.VAULT_STATUS_QUOTING; + case 4: + case "VAULT_STATUS_CLOSE_ONLY": + return VaultStatus.VAULT_STATUS_CLOSE_ONLY; + case -1: + case "UNRECOGNIZED": + default: + return VaultStatus.UNRECOGNIZED; } -}; -function createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest() { - return {}; } -exports.QueryGetWithdrawalAndTransfersBlockedInfoRequest = { - encode(_, writer = _m0.Writer.create()) { - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_) { - const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest(); - return message; +exports.vaultStatusFromJSON = vaultStatusFromJSON; +function vaultStatusToJSON(object) { + switch (object) { + case VaultStatus.VAULT_STATUS_UNSPECIFIED: + return "VAULT_STATUS_UNSPECIFIED"; + case VaultStatus.VAULT_STATUS_DEACTIVATED: + return "VAULT_STATUS_DEACTIVATED"; + case VaultStatus.VAULT_STATUS_STAND_BY: + return "VAULT_STATUS_STAND_BY"; + case VaultStatus.VAULT_STATUS_QUOTING: + return "VAULT_STATUS_QUOTING"; + case VaultStatus.VAULT_STATUS_CLOSE_ONLY: + return "VAULT_STATUS_CLOSE_ONLY"; + case VaultStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; } -}; -function createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse() { - return { - negativeTncSubaccountSeenAtBlock: 0, - chainOutageSeenAtBlock: 0, - withdrawalsAndTransfersUnblockedAtBlock: 0 - }; } -exports.QueryGetWithdrawalAndTransfersBlockedInfoResponse = { - encode(message, writer = _m0.Writer.create()) { - if (message.negativeTncSubaccountSeenAtBlock !== 0) { - writer.uint32(8).uint32(message.negativeTncSubaccountSeenAtBlock); - } - if (message.chainOutageSeenAtBlock !== 0) { - writer.uint32(16).uint32(message.chainOutageSeenAtBlock); - } - if (message.withdrawalsAndTransfersUnblockedAtBlock !== 0) { - writer.uint32(24).uint32(message.withdrawalsAndTransfersUnblockedAtBlock); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.negativeTncSubaccountSeenAtBlock = reader.uint32(); - break; - case 2: - message.chainOutageSeenAtBlock = reader.uint32(); - break; - case 3: - message.withdrawalsAndTransfersUnblockedAtBlock = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object) { - var _a, _b, _c; - const message = createBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse(); - message.negativeTncSubaccountSeenAtBlock = (_a = object.negativeTncSubaccountSeenAtBlock) !== null && _a !== void 0 ? _a : 0; - message.chainOutageSeenAtBlock = (_b = object.chainOutageSeenAtBlock) !== null && _b !== void 0 ? _b : 0; - message.withdrawalsAndTransfersUnblockedAtBlock = (_c = object.withdrawalsAndTransfersUnblockedAtBlock) !== null && _c !== void 0 ? _c : 0; - return message; - } -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQGR5ZHhwcm90b2NvbC92NC1wcm90by9zcmMvY29kZWdlbi9keWR4cHJvdG9jb2wvc3ViYWNjb3VudHMvcXVlcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyRUFBZ0k7QUFDaEksNkNBQTZEO0FBQzdELHdEQUEwQztBQStFMUMsU0FBUyxtQ0FBbUM7SUFDMUMsT0FBTztRQUNMLEtBQUssRUFBRSxFQUFFO1FBQ1QsTUFBTSxFQUFFLENBQUM7S0FDVixDQUFDO0FBQ0osQ0FBQztBQUVZLFFBQUEseUJBQXlCLEdBQUc7SUFDdkMsTUFBTSxDQUFDLE9BQWtDLEVBQUUsU0FBcUIsR0FBRyxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUU7UUFDakYsSUFBSSxPQUFPLENBQUMsS0FBSyxLQUFLLEVBQUUsRUFBRTtZQUN4QixNQUFNLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7U0FDekM7UUFFRCxJQUFJLE9BQU8sQ0FBQyxNQUFNLEtBQUssQ0FBQyxFQUFFO1lBQ3hCLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ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0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyxnQ0FBZ0MsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7b0JBQzNELE1BQU07Z0JBRVIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyxzQkFBc0IsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7b0JBQ2pELE1BQU07Z0JBRVIsS0FBSyxDQUFDO29CQUNKLE9BQU8sQ0FBQyx1Q0FBdUMsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUM7b0JBQ2xFLE1BQU07Z0JBRVI7b0JBQ0UsTUFBTSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLENBQUM7b0JBQ3pCLE1BQU07YUFDVDtTQUNGO1FBRUQsT0FBTyxPQUFPLENBQUM7SUFDakIsQ0FBQztJQUVELFdBQVcsQ0FBQyxNQUFzRTs7UUFDaEYsTUFBTSxPQUFPLEdBQUcsMkRBQTJELEVBQUUsQ0FBQztRQUM5RSxPQUFPLENBQUMsZ0NBQWdDLEdBQUcsTUFBQSxNQUFNLENBQUMsZ0NBQWdDLG1DQUFJLENBQUMsQ0FBQztRQUN4RixPQUFPLENBQUMsc0JBQXNCLEdBQUcsTUFBQSxNQUFNLENBQUMsc0JBQXNCLG1DQUFJLENBQUMsQ0FBQztRQUNwRSxPQUFPLENBQUMsdUNBQXVDLEdBQUcsTUFBQSxNQUFNLENBQUMsdUNBQXVDLG1DQUFJLENBQUMsQ0FBQztRQUN0RyxPQUFPLE9BQU8sQ0FBQztJQUNqQixDQUFDO0NBRUYsQ0FBQyJ9 - -/***/ }), - -/***/ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts": -/*!************************************************************************************************!*\ - !*** ./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/subaccount.ts ***! - \************************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Subaccount = exports.SubaccountId = void 0; -const asset_position_1 = __webpack_require__(/*! ./asset_position */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/asset_position.ts"); -const perpetual_position_1 = __webpack_require__(/*! ./perpetual_position */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/subaccounts/perpetual_position.ts"); -const _m0 = __importStar(__webpack_require__(/*! protobufjs/minimal */ "./node_modules/protobufjs/minimal.js")); -function createBaseSubaccountId() { +exports.vaultStatusToJSON = vaultStatusToJSON; +function createBaseVaultId() { return { - owner: "", + type: 0, number: 0 }; } -exports.SubaccountId = { +exports.VaultId = { encode(message, writer = _m0.Writer.create()) { - if (message.owner !== "") { - writer.uint32(10).string(message.owner); + if (message.type !== 0) { + writer.uint32(8).int32(message.type); } if (message.number !== 0) { writer.uint32(16).uint32(message.number); @@ -194978,12 +197219,12 @@ exports.SubaccountId = { decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSubaccountId(); + const message = createBaseVaultId(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.owner = reader.string(); + message.type = reader.int32(); break; case 2: message.number = reader.uint32(); @@ -194997,73 +197238,13 @@ exports.SubaccountId = { }, fromPartial(object) { var _a, _b; - const message = createBaseSubaccountId(); - message.owner = (_a = object.owner) !== null && _a !== void 0 ? _a : ""; + const message = createBaseVaultId(); + message.type = (_a = object.type) !== null && _a !== void 0 ? _a : 0; message.number = (_b = object.number) !== null && _b !== void 0 ? _b : 0; return message; } }; -function createBaseSubaccount() { - return { - id: undefined, - assetPositions: [], - perpetualPositions: [], - marginEnabled: false - }; -} -exports.Subaccount = { - encode(message, writer = _m0.Writer.create()) { - if (message.id !== undefined) { - exports.SubaccountId.encode(message.id, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.assetPositions) { - asset_position_1.AssetPosition.encode(v, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.perpetualPositions) { - perpetual_position_1.PerpetualPosition.encode(v, writer.uint32(26).fork()).ldelim(); - } - if (message.marginEnabled === true) { - writer.uint32(32).bool(message.marginEnabled); - } - return writer; - }, - decode(input, length) { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSubaccount(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = exports.SubaccountId.decode(reader, reader.uint32()); - break; - case 2: - message.assetPositions.push(asset_position_1.AssetPosition.decode(reader, reader.uint32())); - break; - case 3: - message.perpetualPositions.push(perpetual_position_1.PerpetualPosition.decode(reader, reader.uint32())); - break; - case 4: - message.marginEnabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object) { - var _a, _b, _c; - const message = createBaseSubaccount(); - message.id = object.id !== undefined && object.id !== null ? exports.SubaccountId.fromPartial(object.id) : undefined; - message.assetPositions = ((_a = object.assetPositions) === null || _a === void 0 ? void 0 : _a.map(e => asset_position_1.AssetPosition.fromPartial(e))) || []; - message.perpetualPositions = ((_b = object.perpetualPositions) === null || _b === void 0 ? void 0 : _b.map(e => perpetual_position_1.PerpetualPosition.fromPartial(e))) || []; - message.marginEnabled = (_c = object.marginEnabled) !== null && _c !== void 0 ? _c : false; - return message; - } -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ViYWNjb3VudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9AZHlkeHByb3RvY29sL3Y0LXByb3RvL3NyYy9jb2RlZ2VuL2R5ZHhwcm90b2NvbC9zdWJhY2NvdW50cy9zdWJhY2NvdW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEscURBQXVFO0FBQ3ZFLDZEQUFtRjtBQUNuRix3REFBMEM7QUEyRDFDLFNBQVMsc0JBQXNCO0lBQzdCLE9BQU87UUFDTCxLQUFLLEVBQUUsRUFBRTtRQUNULE1BQU0sRUFBRSxDQUFDO0tBQ1YsQ0FBQztBQUNKLENBQUM7QUFFWSxRQUFBLFlBQVksR0FBRztJQUMxQixNQUFNLENBQUMsT0FBcUIsRUFBRSxTQUFxQixHQUFHLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRTtRQUNwRSxJQUFJLE9BQU8sQ0FBQyxLQUFLLEtBQUssRUFBRSxFQUFFO1lBQ3hCLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztTQUN6QztRQUVELElBQUksT0FBTyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUU7WUFDeEIsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENB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__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; var __importDefault = (this && this.__importDefault) || function (mod) { @@ -201094,6 +203276,7 @@ const order_1 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxp const ethers_1 = __webpack_require__(/*! ethers */ "./node_modules/ethers/lib.commonjs/index.js"); const long_1 = __importDefault(__webpack_require__(/*! long */ "./node_modules/long/src/long.js")); const protobufjs_1 = __importDefault(__webpack_require__(/*! protobufjs */ "./node_modules/protobufjs/index.js")); +const helpers_1 = __webpack_require__(/*! ../lib/helpers */ "./src/lib/helpers.ts"); const validation_1 = __webpack_require__(/*! ../lib/validation */ "./src/lib/validation.ts"); const types_1 = __webpack_require__(/*! ../types */ "./src/types.ts"); const constants_1 = __webpack_require__(/*! ./constants */ "./src/clients/constants.ts"); @@ -201109,16 +203292,16 @@ const validator_client_1 = __webpack_require__(/*! ./validator-client */ "./src/ protobufjs_1.default.util.Long = long_1.default; protobufjs_1.default.configure(); class CompositeClient { - constructor(network, apiTimeout) { - this.gasDenom = constants_1.SelectedGasDenom.USDC; - this.network = network; - this._indexerClient = new indexer_client_1.IndexerClient(network.indexerConfig, apiTimeout); - } static async connect(network) { const client = new CompositeClient(network); await client.initialize(); return client; } + constructor(network, apiTimeout) { + this.gasDenom = constants_1.SelectedGasDenom.USDC; + this.network = network; + this._indexerClient = new indexer_client_1.IndexerClient(network.indexerConfig, apiTimeout); + } async initialize() { this._validatorClient = await validator_client_1.ValidatorClient.connect(this.network.validatorConfig); } @@ -201144,6 +203327,11 @@ class CompositeClient { throw new Error('Validator client not initialized'); this._validatorClient.setSelectedGasDenom(gasDenom); } + async populateAccountNumberCache(address) { + if (!this._validatorClient) + throw new Error('Validator client not initialized'); + await this._validatorClient.populateAccountNumberCache(address); + } /** * @description Sign a list of messages with a wallet. * the calling function is responsible for creating the messages. @@ -201323,7 +203511,7 @@ class CompositeClient { msg .then((it) => resolve([it])) .catch((err) => { - console.log(err); + throw err; }); }); const orderFlags = (0, chain_helpers_1.calculateOrderFlags)(type, timeInForce); @@ -201506,6 +203694,32 @@ class CompositeClient { } return this.validatorClient.post.cancelOrder(subaccount, clientId, orderFlags, clobPairId, goodTilBlock, goodTilBlockTime); } + /** + * @description Batch cancel short term orders using marketId to clobPairId translation. + * + * @param subaccount The subaccount to cancel the order from + * @param shortTermOrders The list of short term order batches to cancel with marketId + * @param goodTilBlock The goodTilBlock of the order to cancel + * @returns The transaction hash. + */ + async batchCancelShortTermOrdersWithMarketId(subaccount, shortTermOrders, goodTilBlock, broadcastMode) { + const orderBatches = await Promise.all(shortTermOrders.map(async ({ marketId, clobPairId, clientIds }) => ({ + clobPairId: (clobPairId !== null && clobPairId !== void 0 ? clobPairId : (await this.indexerClient.markets.getPerpetualMarkets(marketId)).markets[marketId]).clobPairId, + clientIds, + }))); + return this.validatorClient.post.batchCancelShortTermOrders(subaccount, orderBatches, goodTilBlock, broadcastMode); + } + /** + * @description Batch cancel short term orders using clobPairId. + * + * @param subaccount The subaccount to cancel the order from + * @param shortTermOrders The list of short term order batches to cancel with clobPairId + * @param goodTilBlock The goodTilBlock of the order to cancel + * @returns The transaction hash. + */ + async batchCancelShortTermOrdersWithClobPairId(subaccount, shortTermOrders, goodTilBlock, broadcastMode) { + return this.validatorClient.post.batchCancelShortTermOrders(subaccount, shortTermOrders, goodTilBlock, broadcastMode); + } /** * @description Transfer from a subaccount to another subaccount * @@ -201686,6 +203900,19 @@ class CompositeClient { const signature = await this.sign(subaccount.wallet, () => msgs, true); return Buffer.from(signature).toString('base64'); } + // vaults + async depositToMegavault(subaccount, amountUsdc, broadcastMode) { + return this.validatorClient.post.depositToMegavault(subaccount, (0, helpers_1.bigIntToBytes)((0, chain_helpers_1.calculateVaultQuantums)(amountUsdc)), broadcastMode); + } + depositToMegavaultMessage(subaccount, amountUsdc) { + return this.validatorClient.post.depositToMegavaultMsg(subaccount.address, subaccount.subaccountNumber, (0, helpers_1.bigIntToBytes)((0, chain_helpers_1.calculateVaultQuantums)(amountUsdc))); + } + async withdrawFromMegavault(subaccount, shares, minAmount, broadcastMode) { + return this.validatorClient.post.withdrawFromMegavault(subaccount, (0, helpers_1.bigIntToBytes)(BigInt(Math.floor(shares))), (0, helpers_1.bigIntToBytes)((0, chain_helpers_1.calculateVaultQuantums)(minAmount)), broadcastMode); + } + withdrawFromMegavaultMessage(subaccount, shares, minAmount) { + return this.validatorClient.post.withdrawFromMegavaultMsg(subaccount.address, subaccount.subaccountNumber, (0, helpers_1.bigIntToBytes)(BigInt(Math.floor(shares))), (0, helpers_1.bigIntToBytes)((0, chain_helpers_1.calculateVaultQuantums)(minAmount))); + } /** * @description Submit a governance proposal to add a new market. * @@ -201732,9 +203959,12 @@ class CompositeClient { }); return this.send(wallet, () => msg, false, undefined, memo); } + async createMarketPermissionless(subaccount, ticker, broadcastMode, gasAdjustment, memo) { + return this.validatorClient.post.createMarketPermissionless(ticker, subaccount, broadcastMode, gasAdjustment, memo); + } } exports.CompositeClient = CompositeClient; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9zaXRlLWNsaWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGllbnRzL2NvbXBvc2l0ZS1jbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBRUEsMkRBQWdEO0FBS2hELHNGQUdvRTtBQUNwRSxtQ0FBb0M7QUFDcEMsZ0RBQXdCO0FBQ3hCLDREQUFrQztBQUVsQyxrREFBc0U7QUFDdEUsb0NBQTZEO0FBQzdELDJDQVNxQjtBQUNyQiwyREFTaUM7QUFDakMscURBQWlEO0FBQ2pELHlDQUF5QztBQUN6Qyw2Q0FBa0Q7QUF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UFDLElBQUksQ0FBQywwQkFBMEIsQ0FBQyxNQUFNLEVBQUUsVUFBVSxFQUFFLGFBQWEsRUFBRSxhQUFhLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDdEgsQ0FBQztDQUNGO0FBL25DRCwwQ0ErbkNDIn0= /***/ }), @@ -201764,7 +203994,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Network = exports.ValidatorConfig = exports.IndexerConfig = exports.PAGE_REQUEST = exports.SHORT_BLOCK_FORWARD = exports.SHORT_BLOCK_WINDOW = exports.MAX_MEMO_CHARACTERS = exports.DEFAULT_API_TIMEOUT = exports.TimePeriod = exports.PositionStatus = exports.TickerType = exports.OrderStatus = exports.OrderExecution = exports.OrderTimeInForce = exports.OrderSide = exports.OrderType = exports.MarketStatisticDay = exports.DELAYMSG_MODULE_ADDRESS = exports.GOV_MODULE_ADDRESS = exports.TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD = exports.TYPE_URL_MSG_UNDELEGATE = exports.TYPE_URL_MSG_DELEGATE = exports.TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT = exports.TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT = exports.TYPE_URL_MSG_CREATE_TRANSFER = exports.TYPE_URL_MSG_CREATE_ORACLE_MARKET = exports.TYPE_URL_MSG_CREATE_PERPETUAL = exports.TYPE_URL_MSG_DELAY_MESSAGE = exports.TYPE_URL_MSG_UPDATE_CLOB_PAIR = exports.TYPE_URL_MSG_CREATE_CLOB_PAIR = exports.TYPE_URL_MSG_CANCEL_ORDER = exports.TYPE_URL_MSG_PLACE_ORDER = exports.TYPE_URL_MSG_SUBMIT_PROPOSAL = exports.TYPE_URL_MSG_SEND = exports.SelectedGasDenom = exports.NETWORK_ID_MAINNET = exports.NETWORK_ID_TESTNET = exports.NetworkId = exports.ValidatorApiHost = exports.FaucetApiHost = exports.IndexerWSHost = exports.IndexerApiHost = exports.MAINNET_CHAIN_ID = exports.LOCAL_CHAIN_ID = exports.TESTNET_CHAIN_ID = exports.STAGING_CHAIN_ID = exports.DEV_CHAIN_ID = void 0; +exports.SHORT_BLOCK_WINDOW = exports.MAX_MEMO_CHARACTERS = exports.DEFAULT_API_TIMEOUT = exports.TradingRewardAggregationPeriod = exports.PnlTickInterval = exports.TimePeriod = exports.PositionStatus = exports.TickerType = exports.OrderStatus = exports.OrderExecution = exports.OrderTimeInForce = exports.OrderSide = exports.OrderType = exports.MarketStatisticDay = exports.MEGAVAULT_MODULE_ADDRESS = exports.DELAYMSG_MODULE_ADDRESS = exports.GOV_MODULE_ADDRESS = exports.TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD = exports.TYPE_URL_MSG_UNDELEGATE = exports.TYPE_URL_MSG_DELEGATE = exports.TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT = exports.TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT = exports.TYPE_URL_MSG_REGISTER_AFFILIATE = exports.TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT = exports.TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT = exports.TYPE_URL_MSG_CREATE_TRANSFER = exports.TYPE_URL_MSG_CREATE_ORACLE_MARKET = exports.TYPE_URL_MSG_CREATE_PERPETUAL = exports.TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS = exports.TYPE_URL_MSG_DELAY_MESSAGE = exports.TYPE_URL_MSG_UPDATE_CLOB_PAIR = exports.TYPE_URL_MSG_CREATE_CLOB_PAIR = exports.TYPE_URL_BATCH_CANCEL = exports.TYPE_URL_MSG_CANCEL_ORDER = exports.TYPE_URL_MSG_PLACE_ORDER = exports.TYPE_URL_MSG_SUBMIT_PROPOSAL = exports.TYPE_URL_MSG_SEND = exports.SelectedGasDenom = exports.NETWORK_ID_MAINNET = exports.NETWORK_ID_TESTNET = exports.NetworkId = exports.ValidatorApiHost = exports.FaucetApiHost = exports.IndexerWSHost = exports.IndexerApiHost = exports.MAINNET_CHAIN_ID = exports.LOCAL_CHAIN_ID = exports.TESTNET_CHAIN_ID = exports.STAGING_CHAIN_ID = exports.DEV_CHAIN_ID = void 0; +exports.Network = exports.ValidatorConfig = exports.IndexerConfig = exports.PAGE_REQUEST = exports.SHORT_BLOCK_FORWARD = void 0; const long_1 = __importDefault(__webpack_require__(/*! long */ "./node_modules/long/src/long.js")); __exportStar(__webpack_require__(/*! ../lib/constants */ "./src/lib/constants.ts"), exports); /** @@ -201784,13 +204015,15 @@ exports.MAINNET_CHAIN_ID = 'dydx-mainnet-1'; var IndexerApiHost; (function (IndexerApiHost) { IndexerApiHost["TESTNET"] = "https://indexer.v4testnet.dydx.exchange/"; + IndexerApiHost["STAGING"] = "https://indexer.v4staging.dydx.exchange/"; IndexerApiHost["LOCAL"] = "http://localhost:3002"; // For the deployment by DYDX token holders IndexerApiHost["MAINNET"] = "https://indexer.dydx.trade"; })(IndexerApiHost = exports.IndexerApiHost || (exports.IndexerApiHost = {})); var IndexerWSHost; (function (IndexerWSHost) { - IndexerWSHost["TESTNET"] = "wss://dydx-testnet.imperator.co/v4/ws"; + IndexerWSHost["TESTNET"] = "wss://indexer.v4testnet.dydx.exchange/v4/ws"; + IndexerWSHost["STAGING"] = "wss://indexer.v4staging.dydx.exchange/v4/ws"; IndexerWSHost["LOCAL"] = "ws://localhost:3003"; // For the deployment by DYDX token holders IndexerWSHost["MAINNET"] = "wss://indexer.dydx.trade/v4/ws"; @@ -201801,7 +204034,8 @@ var FaucetApiHost; })(FaucetApiHost = exports.FaucetApiHost || (exports.FaucetApiHost = {})); var ValidatorApiHost; (function (ValidatorApiHost) { - ValidatorApiHost["TESTNET"] = "https://test-dydx.kingnodes.com"; + ValidatorApiHost["TESTNET"] = "https://test-dydx-rpc.kingnodes.com"; + ValidatorApiHost["STAGING"] = "https://validator.v4staging.dydx.exchange"; ValidatorApiHost["LOCAL"] = "http://localhost:26657"; // For the deployment by DYDX token holders ValidatorApiHost["MAINNET"] = "https://dydx-ops-rpc.kingnodes.com:443"; @@ -201832,10 +204066,13 @@ exports.TYPE_URL_MSG_SUBMIT_PROPOSAL = '/cosmos.gov.v1.MsgSubmitProposal'; // x/clob exports.TYPE_URL_MSG_PLACE_ORDER = '/dydxprotocol.clob.MsgPlaceOrder'; exports.TYPE_URL_MSG_CANCEL_ORDER = '/dydxprotocol.clob.MsgCancelOrder'; +exports.TYPE_URL_BATCH_CANCEL = '/dydxprotocol.clob.MsgBatchCancel'; exports.TYPE_URL_MSG_CREATE_CLOB_PAIR = '/dydxprotocol.clob.MsgCreateClobPair'; exports.TYPE_URL_MSG_UPDATE_CLOB_PAIR = '/dydxprotocol.clob.MsgUpdateClobPair'; // x/delaymsg exports.TYPE_URL_MSG_DELAY_MESSAGE = '/dydxprotocol.delaymsg.MsgDelayMessage'; +// x/listing +exports.TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS = '/dydxprotocol.listing.MsgCreateMarketPermissionless'; // x/perpetuals exports.TYPE_URL_MSG_CREATE_PERPETUAL = '/dydxprotocol.perpetuals.MsgCreatePerpetual'; // x/prices @@ -201844,6 +204081,11 @@ exports.TYPE_URL_MSG_CREATE_ORACLE_MARKET = '/dydxprotocol.prices.MsgCreateOracl exports.TYPE_URL_MSG_CREATE_TRANSFER = '/dydxprotocol.sending.MsgCreateTransfer'; exports.TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT = '/dydxprotocol.sending.MsgWithdrawFromSubaccount'; exports.TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT = '/dydxprotocol.sending.MsgDepositToSubaccount'; +// x/affiliates +exports.TYPE_URL_MSG_REGISTER_AFFILIATE = '/dydxprotocol.affiliates.MsgRegisterAffiliate'; +// x/vault +exports.TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT = '/dydxprotocol.vault.MsgDepositToMegavault'; +exports.TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT = '/dydxprotocol.vault.MsgWithdrawFromMegavault'; // x/staking exports.TYPE_URL_MSG_DELEGATE = '/cosmos.staking.v1beta1.MsgDelegate'; exports.TYPE_URL_MSG_UNDELEGATE = '/cosmos.staking.v1beta1.MsgUndelegate'; @@ -201853,6 +204095,7 @@ exports.TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD = '/cosmos.distribution.v1beta1.M // The following are same across different networks / deployments. exports.GOV_MODULE_ADDRESS = 'dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky'; exports.DELAYMSG_MODULE_ADDRESS = 'dydx1mkkvp26dngu6n8rmalaxyp3gwkjuzztq5zx6tr'; +exports.MEGAVAULT_MODULE_ADDRESS = 'dydx18tkxrnrkqc2t0lr3zxr5g6a4hdvqksylxqje4r'; // ------------ Market Statistic Day Types ------------ var MarketStatisticDay; (function (MarketStatisticDay) { @@ -201921,6 +204164,17 @@ var TimePeriod; TimePeriod["ONE_DAY"] = "ONE_DAY"; TimePeriod["SEVEN_DAYS"] = "SEVEN_DAYS"; })(TimePeriod = exports.TimePeriod || (exports.TimePeriod = {})); +var PnlTickInterval; +(function (PnlTickInterval) { + PnlTickInterval["HOUR"] = "hour"; + PnlTickInterval["day"] = "day"; +})(PnlTickInterval = exports.PnlTickInterval || (exports.PnlTickInterval = {})); +var TradingRewardAggregationPeriod; +(function (TradingRewardAggregationPeriod) { + TradingRewardAggregationPeriod["DAILY"] = "DAILY"; + TradingRewardAggregationPeriod["WEEKLY"] = "WEEKLY"; + TradingRewardAggregationPeriod["MONTHLY"] = "MONTHLY"; +})(TradingRewardAggregationPeriod = exports.TradingRewardAggregationPeriod || (exports.TradingRewardAggregationPeriod = {})); // ------------ API Defaults ------------ exports.DEFAULT_API_TIMEOUT = 3000; exports.MAX_MEMO_CHARACTERS = 256; @@ -201942,12 +204196,13 @@ class IndexerConfig { } exports.IndexerConfig = IndexerConfig; class ValidatorConfig { - constructor(restEndpoint, chainId, denoms, broadcastOptions, defaultClientMemo) { + constructor(restEndpoint, chainId, denoms, broadcastOptions, defaultClientMemo, useTimestampNonce) { this.restEndpoint = (restEndpoint === null || restEndpoint === void 0 ? void 0 : restEndpoint.endsWith('/')) ? restEndpoint.slice(0, -1) : restEndpoint; this.chainId = chainId; this.denoms = denoms; this.broadcastOptions = broadcastOptions; this.defaultClientMemo = defaultClientMemo; + this.useTimestampNonce = useTimestampNonce; } } exports.ValidatorConfig = ValidatorConfig; @@ -201968,6 +204223,17 @@ class Network { }, undefined, 'Client Example'); return new Network('testnet', indexerConfig, validatorConfig); } + static staging() { + const indexerConfig = new IndexerConfig(IndexerApiHost.STAGING, IndexerWSHost.STAGING); + const validatorConfig = new ValidatorConfig(ValidatorApiHost.STAGING, exports.TESTNET_CHAIN_ID, { + CHAINTOKEN_DENOM: 'adv4tnt', + USDC_DENOM: 'ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5', + USDC_GAS_DENOM: 'uusdc', + USDC_DECIMALS: 6, + CHAINTOKEN_DECIMALS: 18, + }, undefined, 'Client Example'); + return new Network('staging', indexerConfig, validatorConfig); + } static local() { const indexerConfig = new IndexerConfig(IndexerApiHost.LOCAL, IndexerWSHost.LOCAL); const validatorConfig = new ValidatorConfig(ValidatorApiHost.LOCAL, exports.LOCAL_CHAIN_ID, { @@ -201996,7 +204262,7 @@ class Network { } } exports.Network = Network; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudHMvY29uc3RhbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0EsZ0RBQXdCO0FBSXhCLG1EQUFpQztBQUVqQzs7Ozs7R0FLRztBQUVILFdBQVc7QUFDRSxRQUFBLFlBQVksR0FBRyxzQkFBc0IsQ0FBQztBQUN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IsQ0FBQztRQUNGLE9BQU8sSUFBSSxPQUFPLENBQUMsT0FBTyxFQUFFLGFBQWEsRUFBRSxlQUFlLENBQUMsQ0FBQztJQUM5RCxDQUFDO0lBRUQsNENBQTRDO0lBQzVDLE1BQU0sQ0FBQyxPQUFPO1FBQ1osTUFBTSxhQUFhLEdBQUcsSUFBSSxhQUFhLENBQUMsY0FBYyxDQUFDLE9BQU8sRUFBRSxhQUFhLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDdkYsTUFBTSxlQUFlLEdBQUcsSUFBSSxlQUFlLENBQ3pDLGdCQUFnQixDQUFDLE9BQU8sRUFDeEIsd0JBQWdCLEVBQ2hCO1lBQ0UsZ0JBQWdCLEVBQUUsT0FBTztZQUN6QixVQUFVLEVBQUUsc0VBQXNFO1lBQ2xGLGNBQWMsRUFBRSxPQUFPO1lBQ3ZCLGFBQWEsRUFBRSxDQUFDO1lBQ2hCLG1CQUFtQixFQUFFLEVBQUU7U0FDeEIsRUFDRCxTQUFTLEVBQ1QsZ0JBQWdCLENBQ2pCLENBQUM7UUFDRixPQUFPLElBQUksT0FBTyxDQUFDLFNBQVMsRUFBRSxhQUFhLEVBQUUsZUFBZSxDQUFDLENBQUM7SUFDaEUsQ0FBQztJQUVELFNBQVM7UUFDUCxPQUFPLElBQUksQ0FBQyxHQUFHLENBQUM7SUFDbEIsQ0FBQztDQUNGO0FBbkZELDBCQW1GQyJ9 /***/ }), @@ -202058,24 +204324,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.calculateConditionalOrderTriggerSubticks = exports.calculateConditionType = exports.calculateClientMetadata = exports.calculateOrderFlags = exports.calculateTimeInForce = exports.calculateSide = exports.calculateSubticks = exports.calculateQuantums = exports.round = void 0; +exports.calculateConditionalOrderTriggerSubticks = exports.calculateConditionType = exports.calculateClientMetadata = exports.calculateOrderFlags = exports.calculateTimeInForce = exports.calculateSide = exports.calculateSubticks = exports.calculateVaultQuantums = exports.calculateQuantums = exports.round = void 0; const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "./node_modules/bignumber.js/bignumber.js")); const long_1 = __importDefault(__webpack_require__(/*! long */ "./node_modules/long/src/long.js")); const constants_1 = __webpack_require__(/*! ../constants */ "./src/clients/constants.ts"); const proto_includes_1 = __webpack_require__(/*! ../modules/proto-includes */ "./src/clients/modules/proto-includes.ts"); const types_1 = __webpack_require__(/*! ../types */ "./src/clients/types.ts"); function round(input, base) { - return Math.floor(input / base) * base; + return (0, bignumber_js_1.default)(input) + .div((0, bignumber_js_1.default)(base)) + .integerValue(bignumber_js_1.default.ROUND_FLOOR) + .times((0, bignumber_js_1.default)(base)) + .toNumber(); } exports.round = round; function calculateQuantums(size, atomicResolution, stepBaseQuantums) { - const rawQuantums = size * 10 ** (-1 * atomicResolution); - const quantums = round(rawQuantums, stepBaseQuantums); + const rawQuantums = (0, bignumber_js_1.default)(size).times((0, bignumber_js_1.default)(10).pow((0, bignumber_js_1.default)(atomicResolution).negated())); + const quantums = round(rawQuantums.toNumber(), stepBaseQuantums); // stepBaseQuantums functions as minimum order size const result = Math.max(quantums, stepBaseQuantums); return long_1.default.fromNumber(result); } exports.calculateQuantums = calculateQuantums; +function calculateVaultQuantums(size) { + return BigInt((0, bignumber_js_1.default)(size).times(1000000).toFixed(0, bignumber_js_1.default.ROUND_FLOOR)); +} +exports.calculateVaultQuantums = calculateVaultQuantums; function calculateSubticks(price, atomicResolution, quantumConversionExponent, subticksPerTick) { const QUOTE_QUANTUMS_ATOMIC_RESOLUTION = -6; const exponent = atomicResolution - quantumConversionExponent - QUOTE_QUANTUMS_ATOMIC_RESOLUTION; @@ -202223,7 +204497,7 @@ function calculateConditionalOrderTriggerSubticks(orderType, atomicResolution, q } } exports.calculateConditionalOrderTriggerSubticks = calculateConditionalOrderTriggerSubticks; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJm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QkFBUyxDQUFDLGtCQUFrQjtZQUMvQixPQUFPLG9DQUFtQixDQUFDLDBCQUEwQixDQUFDO1FBRXhEO1lBQ0UsT0FBTyxvQ0FBbUIsQ0FBQywwQkFBMEIsQ0FBQztLQUN6RDtBQUNILENBQUM7QUFuQkQsd0RBbUJDO0FBRUQsU0FBZ0Isd0NBQXdDLENBQ3RELFNBQW9CLEVBQ3BCLGdCQUF3QixFQUN4Qix5QkFBaUMsRUFDakMsZUFBdUIsRUFDdkIsWUFBcUI7SUFFckIsUUFBUSxTQUFTLEVBQUU7UUFDakIsS0FBSyxxQkFBUyxDQUFDLEtBQUssQ0FBQztRQUNyQixLQUFLLHFCQUFTLENBQUMsTUFBTTtZQUNuQixPQUFPLGNBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFFNUIsS0FBSyxxQkFBUyxDQUFDLFVBQVUsQ0FBQztRQUMxQixLQUFLLHFCQUFTLENBQUMsV0FBVyxDQUFDO1FBQzNCLEtBQUsscUJBQVMsQ0FBQyxpQkFBaUIsQ0FBQztRQUNqQyxLQUFLLHFCQUFTLENBQUMsa0JBQWtCO1lBQy9CLElBQUksWUFBWSxLQUFLLFNBQVMsRUFBRTtnQkFDOUIsTUFBTSxJQUFJLEtBQUssQ0FDYiw0R0FBNEcsQ0FDN0csQ0FBQzthQUNIO1lBQ0QsT0FBTyxpQkFBaUIsQ0FDdEIsWUFBWSxFQUNaLGdCQUFnQixFQUNoQix5QkFBeUIsRUFDekIsZUFBZSxDQUNoQixDQUFDO1FBRUo7WUFDRSxPQUFPLGNBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7S0FDN0I7QUFDSCxDQUFDO0FBL0JELDRGQStCQyJ9 /***/ }), @@ -202231,12 +204505,18 @@ exports.calculateConditionalOrderTriggerSubticks = calculateConditionalOrderTrig /*!************************************************!*\ !*** ./src/clients/helpers/request-helpers.ts ***! \************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.generateQueryPath = void 0; +exports.parseToPrimitives = exports.generateQueryPath = void 0; +const long_1 = __importDefault(__webpack_require__(/*! long */ "./node_modules/long/src/long.js")); +/* eslint-disable @typescript-eslint/no-explicit-any */ function generateQueryPath(url, params) { const definedEntries = Object.entries(params).filter(([_key, value]) => value !== undefined); if (!definedEntries.length) { @@ -202248,7 +204528,53 @@ function generateQueryPath(url, params) { return `${url}?${paramsString}`; } exports.generateQueryPath = generateQueryPath; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdC1oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NsaWVudHMvaGVscGVycy9yZXF1ZXN0LWhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsU0FBZ0IsaUJBQWlCLENBQUMsR0FBVyxFQUFFLE1BQVU7SUFDdkQsTUFBTSxjQUFjLEdBQUcsTUFBTSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQyxNQUFNLENBQ2xELENBQUMsQ0FBQyxJQUFJLEVBQUUsS0FBSyxDQUFvQixFQUFFLEVBQUUsQ0FBQyxLQUFLLEtBQUssU0FBUyxDQUMxRCxDQUFDO0lBRUYsSUFBSSxDQUFDLGNBQWMsQ0FBQyxNQUFNLEVBQUU7UUFDMUIsT0FBTyxHQUFHLENBQUM7S0FDWjtJQUVELE1BQU0sWUFBWSxHQUFHLGNBQWM7U0FDaEMsR0FBRyxDQUFDLENBQUMsQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFvQixFQUFFLEVBQUUsQ0FBQyxHQUFHLEdBQUcsSUFBSSxLQUFLLEVBQUUsQ0FBQztTQUMzRCxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDYixPQUFPLEdBQUcsR0FBRyxJQUFJLFlBQVksRUFBRSxDQUFDO0FBQ2xDLENBQUM7QUFiRCw4Q0FhQyJ9 +function parseToPrimitives(x) { + if (typeof x === 'number' || typeof x === 'string' || typeof x === 'boolean' || x === null) { + return x; + } + if (Array.isArray(x)) { + return x.map((item) => parseToPrimitives(item)); + } + if (long_1.default.isLong(x)) { + return x.toString(); + } + if (x instanceof Uint8Array) { + return bytesToBigInt(x).toString(); + } + if (x instanceof Date) { + return x.toString(); + } + if (typeof x === 'object') { + const parsedObj = {}; + // eslint-disable-next-line no-restricted-syntax + for (const key in x) { + if (Object.prototype.hasOwnProperty.call(x, key)) { + parsedObj[key] = parseToPrimitives(x[key]); + } + } + return parsedObj; + } + if (typeof x === 'bigint') { + return x.toString(); + } + throw new Error(`Unsupported data type: ${typeof x}`); +} +exports.parseToPrimitives = parseToPrimitives; +/** + * Converts a byte array (representing an arbitrary-size signed integer) into a bigint. + * @param u Array of bytes represented as a Uint8Array. + */ +function bytesToBigInt(u) { + if (u.length <= 1) { + return BigInt(0); + } + // eslint-disable-next-line no-bitwise + const negated = (u[0] & 1) === 1; + const hex = Buffer.from(u.slice(1)).toString('hex'); + const abs = BigInt(`0x${hex}`); + return negated ? -abs : abs; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdC1oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NsaWVudHMvaGVscGVycy9yZXF1ZXN0LWhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsZ0RBQXdCO0FBRXhCLHVEQUF1RDtBQUN2RCxTQUF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ztJQUN0QyxNQUFNLE9BQU8sR0FBWSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDMUMsTUFBTSxHQUFHLEdBQVcsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQzVELE1BQU0sR0FBRyxHQUFXLE1BQU0sQ0FBQyxLQUFLLEdBQUcsRUFBRSxDQUFDLENBQUM7SUFDdkMsT0FBTyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUM7QUFDOUIsQ0FBQyJ9 /***/ }), @@ -202269,6 +204595,7 @@ const constants_1 = __webpack_require__(/*! ./constants */ "./src/clients/consta const account_1 = __importDefault(__webpack_require__(/*! ./modules/account */ "./src/clients/modules/account.ts")); const markets_1 = __importDefault(__webpack_require__(/*! ./modules/markets */ "./src/clients/modules/markets.ts")); const utility_1 = __importDefault(__webpack_require__(/*! ./modules/utility */ "./src/clients/modules/utility.ts")); +const vault_1 = __importDefault(__webpack_require__(/*! ./modules/vault */ "./src/clients/modules/vault.ts")); /** * @description Client for Indexer */ @@ -202279,6 +204606,7 @@ class IndexerClient { this._markets = new markets_1.default(config.restEndpoint); this._account = new account_1.default(config.restEndpoint); this._utility = new utility_1.default(config.restEndpoint); + this._vault = new vault_1.default(config.restEndpoint); } /** * @description Get the public module, used for interacting with public endpoints. @@ -202302,9 +204630,17 @@ class IndexerClient { get utility() { return this._utility; } + /** + * @description Get the vault module, used for interacting with vault endpoints. + * + * @returns The vault module + */ + get vault() { + return this._vault; + } } exports.IndexerClient = IndexerClient; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXhlci1jbGllbnQuanMiLCJzb3VyY2VSb290IjoiI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BQztJQUN2QixDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILElBQUksS0FBSztRQUNQLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQztJQUNyQixDQUFDO0NBQ0Y7QUFuREQsc0NBbURDIn0= /***/ }), @@ -205777,37 +208113,48 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.generateRegistry = exports.registry = void 0; const proto_signing_1 = __webpack_require__(/*! @cosmjs/proto-signing */ "./node_modules/@cosmjs/proto-signing/build/index.js"); const stargate_1 = __webpack_require__(/*! @cosmjs/stargate */ "./node_modules/@cosmjs/stargate/build/index.js"); -const tx_1 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/tx.ts"); -const tx_2 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/delaymsg/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/delaymsg/tx.ts"); -const tx_3 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx.ts"); -const tx_4 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx.ts"); +const tx_1 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/tx.ts"); +const tx_2 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/tx.ts"); +const tx_3 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/delaymsg/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/delaymsg/tx.ts"); +const tx_4 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx.ts"); +const tx_5 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx.ts"); +const tx_6 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx.ts"); const transfer_1 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts"); -const tx_5 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx.ts"); +const tx_7 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx.ts"); +const tx_8 = __webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/tx.ts"); const constants_1 = __webpack_require__(/*! ../constants */ "./src/clients/constants.ts"); exports.registry = []; function generateRegistry() { return new proto_signing_1.Registry([ // clob - [constants_1.TYPE_URL_MSG_PLACE_ORDER, tx_1.MsgPlaceOrder], - [constants_1.TYPE_URL_MSG_CANCEL_ORDER, tx_1.MsgCancelOrder], - [constants_1.TYPE_URL_MSG_CREATE_CLOB_PAIR, tx_1.MsgCreateClobPair], - [constants_1.TYPE_URL_MSG_UPDATE_CLOB_PAIR, tx_1.MsgUpdateClobPair], + [constants_1.TYPE_URL_MSG_PLACE_ORDER, tx_2.MsgPlaceOrder], + [constants_1.TYPE_URL_MSG_CANCEL_ORDER, tx_2.MsgCancelOrder], + [constants_1.TYPE_URL_BATCH_CANCEL, tx_2.MsgBatchCancel], + [constants_1.TYPE_URL_MSG_CREATE_CLOB_PAIR, tx_2.MsgCreateClobPair], + [constants_1.TYPE_URL_MSG_UPDATE_CLOB_PAIR, tx_2.MsgUpdateClobPair], // delaymsg - [constants_1.TYPE_URL_MSG_DELAY_MESSAGE, tx_2.MsgDelayMessage], + [constants_1.TYPE_URL_MSG_DELAY_MESSAGE, tx_3.MsgDelayMessage], + // listing + [constants_1.TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS, tx_4.MsgCreateMarketPermissionless], // perpetuals - [constants_1.TYPE_URL_MSG_CREATE_PERPETUAL, tx_3.MsgCreatePerpetual], + [constants_1.TYPE_URL_MSG_CREATE_PERPETUAL, tx_5.MsgCreatePerpetual], // prices - [constants_1.TYPE_URL_MSG_CREATE_ORACLE_MARKET, tx_4.MsgCreateOracleMarket], + [constants_1.TYPE_URL_MSG_CREATE_ORACLE_MARKET, tx_6.MsgCreateOracleMarket], + // vaults + [constants_1.TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT, tx_8.MsgDepositToMegavault], + [constants_1.TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT, tx_8.MsgWithdrawFromMegavault], // sending - [constants_1.TYPE_URL_MSG_CREATE_TRANSFER, tx_5.MsgCreateTransfer], + [constants_1.TYPE_URL_MSG_CREATE_TRANSFER, tx_7.MsgCreateTransfer], [constants_1.TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT, transfer_1.MsgWithdrawFromSubaccount], [constants_1.TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT, transfer_1.MsgDepositToSubaccount], + // affiliates + [constants_1.TYPE_URL_MSG_REGISTER_AFFILIATE, tx_1.MsgRegisterAffiliate], // default types ...stargate_1.defaultRegistryTypes, ]); } exports.generateRegistry = generateRegist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c0MsQ0FBQztRQUUzRSxTQUFTO1FBQ1QsQ0FBQyw2Q0FBaUMsRUFBRSwwQkFBc0MsQ0FBQztRQUMzRSxDQUFDLGdEQUFvQyxFQUFFLDZCQUF5QyxDQUFDO1FBRWpGLFVBQVU7UUFDVixDQUFDLHdDQUE0QixFQUFFLHNCQUFrQyxDQUFDO1FBQ2xFLENBQUMsaURBQXFDLEVBQUUsb0NBQTBDLENBQUM7UUFDbkYsQ0FBQyw4Q0FBa0MsRUFBRSxpQ0FBdUMsQ0FBQztRQUU3RSxhQUFhO1FBQ2IsQ0FBQywyQ0FBK0IsRUFBRSx5QkFBcUMsQ0FBQztRQUV4RSxnQkFBZ0I7UUFDaEIsR0FBRywrQkFBb0I7S0FDeEIsQ0FBQyxDQUFDO0FBQ0wsQ0FBQztBQXBDRCw0Q0FvQ0MifQ== /***/ }), @@ -205829,6 +208176,7 @@ const rest_1 = __importDefault(__webpack_require__(/*! ./rest */ "./src/clients/ * @description REST endpoints for data related to a particular address. */ class AccountClient extends rest_1.default { + // ------ Subaccount ------ // async getSubaccounts(address, limit) { const uri = `/v4/addresses/${address}`; return this.get(uri, { limit }); @@ -205837,6 +208185,11 @@ class AccountClient extends rest_1.default { const uri = `/v4/addresses/${address}/subaccountNumber/${subaccountNumber}`; return this.get(uri); } + async getParentSubaccount(address, parentSubaccountNumber) { + const uri = `/v4/addresses/${address}/subaccountNumber/${parentSubaccountNumber}`; + return this.get(uri); + } + // ------ Positions ------ // async getSubaccountPerpetualPositions(address, subaccountNumber, status, limit, createdBeforeOrAtHeight, createdBeforeOrAt) { const uri = '/v4/perpetualPositions'; return this.get(uri, { @@ -205859,6 +208212,18 @@ class AccountClient extends rest_1.default { createdBeforeOrAt, }); } + // ------ Transfers ------ // + async getTransfersBetween(sourceAddress, sourceSubaccountNumber, recipientAddress, recipientSubaccountNumber, createdBeforeOrAtHeight, createdBeforeOrAt) { + const uri = '/v4/transfers/between'; + return this.get(uri, { + sourceAddress, + sourceSubaccountNumber, + recipientAddress, + recipientSubaccountNumber, + createdBeforeOrAtHeight, + createdBeforeOrAt, + }); + } async getSubaccountTransfers(address, subaccountNumber, limit, createdBeforeOrAtHeight, createdBeforeOrAt, page) { const uri = '/v4/transfers'; return this.get(uri, { @@ -205881,6 +208246,7 @@ class AccountClient extends rest_1.default { page, }); } + // ------ Orders ------ // async getSubaccountOrders(address, subaccountNumber, ticker, tickerType = constants_1.TickerType.PERPETUAL, side, status, type, limit, goodTilBlockBeforeOrAt, goodTilBlockTimeBeforeOrAt, returnLatestOrders) { const uri = '/v4/orders'; return this.get(uri, { @@ -205897,10 +208263,26 @@ class AccountClient extends rest_1.default { returnLatestOrders, }); } + async getParentSubaccountNumberOrders(address, parentSubaccountNumber, ticker, side, status, type, limit, goodTilBlockBeforeOrAt, goodTilBlockTimeBeforeOrAt, returnLatestOrders) { + const uri = '/v4/orders/parentSubaccountNumber'; + return this.get(uri, { + address, + parentSubaccountNumber, + ticker, + side, + status, + type, + limit, + goodTilBlockBeforeOrAt, + goodTilBlockTimeBeforeOrAt, + returnLatestOrders, + }); + } async getOrder(orderId) { const uri = `/v4/orders/${orderId}`; return this.get(uri); } + // ------ Fills ------ // async getSubaccountFills(address, subaccountNumber, ticker, tickerType = constants_1.TickerType.PERPETUAL, limit, createdBeforeOrAtHeight, createdBeforeOrAt, page) { const uri = '/v4/fills'; return this.get(uri, { @@ -205927,6 +208309,7 @@ class AccountClient extends rest_1.default { page, }); } + // ------ Pnl ------ // async getSubaccountHistoricalPNLs(address, subaccountNumber, createdBeforeOrAtHeight, createdBeforeOrAt, createdOnOrAfterHeight, createdOnOrAfter, limit, page) { const uri = '/v4/historical-pnl'; return this.get(uri, { @@ -205940,9 +208323,27 @@ class AccountClient extends rest_1.default { page, }); } + async getParentSubaccountNumberHistoricalPNLs(address, parentSubaccountNumber, createdBeforeOrAtHeight, createdBeforeOrAt, createdOnOrAfterHeight, createdOnOrAfter, limit, page) { + const uri = '/v4//historical-pnl/parentSubaccount'; + return this.get(uri, { + address, + parentSubaccountNumber, + createdBeforeOrAtHeight, + createdBeforeOrAt, + createdOnOrAfterHeight, + createdOnOrAfter, + limit, + page, + }); + } + // ------ Rewards ------ // + async getHistoricalTradingRewardsAggregations(address, period, limit, startingBeforeOrAt, startingBeforeOrAtHeight) { + const uri = `/v4/historicalTradingRewardAggregations/${address}`; + return this.get(uri, { period, limit, startingBeforeOrAt, startingBeforeOrAtHeight }); + } } exports["default"] = AccountClient; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jbGllbnRzL21vZHVsZXMvYWNjb3VudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDRDQUE2RjtBQUU3RixrREFBZ0M7QUFFaEM7O0dBRUc7QUFDSCxNQUFxQixhQUFjLFNBQVEsY0FBVTtJQUNuRCxLQUFLLENBQUMsY0FBYyxDQUFDLE9BQWUsRUFBRSxLQUFjO1FBQ2xELE1BQU0sR0FBRyxHQUFHLGlCQUFpQixPQUFPLEVBQUUsQ0FBQztRQUN2QyxPQUFPLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQztJQUNsQyxDQUFDO0lBRUQsS0FBSyxDQUFDLGFBQWEsQ0FBQyxPQUFlLEVBQUUsZ0JBQXdCO1FBQzNELE1BQU0sR0FBRyxHQUFHLGlCQUFpQixPQUFPLHFCQUFxQixnQkFBZ0IsRUFBRSxDQUFDO1FBQzVFLE9BQU8sSUFBSSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUN2QixDQUFDO0lBRUQsS0FBSyxDQUFDLCtCQUErQixDQUNuQyxPQUFlLEVBQ2YsZ0JBQXdCLEVBQ3hCLE1BQThCLEVBQzlCLEtBQXFCLEVBQ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3hGLENBQUM7Q0FDRjtBQWhTRCxnQ0FnU0MifQ== /***/ }), @@ -206023,6 +208424,21 @@ class Composer { value: msg, }; } + composeMsgBatchCancelShortTermOrders(address, subaccountNumber, shortTermCancels, goodTilBlock) { + const subaccountId = { + owner: address, + number: subaccountNumber, + }; + const msg = { + subaccountId, + shortTermCancels, + goodTilBlock, + }; + return { + typeUrl: constants_1.TYPE_URL_BATCH_CANCEL, + value: msg, + }; + } composeMsgCreateClobPair(clobId, perpetualId, quantumConversionExponent, stepBaseQuantums, subticksPerTick) { const msg = { // uses x/gov module account since creating the clob pair is a governance action. @@ -206209,6 +208625,36 @@ class Composer { value: msg, }; } + // ------------ x/vault ------------ + composeMsgDepositToMegavault(address, subaccountNumber, quoteQuantums) { + const subaccountId = { + owner: address, + number: subaccountNumber, + }; + const msg = { + quoteQuantums, + subaccountId, + }; + return { + typeUrl: constants_1.TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT, + value: msg, + }; + } + composeMsgWithdrawFromMegavault(address, subaccountNumber, shares, minQuoteQuantums) { + const subaccountId = { + owner: address, + number: subaccountNumber, + }; + const msg = { + minQuoteQuantums, + shares: { numShares: shares }, + subaccountId, + }; + return { + typeUrl: constants_1.TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT, + value: msg, + }; + } // ------------ x/staking ------------ composeMsgDelegate(delegator, validator, amount) { const msg = { @@ -206243,6 +208689,32 @@ class Composer { value: msg, }; } + // ------------ x/affiliates ------------ + composeMsgRegisterAffiliate(referee, affiliate) { + const msg = { + referee, + affiliate, + }; + return { + typeUrl: constants_1.TYPE_URL_MSG_REGISTER_AFFILIATE, + value: msg, + }; + } + // ------------ x/listing ------------ + composeMsgCreateMarketPermissionless(address, ticker, subaccountNumber) { + const subaccountId = { + owner: address, + number: subaccountNumber, + }; + const msg = { + ticker, + subaccountId + }; + return { + typeUrl: constants_1.TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS, + value: msg, + }; + } // ------------ util ------------ validateGoodTilBlockAndTime(orderFlags, goodTilBlock, goodTilBlockTime) { if (orderFlags === 0 && goodTilBlock === 0) { @@ -206261,7 +208733,7 @@ class Composer { } } exports.Composer = Composer; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9zZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpZW50cy9tb2R1bGVzL2NvbXBvc2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQVNBLDhGQUFpRztBQVlqRyxnREFBd0I7QUFDeEIsNERBQWtDO0FBRWxDLDRDQWtCc0I7QUFFdEIscURBYTBCO0FBRTFCLG9CQUFRLENBQUMsSUFBSSxDQUFDLElBQUksR0FBRyxjQUFJLENBQUM7QUFDMUIsb0JBQVEsQ0FBQyxTQUFTLEVBQUUsQ0FBQztBQUVyQixNQUFhLFFBQVE7SUFDbkIsbUNBQW1DO0lBQzVCLG9CQUFvQixDQUN6QixPQUFlLEVBQ2YsZ0JBQXdCLEVBQ3hCLFFBQWdCLEVBQ2hCLFVBQWtCLEVBQ2xCLFVBQWtCLEVBQ2xCLFlBQW9CLEVBQ3BCLGdCQUF3QixFQUN4QixJQUFnQixFQUNoQixRQUFjLEVBQ2QsUUFBYyxFQUNkLFdBQThCLEVBQzlCLFVBQW1CLEVBQ25CLGNBQXNCLEVBQ3RCLGdCQUFxQyxvQ0FBbUIsQ0FBQywwQkFBMEIsRUFDbkYsa0NBQXdDLGNBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDO1FBRXZELElBQUksQ0FBQywyQkFBMkIsQ0FBQyxVQUFVLEVBQUUsWUFBWSxFQUFFLGdCQUFnQixDQUFDLENBQUM7UUFFN0UsTUFBTSxZQUFZLEdBQWlCO1lBQ2pDLEtBQUssRUFBRSxPQUFPO1lBQ2QsTUFBTSxFQUFFLGdCQUFnQjtTQUN6QixDQUFDO1FBRU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xDQUFDO0lBQ3pCLENBQUM7Q0FDRjtBQTdnQkQsNEJBNmdCQyJ9 /***/ }), @@ -206306,6 +208778,7 @@ const AuthModule = __importStar(__webpack_require__(/*! cosmjs-types/cosmos/auth const BankModule = __importStar(__webpack_require__(/*! cosmjs-types/cosmos/bank/v1beta1/query */ "./node_modules/cosmjs-types/cosmos/bank/v1beta1/query.js")); const long_1 = __importDefault(__webpack_require__(/*! long */ "./node_modules/long/src/long.js")); const protobufjs_1 = __importDefault(__webpack_require__(/*! protobufjs */ "./node_modules/protobufjs/index.js")); +const helpers_1 = __webpack_require__(/*! ../../lib/helpers */ "./src/lib/helpers.ts"); const constants_1 = __webpack_require__(/*! ../constants */ "./src/clients/constants.ts"); const errors_1 = __webpack_require__(/*! ../lib/errors */ "./src/clients/lib/errors.ts"); const proto_includes_1 = __webpack_require__(/*! ./proto-includes */ "./src/clients/modules/proto-includes.ts"); @@ -206548,8 +209021,7 @@ class Get { async getDelegationTotalRewards(delegatorAddress) { const requestData = Uint8Array.from(proto_includes_1.DistributionModule.QueryDelegationTotalRewardsRequest.encode({ delegatorAddress, - }) - .finish()); + }).finish()); const data = await this.sendQuery('/cosmos.distribution.v1beta1.Query/DelegationTotalRewards', requestData); return proto_includes_1.DistributionModule.QueryDelegationTotalRewardsResponse.decode(data); } @@ -206595,8 +209067,10 @@ class Get { const data = await this.sendQuery('/cosmos.gov.v1.Query/Proposals', requestData); return proto_includes_1.GovV1Module.QueryProposalsResponse.decode(data); } - async getWithdrawalAndTransferGatingStatus() { - const requestData = Uint8Array.from(proto_includes_1.SubaccountsModule.QueryGetWithdrawalAndTransfersBlockedInfoRequest.encode({}).finish()); + async getWithdrawalAndTransferGatingStatus(perpetualId) { + const requestData = Uint8Array.from(proto_includes_1.SubaccountsModule.QueryGetWithdrawalAndTransfersBlockedInfoRequest.encode({ + perpetualId, + }).finish()); const data = await this.sendQuery('/dydxprotocol.subaccounts.Query/GetWithdrawalAndTransfersBlockedInfo', requestData); return proto_includes_1.SubaccountsModule.QueryGetWithdrawalAndTransfersBlockedInfoResponse.decode(data); } @@ -206607,6 +209081,46 @@ class Get { const data = await this.sendQuery('/dydxprotocol.ratelimit.Query/CapacityByDenom', requestData); return proto_includes_1.RateLimitModule.QueryCapacityByDenomResponse.decode(data); } + async getMegavaultOwnerShares(address) { + const requestData = Uint8Array.from(proto_includes_1.VaultModule.QueryMegavaultOwnerSharesRequest.encode({ + address, + }).finish()); + const data = await this.sendQuery('/dydxprotocol.vault.Query/MegavaultOwnerShares', requestData); + return proto_includes_1.VaultModule.QueryMegavaultOwnerSharesResponse.decode(data); + } + async getMegavaultWithdrawalInfo(sharesToWithdraw) { + const requestData = Uint8Array.from(proto_includes_1.VaultModule.QueryMegavaultWithdrawalInfoRequest.encode({ + sharesToWithdraw: { + numShares: (0, helpers_1.bigIntToBytes)(sharesToWithdraw), + }, + }).finish()); + const data = await this.sendQuery('/dydxprotocol.vault.Query/MegavaultWithdrawalInfo', requestData); + return proto_includes_1.VaultModule.QueryMegavaultWithdrawalInfoResponse.decode(data); + } + async getAffiliateInfo(address) { + const requestData = Uint8Array.from(proto_includes_1.AffiliateModule.AffiliateInfoRequest.encode({ + address, + }).finish()); + const data = await this.sendQuery('/dydxprotocol.affiliates.Query/AffiliateInfo', requestData); + return proto_includes_1.AffiliateModule.AffiliateInfoResponse.decode(data); + } + async getReferredBy(address) { + const requestData = Uint8Array.from(proto_includes_1.AffiliateModule.ReferredByRequest.encode({ + address, + }).finish()); + const data = await this.sendQuery('/dydxprotocol.affiliates.Query/ReferredBy', requestData); + return proto_includes_1.AffiliateModule.ReferredByResponse.decode(data); + } + async getAllAffiliateTiers() { + const requestData = Uint8Array.from(proto_includes_1.AffiliateModule.AllAffiliateTiersRequest.encode({}).finish()); + const data = await this.sendQuery('/dydxprotocol.affiliates.Query/AllAffiliateTiers', requestData); + return proto_includes_1.AffiliateModule.AllAffiliateTiersResponse.decode(data); + } + async getAffiliateWhitelist() { + const requestData = Uint8Array.from(proto_includes_1.AffiliateModule.AffiliateWhitelistRequest.encode({}).finish()); + const data = await this.sendQuery('/dydxprotocol.affiliates.Query/AffiliateWhitelist', requestData); + return proto_includes_1.AffiliateModule.AffiliateWhitelistResponse.decode(data); + } async sendQuery(requestUrl, requestData) { // eslint-disable-next-line max-len const resp = await this.stargateQueryClient.queryAbci(requestUrl, requestData); @@ -206614,7 +209128,7 @@ class Get { } } exports.Get = Get; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NsaWVudHMvbW9kdWxlcy9nZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFDQSwrQ0FPMEI7QUFDMUIsbUZBQXFFO0FBQ3JFLG1GQUFxRTtBQUVyRSxnREFBd0I7QUFDeEIsNERBQWtDO0FBRWxDLDRDQUE0QztBQUM1QywwQ0FBc0Q7QUFDdEQscURBYzBCO0FBRzFCLG9FQUFvRTtBQUNwRSw2RUFBNkU7QUFDN0UsbUZBQW1GO0FBQ25GLGtFQUFrRTtBQUNsRSxvQkFBUSxDQUFDLElBQUksQ0FBQyxJQUFJLEdBQUcsY0FBSSxDQUFDO0FBQzFCLG9CQUFRLENBQUMsU0FBUyxFQUFFLENBQUM7QUFFckIsTUFBYSxHQUFHO0lBSWQsWUFDRSxnQkFBa0MsRUFDbEMsbUJBQXNEO1FBRXRELElBQUksQ0FBQyxnQkFBZ0IsR0FBRyxnQkFBZ0IsQ0FBQztRQUN6QyxJQUFJLENBQUMsbUJBQW1CLEdBQUcsbUJBQW1CLENBQUM7SUFDakQsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxLQUFLLENBQUMsV0FBVztRQUNmLE9BQU8sSUFBSSxDQUFDLGdCQUFnQixDQUFDLFFBQVEsRUFBRSxD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WpCLE9BQU8sSUFBSSxDQUFDLE1BQU8sQ0FBQyxlQUFlLENBQUMsUUFBUSxFQUFFLGtCQUFrQixFQUFFLEdBQUcsRUFBRSxJQUFJLENBQUMsQ0FBQztJQUMvRSxDQUFDO0NBQ0Y7QUE3Q0QsOEJBNkNDIn0= /***/ }), @@ -206772,8 +209286,9 @@ const proto_includes_1 = __webpack_require__(/*! ./proto-includes */ "./src/clie protobufjs_1.default.util.Long = long_1.default; protobufjs_1.default.configure(); class Post { - constructor(get, chainId, denoms, defaultClientMemo) { + constructor(get, chainId, denoms, defaultClientMemo, useTimestampNonce) { this.selectedGasDenom = constants_1.SelectedGasDenom.USDC; + this.useTimestampNonce = false; this.accountNumberCache = new Map(); this.get = get; this.chainId = chainId; @@ -206785,6 +209300,19 @@ class Post { this.defaultDydxGasPrice = stargate_1.GasPrice.fromString(`25000000000${denoms.CHAINTOKEN_GAS_DENOM !== undefined ? denoms.CHAINTOKEN_GAS_DENOM : denoms.CHAINTOKEN_DENOM}`); + if (useTimestampNonce === true) + this.useTimestampNonce = useTimestampNonce; + } + /** + * @description Retrieves the account number for the given wallet address and populates the accountNumberCache. + * The account number is required for txOptions when signing a transaction. + * Pre-populating the cache avoids a round-trip request during the first transaction creation in the session, preventing it from being a performance blocker. + */ + async populateAccountNumberCache(address) { + if (this.accountNumberCache.has(address)) + return; + const account = await this.get.getAccount(address); + this.accountNumberCache.set(address, account); } setSelectedGasDenom(selectedGasDenom) { this.selectedGasDenom = selectedGasDenom; @@ -206803,11 +209331,20 @@ class Post { * @returns The Fee for broadcasting a transaction. */ async simulate(wallet, messaging, gasPrice = this.getGasPrice(), memo, account) { - const msgsPromise = messaging(); - const accountPromise = account ? await account() : this.account(wallet.address); - const msgsAndAccount = await Promise.all([msgsPromise, accountPromise]); - const msgs = msgsAndAccount[0]; - return this.simulateTransaction(wallet.pubKey, msgsAndAccount[1].sequence, msgs, gasPrice, memo); + let msgs; + // protocol expects timestamp nonce in UTC milliseconds, which is the unit returned by Date.now() + let sequence = Date.now(); + if (this.useTimestampNonce) { + msgs = await messaging(); + } + else { + const msgsPromise = messaging(); + const accountPromise = account ? await account() : this.account(wallet.address); + const msgsAndAccount = await Promise.all([msgsPromise, accountPromise]); + msgs = msgsAndAccount[0]; + sequence = msgsAndAccount[1].sequence; + } + return this.simulateTransaction(wallet.pubKey, sequence, msgs, gasPrice, memo); } /** * @description Sign a transaction @@ -206832,12 +209369,12 @@ class Post { * at any point. * @returns The Tx Hash. */ - async send(wallet, messaging, zeroFee, gasPrice = this.getGasPrice(), memo, broadcastMode, account) { + async send(wallet, messaging, zeroFee, gasPrice = this.getGasPrice(), memo, broadcastMode, account, gasAdjustment = constants_1.GAS_MULTIPLIER) { const msgsPromise = messaging(); const accountPromise = account ? await account() : this.account(wallet.address); const msgsAndAccount = await Promise.all([msgsPromise, accountPromise]); const msgs = msgsAndAccount[0]; - return this.signAndSendTransaction(wallet, msgsAndAccount[1], msgs, zeroFee, gasPrice, memo !== null && memo !== void 0 ? memo : this.defaultClientMemo, broadcastMode !== null && broadcastMode !== void 0 ? broadcastMode : this.defaultBroadcastMode(msgs)); + return this.signAndSendTransaction(wallet, msgsAndAccount[1], msgs, zeroFee, gasPrice, memo !== null && memo !== void 0 ? memo : this.defaultClientMemo, broadcastMode !== null && broadcastMode !== void 0 ? broadcastMode : this.defaultBroadcastMode(msgs), gasAdjustment); } /** * @description Calculate the default broadcast mode. @@ -206867,16 +209404,18 @@ class Post { * * @returns The Tx Response. */ - async signTransaction(wallet, messages, account, zeroFee, gasPrice = this.getGasPrice(), memo) { + async signTransaction(wallet, messages, account, zeroFee, gasPrice = this.getGasPrice(), memo, gasAdjustment = constants_1.GAS_MULTIPLIER) { + // protocol expects timestamp nonce in UTC milliseconds, which is the unit returned by Date.now() + const sequence = this.useTimestampNonce ? Date.now() : account.sequence; // Simulate transaction if no fee is specified. const fee = zeroFee ? { amount: [], gas: '1000000', } - : await this.simulateTransaction(wallet.pubKey, account.sequence, messages, gasPrice, memo); + : await this.simulateTransaction(wallet.pubKey, sequence, messages, gasPrice, memo, gasAdjustment); const txOptions = { - sequence: account.sequence, + sequence, accountNumber: account.accountNumber, chainId: this.chainId, }; @@ -206887,11 +209426,12 @@ class Post { * @description Retrieve an account structure for transactions. * For short term orders, the sequence doesn't matter. Use cached if available. * For long term and conditional orders, a round trip to validator must be made. + * when timestamp nonce is supported, no need to fetch account sequence number */ async account(address, orderFlags) { - if (orderFlags === types_1.OrderFlags.SHORT_TERM) { + if (orderFlags === types_1.OrderFlags.SHORT_TERM || this.useTimestampNonce) { if (this.accountNumberCache.has(address)) { - // For SHORT_TERM orders, the sequence doesn't matter + // If order is SHORT_TERM or if timestamp nonce is enabled, the sequence doesn't matter return this.accountNumberCache.get(address); } } @@ -206904,8 +209444,8 @@ class Post { * * @returns The Tx Response. */ - async signAndSendTransaction(wallet, account, messages, zeroFee, gasPrice = this.getGasPrice(), memo, broadcastMode) { - const signedTransaction = await this.signTransaction(wallet, messages, account, zeroFee, gasPrice, memo); + async signAndSendTransaction(wallet, account, messages, zeroFee, gasPrice = this.getGasPrice(), memo, broadcastMode, gasAdjustment = constants_1.GAS_MULTIPLIER) { + const signedTransaction = await this.signTransaction(wallet, messages, account, zeroFee, gasPrice, memo, gasAdjustment); return this.sendSignedTransaction(signedTransaction, broadcastMode); } /** @@ -206923,7 +209463,7 @@ class Post { * at any point. * @returns The Fee for broadcasting a transaction. */ - async simulateTransaction(pubKey, sequence, messages, gasPrice = this.getGasPrice(), memo) { + async simulateTransaction(pubKey, sequence, messages, gasPrice = this.getGasPrice(), memo, gasAdjustment = constants_1.GAS_MULTIPLIER) { // Get simulated response. const encodedMessages = messages.map((message) => this.registry.encodeAsAny(message)); const simulationResponse = await this.get.stargateQueryClient.tx.simulate(encodedMessages, memo, pubKey, sequence); @@ -206933,7 +209473,7 @@ class Post { } // Calculate and return fee from gasEstimate. const gasEstimate = math_1.Uint53.fromString(simulationResponse.gasInfo.gasUsed.toString()).toNumber(); - const fee = (0, stargate_1.calculateFee)(Math.floor(gasEstimate * constants_1.GAS_MULTIPLIER), gasPrice); + const fee = (0, stargate_1.calculateFee)(Math.floor(gasEstimate * gasAdjustment), gasPrice); // TODO(TRCL-2550): Temporary workaround before IBC denom is supported in '@cosmjs/stargate'. // The '@cosmjs/stargate' does not support denom with '/', so currently GAS_PRICE is // represented in 'uusdc', and the output of `calculateFee` is in '', which is replaced @@ -206981,6 +209521,16 @@ class Post { async cancelOrderObject(subaccount, cancelOrder, broadcastMode) { return this.cancelOrder(subaccount, cancelOrder.clientId, cancelOrder.orderFlags, cancelOrder.clobPairId, cancelOrder.goodTilBlock, cancelOrder.goodTilBlockTime, broadcastMode); } + async batchCancelShortTermOrders(subaccount, shortTermOrders, goodTilBlock, broadcastMode) { + const msg = await this.batchCancelShortTermOrdersMsg(subaccount.address, subaccount.subaccountNumber, shortTermOrders, goodTilBlock); + return this.send(subaccount.wallet, () => Promise.resolve([msg]), true, undefined, undefined, broadcastMode); + } + async batchCancelShortTermOrdersMsg(address, subaccountNumber, shortTermOrders, goodTilBlock) { + return new Promise((resolve) => { + const msg = this.composer.composeMsgBatchCancelShortTermOrders(address, subaccountNumber, shortTermOrders, goodTilBlock); + resolve(msg); + }); + } async transfer(subaccount, recipientAddress, recipientSubaccountNumber, assetId, amount, broadcastMode) { const msg = await this.transferMsg(subaccount.address, subaccount.subaccountNumber, recipientAddress, recipientSubaccountNumber, assetId, amount); return this.send(subaccount.wallet, () => Promise.resolve([msg]), false, undefined, undefined, broadcastMode); @@ -207057,9 +209607,38 @@ class Post { withdrawDelegatorRewardMsg(delegator, validator) { return this.composer.composeMsgWithdrawDelegatorReward(delegator, validator); } + // vaults + async depositToMegavault(subaccount, quoteQuantums, broadcastMode) { + const msg = await this.depositToMegavaultMsg(subaccount.address, subaccount.subaccountNumber, quoteQuantums); + return this.send(subaccount.wallet, () => Promise.resolve([msg]), false, undefined, undefined, broadcastMode); + } + depositToMegavaultMsg(...args) { + return this.composer.composeMsgDepositToMegavault(...args); + } + async withdrawFromMegavault(subaccount, shares, minQuoteQuantums, broadcastMode) { + const msg = await this.withdrawFromMegavaultMsg(subaccount.address, subaccount.subaccountNumber, shares, minQuoteQuantums); + return this.send(subaccount.wallet, () => Promise.resolve([msg]), false, undefined, undefined, broadcastMode); + } + withdrawFromMegavaultMsg(...args) { + return this.composer.composeMsgWithdrawFromMegavault(...args); + } + async registerAffiliate(subaccount, affiliate, broadcastMode, gasAdjustment = 2) { + const msg = this.registerAffiliateMsg(subaccount.address, affiliate); + return this.send(subaccount.wallet, () => Promise.resolve([msg]), false, undefined, undefined, broadcastMode, undefined, gasAdjustment); + } + registerAffiliateMsg(...args) { + return this.composer.composeMsgRegisterAffiliate(...args); + } + launchMarketMsg(...args) { + return this.composer.composeMsgCreateMarketPermissionless(...args); + } + async createMarketPermissionless(ticker, subaccount, broadcastMode, gasAdjustment, memo) { + const msg = this.launchMarketMsg(subaccount.address, ticker, subaccount.subaccountNumber); + return this.send(subaccount.wallet, () => Promise.resolve([msg]), false, undefined, memo, broadcastMode, undefined, gasAdjustment); + } } exports.Post = Post; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9zdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jbGllbnRzL21vZHVsZXMvcG9zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDQSx1Q0FBc0M7QUFFdEMsK0NBQXNGO0FBQ3RGLDJEQUFnRDtBQUtoRCxvREFBdUI7QUFDdkIsZ0RBQXdCO0FBQ3hCLDREQUFrQztBQUVsQyw0Q0FBZ0U7QUFDaEUsMENBQXNEO0FBQ3RELDhDQUFtRDtBQUVuRCxvQ0FPa0I7QUFDbEIseUNBQXNDO0FBR3RDLHFEQU8wQjtBQUUxQixvRUFBb0U7QUFDcEUscUVBQXFFO0FBQ3JFLHdFQUF3RTtBQUN4RSxr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QyxHQUFHLENBQUMsQ0FBQyxFQUM1QixLQUFLLEVBQ0wsU0FBUyxFQUNULElBQUksRUFDSixhQUFhLEVBQ2IsU0FBUyxFQUNULGFBQWEsQ0FDZCxDQUFDO0lBQ0osQ0FBQztDQUNGO0FBcjRCRCxvQkFxNEJDIn0= /***/ }), @@ -207098,7 +209677,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DistributionModule = exports.BridgeModule = exports.StakingModule = exports.RewardsModule = exports.RateLimitModule = exports.FeeTierModule = exports.SubaccountsModule = exports.PricesModule = exports.PerpetualsModule = exports.ClobModule = exports.StatsModule = exports.GovV1Module = void 0; +exports.ListingModule = exports.VaultModule = exports.AffiliateModule = exports.DistributionModule = exports.BridgeModule = exports.StakingModule = exports.RewardsModule = exports.RateLimitModule = exports.FeeTierModule = exports.SubaccountsModule = exports.PricesModule = exports.PerpetualsModule = exports.ClobModule = exports.StatsModule = exports.GovV1Module = void 0; exports.GovV1Module = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/cosmos/gov/v1/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/gov/v1/query.ts")); exports.StatsModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/stats/query.ts")); exports.ClobModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/query.ts")); @@ -207111,6 +209690,9 @@ exports.RewardsModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-pr exports.StakingModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/cosmos/staking/v1beta1/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/staking/v1beta1/query.ts")); exports.BridgeModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/bridge/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/bridge/query.ts")); exports.DistributionModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/cosmos/distribution/v1beta1/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/distribution/v1beta1/query.ts")); +exports.AffiliateModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/query.ts")); +exports.VaultModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/query.ts")); +exports.ListingModule = __importStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/query */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/query.ts")); __exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/cosmos/base/abci/v1beta1/abci */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts"), exports); __exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/cosmos/gov/v1/gov */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/cosmos/gov/v1/gov.ts"), exports); __exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/order */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/order.ts"), exports); @@ -207124,7 +209706,8 @@ __exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprot __exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer.ts"), exports); __exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis.ts"), exports); __exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset.ts"), exports); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdG8taW5jbHVkZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpZW50cy9tb2R1bGVzL3Byb3RvLWluY2x1ZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsc0dBQXNGO0FBQ3RGLDJHQUEyRjtBQUUzRix5R0FBeUY7QUFDekYscUhBQXFHO0FBQ3JHLDZHQUE2RjtBQUM3Rix1SEFBdUc7QUFDdkcsZ0hBQWdHO0FBQ2hHLG1IQUFtRztBQUNuRywrR0FBK0Y7QUFDL0YsaUhBQWlHO0FBQ2pHLDZHQUE2RjtBQUM3RiwySEFBMkc7QUFFM0csbUdBQWlGO0FBQ2pGLHVGQUFxRTtBQUNyRSw2RkFBMkU7QUFDM0UsMEZBQXdFO0FBQ3hFLDhGQUE0RTtBQUM1RSxnR0FBOEU7QUFDOUUsNEZBQTBFO0FBQzFFLHlGQUF1RTtBQUN2RSx5R0FBdUY7QUFDdkYsNkZBQTJFO0FBQzNFLG1HQUFpRjtBQUNqRixpR0FBK0U7QUFDL0UsK0ZBQTZFIn0= +__exportStar(__webpack_require__(/*! @dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx */ "./node_modules/@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx.ts"), exports); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdG8taW5jbHVkZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpZW50cy9tb2R1bGVzL3Byb3RvLWluY2x1ZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsc0dBQXNGO0FBQ3RGLDJHQUEyRjtBQUUzRix5R0FBeUY7QUFDekYscUhBQXFHO0FBQ3JHLDZHQUE2RjtBQUM3Rix1SEFBdUc7QUFDdkcsZ0hBQWdHO0FBQ2hHLG1IQUFtRztBQUNuRywrR0FBK0Y7QUFDL0YsaUhBQWlHO0FBQ2pHLDZHQUE2RjtBQUM3RiwySEFBMkc7QUFDM0csb0hBQW9HO0FBQ3BHLDJHQUEyRjtBQUMzRiwrR0FBK0Y7QUFFL0YsbUdBQWlGO0FBQ2pGLHVGQUFxRTtBQUNyRSw2RkFBMkU7QUFDM0UsMEZBQXdFO0FBQ3hFLDhGQUE0RTtBQUM1RSxnR0FBOEU7QUFDOUUsNEZBQTBFO0FBQzFFLHlGQUF1RTtBQUN2RSx5R0FBdUY7QUFDdkYsNkZBQTJFO0FBQzNFLG1HQUFpRjtBQUNqRixpR0FBK0U7QUFDL0UsK0ZBQTZFO0FBQzdFLDZGQUEyRSJ9 /***/ }), @@ -207412,6 +209995,41 @@ exports["default"] = UtilityClient; /***/ }), +/***/ "./src/clients/modules/vault.ts": +/*!**************************************!*\ + !*** ./src/clients/modules/vault.ts ***! + \**************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const rest_1 = __importDefault(__webpack_require__(/*! ./rest */ "./src/clients/modules/rest.ts")); +/** + * @description REST endpoints for data unrelated to a particular address. + */ +class VaultClient extends rest_1.default { + async getMegavaultHistoricalPnl(resolution) { + const uri = '/v4/vault/v1/megavault/historicalPnl'; + return this.get(uri, { resolution }); + } + async getVaultsHistoricalPnl(resolution) { + const uri = '/v4/vault/v1/vaults/historicalPnl'; + return this.get(uri, { resolution }); + } + async getMegavaultPositions() { + const uri = '/v4/vault/v1/megavault/positions'; + return this.get(uri); + } +} +exports["default"] = VaultClient; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmF1bHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpZW50cy9tb2R1bGVzL3ZhdWx0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBRUEsa0RBQWdDO0FBRWhDOztHQUVHO0FBQ0gsTUFBcUIsV0FBWSxTQUFRLGNBQVU7SUFDakQsS0FBSyxDQUFDLHlCQUF5QixDQUFDLFVBQW1DO1FBQ2pFLE1BQU0sR0FBRyxHQUFHLHNDQUFzQyxDQUFDO1FBQ25ELE9BQU8sSUFBSSxDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsRUFBRSxVQUFVLEVBQUUsQ0FBQyxDQUFDO0lBQ3ZDLENBQUM7SUFFRCxLQUFLLENBQUMsc0JBQXNCLENBQUMsVUFBbUM7UUFDOUQsTUFBTSxHQUFHLEdBQUcsbUNBQW1DLENBQUM7UUFDaEQsT0FBTyxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsRUFBRSxFQUFFLFVBQVUsRUFBRSxDQUFDLENBQUM7SUFDdkMsQ0FBQztJQUVELEtBQUssQ0FBQyxxQkFBcUI7UUFDekIsTUFBTSxHQUFHLEdBQUcsa0NBQWtDLENBQUM7UUFDL0MsT0FBTyxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ3ZCLENBQUM7Q0FDRjtBQWZELDhCQWVDIn0= + +/***/ }), + /***/ "./src/clients/native.ts": /*!*******************************!*\ !*** ./src/clients/native.ts ***! @@ -207419,8 +210037,10 @@ exports["default"] = UtilityClient; /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; +/* eslint-disable @typescript-eslint/no-explicit-any */ /* Native app can call JS functions with primitives. */ @@ -207451,7 +210071,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSelectedGasDenom = exports.signCompliancePayload = exports.subaccountTransfer = exports.getWithdrawalAndTransferGatingStatus = exports.getWithdrawalCapacityByDenom = exports.cctpMultiMsgWithdraw = exports.cctpWithdraw = exports.withdrawToNobleIBC = exports.sendNobleIBC = exports.getNobleBalance = exports.getMarketPrice = exports.getCurrentUnstaking = exports.getStakingRewards = exports.getDelegatorDelegations = exports.getRewardsParams = exports.getOptimalIndexer = exports.getOptimalNode = exports.decodeAccountResponseValue = exports.encodeAccountRequestData = exports.signCancelOrder = exports.signPlaceOrder = exports.signRawPlaceOrder = exports.simulateTransferNativeToken = exports.simulateWithdraw = exports.simulateDeposit = exports.getUserStats = exports.getAccountBalances = exports.getAccountBalance = exports.transferNativeToken = exports.withdrawToIBC = exports.faucet = exports.withdraw = exports.deposit = exports.cancelOrder = exports.wrappedError = exports.placeOrder = exports.getPerpetualMarkets = exports.getEquityTiers = exports.getUserFeeTier = exports.getFeeTiers = exports.getHeight = exports.deriveMnemomicFromEthereumSignature = exports.connect = exports.connectWallet = exports.connectNetwork = exports.connectClient = void 0; +exports.depositToMegavault = exports.getMegavaultWithdrawalInfo = exports.getMegavaultOwnerShares = exports.setSelectedGasDenom = exports.signPushNotificationTokenRegistrationPayload = exports.signCompliancePayload = exports.subaccountTransfer = exports.getWithdrawalAndTransferGatingStatus = exports.getWithdrawalCapacityByDenom = exports.cctpMultiMsgWithdraw = exports.cctpWithdraw = exports.withdrawToNobleIBC = exports.sendNobleIBC = exports.getNobleBalance = exports.getMarketPrice = exports.getCurrentUnstaking = exports.getStakingRewards = exports.getDelegatorDelegations = exports.getRewardsParams = exports.getOptimalIndexer = exports.getOptimalNode = exports.decodeAccountResponseValue = exports.encodeAccountRequestData = exports.signCancelOrder = exports.signPlaceOrder = exports.signRawPlaceOrder = exports.simulateTransferNativeToken = exports.simulateWithdraw = exports.simulateDeposit = exports.getUserStats = exports.getAccountBalances = exports.getAccountBalance = exports.transferNativeToken = exports.withdrawToIBC = exports.faucet = exports.withdraw = exports.deposit = exports.cancelOrder = exports.wrappedError = exports.placeOrder = exports.getPerpetualMarkets = exports.getEquityTiers = exports.getUserFeeTier = exports.getFeeTiers = exports.getHeight = exports.deriveMnemomicFromEthereumSignature = exports.connect = exports.connectWallet = exports.connectNetwork = exports.connectClient = void 0; +exports.withdrawFromMegavault = void 0; const crypto_1 = __webpack_require__(/*! @cosmjs/crypto */ "./node_modules/@cosmjs/crypto/build/index.js"); const proto_signing_1 = __webpack_require__(/*! @cosmjs/proto-signing */ "./node_modules/@cosmjs/proto-signing/build/index.js"); const stargate_1 = __webpack_require__(/*! @cosmjs/stargate */ "./node_modules/@cosmjs/stargate/build/index.js"); @@ -207466,6 +210087,7 @@ const network_optimizer_1 = __webpack_require__(/*! ../network_optimizer */ "./s const composite_client_1 = __webpack_require__(/*! ./composite-client */ "./src/clients/composite-client.ts"); const constants_2 = __webpack_require__(/*! ./constants */ "./src/clients/constants.ts"); const faucet_client_1 = __webpack_require__(/*! ./faucet-client */ "./src/clients/faucet-client.ts"); +const request_helpers_1 = __webpack_require__(/*! ./helpers/request-helpers */ "./src/clients/helpers/request-helpers.ts"); const local_wallet_1 = __importDefault(__webpack_require__(/*! ./modules/local-wallet */ "./src/clients/modules/local-wallet.ts")); const noble_client_1 = __webpack_require__(/*! ./noble-client */ "./src/clients/noble-client.ts"); const subaccount_1 = __webpack_require__(/*! ./subaccount */ "./src/clients/subaccount.ts"); @@ -207537,6 +210159,11 @@ async function connectWallet(mnemonic) { try { globalThis.wallet = await local_wallet_1.default.fromMnemonic(mnemonic, constants_1.BECH32_PREFIX); globalThis.nobleWallet = await local_wallet_1.default.fromMnemonic(mnemonic, constants_1.NOBLE_BECH32_PREFIX); + const { privateKey, publicKey } = (0, onboarding_1.deriveHDKeyFromMnemonic)(mnemonic); + globalThis.hdKey = { + privateKey, + publicKey, + }; try { await ((_a = globalThis.nobleClient) === null || _a === void 0 ? void 0 : _a.connect(globalThis.nobleWallet)); } @@ -207609,13 +210236,18 @@ async function getFeeTiers() { } } exports.getFeeTiers = getFeeTiers; -async function getUserFeeTier(address) { +async function getUserFeeTier(payload) { var _a; try { const client = globalThis.client; if (client === undefined) { throw new errors_1.UserError('client is not connected. Call connectClient() first'); } + const json = JSON.parse(payload); + const address = json.address; + if (address === undefined) { + throw new errors_1.UserError('address is not set'); + } const feeTiers = await ((_a = globalThis.client) === null || _a === void 0 ? void 0 : _a.validatorClient.get.getUserFeeTier(address)); return (0, helpers_1.encodeJson)(feeTiers); } @@ -207804,7 +210436,7 @@ async function withdraw(payload) { throw new errors_1.UserError('amount is not set'); } const subaccount = new subaccount_1.SubaccountInfo(wallet, subaccountNumber); - const tx = await client.withdrawFromSubaccount(subaccount, amount, json.recipient); + const tx = await client.withdrawFromSubaccount(subaccount, amount, json.recipient, json.memo); return (0, helpers_1.encodeJson)(tx); } catch (error) { @@ -207901,7 +210533,7 @@ async function transferNativeToken(payload) { const encodeObjects = new Promise((resolve) => resolve(msgs)); const tx = await client.send(wallet, () => { return encodeObjects; - }, false, client.validatorClient.post.defaultDydxGasPrice, undefined); + }, false, client.validatorClient.post.defaultDydxGasPrice, json.memo); return (0, helpers_1.encodeJson)(tx); } catch (error) { @@ -208461,13 +211093,13 @@ async function getWithdrawalCapacityByDenom(payload) { } } exports.getWithdrawalCapacityByDenom = getWithdrawalCapacityByDenom; -async function getWithdrawalAndTransferGatingStatus() { +async function getWithdrawalAndTransferGatingStatus(perpetualId) { try { const client = globalThis.client; if (client === undefined) { throw new errors_1.UserError('client is not connected. Call connectClient() first'); } - const response = await client.validatorClient.get.getWithdrawalAndTransferGatingStatus(); + const response = await client.validatorClient.get.getWithdrawalAndTransferGatingStatus(perpetualId); return (0, helpers_1.encodeJson)(response); } catch (error) { @@ -208546,6 +211178,33 @@ async function signCompliancePayload(payload) { } } exports.signCompliancePayload = signCompliancePayload; +async function signPushNotificationTokenRegistrationPayload(payload) { + var _a, _b; + try { + const json = JSON.parse(payload); + const message = json.message; + if (message === undefined) { + throw new errors_1.UserError('message is not set'); + } + if (!((_a = globalThis.hdKey) === null || _a === void 0 ? void 0 : _a.privateKey) || !((_b = globalThis.hdKey) === null || _b === void 0 ? void 0 : _b.publicKey)) { + throw new Error('Missing hdKey'); + } + const timestampInSeconds = Math.floor(Date.now() / 1000); + const messageToSign = `${message}:REGISTER_TOKEN"${''}:${timestampInSeconds}`; + const messageHash = (0, crypto_1.sha256)(Buffer.from(messageToSign)); + const signed = await crypto_1.Secp256k1.createSignature(messageHash, globalThis.hdKey.privateKey); + const signedMessage = signed.toFixedLength(); + return (0, helpers_1.encodeJson)({ + signedMessage: Buffer.from(signedMessage).toString('base64'), + publicKey: Buffer.from(globalThis.hdKey.publicKey).toString('base64'), + timestamp: timestampInSeconds, + }); + } + catch (error) { + return wrappedError(error); + } +} +exports.signPushNotificationTokenRegistrationPayload = signPushNotificationTokenRegistrationPayload; async function setSelectedGasDenom(gasDenom) { try { const client = globalThis.client; @@ -208560,7 +211219,80 @@ async function setSelectedGasDenom(gasDenom) { } } exports.setSelectedGasDenom = setSelectedGasDenom; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlLmpzIiw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GFBQWEsRUFBRSxNQUFNLENBQUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQUM7WUFDNUQsU0FBUyxFQUFFLE1BQU0sQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLEtBQUssQ0FBQyxTQUFTLENBQUMsQ0FBQyxRQUFRLENBQUMsUUFBUSxDQUFDO1lBQ3JFLFNBQVMsRUFBRSxrQkFBa0I7U0FDOUIsQ0FBQyxDQUFDO0tBQ0o7SUFBQyxPQUFPLEtBQUssRUFBRTtRQUNkLE9BQU8sWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDO0tBQzVCO0FBQ0gsQ0FBQztBQWxDRCxzREFrQ0M7QUFFTSxLQUFLLFVBQVUsbUJBQW1CLENBQUMsUUFBZ0I7SUFDeEQsSUFBSTtRQUNGLE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQyxNQUFNLENBQUM7UUFDakMsSUFBSSxNQUFNLEtBQUssU0FBUyxFQUFFO1lBQ3hCLE1BQU0sSUFBSSxrQkFBUyxDQUFDLHFEQUFxRCxDQUFDLENBQUM7U0FDNUU7UUFDRCxNQUFNLE1BQU0sQ0FBQyxtQkFBbUIsQ0FBQyxRQUE0QixDQUFDLENBQUM7UUFDL0QsT0FBTyxJQUFBLG9CQUFVLEVBQUMsU0FBUyxDQUFDLENBQUM7S0FDOUI7SUFBQyxPQUFPLEtBQUssRUFBRTtRQUNkLE9BQU8sWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDO0tBQzVCO0FBQ0gsQ0FBQztBQVhELGtEQVdDIn0= +async function getMegavaultOwnerShares(payload) { + var _a; + try { + const client = globalThis.client; + if (client === undefined) { + throw new errors_1.UserError('client is not connected. Call connectClient() first'); + } + const json = JSON.parse(payload); + const address = json.address; + if (address === undefined) { + throw new errors_1.UserError('address is not set'); + } + const response = await ((_a = globalThis.client) === null || _a === void 0 ? void 0 : _a.validatorClient.get.getMegavaultOwnerShares(address)); + return (0, helpers_1.encodeJson)((0, request_helpers_1.parseToPrimitives)(response)); + } + catch (e) { + return wrappedError(e); + } +} +exports.getMegavaultOwnerShares = getMegavaultOwnerShares; +async function getMegavaultWithdrawalInfo(sharesToWithdraw) { + var _a; + try { + const client = globalThis.client; + if (client === undefined) { + throw new errors_1.UserError('client is not connected. Call connectClient() first'); + } + const response = await ((_a = globalThis.client) === null || _a === void 0 ? void 0 : _a.validatorClient.get.getMegavaultWithdrawalInfo(sharesToWithdraw)); + return (0, helpers_1.encodeJson)((0, request_helpers_1.parseToPrimitives)(response)); + } + catch (e) { + return wrappedError(e); + } +} +exports.getMegavaultWithdrawalInfo = getMegavaultWithdrawalInfo; +async function depositToMegavault(subaccountNumber, amountUsdc) { + try { + const client = globalThis.client; + if (client === undefined) { + throw new errors_1.UserError('client is not connected. Call connectNetwork() first'); + } + const wallet = globalThis.wallet; + if (wallet === undefined) { + throw new errors_1.UserError('wallet is not set. Call connectWallet() first'); + } + const subaccount = new subaccount_1.SubaccountInfo(wallet, subaccountNumber); + const tx = await client.depositToMegavault(subaccount, amountUsdc, tendermint_rpc_1.Method.BroadcastTxCommit); + return (0, helpers_1.encodeJson)((0, request_helpers_1.parseToPrimitives)(tx)); + } + catch (error) { + return wrappedError(error); + } +} +exports.depositToMegavault = depositToMegavault; +async function withdrawFromMegavault(subaccountNumber, shares, minAmount) { + try { + const client = globalThis.client; + if (client === undefined) { + throw new errors_1.UserError('client is not connected. Call connectNetwork() first'); + } + const wallet = globalThis.wallet; + if (wallet === undefined) { + throw new errors_1.UserError('wallet is not set. Call connectWallet() first'); + } + const subaccount = new subaccount_1.SubaccountInfo(wallet, subaccountNumber); + const tx = await client.withdrawFromMegavault(subaccount, shares, minAmount, tendermint_rpc_1.Method.BroadcastTxCommit); + return (0, helpers_1.encodeJson)((0, request_helpers_1.parseToPrimitives)(tx)); + } + catch (error) { + return wrappedError(error); + } +} +exports.withdrawFromMegavault = withdrawFromMegavault; +//# sourceMappingURL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UFBSSxNQUFNLEtBQUssU0FBUyxFQUFFO1lBQ3hCLE1BQU0sSUFBSSxrQkFBUyxDQUFDLHNEQUFzRCxDQUFDLENBQUM7U0FDN0U7UUFDRCxNQUFNLE1BQU0sR0FBRyxVQUFVLENBQUMsTUFBTSxDQUFDO1FBQ2pDLElBQUksTUFBTSxLQUFLLFNBQVMsRUFBRTtZQUN4QixNQUFNLElBQUksa0JBQVMsQ0FBQywrQ0FBK0MsQ0FBQyxDQUFDO1NBQ3RFO1FBQ0QsTUFBTSxVQUFVLEdBQUcsSUFBSSwyQkFBYyxDQUFDLE1BQU0sRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDO1FBQ2hFLE1BQU0sRUFBRSxHQUFHLE1BQU0sTUFBTSxDQUFDLHFCQUFxQixDQUMzQyxVQUFVLEVBQ1YsTUFBTSxFQUNOLFNBQVMsRUFDVCx1QkFBTSxDQUFDLGlCQUFpQixDQUN6QixDQUFDO1FBQ0YsT0FBTyxJQUFBLG9CQUFVLEVBQUMsSUFBQSxtQ0FBaUIsRUFBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0tBQzFDO0lBQUMsT0FBTyxLQUFLLEVBQUU7UUFDZCxPQUFPLFlBQVksQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUM1QjtBQUNILENBQUM7QUF6QkQsc0RBeUJDIn0= /***/ }), @@ -208715,7 +211447,7 @@ var OrderFlags; OrderFlags[OrderFlags["CONDITIONAL"] = 32] = "CONDITIONAL"; })(OrderFlags = exports.OrderFlags || (exports.OrderFlags = {})); __exportStar(__webpack_require__(/*! ./modules/proto-includes */ "./src/clients/modules/proto-includes.ts"), exports); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpZW50cy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQWlDQSxzRUFBc0U7QUFDdEUsSUFBWSxVQUlYO0FBSkQsV0FBWSxVQUFVO0lBQ3BCLHVEQUFjLENBQUE7SUFDZCxzREFBYyxDQUFBO0lBQ2QsMERBQWdCLENBQUE7QUFDbEIsQ0FBQyxFQUpXLFVBQVUsR0FBVixrQkFBVSxLQUFWLGtCQUFVLFFBSXJCO0FBMEdELDJEQUF5QyJ9 +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpZW50cy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQWlDQSxzRUFBc0U7QUFDdEUsSUFBWSxVQUlYO0FBSkQsV0FBWSxVQUFVO0lBQ3BCLHVEQUFjLENBQUE7SUFDZCxzREFBYyxDQUFBO0lBQ2QsMERBQWdCLENBQUE7QUFDbEIsQ0FBQyxFQUpXLFVBQVUsR0FBVixrQkFBVSxLQUFWLGtCQUFVLFFBSXJCO0FBK0dELDJEQUF5QyJ9 /***/ }), @@ -208747,9 +211479,6 @@ const tendermintClient_1 = __webpack_require__(/*! ./modules/tendermintClient */ protobufjs_1.default.util.Long = long_1.default; protobufjs_1.default.configure(); class ValidatorClient { - constructor(config) { - this.config = config; - } /** * @description Connect to a validator client * @@ -208760,6 +211489,9 @@ class ValidatorClient { await client.initialize(); return client; } + constructor(config) { + this.config = config; + } /** * @description Get the query module, used for retrieving on-chain data. * @@ -208786,6 +211518,14 @@ class ValidatorClient { throw new Error('Post module not initialized'); this._post.setSelectedGasDenom(gasDenom); } + /** + * @description populate account number cache in the Post module for performance. + */ + async populateAccountNumberCache(address) { + if (!this._post) + throw new Error('Post module not initialized'); + await this._post.populateAccountNumberCache(address); + } async initialize() { const tendermint37Client = await tendermint_rpc_1.Tendermint37Client.connect(this.config.restEndpoint); const tendermintClient = new tendermintClient_1.TendermintClient(tendermint37Client, { @@ -208794,11 +211534,11 @@ class ValidatorClient { }); const queryClient = stargate_1.QueryClient.withExtensions(tendermint37Client, stargate_1.setupTxExtension); this._get = new get_1.Get(tendermintClient, queryClient); - this._post = new post_1.Post(this._get, this.config.chainId, this.config.denoms, this.config.defaultClientMemo); + this._post = new post_1.Post(this._get, this.config.chainId, this.config.denoms, this.config.defaultClientMemo, this.config.useTimestampNonce); } } exports.ValidatorClient = ValidatorClient; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9yLWNsaWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGllbnRzL3ZhbGlkYXRvci1jbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsK0NBQThFO0FBQzlFLDJEQUE0RDtBQUM1RCxnREFBd0I7QUFDeEIsNERBQWtDO0FBRWxDLDJDQUtxQjtBQUNyQix1Q0FBb0M7QUFDcEMseUNBQXNDO0FBQ3RDLGlFQUE4RDtBQUU5RCxvRUFBb0U7QUFDcEUscUVBQXFFO0FBQ3JFLHdFQUF3RTtBQUN4RSxrRUFBa0U7QUFDbEUsb0JBQVEsQ0FBQyxJQUFJLENBQUMsSUFBSSxHQUFHLGNBQUksQ0FBQztBQUMxQixvQkFBUSxDQUFDLFNBQVMsRUFBRSxDQUFDO0FBRXJCLE1BQWEsZUFBZTtJQWdCMUIsWUFBb0IsTUFBdUI7UUFDekMsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7SUFDdkIsQ0FBQztJQWJEOzs7O09BSUc7SUFDSCxNQUFNLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxNQUF1QjtRQUMxQyxNQUFNLE1BQU0sR0FBRyxJQUFJLGVBQWUsQ0FBQyxNQUFNLENBQUMsQ0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sT0FBTyxDQUM3RSxJQUFJLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FDekIsQ0FBQztRQUVGLE1BQU0sZ0JBQWdCLEdBQUcsSUFBSSxtQ0FBZ0IsQ0FBQyxrQkFBa0IsRUFBRTtZQUNoRSx1QkFBdUIsRUFBRSxzQ0FBMEI7WUFDbkQsa0JBQWtCLEVBQUUsZ0NBQW9CO1NBQ3pDLENBQUMsQ0FBQztRQUNILE1BQU0sV0FBVyxHQUE4QixzQkFBVyxDQUFDLGNBQWMsQ0FDdkUsa0JBQWtCLEVBQ2xCLDJCQUFnQixDQUNqQixDQUFDO1FBQ0YsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLFNBQUcsQ0FBQyxnQkFBZ0IsRUFBRSxXQUFXLENBQUMsQ0FBQztRQUNuRCxJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksV0FBSSxDQUNuQixJQUFJLENBQUMsSUFBSyxFQUNWLElBQUksQ0FBQyxNQUFNLENBQUMsT0FBTyxFQUNuQixJQUFJLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFDbEIsSUFBSSxDQUFDLE1BQU0sQ0FBQyxpQkFBaUIsRUFDN0IsSUFBSSxDQUFDLE1BQU0sQ0FBQyxpQkFBaUIsQ0FDOUIsQ0FBQztJQUNKLENBQUM7Q0FDRjtBQWhGRCwwQ0FnRkMifQ== /***/ }), @@ -208821,7 +211561,7 @@ exports.BROADCAST_TIMEOUT_MS = 8000; // API Defaults exports.API_TIMEOUT_DEFAULT_MS = 5000; // Gas -exports.GAS_MULTIPLIER = 1.4; +exports.GAS_MULTIPLIER = 1.6; exports.ZERO_FEE = { amount: [], gas: '0', @@ -208895,7 +211635,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.encodeJson = exports.ByteArrayEncoding = exports.stripHexPrefix = exports.convertPartialTransactionOptionsToFull = void 0; +exports.encodeJson = exports.ByteArrayEncoding = exports.bigIntToBytes = exports.stripHexPrefix = exports.convertPartialTransactionOptionsToFull = void 0; const encoding_1 = __webpack_require__(/*! @cosmjs/encoding */ "./node_modules/@cosmjs/encoding/build/index.js"); const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "./node_modules/bignumber.js/bignumber.js")); const long_1 = __importDefault(__webpack_require__(/*! long */ "./node_modules/long/src/long.js")); @@ -208939,6 +211679,15 @@ function toBigInt(u) { const abs = BigInt(`0x${hex}`); return negated ? -abs : abs; } +function bigIntToBytes(value) { + const absoluteValue = value < 0 ? value * BigInt(-1) : value; + const nonPaddedHexValue = absoluteValue.toString(16); + const paddedHexValue = nonPaddedHexValue.length % 2 === 0 ? nonPaddedHexValue : `0${nonPaddedHexValue}`; + const numberBytes = Buffer.from(paddedHexValue, 'hex'); + const signedBytes = Uint8Array.of(value < 0 ? 3 : 2, ...numberBytes); + return signedBytes; +} +exports.bigIntToBytes = bigIntToBytes; var ByteArrayEncoding; (function (ByteArrayEncoding) { ByteArrayEncoding["HEX"] = "hex"; @@ -208978,7 +211727,7 @@ function encodeJson(object, byteArrayEncoding = ByteArrayEncoding.HEX) { }); } exports.encodeJson = encodeJson; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSwrQ0FBeUM7QUFDekMsZ0VBQXFDO0FBQ3JDLGdEQUF3QjtBQUd4QiwyQ0FBK0M7QUFFL0M7Ozs7O0dBS0c7QUFDSCxTQUFnQixzQ0FBc0MsQ0FDcEQseUJBQXFEO0lBRXJELElBQUkseUJBQXlCLEtBQUssU0FBUyxFQUFFO1FBQzNDLE9BQU8sU0FBUyxDQUFDO0tBQ2xCO0lBRUQsT0FBTzt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sQ0FBQzthQUM1QjtpQkFBTTtnQkFDTCxPQUFPLFFBQVEsQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUMsUUFBUSxFQUFFLENBQUM7YUFDMUM7U0FDRjthQUFNLElBQUksS0FBSyxZQUFZLFVBQVUsRUFBRTtZQUN0QyxJQUFJLGlCQUFpQixLQUFLLGlCQUFpQixDQUFDLEdBQUcsRUFBRTtnQkFDL0MsT0FBTyxJQUFBLGdCQUFLLEVBQUMsS0FBSyxDQUFDLENBQUM7YUFDckI7aUJBQU07Z0JBQ0wsT0FBTyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUMsUUFBUSxFQUFFLENBQUM7YUFDbkM7U0FDRjtRQUNELE9BQU8sS0FBSyxDQUFDO0lBQ2YsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDO0FBaENELGdDQWdDQyJ9 /***/ }), @@ -208992,7 +211741,7 @@ exports.encodeJson = encodeJson; /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deriveHDKeyFromEthereumSignature = exports.exportMnemonicAndPrivateKey = void 0; +exports.deriveHDKeyFromMnemonic = exports.deriveHDKeyFromEthereumSignature = exports.exportMnemonicAndPrivateKey = void 0; const bip32_1 = __webpack_require__(/*! @scure/bip32 */ "./node_modules/@scure/bip32/lib/index.js"); const bip39_1 = __webpack_require__(/*! @scure/bip39 */ "./node_modules/@scure/bip39/index.js"); const english_1 = __webpack_require__(/*! @scure/bip39/wordlists/english */ "./node_modules/@scure/bip39/wordlists/english.js"); @@ -209013,16 +211762,11 @@ const helpers_1 = __webpack_require__(/*! ./helpers */ "./src/lib/helpers.ts"); */ const exportMnemonicAndPrivateKey = (entropy, path = "m/44'/118'/0'/0/0") => { const mnemonic = (0, bip39_1.entropyToMnemonic)(entropy, english_1.wordlist); - const seed = (0, bip39_1.mnemonicToSeedSync)(mnemonic); - const hdkey = bip32_1.HDKey.fromMasterSeed(seed); - const derivedHdkey = hdkey.derive(path); - if (!hdkey.privateKey) { - throw new Error('null hd key'); - } + const { privateKey, publicKey } = (0, exports.deriveHDKeyFromMnemonic)(mnemonic, path); return { mnemonic, - privateKey: derivedHdkey.privateKey, - publicKey: derivedHdkey.publicKey, + privateKey, + publicKey, }; }; exports.exportMnemonicAndPrivateKey = exportMnemonicAndPrivateKey; @@ -209043,7 +211787,33 @@ const deriveHDKeyFromEthereumSignature = (signature) => { return (0, exports.exportMnemonicAndPrivateKey)(entropy); }; exports.deriveHDKeyFromEthereumSignature = deriveHDKeyFromEthereumSignature; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib25ib2FyZGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvb25ib2FyZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx3Q0FBcUM7QUFDckMsd0NBQXFFO0FBQ3JFLDREQUEwRDtBQUMxRCx5REFBeUQ7QUFFekQsdUNBQTJDO0FBRTNDOzs7Ozs7Ozs7Ozs7R0FZRztBQUNJLE1BQU0sMkJBQTJCLEdBQUcsQ0FDekMsT0FBbUIsRUFDbkIsT0FBZSxtQkFBbUIsRUFLbEMsRUFBRTtJQUNGLE1BQU0sUUFBUSxHQUFHLElBQUEseUJBQWlCLEVBQUMsT0FBTyxFQUFFLGtCQUFRLENBQUMsQ0FBQztJQUN0RCxNQUFNLElBQUksR0FBRyxJQUFBLDBCQUFrQixFQUFDLFFBQVEsQ0FBQyxDQUFDO0lBRTFDLE1BQU0sS0FBSyxHQUFHLGFBQUssQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDekMsTUFBTSxZQUFZLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUV4QyxJQUFJLENBQUMsS0FBSyxDQUFDLFVBQVUsRUFBRTtRQUNyQixNQUFNLElBQUksS0FBSyxDQUFDLGFBQWEsQ0FBQyxDQUFDO0tBQ2hDO0lBRUQsT0FBTztRQUNMLFFBQVE7UUFDUixVQUFVLEVBQUUsWUFBWSxDQUFDLFVBQVU7UUFDbkMsU0FBUyxFQUFFLFlBQVksQ0FBQyxTQUFTO0tBQ2xDLENBQUM7QUFDSixDQUFDLENBQUM7QUF2QlcsUUFBQSwyQkFBMkIsK0JBdUJ0QztBQUVGOzs7O0dBSUc7QUFDSSxNQUFNLGdDQUFnQyxHQUFHLENBQzlDLFNBQWlCLEVBS2pCLEVBQUU7SUFDRixNQUFNLE1BQU0sR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUEsd0JBQWMsRUFBQyxTQUFTLENBQUMsRUFBRSxLQUFLLENBQUMsQ0FBQztJQUU3RCxJQUFJLE1BQU0sQ0FBQyxNQUFNLEtBQUssRUFBRSxFQUFFO1FBQ3hCLE1BQU0sSUFBSSxLQUFLLENBQUMsNEJBQTRCLENBQUMsQ0FBQztLQUMvQztJQUVELDBFQUEwRTtJQUMxRSxNQUFNLFFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQztJQUN4QywyRUFBMkU7SUFDM0UsTUFBTSxPQUFPLEdBQUcsSUFBQSxrQkFBUyxFQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQ3BDLE9BQU8sSUFBQSxtQ0FBMkIsRUFBQyxPQUFPLENBQUMsQ0FBQztBQUM5QyxDQUFDLENBQUM7QUFsQlcsUUFBQSxnQ0FBZ0Msb0NBa0IzQyJ9 +/** + * @description Derive priv/pub keys from mnemonic and BIP44 HD path + * + * @url https://github.com/confio/cosmos-hd-key-derivation-spec#bip44 + * + * @param mnemonic used to generate seed + * + * @param path BIP44 HD Path. Default is The Cosmos Hub path + * + * @throws Error if the hdkey does not exist + * + * @returns Priv/pub keys + */ +const deriveHDKeyFromMnemonic = (mnemonic, path = "m/44'/118'/0'/0/0") => { + const seed = (0, bip39_1.mnemonicToSeedSync)(mnemonic); + const hdkey = bip32_1.HDKey.fromMasterSeed(seed); + const derivedHdkey = hdkey.derive(path); + if (!hdkey.privateKey) { + throw new Error('null hd key'); + } + return { + privateKey: derivedHdkey.privateKey, + publicKey: derivedHdkey.publicKey, + }; +}; +exports.deriveHDKeyFromMnemonic = deriveHDKeyFromMnemonic; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib25ib2FyZGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvb25ib2FyZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx3Q0FBcUM7QUFDckMsd0NBQXFFO0FBQ3JFLDREQUEwRDtBQUMxRCx5REFBeUQ7QUFFekQsdUNBQTJDO0FBRTNDOzs7Ozs7Ozs7Ozs7R0FZRztBQUNJLE1BQU0sMkJBQTJCLEdBQUcsQ0FDekMsT0FBbUIsRUFDbkIsT0FBZSxtQkFBbUIsRUFLbEMsRUFBRTtJQUNGLE1BQU0sUUFBUSxHQUFHLElBQUEseUJBQWlCLEVBQUMsT0FBTyxFQUFFLGtCQUFRLENBQUMsQ0FBQztJQUN0RCxNQUFNLEVBQUUsVUFBVSxFQUFFLFNBQVMsRUFBRSxHQUFHLElBQUEsK0JBQXVCLEVBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQzFFLE9BQU87UUFDTCxRQUFRO1FBQ1IsVUFBVTtRQUNWLFNBQVM7S0FDVixDQUFDO0FBQ0osQ0FBQyxDQUFDO0FBZlcsUUFBQSwyQkFBMkIsK0JBZXRDO0FBRUY7Ozs7R0FJRztBQUNJLE1BQU0sZ0NBQWdDLEdBQUcsQ0FDOUMsU0FBaUIsRUFLakIsRUFBRTtJQUNGLE1BQU0sTUFBTSxHQUFHLE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ksQ0FBQyxTQUFTO0tBQ2xDLENBQUM7QUFDSixDQUFDLENBQUM7QUFwQlcsUUFBQSx1QkFBdUIsMkJBb0JsQyJ9 /***/ }), @@ -209059,7 +211829,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidAddress = exports.isStatefulOrder = exports.verifyOrderFlags = exports.validateTransferMessage = exports.validateCancelOrderMessage = exports.validatePlaceOrderMessage = void 0; +exports.isValidAddress = exports.isStatefulOrder = exports.verifyOrderFlags = exports.validateTransferMessage = exports.validateBatchCancelOrderMessage = exports.validateCancelOrderMessage = exports.validatePlaceOrderMessage = void 0; const bech32_1 = __webpack_require__(/*! bech32 */ "./node_modules/bech32/index.js"); const long_1 = __importDefault(__webpack_require__(/*! long */ "./node_modules/long/src/long.js")); const constants_1 = __webpack_require__(/*! ../clients/constants */ "./src/clients/constants.ts"); @@ -209117,6 +211887,27 @@ function validateCancelOrderMessage(subaccountNumber, order) { return undefined; } exports.validateCancelOrderMessage = validateCancelOrderMessage; +/** + * @describe validateBatchCancelOrderMessage validates that orders to batch cancel have fields that would be + * valid on-chain. + */ +function validateBatchCancelOrderMessage(subaccountNumber, orders) { + for (const orderBatch of orders.shortTermOrders) { + for (const clientId of orderBatch.clientIds) { + if (!verifyNumberIsUint32(clientId)) { + return new errors_1.UserError(`clientId: ${clientId} is not a valid uint32`); + } + } + } + if (!verifyGoodTilBlock(orders.goodTilBlock)) { + return new errors_1.UserError(`goodTilBlock: ${orders.goodTilBlock} is not a valid uint32 or is 0`); + } + if (!verifySubaccountNumber(subaccountNumber)) { + return new errors_1.UserError(`subaccountNumber: ${subaccountNumber} cannot be < 0 or > ${constants_1.MAX_SUBACCOUNT_NUMBER}`); + } + return undefined; +} +exports.validateBatchCancelOrderMessage = validateBatchCancelOrderMessage; /** * @describe validateTransferMessage validates that a transfer to place has fields that would be * valid on-chain. @@ -209183,7 +211974,7 @@ function isValidAddress(address) { return address.startsWith('dydx1') && verifyIsBech32(address) === undefined; } exports.isValidAddress = isValidAddress; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdmFsaWRhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxtQ0FBZ0M7QUFDaEMsZ0RBQXdCO0FBRXhCLG9EQUEwRTtBQUMxRSw0Q0FBbUY7QUFDbkYscUNBQXFDO0FBRXJDOzs7R0FHRztBQUNILFNBQWdCLHlCQUF5QixDQUN2QyxnQkFBd0IsRUFDeEIsS0FBa0I7SUFFbEIsSUFBSSxDQUFDLG9CQUFvQixDQUFDLEtBQUssQ0FBQyxRQUFRLENBQUMsRUFBRTtRQUN6QyxPQUFPLElBQUksa0JBQVMsQ0FBQyxhQUFhLEtBQUssQ0FBQyxRQUFRLHdCQUF3QixDQUFDLENBQUM7S0FDM0U7SUFDRCxJQUFJLEtBQUssQ0FBQyxRQUFRLENBQUMsZUFBZSxDQUFDLGNBQUksQ0FBQyxJQUFJLENBQUMsRUFBRTtRQUM3QyxPQUFPLElBQUksa0JBQVMsQ0FBQyxhQUFhLEtBQUssQ0FBQyxRQUFRLGlCQUFpQixDQUFDLENBQUM7S0FDcEU7SUFDRCxJQUFJLEtBQUssQ0FBQyxRQUFRLENBQUMsZUFBZSxDQUFDLGNBQUksQ0FBQyxJQUFJLENBQUMsRUFBRTtRQUM3QyxPQUFPLElBQUksa0JBQVMsQ0FBQyxhQUFhLEtBQUssQ0FBQyxRQUFRLGlCQUFpQixDQUFDLENBQUM7S0FDcEU7SUFDRCxJQUFJLENBQUMsc0JBQXNCLENBQUMsZ0JBQWdCLENBQUMsRUFBRTtRQUM3QyxPQUFPLElBQUksa0JBQVMsQ0FDbEIscUJBQXFCLGdCQ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DLHNFQUFzRTtJQUN0RSxPQUFPLE9BQU8sQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLElBQUksY0FBYyxDQUFDLE9BQU8sQ0FBQyxLQUFLLFNBQVMsQ0FBQztBQUM5RSxDQUFDO0FBSEQsd0NBR0MifQ== /***/ }), @@ -209322,8 +212113,9 @@ __exportStar(__webpack_require__(/*! ./clients/constants */ "./src/clients/const var ClobPairId; (function (ClobPairId) { ClobPairId[ClobPairId["PERPETUAL_PAIR_BTC_USD"] = 0] = "PERPETUAL_PAIR_BTC_USD"; + ClobPairId[ClobPairId["PERPETUAL_PAIR_ETH_USD"] = 1] = "PERPETUAL_PAIR_ETH_USD"; })(ClobPairId = exports.ClobPairId || (exports.ClobPairId = {})); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFLQSxrREFBZ0M7QUFDaEMsc0RBQW9DO0FBa0NwQyxJQUFZLFVBRVg7QUFGRCxXQUFZLFVBQVU7SUFDcEIsK0VBQTBCLENBQUE7QUFDNUIsQ0FBQyxFQUZXLFVBQVUsR0FBVixrQkFBVSxLQUFWLGtCQUFVLFFBRXJCIn0= +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFLQSxrREFBZ0M7QUFDaEMsc0RBQW9DO0FBa0NwQyxJQUFZLFVBR1g7QUFIRCxXQUFZLFVBQVU7SUFDcEIsK0VBQTBCLENBQUE7SUFDMUIsK0VBQTBCLENBQUE7QUFDNUIsQ0FBQyxFQUhXLFVBQVUsR0FBVixrQkFBVSxLQUFWLGtCQUFVLFFBR3JCIn0= /***/ }), @@ -210633,6 +213425,7 @@ module.exports = { \************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /** * Module exports. @@ -210702,39 +213495,6 @@ function config (name) { } -/***/ }), - -/***/ "./node_modules/util/node_modules/inherits/inherits_browser.js": -/*!*********************************************************************!*\ - !*** ./node_modules/util/node_modules/inherits/inherits_browser.js ***! - \*********************************************************************/ -/***/ (function(module) { - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} - - /***/ }), /***/ "./node_modules/util/support/isBufferBrowser.js": @@ -210750,6 +213510,351 @@ module.exports = function isBuffer(arg) { && typeof arg.readUInt8 === 'function'; } +/***/ }), + +/***/ "./node_modules/util/support/types.js": +/*!********************************************!*\ + !*** ./node_modules/util/support/types.js ***! + \********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +// Currently in sync with Node.js lib/internal/util/types.js +// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 + + + +var isArgumentsObject = __webpack_require__(/*! is-arguments */ "./node_modules/is-arguments/index.js"); +var isGeneratorFunction = __webpack_require__(/*! is-generator-function */ "./node_modules/is-generator-function/index.js"); +var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); +var isTypedArray = __webpack_require__(/*! is-typed-array */ "./node_modules/is-typed-array/index.js"); + +function uncurryThis(f) { + return f.call.bind(f); +} + +var BigIntSupported = typeof BigInt !== 'undefined'; +var SymbolSupported = typeof Symbol !== 'undefined'; + +var ObjectToString = uncurryThis(Object.prototype.toString); + +var numberValue = uncurryThis(Number.prototype.valueOf); +var stringValue = uncurryThis(String.prototype.valueOf); +var booleanValue = uncurryThis(Boolean.prototype.valueOf); + +if (BigIntSupported) { + var bigIntValue = uncurryThis(BigInt.prototype.valueOf); +} + +if (SymbolSupported) { + var symbolValue = uncurryThis(Symbol.prototype.valueOf); +} + +function checkBoxedPrimitive(value, prototypeValueOf) { + if (typeof value !== 'object') { + return false; + } + try { + prototypeValueOf(value); + return true; + } catch(e) { + return false; + } +} + +exports.isArgumentsObject = isArgumentsObject; +exports.isGeneratorFunction = isGeneratorFunction; +exports.isTypedArray = isTypedArray; + +// Taken from here and modified for better browser support +// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js +function isPromise(input) { + return ( + ( + typeof Promise !== 'undefined' && + input instanceof Promise + ) || + ( + input !== null && + typeof input === 'object' && + typeof input.then === 'function' && + typeof input.catch === 'function' + ) + ); +} +exports.isPromise = isPromise; + +function isArrayBufferView(value) { + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + return ArrayBuffer.isView(value); + } + + return ( + isTypedArray(value) || + isDataView(value) + ); +} +exports.isArrayBufferView = isArrayBufferView; + + +function isUint8Array(value) { + return whichTypedArray(value) === 'Uint8Array'; +} +exports.isUint8Array = isUint8Array; + +function isUint8ClampedArray(value) { + return whichTypedArray(value) === 'Uint8ClampedArray'; +} +exports.isUint8ClampedArray = isUint8ClampedArray; + +function isUint16Array(value) { + return whichTypedArray(value) === 'Uint16Array'; +} +exports.isUint16Array = isUint16Array; + +function isUint32Array(value) { + return whichTypedArray(value) === 'Uint32Array'; +} +exports.isUint32Array = isUint32Array; + +function isInt8Array(value) { + return whichTypedArray(value) === 'Int8Array'; +} +exports.isInt8Array = isInt8Array; + +function isInt16Array(value) { + return whichTypedArray(value) === 'Int16Array'; +} +exports.isInt16Array = isInt16Array; + +function isInt32Array(value) { + return whichTypedArray(value) === 'Int32Array'; +} +exports.isInt32Array = isInt32Array; + +function isFloat32Array(value) { + return whichTypedArray(value) === 'Float32Array'; +} +exports.isFloat32Array = isFloat32Array; + +function isFloat64Array(value) { + return whichTypedArray(value) === 'Float64Array'; +} +exports.isFloat64Array = isFloat64Array; + +function isBigInt64Array(value) { + return whichTypedArray(value) === 'BigInt64Array'; +} +exports.isBigInt64Array = isBigInt64Array; + +function isBigUint64Array(value) { + return whichTypedArray(value) === 'BigUint64Array'; +} +exports.isBigUint64Array = isBigUint64Array; + +function isMapToString(value) { + return ObjectToString(value) === '[object Map]'; +} +isMapToString.working = ( + typeof Map !== 'undefined' && + isMapToString(new Map()) +); + +function isMap(value) { + if (typeof Map === 'undefined') { + return false; + } + + return isMapToString.working + ? isMapToString(value) + : value instanceof Map; +} +exports.isMap = isMap; + +function isSetToString(value) { + return ObjectToString(value) === '[object Set]'; +} +isSetToString.working = ( + typeof Set !== 'undefined' && + isSetToString(new Set()) +); +function isSet(value) { + if (typeof Set === 'undefined') { + return false; + } + + return isSetToString.working + ? isSetToString(value) + : value instanceof Set; +} +exports.isSet = isSet; + +function isWeakMapToString(value) { + return ObjectToString(value) === '[object WeakMap]'; +} +isWeakMapToString.working = ( + typeof WeakMap !== 'undefined' && + isWeakMapToString(new WeakMap()) +); +function isWeakMap(value) { + if (typeof WeakMap === 'undefined') { + return false; + } + + return isWeakMapToString.working + ? isWeakMapToString(value) + : value instanceof WeakMap; +} +exports.isWeakMap = isWeakMap; + +function isWeakSetToString(value) { + return ObjectToString(value) === '[object WeakSet]'; +} +isWeakSetToString.working = ( + typeof WeakSet !== 'undefined' && + isWeakSetToString(new WeakSet()) +); +function isWeakSet(value) { + return isWeakSetToString(value); +} +exports.isWeakSet = isWeakSet; + +function isArrayBufferToString(value) { + return ObjectToString(value) === '[object ArrayBuffer]'; +} +isArrayBufferToString.working = ( + typeof ArrayBuffer !== 'undefined' && + isArrayBufferToString(new ArrayBuffer()) +); +function isArrayBuffer(value) { + if (typeof ArrayBuffer === 'undefined') { + return false; + } + + return isArrayBufferToString.working + ? isArrayBufferToString(value) + : value instanceof ArrayBuffer; +} +exports.isArrayBuffer = isArrayBuffer; + +function isDataViewToString(value) { + return ObjectToString(value) === '[object DataView]'; +} +isDataViewToString.working = ( + typeof ArrayBuffer !== 'undefined' && + typeof DataView !== 'undefined' && + isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)) +); +function isDataView(value) { + if (typeof DataView === 'undefined') { + return false; + } + + return isDataViewToString.working + ? isDataViewToString(value) + : value instanceof DataView; +} +exports.isDataView = isDataView; + +// Store a copy of SharedArrayBuffer in case it's deleted elsewhere +var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; +function isSharedArrayBufferToString(value) { + return ObjectToString(value) === '[object SharedArrayBuffer]'; +} +function isSharedArrayBuffer(value) { + if (typeof SharedArrayBufferCopy === 'undefined') { + return false; + } + + if (typeof isSharedArrayBufferToString.working === 'undefined') { + isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); + } + + return isSharedArrayBufferToString.working + ? isSharedArrayBufferToString(value) + : value instanceof SharedArrayBufferCopy; +} +exports.isSharedArrayBuffer = isSharedArrayBuffer; + +function isAsyncFunction(value) { + return ObjectToString(value) === '[object AsyncFunction]'; +} +exports.isAsyncFunction = isAsyncFunction; + +function isMapIterator(value) { + return ObjectToString(value) === '[object Map Iterator]'; +} +exports.isMapIterator = isMapIterator; + +function isSetIterator(value) { + return ObjectToString(value) === '[object Set Iterator]'; +} +exports.isSetIterator = isSetIterator; + +function isGeneratorObject(value) { + return ObjectToString(value) === '[object Generator]'; +} +exports.isGeneratorObject = isGeneratorObject; + +function isWebAssemblyCompiledModule(value) { + return ObjectToString(value) === '[object WebAssembly.Module]'; +} +exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; + +function isNumberObject(value) { + return checkBoxedPrimitive(value, numberValue); +} +exports.isNumberObject = isNumberObject; + +function isStringObject(value) { + return checkBoxedPrimitive(value, stringValue); +} +exports.isStringObject = isStringObject; + +function isBooleanObject(value) { + return checkBoxedPrimitive(value, booleanValue); +} +exports.isBooleanObject = isBooleanObject; + +function isBigIntObject(value) { + return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); +} +exports.isBigIntObject = isBigIntObject; + +function isSymbolObject(value) { + return SymbolSupported && checkBoxedPrimitive(value, symbolValue); +} +exports.isSymbolObject = isSymbolObject; + +function isBoxedPrimitive(value) { + return ( + isNumberObject(value) || + isStringObject(value) || + isBooleanObject(value) || + isBigIntObject(value) || + isSymbolObject(value) + ); +} +exports.isBoxedPrimitive = isBoxedPrimitive; + +function isAnyArrayBuffer(value) { + return typeof Uint8Array !== 'undefined' && ( + isArrayBuffer(value) || + isSharedArrayBuffer(value) + ); +} +exports.isAnyArrayBuffer = isAnyArrayBuffer; + +['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) { + Object.defineProperty(exports, method, { + enumerable: false, + value: function() { + throw new Error(method + ' is not supported in userland'); + } + }); +}); + + /***/ }), /***/ "./node_modules/util/util.js": @@ -210758,6 +213863,7 @@ module.exports = function isBuffer(arg) { \***********************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -210779,6 +213885,16 @@ module.exports = function isBuffer(arg) { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || + function getOwnPropertyDescriptors(obj) { + var keys = Object.keys(obj); + var descriptors = {}; + for (var i = 0; i < keys.length; i++) { + descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); + } + return descriptors; + }; + var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { @@ -210823,17 +213939,13 @@ exports.format = function(f) { // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(__webpack_require__.g.process)) { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - if (({"env":{"NODE_ENV":"production"}}).noDeprecation === true) { + if ( true && ({"env":{"NODE_ENV":"production"}}).noDeprecation === true) { return fn; } + // Allow for deprecating things in the process of starting up. + if (false) {} + var warned = false; function deprecated() { if (!warned) { @@ -210854,13 +213966,20 @@ exports.deprecate = function(fn, msg) { var debugs = {}; -var debugEnviron; +var debugEnvRegex = /^$/; + +if (({"NODE_ENV":"production"}).NODE_DEBUG) { + var debugEnv = ({"NODE_ENV":"production"}).NODE_DEBUG; + debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') + .replace(/\*/g, '.*') + .replace(/,/g, '$|^') + .toUpperCase(); + debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i'); +} exports.debuglog = function(set) { - if (isUndefined(debugEnviron)) - debugEnviron = ({"NODE_ENV":"production"}).NODE_DEBUG || ''; set = set.toUpperCase(); if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + if (debugEnvRegex.test(set)) { var pid = ({"env":{"NODE_ENV":"production"}}).pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); @@ -211153,7 +214272,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; - }).join('\n').substr(2); + }).join('\n').slice(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; @@ -211170,7 +214289,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); + name = name.slice(1, -1); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'") @@ -211207,6 +214326,8 @@ function reduceToSingleString(output, base, braces) { // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. +exports.types = __webpack_require__(/*! ./support/types */ "./node_modules/util/support/types.js"); + function isArray(ar) { return Array.isArray(ar); } @@ -211251,6 +214372,7 @@ function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; +exports.types.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; @@ -211261,12 +214383,14 @@ function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; +exports.types.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; +exports.types.isNativeError = isError; function isFunction(arg) { return typeof arg === 'function'; @@ -211327,7 +214451,7 @@ exports.log = function() { * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */ -exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/util/node_modules/inherits/inherits_browser.js"); +exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); exports._extend = function(origin, add) { // Don't do anything if add isn't an object @@ -211345,6 +214469,272 @@ function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; + +exports.promisify = function promisify(original) { + if (typeof original !== 'function') + throw new TypeError('The "original" argument must be of type Function'); + + if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { + var fn = original[kCustomPromisifiedSymbol]; + if (typeof fn !== 'function') { + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + } + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return fn; + } + + function fn() { + var promiseResolve, promiseReject; + var promise = new Promise(function (resolve, reject) { + promiseResolve = resolve; + promiseReject = reject; + }); + + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + args.push(function (err, value) { + if (err) { + promiseReject(err); + } else { + promiseResolve(value); + } + }); + + try { + original.apply(this, args); + } catch (err) { + promiseReject(err); + } + + return promise; + } + + Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); + + if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return Object.defineProperties( + fn, + getOwnPropertyDescriptors(original) + ); +} + +exports.promisify.custom = kCustomPromisifiedSymbol + +function callbackifyOnRejected(reason, cb) { + // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). + // Because `null` is a special error value in callbacks which means "no error + // occurred", we error-wrap so the callback consumer can distinguish between + // "the promise rejected with null" or "the promise fulfilled with undefined". + if (!reason) { + var newReason = new Error('Promise was rejected with a falsy value'); + newReason.reason = reason; + reason = newReason; + } + return cb(reason); +} + +function callbackify(original) { + if (typeof original !== 'function') { + throw new TypeError('The "original" argument must be of type Function'); + } + + // We DO NOT return the promise as it gives the user a false sense that + // the promise is actually somehow related to the callback's execution + // and that the callback throwing will reject the promise. + function callbackified() { + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + var maybeCb = args.pop(); + if (typeof maybeCb !== 'function') { + throw new TypeError('The last argument must be of type Function'); + } + var self = this; + var cb = function() { + return maybeCb.apply(self, arguments); + }; + // In true node style we process the callback on `nextTick` with all the + // implications (stack, `uncaughtException`, `async_hooks`) + original.apply(this, args) + .then(function(ret) { ({"env":{"NODE_ENV":"production"}}).nextTick(cb.bind(null, null, ret)) }, + function(rej) { ({"env":{"NODE_ENV":"production"}}).nextTick(callbackifyOnRejected.bind(null, rej, cb)) }); + } + + Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); + Object.defineProperties(callbackified, + getOwnPropertyDescriptors(original)); + return callbackified; +} +exports.callbackify = callbackify; + + +/***/ }), + +/***/ "./node_modules/vm-browserify/index.js": +/*!*********************************************!*\ + !*** ./node_modules/vm-browserify/index.js ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, exports) { + +var indexOf = function (xs, item) { + if (xs.indexOf) return xs.indexOf(item); + else for (var i = 0; i < xs.length; i++) { + if (xs[i] === item) return i; + } + return -1; +}; +var Object_keys = function (obj) { + if (Object.keys) return Object.keys(obj) + else { + var res = []; + for (var key in obj) res.push(key) + return res; + } +}; + +var forEach = function (xs, fn) { + if (xs.forEach) return xs.forEach(fn) + else for (var i = 0; i < xs.length; i++) { + fn(xs[i], i, xs); + } +}; + +var defineProp = (function() { + try { + Object.defineProperty({}, '_', {}); + return function(obj, name, value) { + Object.defineProperty(obj, name, { + writable: true, + enumerable: false, + configurable: true, + value: value + }) + }; + } catch(e) { + return function(obj, name, value) { + obj[name] = value; + }; + } +}()); + +var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function', +'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError', +'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError', +'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape', +'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape']; + +function Context() {} +Context.prototype = {}; + +var Script = exports.Script = function NodeScript (code) { + if (!(this instanceof Script)) return new Script(code); + this.code = code; +}; + +Script.prototype.runInContext = function (context) { + if (!(context instanceof Context)) { + throw new TypeError("needs a 'context' argument."); + } + + var iframe = document.createElement('iframe'); + if (!iframe.style) iframe.style = {}; + iframe.style.display = 'none'; + + document.body.appendChild(iframe); + + var win = iframe.contentWindow; + var wEval = win.eval, wExecScript = win.execScript; + + if (!wEval && wExecScript) { + // win.eval() magically appears when this is called in IE: + wExecScript.call(win, 'null'); + wEval = win.eval; + } + + forEach(Object_keys(context), function (key) { + win[key] = context[key]; + }); + forEach(globals, function (key) { + if (context[key]) { + win[key] = context[key]; + } + }); + + var winKeys = Object_keys(win); + + var res = wEval.call(win, this.code); + + forEach(Object_keys(win), function (key) { + // Avoid copying circular objects like `top` and `window` by only + // updating existing context properties or new properties in the `win` + // that was only introduced after the eval. + if (key in context || indexOf(winKeys, key) === -1) { + context[key] = win[key]; + } + }); + + forEach(globals, function (key) { + if (!(key in context)) { + defineProp(context, key, win[key]); + } + }); + + document.body.removeChild(iframe); + + return res; +}; + +Script.prototype.runInThisContext = function () { + return eval(this.code); // maybe... +}; + +Script.prototype.runInNewContext = function (context) { + var ctx = Script.createContext(context); + var res = this.runInContext(ctx); + + if (context) { + forEach(Object_keys(ctx), function (key) { + context[key] = ctx[key]; + }); + } + + return res; +}; + +forEach(Object_keys(Script.prototype), function (name) { + exports[name] = Script[name] = function (code) { + var s = Script(code); + return s[name].apply(s, [].slice.call(arguments, 1)); + }; +}); + +exports.isContext = function (context) { + return context instanceof Context; +}; + +exports.createScript = function (code) { + return exports.Script(code); +}; + +exports.createContext = Script.createContext = function (context) { + var copy = new Context(); + if(typeof context === 'object') { + forEach(Object_keys(context), function (key) { + copy[key] = context[key]; + }); + } + return copy; +}; + /***/ }), @@ -211482,6 +214872,7 @@ module.exports = function whichTypedArray(value) { /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { @@ -213450,7 +216841,7 @@ function extend() { "use strict"; -// created 2023-09-12T22:05:14.211Z +// created 2023-09-25T01:01:55.148Z // compressed base64-encoded blob for include-ens data // source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js // see: https://github.com/adraffy/ens-normalize.js#security @@ -213731,7 +217122,7 @@ function compare_arrays(a, b) { return c; } -// created 2023-09-12T22:05:14.211Z +// created 2023-09-25T01:01:55.148Z // compressed base64-encoded blob for include-nf data // source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js // see: https://github.com/adraffy/ens-normalize.js#security @@ -213948,6 +217339,7 @@ function init() { let r = read_compressed_payload(COMPRESSED$1); const read_sorted_array = () => read_sorted(r); const read_sorted_set = () => new Set(read_sorted_array()); + const set_add_many = (set, v) => v.forEach(x => set.add(x)); MAPPED = new Map(read_mapped(r)); IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints @@ -213970,13 +217362,20 @@ function init() { let chunks = read_sorted_arrays(r); let unrestricted = r(); - const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); + //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); + const read_chunked = () => { + // 20230921: build set in parts, 2x faster + let set = new Set(); + read_sorted_array().forEach(i => set_add_many(set, chunks[i])); + set_add_many(set, read_sorted_array()); + return set; + }; GROUPS = read_array_while(i => { // minifier property mangling seems unsafe // so these are manually renamed to single chars let N = read_array_while(r).map(x => x+0x60); if (N.length) { - let R = i >= unrestricted; // first arent restricted + let R = i >= unrestricted; // unrestricted then restricted N[0] -= 32; // capitalize N = str_from_cps(N); if (R) N=`Restricted[${N}]`; @@ -214014,6 +217413,7 @@ function init() { }); // compute confusable-extent complements + // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set for (let {V, M} of new Set(WHOLE_MAP.values())) { // connect all groups that have each whole character let recs = []; @@ -214025,34 +217425,37 @@ function init() { recs.push(rec); } rec.V.push(cp); - gs.forEach(g => rec.G.add(g)); + set_add_many(rec.G, gs); } // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); + let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); + let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent for (let cp of V) { - M.set(cp, complement); + M.set(cp, complement); // this is the same reference } } } // compute valid set - let union = new Set(); // exists in 1+ groups + // 20230924: VALID was union but can be re-used + VALID = new Set(); // exists in 1+ groups let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => union.has(cp) ? multi.add(cp) : union.add(cp); + const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); for (let g of GROUPS) { for (let cp of g.P) add_to_union(cp); for (let cp of g.Q) add_to_union(cp); } // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of union) { + for (let cp of VALID) { if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { WHOLE_MAP.set(cp, UNIQUE_PH); } } - VALID = new Set(Array_from(union).concat(Array_from(nfd(union)))); // possibly valid - + // add all decomposed parts + // see derive: "Valid is Closed (via Brute-force)" + set_add_many(VALID, nfd(VALID)); + // decode emoji // 20230719: emoji are now fully-expanded to avoid quirk logic EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); @@ -214105,7 +217508,7 @@ function bidi_qq(s) { function check_label_extension(cps) { if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); + throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi } } function check_leading_underscore(cps) { @@ -214139,13 +217542,18 @@ function check_fenced(cps) { // create a safe to print string // invisibles are escaped // leading cm uses placeholder +// if cps exceed max, middle truncate with ellipsis // quoter(cp) => string, eg. 3000 => "{3000}" // note: in html, you'd call this function then replace [<>&] with entities -function safe_str_from_cps(cps, quoter = quote_cp) { +function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { //if (Number.isInteger(cps)) cps = [cps]; //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); let buf = []; if (is_combining_mark(cps[0])) buf.push('◌'); + if (cps.length > max) { + max >>= 1; + cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; + } let prev = 0; let n = cps.length; for (let i = 0; i < n; i++) { @@ -214210,15 +217618,7 @@ function ens_beautify(name) { // update ethereum symbol // ξ => Ξ if not greek - if (type !== 'Greek') { - let prev = 0; - while (true) { - let next = output.indexOf(0x3BE, prev); - if (next < 0) break; - output[next] = 0x39E; - prev = next + 1; - } - } + if (type !== 'Greek') array_replace(output, 0x3BE, 0x39E); // 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed) // could be fixed with special case for: 2D (.) + 200E (LTR) @@ -214228,6 +217628,16 @@ function ens_beautify(name) { return flatten(labels); } +function array_replace(v, a, b) { + let prev = 0; + while (true) { + let next = v.indexOf(a, prev); + if (next < 0) break; + v[next] = b; + prev = next + 1; + } +} + function ens_split(name, preserve_emoji) { return split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy } @@ -214367,7 +217777,7 @@ function flatten(split) { // don't print label again if just a single label let msg = error.message; // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input))}: ${msg}`); + throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); } return str_from_cps(output); }).join(STOP_CH); @@ -214693,7 +218103,8 @@ exports.should_escape = should_escape; "use strict"; /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; -// Axios v1.6.2 Copyright (c) 2023 Matt Zabriskie and contributors +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); +// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors function bind(fn, thisArg) { @@ -214909,6 +218320,8 @@ const isFormData = (thing) => { */ const isURLSearchParams = kindOfTest('URLSearchParams'); +const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); + /** * Trim excess whitespace off the beginning and end of a string * @@ -215297,8 +218710,7 @@ const toObjectSet = (arrayOrString, delimiter) => { const noop = () => {}; const toFiniteNumber = (value, defaultValue) => { - value = +value; - return Number.isFinite(value) ? value : defaultValue; + return value != null && Number.isFinite(value = +value) ? value : defaultValue; }; const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; @@ -215368,6 +218780,36 @@ const isAsyncFn = kindOfTest('AsyncFunction'); const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); +// original code +// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 + +const _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({source, data}) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + } + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})( + typeof setImmediate === 'function', + isFunction(_global.postMessage) +); + +const asap = typeof queueMicrotask !== 'undefined' ? + queueMicrotask.bind(_global) : ( true && ({"env":{"NODE_ENV":"production"}}).nextTick || _setImmediate); + +// ********************* + var utils$1 = { isArray, isArrayBuffer, @@ -215379,6 +218821,10 @@ var utils$1 = { isBoolean, isObject, isPlainObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, isUndefined, isDate, isFile, @@ -215419,7 +218865,9 @@ var utils$1 = { isSpecCompliantForm, toJSONObject, isAsyncFn, - isThenable + isThenable, + setImmediate: _setImmediate, + asap }; /** @@ -215447,7 +218895,10 @@ function AxiosError(message, code, config, request, response) { code && (this.code = code); config && (this.config = config); request && (this.request = request); - response && (this.response = response); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } } utils$1.inherits(AxiosError, Error, { @@ -215467,7 +218918,7 @@ utils$1.inherits(AxiosError, Error, { // Axios config: utils$1.toJSONObject(this.config), code: this.code, - status: this.response && this.response.status ? this.response.status : null + status: this.status }; } }); @@ -215935,6 +219386,8 @@ var platform$1 = { const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; +const _navigator = typeof navigator === 'object' && navigator || undefined; + /** * Determine if we're running in a standard browser environment * @@ -215952,10 +219405,8 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde * * @returns {boolean} */ -const hasStandardBrowserEnv = ( - (product) => { - return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 - })(typeof navigator !== 'undefined' && navigator.product); +const hasStandardBrowserEnv = hasBrowserEnv && + (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); /** * Determine if we're running in a standard browser webWorker environment @@ -215975,11 +219426,15 @@ const hasStandardBrowserWebWorkerEnv = (() => { ); })(); +const origin = hasBrowserEnv && window.location.href || 'http://localhost'; + var utils = /*#__PURE__*/Object.freeze({ __proto__: null, hasBrowserEnv: hasBrowserEnv, hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, - hasStandardBrowserEnv: hasStandardBrowserEnv + hasStandardBrowserEnv: hasStandardBrowserEnv, + navigator: _navigator, + origin: origin }); var platform = { @@ -216047,6 +219502,9 @@ function arrayToObject(arr) { function formDataToJSON(formData) { function buildPath(path, value, target, index) { let name = path[index++]; + + if (name === '__proto__') return true; + const isNumericKey = Number.isFinite(+name); const isLast = index >= path.length; name = !name && utils$1.isArray(target) ? target.length : name; @@ -216116,7 +219574,7 @@ const defaults = { transitional: transitionalDefaults, - adapter: ['xhr', 'http'], + adapter: ['xhr', 'http', 'fetch'], transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ''; @@ -216130,9 +219588,6 @@ const defaults = { const isFormData = utils$1.isFormData(data); if (isFormData) { - if (!hasJSONContentType) { - return data; - } return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; } @@ -216140,7 +219595,8 @@ const defaults = { utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || - utils$1.isBlob(data) + utils$1.isBlob(data) || + utils$1.isReadableStream(data) ) { return data; } @@ -216183,6 +219639,10 @@ const defaults = { const forcedJSONParsing = transitional && transitional.forcedJSONParsing; const JSONRequested = this.responseType === 'json'; + if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { + return data; + } + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { const silentJSONParsing = transitional && transitional.silentJSONParsing; const strictJSONParsing = !silentJSONParsing && JSONRequested; @@ -216386,6 +219846,10 @@ class AxiosHeaders { setHeaders(header, valueOrRewrite); } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$1.isHeaders(header)) { + for (const [key, value] of header.entries()) { + setHeader(value, key, rewrite); + } } else { header != null && setHeader(valueOrRewrite, header, rewrite); } @@ -216653,6 +220117,210 @@ function settle(resolve, reject, response) { } } +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1000 / freq; + let lastArgs; + let timer; + + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn.apply(null, args); + }; + + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if ( passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + + const flush = () => lastArgs && invoke(lastArgs); + + return [throttled, flush]; +} + +const progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return throttle(e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e, + lengthComputable: total != null, + [isDownloadStream ? 'download' : 'upload']: true + }; + + listener(data); + }, freq); +}; + +const progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +}; + +const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); + +var isURLSameOrigin = platform.hasStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })(); + var cookies = platform.hasStandardBrowserEnv ? // Standard browser envs support document.cookie @@ -216716,7 +220384,7 @@ function isAbsoluteURL(url) { */ function combineURLs(baseURL, relativeURL) { return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; } @@ -216737,200 +220405,183 @@ function buildFullPath(baseURL, requestedURL) { return requestedURL; } -var isURLSameOrigin = platform.hasStandardBrowserEnv ? +const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; -// Standard browser envs have full support of the APIs needed to test -// whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - const msie = /(msie|trident)/i.test(navigator.userAgent); - const urlParsingNode = document.createElement('a'); - let originURL; +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; - /** - * Parse a URL to discover its components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - let href = url; + function getMergedValue(target, source, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } - urlParsingNode.setAttribute('href', href); + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); } + } - originURL = resolveURL(window.location.href); + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })(); + utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); -function parseProtocol(url) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); - return match && match[1] || ''; + return config; } -/** - * Calculate data maxRate - * @param {Number} [samplesCount= 10] - * @param {Number} [min= 1000] - * @returns {Function} - */ -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; +var resolveConfig = (config) => { + const newConfig = mergeConfig({}, config); - min = min !== undefined ? min : 1000; + let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig; - return function push(chunkLength) { - const now = Date.now(); - - const startedAt = timestamps[tail]; - - if (!firstSampleTS) { - firstSampleTS = now; - } + newConfig.headers = headers = AxiosHeaders$1.from(headers); - bytes[head] = chunkLength; - timestamps[head] = now; + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer); - let i = tail; - let bytesCount = 0; - - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - - head = (head + 1) % samplesCount; + // HTTP basic authentication + if (auth) { + headers.set('Authorization', 'Basic ' + + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) + ); + } - if (head === tail) { - tail = (tail + 1) % samplesCount; - } + let contentType; - if (now - firstSampleTS < min) { - return; + if (utils$1.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(undefined); // Let the browser set it + } else if ((contentType = headers.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; + headers.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); } + } - const passed = startedAt && now - startedAt; - - return passed ? Math.round(bytesCount * 1000 / passed) : undefined; - }; -} - -function progressEventReducer(listener, isDownloadStream) { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - - return e => { - const loaded = e.loaded; - const total = e.lengthComputable ? e.total : undefined; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange = loaded <= total; + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. - bytesNotified = loaded; + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - const data = { - loaded, - total, - progress: total ? (loaded / total) : undefined, - bytes: progressBytes, - rate: rate ? rate : undefined, - estimated: rate && total && inRange ? (total - loaded) / rate : undefined, - event: e - }; + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) { + // Add xsrf header + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - data[isDownloadStream ? 'download' : 'upload'] = true; + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } - listener(data); - }; -} + return newConfig; +}; const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; var xhrAdapter = isXHRAdapterSupported && function (config) { return new Promise(function dispatchXhrRequest(resolve, reject) { - let requestData = config.data; - const requestHeaders = AxiosHeaders$1.from(config.headers).normalize(); - let {responseType, withXSRFToken} = config; + const _config = resolveConfig(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); + let {responseType, onUploadProgress, onDownloadProgress} = _config; let onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); - } + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; - if (config.signal) { - config.signal.removeEventListener('abort', onCanceled); - } - } + function done() { + flushUpload && flushUpload(); // flush events + flushDownload && flushDownload(); // flush events - let contentType; + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - if (utils$1.isFormData(requestData)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { - requestHeaders.setContentType(false); // Let the browser set it - } else if ((contentType = requestHeaders.getContentType()) !== false) { - // fix semicolon duplication issue for ReactNative FormData implementation - const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; - requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); - } + _config.signal && _config.signal.removeEventListener('abort', onCanceled); } let request = new XMLHttpRequest(); - // HTTP basic authentication - if (config.auth) { - const username = config.auth.username || ''; - const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); - } - - const fullPath = buildFullPath(config.baseURL, config.url); - - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + request.open(_config.method.toUpperCase(), _config.url, true); // Set the request timeout in MS - request.timeout = config.timeout; + request.timeout = _config.timeout; function onloadend() { if (!request) { @@ -217010,10 +220661,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) { // Handle timeout request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; - const transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; + let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; } reject(new AxiosError( timeoutErrorMessage, @@ -217025,22 +220676,6 @@ var xhrAdapter = isXHRAdapterSupported && function (config) { request = null; }; - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if(platform.hasStandardBrowserEnv) { - withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); - - if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { - // Add xsrf header - const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); - - if (xsrfValue) { - requestHeaders.set(config.xsrfHeaderName, xsrfValue); - } - } - } - // Remove Content-Type if data is undefined requestData === undefined && requestHeaders.setContentType(null); @@ -217052,26 +220687,31 @@ var xhrAdapter = isXHRAdapterSupported && function (config) { } // Add withCredentials to request if needed - if (!utils$1.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; + if (!utils$1.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; } // Add responseType to request if needed if (responseType && responseType !== 'json') { - request.responseType = config.responseType; + request.responseType = _config.responseType; } // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + if (onDownloadProgress) { + ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); + request.addEventListener('progress', downloadThrottled); } // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + if (onUploadProgress && request.upload) { + ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); + + request.upload.addEventListener('progress', uploadThrottled); + + request.upload.addEventListener('loadend', flushUpload); } - if (config.cancelToken || config.signal) { + if (_config.cancelToken || _config.signal) { // Handle cancellation // eslint-disable-next-line func-names onCanceled = cancel => { @@ -217083,13 +220723,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) { request = null; }; - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); } } - const protocol = parseProtocol(fullPath); + const protocol = parseProtocol(_config.url); if (protocol && platform.protocols.indexOf(protocol) === -1) { reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); @@ -217102,9 +220742,360 @@ var xhrAdapter = isXHRAdapterSupported && function (config) { }); }; +const composeSignals = (signals, timeout) => { + const {length} = (signals = signals ? signals.filter(Boolean) : []); + + if (timeout || length) { + let controller = new AbortController(); + + let aborted; + + const onabort = function (reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); + }, timeout); + + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach(signal => { + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); + }); + signals = null; + } + }; + + signals.forEach((signal) => signal.addEventListener('abort', onabort)); + + const {signal} = controller; + + signal.unsubscribe = () => utils$1.asap(unsubscribe); + + return signal; + } +}; + +var composeSignals$1 = composeSignals; + +const streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + + let pos = 0; + let end; + + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; + +const readBytes = async function* (iterable, chunkSize) { + for await (const chunk of readStream(iterable)) { + yield* streamChunk(chunk, chunkSize); + } +}; + +const readStream = async function* (stream) { + if (stream[Symbol.asyncIterator]) { + yield* stream; + return; + } + + const reader = stream.getReader(); + try { + for (;;) { + const {done, value} = await reader.read(); + if (done) { + break; + } + yield value; + } + } finally { + await reader.cancel(); + } +}; + +const trackStream = (stream, chunkSize, onProgress, onFinish) => { + const iterator = readBytes(stream, chunkSize); + + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + + return new ReadableStream({ + async pull(controller) { + try { + const {done, value} = await iterator.next(); + + if (done) { + _onFinish(); + controller.close(); + return; + } + + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { + highWaterMark: 2 + }) +}; + +const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function'; +const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function'; + +// used only inside the fetch adapter +const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? + ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : + async (str) => new Uint8Array(await new Response(str).arrayBuffer()) +); + +const test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false + } +}; + +const supportsRequestStream = isReadableStreamSupported && test(() => { + let duplexAccessed = false; + + const hasContentType = new Request(platform.origin, { + body: new ReadableStream(), + method: 'POST', + get duplex() { + duplexAccessed = true; + return 'half'; + }, + }).headers.has('Content-Type'); + + return duplexAccessed && !hasContentType; +}); + +const DEFAULT_CHUNK_SIZE = 64 * 1024; + +const supportsResponseStream = isReadableStreamSupported && + test(() => utils$1.isReadableStream(new Response('').body)); + + +const resolvers = { + stream: supportsResponseStream && ((res) => res.body) +}; + +isFetchSupported && (((res) => { + ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { + !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() : + (_, config) => { + throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); + }); + }); +})(new Response)); + +const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + + if(utils$1.isBlob(body)) { + return body.size; + } + + if(utils$1.isSpecCompliantForm(body)) { + const _request = new Request(platform.origin, { + method: 'POST', + body, + }); + return (await _request.arrayBuffer()).byteLength; + } + + if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { + return body.byteLength; + } + + if(utils$1.isURLSearchParams(body)) { + body = body + ''; + } + + if(utils$1.isString(body)) { + return (await encodeText(body)).byteLength; + } +}; + +const resolveBodyLength = async (headers, body) => { + const length = utils$1.toFiniteNumber(headers.getContentLength()); + + return length == null ? getBodyLength(body) : length; +}; + +var fetchAdapter = isFetchSupported && (async (config) => { + let { + url, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = 'same-origin', + fetchOptions + } = resolveConfig(config); + + responseType = responseType ? (responseType + '').toLowerCase() : 'text'; + + let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + + let request; + + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + + let requestContentLength; + + try { + if ( + onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && + (requestContentLength = await resolveBodyLength(headers, data)) !== 0 + ) { + let _request = new Request(url, { + method: 'POST', + body: data, + duplex: "half" + }); + + let contentTypeHeader; + + if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { + headers.setContentType(contentTypeHeader); + } + + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + } + + if (!utils$1.isString(withCredentials)) { + withCredentials = withCredentials ? 'include' : 'omit'; + } + + // Cloudflare Workers throws when credentials are defined + // see https://github.com/cloudflare/workerd/issues/902 + const isCredentialsSupported = "credentials" in Request.prototype; + request = new Request(url, { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : undefined + }); + + let response = await fetch(request); + + const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); + + if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { + const options = {}; + + ['status', 'statusText', 'headers'].forEach(prop => { + options[prop] = response[prop]; + }); + + const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length')); + + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), + options + ); + } + + responseType = responseType || 'text'; + + let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config); + + !isStreamResponse && unsubscribe && unsubscribe(); + + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders$1.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }) + } catch (err) { + unsubscribe && unsubscribe(); + + if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), + { + cause: err.cause || err + } + ) + } + + throw AxiosError.from(err, err && err.code, config, request); + } +}); + const knownAdapters = { http: httpAdapter, - xhr: xhrAdapter + xhr: xhrAdapter, + fetch: fetchAdapter }; utils$1.forEach(knownAdapters, (fn, value) => { @@ -217248,109 +221239,7 @@ function dispatchRequest(config) { }); } -const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing; - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * - * @returns {Object} New object resulting from merging config2 to config1 - */ -function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - const config = {}; - - function getMergedValue(target, source, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({caseless}, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - - // eslint-disable-next-line consistent-return - function mergeDeepProperties(a, b, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a, caseless); - } - } - - // eslint-disable-next-line consistent-return - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } - } - - // eslint-disable-next-line consistent-return - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a); - } - } - - // eslint-disable-next-line consistent-return - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(undefined, a); - } - } - - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) - }; - - utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { - const merge = mergeMap[prop] || mergeDeepProperties; - const configValue = merge(config1[prop], config2[prop], prop); - (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); - - return config; -} - -const VERSION = "1.6.2"; +const VERSION = "1.7.7"; const validators$1 = {}; @@ -217465,7 +221354,34 @@ class Axios { * * @returns {Promise} The Promise to be fulfilled */ - request(configOrUrl, config) { + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy; + + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + try { + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack; + } + } catch (e) { + // ignore the case where "stack" is an un-writable property + } + } + + throw err; + } + } + + _request(configOrUrl, config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof configOrUrl === 'string') { @@ -217730,6 +221646,20 @@ class CancelToken { } } + toAbortSignal() { + const controller = new AbortController(); + + const abort = (err) => { + controller.abort(err); + }; + + this.subscribe(abort); + + controller.signal.unsubscribe = () => this.unsubscribe(abort); + + return controller.signal; + } + /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. @@ -218654,6 +222584,7 @@ module.exports = function availableTypedArrays() { "use strict"; /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")["Buffer"]; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); // Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors @@ -218662,7 +222593,7 @@ const url = __webpack_require__(/*! url */ "./node_modules/url/url.js"); const proxyFromEnv = __webpack_require__(/*! proxy-from-env */ "./node_modules/proxy-from-env/index.js"); const http = __webpack_require__(/*! http */ "./node_modules/stream-http/index.js"); const https = __webpack_require__(/*! https */ "./node_modules/https-browserify/index.js"); -const followRedirects = __webpack_require__(/*! follow-redirects */ "./node_modules/follow-redirects/index.js"); +const followRedirects = __webpack_require__(/*! follow-redirects */ "./node_modules/follow-redirects/nope.js"); const zlib = __webpack_require__(/*! zlib */ "./node_modules/browserify-zlib/lib/index.js"); const stream = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js"); const EventEmitter = __webpack_require__(/*! events */ "./node_modules/events/events.js"); @@ -222436,7 +226367,7 @@ exports.version = void 0; /** * The current version of Ethers. */ -exports.version = "6.8.0"; +exports.version = "6.13.2"; //# sourceMappingURL=_version.js.map /***/ }), @@ -222493,6 +226424,7 @@ PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); let defaultCoder = null; +let defaultMaxInflation = 1024; function getBuiltinCallException(action, tx, data, abiCoder) { let message = "missing revert data"; let reason = null; @@ -222629,7 +226561,11 @@ class AbiCoder { decode(types, data, loose) { const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type))); const coder = new tuple_js_1.TupleCoder(coders, "_"); - return coder.decode(new abstract_coder_js_1.Reader(data, loose)); + return coder.decode(new abstract_coder_js_1.Reader(data, loose, defaultMaxInflation)); + } + static _setDefaultMaxInflation(value) { + (0, index_js_1.assertArgument)(typeof (value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); + defaultMaxInflation = value; } /** * Returns the shared singleton instance of a default [[AbiCoder]]. @@ -222731,11 +226667,38 @@ const Padding = new Uint8Array(exports.WordSize); // - `then` is used to detect if an object is a Promise for await const passProperties = ["then"]; const _guard = {}; +const resultNames = new WeakMap(); +function getNames(result) { + return resultNames.get(result); +} +function setNames(result, names) { + resultNames.set(result, names); +} function throwError(name, error) { const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); wrapped.error = error; throw wrapped; } +function toObject(names, items, deep) { + if (names.indexOf(null) >= 0) { + return items.map((item, index) => { + if (item instanceof Result) { + return toObject(getNames(item), item, deep); + } + return item; + }); + } + return names.reduce((accum, name, index) => { + let item = items.getValue(name); + if (!(name in accum)) { + if (deep && item instanceof Result) { + item = toObject(getNames(item), item, deep); + } + accum[name] = item; + } + return accum; + }, {}); +} /** * A [[Result]] is a sub-class of Array, which allows accessing any * of its values either positionally by its index or, if keys are @@ -222744,6 +226707,9 @@ function throwError(name, error) { * @_docloc: api/abi */ class Result extends Array { + // No longer used; but cannot be removed as it will remove the + // #private field from the .d.ts which may break backwards + // compatibility #names; /** * @private @@ -222776,20 +226742,25 @@ class Result extends Array { return accum; }, (new Map())); // Remove any key thats not unique - this.#names = Object.freeze(items.map((item, index) => { + setNames(this, Object.freeze(items.map((item, index) => { const name = names[index]; if (name != null && nameCounts.get(name) === 1) { return name; } return null; - })); + }))); + // Dummy operations to prevent TypeScript from complaining + this.#names = []; + if (this.#names == null) { + void (this.#names); + } if (!wrap) { return; } // A wrapped Result is immutable Object.freeze(this); // Proxy indices and names so we can trap deferred errors - return new Proxy(this, { + const proxy = new Proxy(this, { get: (target, prop, receiver) => { if (typeof (prop) === "string") { // Index accessor @@ -222824,39 +226795,44 @@ class Result extends Array { return Reflect.get(target, prop, receiver); } }); + setNames(proxy, getNames(this)); + return proxy; } /** - * Returns the Result as a normal Array. + * Returns the Result as a normal Array. If %%deep%%, any children + * which are Result objects are also converted to a normal Array. * * This will throw if there are any outstanding deferred * errors. */ - toArray() { + toArray(deep) { const result = []; this.forEach((item, index) => { if (item instanceof Error) { throwError(`index ${index}`, item); } + if (deep && item instanceof Result) { + item = item.toArray(deep); + } result.push(item); }); return result; } /** - * Returns the Result as an Object with each name-value pair. + * Returns the Result as an Object with each name-value pair. If + * %%deep%%, any children which are Result objects are also + * converted to an Object. * * This will throw if any value is unnamed, or if there are * any outstanding deferred errors. */ - toObject() { - return this.#names.reduce((accum, name, index) => { - (0, index_js_1.assert)(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { + toObject(deep) { + const names = getNames(this); + return names.reduce((accum, name, index) => { + (0, index_js_1.assert)(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", { operation: "toObject()" }); - // Add values for names that don't conflict - if (!(name in accum)) { - accum[name] = this.getValue(name); - } - return accum; + return toObject(names, this, deep); }, {}); } /** @@ -222884,10 +226860,11 @@ class Result extends Array { if (end > this.length) { end = this.length; } + const _names = getNames(this); const result = [], names = []; for (let i = start; i < end; i++) { result.push(this[i]); - names.push(this.#names[i]); + names.push(_names[i]); } return new Result(_guard, result, names); } @@ -222895,6 +226872,7 @@ class Result extends Array { * @_ignore */ filter(callback, thisArg) { + const _names = getNames(this); const result = [], names = []; for (let i = 0; i < this.length; i++) { const item = this[i]; @@ -222903,7 +226881,7 @@ class Result extends Array { } if (callback.call(thisArg, item, i, this)) { result.push(item); - names.push(this.#names[i]); + names.push(_names[i]); } } return new Result(_guard, result, names); @@ -222931,7 +226909,7 @@ class Result extends Array { * accessible by name. */ getValue(name) { - const index = this.#names.indexOf(name); + const index = getNames(this).indexOf(name); if (index === -1) { return undefined; } @@ -223079,15 +227057,35 @@ class Reader { allowLoose; #data; #offset; - constructor(data, allowLoose) { + #bytesRead; + #parent; + #maxInflation; + constructor(data, allowLoose, maxInflation) { (0, index_js_1.defineProperties)(this, { allowLoose: !!allowLoose }); this.#data = (0, index_js_1.getBytesCopy)(data); + this.#bytesRead = 0; + this.#parent = null; + this.#maxInflation = (maxInflation != null) ? maxInflation : 1024; this.#offset = 0; } get data() { return (0, index_js_1.hexlify)(this.#data); } get dataLength() { return this.#data.length; } get consumed() { return this.#offset; } get bytes() { return new Uint8Array(this.#data); } + #incrementBytesRead(count) { + if (this.#parent) { + return this.#parent.#incrementBytesRead(count); + } + this.#bytesRead += count; + // Check for excessive inflation (see: #4537) + (0, index_js_1.assert)(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { + buffer: (0, index_js_1.getBytesCopy)(this.#data), offset: this.#offset, + length: count, info: { + bytesRead: this.#bytesRead, + dataLength: this.dataLength + } + }); + } #peekBytes(offset, length, loose) { let alignedLength = Math.ceil(length / exports.WordSize) * exports.WordSize; if (this.#offset + alignedLength > this.#data.length) { @@ -223106,11 +227104,14 @@ class Reader { } // Create a sub-reader with the same underlying data, but offset subReader(offset) { - return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); + const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation); + reader.#parent = this; + return reader; } // Read bytes readBytes(length, loose) { let bytes = this.#peekBytes(0, length, !!loose); + this.#incrementBytesRead(length); this.#offset += bytes.length; // @TODO: Make sure the length..end bytes are all 0? return bytes.slice(0, length); @@ -223748,10 +227749,10 @@ function setify(items) { items.forEach((k) => result.add(k)); return Object.freeze(result); } -const _kwVisibDeploy = "external public payable"; +const _kwVisibDeploy = "external public payable override"; const KwVisibDeploy = setify(_kwVisibDeploy.split(" ")); // Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view"; +const _kwVisib = "constant external internal payable private public pure view override"; const KwVisib = setify(_kwVisib.split(" ")); const _kwTypes = "constructor error event fallback function receive struct"; const KwTypes = setify(_kwTypes.split(" ")); @@ -223805,7 +227806,8 @@ class TokenString { // Pops and returns the value of the next token if it is `type`; throws if out of tokens popType(type) { if (this.peek().type !== type) { - throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); + const top = this.peek(); + throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`); } return this.pop().text; } @@ -224037,7 +228039,7 @@ function consumeGas(tokens) { } function consumeEoi(tokens) { if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); + throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`); } } const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); @@ -224185,9 +228187,6 @@ class ParamType { } else { if (this.isTuple()) { - if (format !== "sighash") { - result += this.type; - } result += "(" + this.components.map((comp) => comp.format(format)).join((format === "full") ? ", " : ",") + ")"; } else { @@ -224320,7 +228319,7 @@ class ParamType { * Walks the **ParamType** with %%value%%, asynchronously calling * %%process%% on each type, destructing the %%value%% recursively. * - * This can be used to resolve ENS naes by walking and resolving each + * This can be used to resolve ENS names by walking and resolving each * ``"address"`` type. */ async walkAsync(value, process) { @@ -224734,7 +228733,9 @@ class ConstructorFragment extends Fragment { }); } const result = [`constructor${joinParams(format, this.inputs)}`]; - result.push((this.payable) ? "payable" : "nonpayable"); + if (this.payable) { + result.push("payable"); + } if (this.gas != null) { result.push(`@${this.gas.toString()}`); } @@ -225116,6 +229117,7 @@ Object.defineProperty(exports, "Typed", ({ enumerable: true, get: function () { /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /** * The Interface class is a low-level class that accepts an @@ -225371,7 +229373,7 @@ class Interface { frags.push(fragments_js_1.Fragment.from(a)); } catch (error) { - console.log("EE", error); + console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message); } } (0, index_js_3.defineProperties)(this, { @@ -226212,7 +230214,11 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string { if (typeof (value) === "string") { return new Interface(JSON.parse(value)); } - // Maybe an interface from an older version, or from a symlinked copy + // An Interface; possibly from another v6 instance + if (typeof (value.formatJson) === "function") { + return new Interface(value.formatJson()); + } + // A legacy Interface; from an older version if (typeof (value.format) === "function") { return new Interface(value.format("json")); } @@ -228460,7 +232466,7 @@ class ContractFactory { * Resolves to the Contract deployed by passing %%args%% into the * constructor. * - * This will resovle to the Contract before it has been deployed to the + * This will resolve to the Contract before it has been deployed to the * network, so the [[BaseContract-waitForDeployment]] should be used before * sending any transactions to it. */ @@ -228658,8 +232664,8 @@ class ContractTransactionResponse extends provider_js_1.TransactionResponse { * and the transaction has not been mined, otherwise this will * wait until enough confirmations have completed. */ - async wait(confirms) { - const receipt = await super.wait(confirms); + async wait(confirms, timeout) { + const receipt = await super.wait(confirms, timeout); if (receipt == null) { return null; } @@ -229851,9 +233857,9 @@ exports.SigningKey = SigningKey; // Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.UndecodedEventLog = exports.EventLog = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.ErrorDescription = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.FallbackFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0; -exports.EtherscanPlugin = exports.EnsPlugin = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = void 0; -exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.MulticoinProviderPlugin = exports.NetworkPlugin = exports.GasCostPlugin = exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = void 0; -exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = void 0; +exports.EnsPlugin = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.ChainstackProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = void 0; +exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.MulticoinProviderPlugin = exports.NetworkPlugin = exports.GasCostPlugin = exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EtherscanPlugin = void 0; +exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = void 0; var _version_js_1 = __webpack_require__(/*! ./_version.js */ "./node_modules/ethers/lib.commonjs/_version.js"); Object.defineProperty(exports, "version", ({ enumerable: true, get: function () { return _version_js_1.version; } })); var index_js_1 = __webpack_require__(/*! ./abi/index.js */ "./node_modules/ethers/lib.commonjs/abi/index.js"); @@ -229949,6 +233955,7 @@ Object.defineProperty(exports, "JsonRpcSigner", ({ enumerable: true, get: functi Object.defineProperty(exports, "BrowserProvider", ({ enumerable: true, get: function () { return index_js_7.BrowserProvider; } })); Object.defineProperty(exports, "AlchemyProvider", ({ enumerable: true, get: function () { return index_js_7.AlchemyProvider; } })); Object.defineProperty(exports, "AnkrProvider", ({ enumerable: true, get: function () { return index_js_7.AnkrProvider; } })); +Object.defineProperty(exports, "ChainstackProvider", ({ enumerable: true, get: function () { return index_js_7.ChainstackProvider; } })); Object.defineProperty(exports, "CloudflareProvider", ({ enumerable: true, get: function () { return index_js_7.CloudflareProvider; } })); Object.defineProperty(exports, "EtherscanProvider", ({ enumerable: true, get: function () { return index_js_7.EtherscanProvider; } })); Object.defineProperty(exports, "InfuraProvider", ({ enumerable: true, get: function () { return index_js_7.InfuraProvider; } })); @@ -230054,6 +234061,7 @@ Object.defineProperty(exports, "LangEn", ({ enumerable: true, get: function () { Object.defineProperty(exports, "WordlistOwl", ({ enumerable: true, get: function () { return index_js_11.WordlistOwl; } })); Object.defineProperty(exports, "WordlistOwlA", ({ enumerable: true, get: function () { return index_js_11.WordlistOwlA; } })); Object.defineProperty(exports, "wordlists", ({ enumerable: true, get: function () { return index_js_11.wordlists; } })); +// dummy change; to pick-up ws security issue changes //# sourceMappingURL=ethers.js.map /***/ }), @@ -230277,12 +234285,11 @@ exports.namehash = namehash; * This is used for various parts of ENS name resolution, such * as the wildcard resolution. */ -function dnsEncode(name) { +function dnsEncode(name, _maxLength) { + const length = (_maxLength != null) ? _maxLength : 63; + (0, index_js_2.assertArgument)(length <= 255, "DNS encoded label cannot exceed 255", "length", length); return (0, index_js_2.hexlify)((0, index_js_2.concat)(ensNameSplit(name).map((comp) => { - // DNS does not allow components over 63 bytes in length - if (comp.length > 63) { - throw new Error("invalid DNS encoded entry; length exceeds 63 bytes"); - } + (0, index_js_2.assertArgument)(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, "name", name); const bytes = new Uint8Array(comp.length + 1); bytes.set(comp, 1); bytes[0] = bytes.length - 1; @@ -230490,11 +234497,11 @@ const domainChecks = { function getBaseEncoder(type) { // intXX and uintXX { - const match = type.match(/^(u?)int(\d*)$/); + const match = type.match(/^(u?)int(\d+)$/); if (match) { const signed = (match[1] === ""); - const width = parseInt(match[2] || "256"); - (0, index_js_4.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); + const width = parseInt(match[2]); + (0, index_js_4.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type); const boundsUpper = (0, index_js_4.mask)(BN_MAX_UINT256, signed ? (width - 1) : width); const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0; return function (_value) { @@ -230536,6 +234543,23 @@ function getBaseEncoder(type) { function encodeType(name, fields) { return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`; } +// foo[][3] => { base: "foo", index: "[][3]", array: { +// base: "foo", prefix: "foo[]", count: 3 } } +function splitArray(type) { + const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); + if (match) { + return { + base: match[1], + index: (match[2] + match[4]), + array: { + base: match[1], + prefix: (match[1] + match[2]), + count: (match[5] ? parseInt(match[5]) : -1), + } + }; + } + return { base: type }; +} /** * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads * for signed typed data. @@ -230570,8 +234594,7 @@ class TypedDataEncoder { * do not violate the [[link-eip-712]] structural constraints as * well as computes the [[primaryType]]. */ - constructor(types) { - this.#types = JSON.stringify(types); + constructor(_types) { this.#fullTypes = new Map(); this.#encoderCache = new Map(); // Link struct types to their direct child structs @@ -230580,26 +234603,39 @@ class TypedDataEncoder { const parents = new Map(); // Link all subtypes within a given struct const subtypes = new Map(); - Object.keys(types).forEach((type) => { + const types = {}; + Object.keys(_types).forEach((type) => { + types[type] = _types[type].map(({ name, type }) => { + // Normalize the base type (unless name conflict) + let { base, index } = splitArray(type); + if (base === "int" && !_types["int"]) { + base = "int256"; + } + if (base === "uint" && !_types["uint"]) { + base = "uint256"; + } + return { name, type: (base + (index || "")) }; + }); links.set(type, new Set()); parents.set(type, []); subtypes.set(type, new Set()); }); + this.#types = JSON.stringify(types); for (const name in types) { const uniqueNames = new Set(); for (const field of types[name]) { // Check each field has a unique name - (0, index_js_4.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); + (0, index_js_4.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types); uniqueNames.add(field.name); // Get the base type (drop any array specifiers) - const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null; - (0, index_js_4.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); + const baseType = splitArray(field.type).base; + (0, index_js_4.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types); // Is this a base encoding type? const encoder = getBaseEncoder(baseType); if (encoder) { continue; } - (0, index_js_4.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); + (0, index_js_4.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types); // Add linkage parents.get(baseType).push(name); links.get(name).add(baseType); @@ -230607,12 +234643,12 @@ class TypedDataEncoder { } // Deduce the primary type const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0)); - (0, index_js_4.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", types); - (0, index_js_4.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", types); + (0, index_js_4.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", _types); + (0, index_js_4.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", _types); (0, index_js_4.defineProperties)(this, { primaryType: primaryTypes[0] }); // Check for circular type references function checkCircular(type, found) { - (0, index_js_4.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); + (0, index_js_4.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", _types); found.add(type); for (const child of links.get(type)) { if (!parents.has(child)) { @@ -230655,12 +234691,12 @@ class TypedDataEncoder { } } // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; + const array = splitArray(type).array; + if (array) { + const subtype = array.prefix; const subEncoder = this.getEncoder(subtype); return (value) => { - (0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); + (0, index_js_4.assertArgument)(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); let result = value.map(subEncoder); if (this.#fullTypes.has(subtype)) { result = result.map(index_js_2.keccak256); @@ -230730,10 +234766,10 @@ class TypedDataEncoder { } } // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - (0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - return value.map((v) => this._visit(match[1], v, callback)); + const array = splitArray(type).array; + if (array) { + (0, index_js_4.assertArgument)(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); + return value.map((v) => this._visit(array.prefix, v, callback)); } // Struct const fields = this.types[type]; @@ -230872,6 +234908,8 @@ class TypedDataEncoder { domainTypes.push({ name, type: domainFieldTypes[name] }); }); const encoder = TypedDataEncoder.from(types); + // Get the normalized types + types = encoder.types; const typesWithDomain = Object.assign({}, types); (0, index_js_4.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); typesWithDomain.EIP712Domain = domainTypes; @@ -230948,6 +234986,7 @@ tslib_1.__exportStar(__webpack_require__(/*! ./ethers.js */ "./node_modules/ethe /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /** * The available providers should suffice for most developers purposes, @@ -231044,10 +235083,12 @@ async function getSubscription(_event, provider) { if (typeof (_event) === "string") { switch (_event) { case "block": - case "pending": case "debug": case "error": - case "network": { + case "finalized": + case "network": + case "pending": + case "safe": { return { type: _event, tag: _event }; } } @@ -231345,10 +235386,10 @@ class AbstractProvider { switch (blockTag) { case "earliest": return "0x0"; + case "finalized": case "latest": case "pending": case "safe": - case "finalized": return blockTag; } if ((0, index_js_6.isHexString)(blockTag)) { @@ -231452,7 +235493,7 @@ class AbstractProvider { return resolve(address, fromBlock, toBlock); } /** - * Returns or resovles to a transaction for %%request%%, resolving + * Returns or resolves to a transaction for %%request%%, resolving * any ENS names or [[Addressable]] and returning if already a valid * transaction. */ @@ -231492,16 +235533,19 @@ class AbstractProvider { // No explicit network was set and this is our first time if (this.#networkPromise == null) { // Detect the current network (shared with all calls) - const detectNetwork = this._detectNetwork().then((network) => { - this.emit("network", network, null); - return network; - }, (error) => { - // Reset the networkPromise on failure, so we will try again - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; + const detectNetwork = (async () => { + try { + const network = await this._detectNetwork(); + this.emit("network", network, null); + return network; } - throw error; - }); + catch (error) { + if (this.#networkPromise === detectNetwork) { + this.#networkPromise = null; + } + throw error; + } + })(); this.#networkPromise = detectNetwork; return (await detectNetwork).clone(); } @@ -231531,12 +235575,20 @@ class AbstractProvider { async getFeeData() { const network = await this.getNetwork(); const getFeeDataFunc = async () => { - const { _block, gasPrice } = await (0, index_js_6.resolveProperties)({ + const { _block, gasPrice, priorityFee } = await (0, index_js_6.resolveProperties)({ _block: this.#getBlock("latest", false), gasPrice: ((async () => { try { - const gasPrice = await this.#perform({ method: "getGasPrice" }); - return (0, index_js_6.getBigInt)(gasPrice, "%response"); + const value = await this.#perform({ method: "getGasPrice" }); + return (0, index_js_6.getBigInt)(value, "%response"); + } + catch (error) { } + return null; + })()), + priorityFee: ((async () => { + try { + const value = await this.#perform({ method: "getPriorityFee" }); + return (0, index_js_6.getBigInt)(value, "%response"); } catch (error) { } return null; @@ -231547,7 +235599,7 @@ class AbstractProvider { // These are the recommended EIP-1559 heuristics for fee data const block = this._wrapBlock(_block, network); if (block && block.baseFeePerGas) { - maxPriorityFeePerGas = BigInt("1000000000"); + maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt("1000000000"); maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas; } return new provider_js_1.FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas); @@ -231925,6 +235977,9 @@ class AbstractProvider { subscriber.pollingInterval = this.pollingInterval; return subscriber; } + case "safe": + case "finalized": + return new subscriber_polling_js_1.PollingBlockTagSubscriber(this, sub.type); case "event": return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter); case "transaction": @@ -232494,8 +236549,8 @@ class AbstractSigner { }); } } - else if (pop.type === 2) { - // Explicitly using EIP-1559 + else if (pop.type === 2 || pop.type === 3) { + // Explicitly using EIP-1559 or EIP-4844 // Populate missing fee data if (pop.maxFeePerGas == null) { pop.maxFeePerGas = feeData.maxFeePerGas; @@ -232575,9 +236630,10 @@ exports.VoidSigner = VoidSigner; /*!*****************************************************************!*\ !*** ./node_modules/ethers/lib.commonjs/providers/community.js ***! \*****************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /** * There are many awesome community services that provide Ethereum @@ -232634,6 +236690,7 @@ exports.getDefaultProvider = void 0; const index_js_1 = __webpack_require__(/*! ../utils/index.js */ "./node_modules/ethers/lib.commonjs/utils/index.js"); const provider_ankr_js_1 = __webpack_require__(/*! ./provider-ankr.js */ "./node_modules/ethers/lib.commonjs/providers/provider-ankr.js"); const provider_alchemy_js_1 = __webpack_require__(/*! ./provider-alchemy.js */ "./node_modules/ethers/lib.commonjs/providers/provider-alchemy.js"); +const provider_chainstack_js_1 = __webpack_require__(/*! ./provider-chainstack.js */ "./node_modules/ethers/lib.commonjs/providers/provider-chainstack.js"); const provider_cloudflare_js_1 = __webpack_require__(/*! ./provider-cloudflare.js */ "./node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js"); const provider_etherscan_js_1 = __webpack_require__(/*! ./provider-etherscan.js */ "./node_modules/ethers/lib.commonjs/providers/provider-etherscan.js"); const provider_infura_js_1 = __webpack_require__(/*! ./provider-infura.js */ "./node_modules/ethers/lib.commonjs/providers/provider-infura.js"); @@ -232671,6 +236728,7 @@ const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goe * - ``"alchemy"`` * - ``"ankr"`` * - ``"cloudflare"`` + * - ``"chainstack"`` * - ``"etherscan"`` * - ``"infura"`` * - ``"publicPolygon"`` @@ -232684,7 +236742,7 @@ const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goe * // third-party services available * provider = getDefaultProvider("mainnet"); * - * // Connect to Polygoin, but only allow Etherscan and + * // Connect to Polygon, but only allow Etherscan and * // INFURA and use "MY_API_KEY" in calls to Etherscan. * provider = getDefaultProvider("matic", { * etherscan: "MY_API_KEY", @@ -232724,6 +236782,9 @@ function getDefaultProvider(network, options) { if (staticNetwork.name === "matic") { providers.push(new provider_jsonrpc_js_1.JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork })); } + else if (staticNetwork.name === "matic-amoy") { + providers.push(new provider_jsonrpc_js_1.JsonRpcProvider("https:/\/rpc-amoy.polygon.technology/", staticNetwork, { staticNetwork })); + } } if (allowService("alchemy")) { try { @@ -232737,6 +236798,12 @@ function getDefaultProvider(network, options) { } catch (error) { } } + if (allowService("chainstack")) { + try { + providers.push(new provider_chainstack_js_1.ChainstackProvider(network, options.chainstack)); + } + catch (error) { } + } if (allowService("cloudflare")) { try { providers.push(new provider_cloudflare_js_1.CloudflareProvider(network)); @@ -232873,13 +236940,13 @@ class MulticoinProviderPlugin { return false; } /** - * Resovles to the encoded %%address%% for %%coinType%%. + * Resolves to the encoded %%address%% for %%coinType%%. */ async encodeAddress(coinType, address) { throw new Error("unsupported coin"); } /** - * Resovles to the decoded %%data%% for %%coinType%%. + * Resolves to the decoded %%data%% for %%coinType%%. */ async decodeAddress(coinType, data) { throw new Error("unsupported coin"); @@ -232975,7 +237042,7 @@ class EnsResolver { info: { funcName } }); params = [ - (0, index_js_4.dnsEncode)(this.name), + (0, index_js_4.dnsEncode)(this.name, 255), iface.encodeFunctionData(fragment, params) ]; funcName = "resolve(bytes,bytes)"; @@ -233351,8 +237418,11 @@ function allowNull(format, nullValue) { }); } exports.allowNull = allowNull; -function arrayOf(format) { +function arrayOf(format, allowNull) { return ((array) => { + if (allowNull && array == null) { + return null; + } if (!Array.isArray(array)) { throw new Error("not an array"); } @@ -233440,15 +237510,23 @@ exports.formatLog = formatLog; const _formatBlock = object({ hash: allowNull(formatHash), parentHash: formatHash, + parentBeaconBlockRoot: allowNull(formatHash, null), number: index_js_4.getNumber, timestamp: index_js_4.getNumber, nonce: allowNull(formatData), difficulty: index_js_4.getBigInt, gasLimit: index_js_4.getBigInt, gasUsed: index_js_4.getBigInt, + stateRoot: allowNull(formatHash, null), + receiptsRoot: allowNull(formatHash, null), + blobGasUsed: allowNull(index_js_4.getBigInt, null), + excessBlobGas: allowNull(index_js_4.getBigInt, null), miner: allowNull(index_js_1.getAddress), + prevRandao: allowNull(formatHash, null), extraData: formatData, baseFeePerGas: allowNull(index_js_4.getBigInt) +}, { + prevRandao: ["mixHash"] }); function formatBlock(value) { const result = _formatBlock(value); @@ -233485,6 +237563,7 @@ const _formatTransactionReceipt = object({ index: index_js_4.getNumber, root: allowNull(index_js_4.hexlify), gasUsed: index_js_4.getBigInt, + blobGasUsed: allowNull(index_js_4.getBigInt, null), logsBloom: allowNull(formatData), blockHash: formatHash, hash: formatHash, @@ -233493,6 +237572,7 @@ const _formatTransactionReceipt = object({ //confirmations: allowNull(getNumber, null), cumulativeGasUsed: index_js_4.getBigInt, effectiveGasPrice: allowNull(index_js_4.getBigInt), + blobGasPrice: allowNull(index_js_4.getBigInt, null), status: allowNull(index_js_4.getNumber), type: allowNull(index_js_4.getNumber, 0) }, { @@ -233512,6 +237592,8 @@ function formatTransactionResponse(value) { } const result = object({ hash: formatHash, + // Some nodes do not return this, usually test nodes (like Ganache) + index: allowNull(index_js_4.getNumber, undefined), type: (value) => { if (value === "0x" || value == null) { return 0; @@ -233519,15 +237601,16 @@ function formatTransactionResponse(value) { return (0, index_js_4.getNumber)(value); }, accessList: allowNull(index_js_3.accessListify, null), + blobVersionedHashes: allowNull(arrayOf(formatHash, true), null), blockHash: allowNull(formatHash, null), blockNumber: allowNull(index_js_4.getNumber, null), transactionIndex: allowNull(index_js_4.getNumber, null), - //confirmations: allowNull(getNumber, null), from: index_js_1.getAddress, // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set gasPrice: allowNull(index_js_4.getBigInt), maxPriorityFeePerGas: allowNull(index_js_4.getBigInt), maxFeePerGas: allowNull(index_js_4.getBigInt), + maxFeePerBlobGas: allowNull(index_js_4.getBigInt, null), gasLimit: index_js_4.getBigInt, to: allowNull(index_js_1.getAddress, null), value: index_js_4.getBigInt, @@ -233537,7 +237620,8 @@ function formatTransactionResponse(value) { chainId: allowNull(index_js_4.getBigInt, null) }, { data: ["input"], - gasLimit: ["gas"] + gasLimit: ["gas"], + index: ["transactionIndex"] })(value); // If to and creates are empty, populate the creates from the value if (result.to == null && result.creates == null) { @@ -233627,7 +237711,7 @@ exports.formatTransactionResponse = formatTransactionResponse; * @_section: api/providers:Providers [about-providers] */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.MulticoinProviderPlugin = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0; +exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.ChainstackProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.MulticoinProviderPlugin = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0; var abstract_provider_js_1 = __webpack_require__(/*! ./abstract-provider.js */ "./node_modules/ethers/lib.commonjs/providers/abstract-provider.js"); Object.defineProperty(exports, "AbstractProvider", ({ enumerable: true, get: function () { return abstract_provider_js_1.AbstractProvider; } })); Object.defineProperty(exports, "UnmanagedSubscriber", ({ enumerable: true, get: function () { return abstract_provider_js_1.UnmanagedSubscriber; } })); @@ -233672,6 +237756,8 @@ var provider_ankr_js_1 = __webpack_require__(/*! ./provider-ankr.js */ "./node_m Object.defineProperty(exports, "AnkrProvider", ({ enumerable: true, get: function () { return provider_ankr_js_1.AnkrProvider; } })); var provider_cloudflare_js_1 = __webpack_require__(/*! ./provider-cloudflare.js */ "./node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js"); Object.defineProperty(exports, "CloudflareProvider", ({ enumerable: true, get: function () { return provider_cloudflare_js_1.CloudflareProvider; } })); +var provider_chainstack_js_1 = __webpack_require__(/*! ./provider-chainstack.js */ "./node_modules/ethers/lib.commonjs/providers/provider-chainstack.js"); +Object.defineProperty(exports, "ChainstackProvider", ({ enumerable: true, get: function () { return provider_chainstack_js_1.ChainstackProvider; } })); var provider_etherscan_js_1 = __webpack_require__(/*! ./provider-etherscan.js */ "./node_modules/ethers/lib.commonjs/providers/provider-etherscan.js"); Object.defineProperty(exports, "EtherscanProvider", ({ enumerable: true, get: function () { return provider_etherscan_js_1.EtherscanProvider; } })); Object.defineProperty(exports, "EtherscanPlugin", ({ enumerable: true, get: function () { return provider_etherscan_js_1.EtherscanPlugin; } })); @@ -233997,23 +238083,6 @@ function getGasStationPlugin(url) { } }); } -// Used by Optimism for a custom priority fee -function getPriorityFeePlugin(maxPriorityFeePerGas) { - return new plugins_network_js_1.FetchUrlFeeDataNetworkPlugin("data:", async (fetchFeeData, provider, request) => { - const feeData = await fetchFeeData(); - // This should always fail - if (feeData.maxFeePerGas == null || feeData.maxPriorityFeePerGas == null) { - return feeData; - } - // Compute the corrected baseFee to recompute the updated values - const baseFee = feeData.maxFeePerGas - feeData.maxPriorityFeePerGas; - return { - gasPrice: feeData.gasPrice, - maxFeePerGas: (baseFee + maxPriorityFeePerGas), - maxPriorityFeePerGas - }; - }); -} // See: https://chainlist.org let injected = false; function injectCommonNetworks() { @@ -234049,23 +238118,30 @@ function injectCommonNetworks() { registerEth("rinkeby", 4, { ensNetwork: 4 }); registerEth("goerli", 5, { ensNetwork: 5 }); registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, {}); + registerEth("sepolia", 11155111, { ensNetwork: 11155111 }); + registerEth("holesky", 17000, { ensNetwork: 17000 }); registerEth("classic", 61, {}); registerEth("classicKotti", 6, {}); registerEth("arbitrum", 42161, { ensNetwork: 1, }); registerEth("arbitrum-goerli", 421613, {}); + registerEth("arbitrum-sepolia", 421614, {}); + registerEth("base", 8453, { ensNetwork: 1 }); + registerEth("base-goerli", 84531, {}); + registerEth("base-sepolia", 84532, {}); registerEth("bnb", 56, { ensNetwork: 1 }); registerEth("bnbt", 97, {}); registerEth("linea", 59144, { ensNetwork: 1 }); registerEth("linea-goerli", 59140, {}); + registerEth("linea-sepolia", 59141, {}); registerEth("matic", 137, { ensNetwork: 1, plugins: [ getGasStationPlugin("https:/\/gasstation.polygon.technology/v2") ] }); + registerEth("matic-amoy", 80002, {}); registerEth("matic-mumbai", 80001, { altNames: ["maticMumbai", "maticmum"], plugins: [ @@ -234074,11 +238150,10 @@ function injectCommonNetworks() { }); registerEth("optimism", 10, { ensNetwork: 1, - plugins: [ - getPriorityFeePlugin(BigInt("1000000")) - ] + plugins: [] }); registerEth("optimism-goerli", 420, {}); + registerEth("optimism-sepolia", 11155420, {}); registerEth("xdai", 100, { ensNetwork: 1 }); } //# sourceMappingURL=network.js.map @@ -234319,13 +238394,32 @@ export class CustomBlockNetworkPlugin extends NetworkPlugin { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlchemyProvider = void 0; /** - * About Alchemy + * [[link-alchemy]] provides a third-party service for connecting to + * various blockchains over JSON-RPC. + * + * **Supported Networks** + * + * - Ethereum Mainnet (``mainnet``) + * - Goerli Testnet (``goerli``) + * - Sepolia Testnet (``sepolia``) + * - Arbitrum (``arbitrum``) + * - Arbitrum Goerli Testnet (``arbitrum-goerli``) + * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) + * - Base (``base``) + * - Base Goerlia Testnet (``base-goerli``) + * - Base Sepolia Testnet (``base-sepolia``) + * - Optimism (``optimism``) + * - Optimism Goerli Testnet (``optimism-goerli``) + * - Optimism Sepolia Testnet (``optimism-sepolia``) + * - Polygon (``matic``) + * - Polygon Amoy Testnet (``matic-amoy``) + * - Polygon Mumbai Testnet (``matic-mumbai``) * * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlchemyProvider = void 0; const index_js_1 = __webpack_require__(/*! ../utils/index.js */ "./node_modules/ethers/lib.commonjs/utils/index.js"); const community_js_1 = __webpack_require__(/*! ./community.js */ "./node_modules/ethers/lib.commonjs/providers/community.js"); const network_js_1 = __webpack_require__(/*! ./network.js */ "./node_modules/ethers/lib.commonjs/providers/network.js"); @@ -234343,14 +238437,26 @@ function getHost(name) { return "arb-mainnet.g.alchemy.com"; case "arbitrum-goerli": return "arb-goerli.g.alchemy.com"; + case "arbitrum-sepolia": + return "arb-sepolia.g.alchemy.com"; + case "base": + return "base-mainnet.g.alchemy.com"; + case "base-goerli": + return "base-goerli.g.alchemy.com"; + case "base-sepolia": + return "base-sepolia.g.alchemy.com"; case "matic": return "polygon-mainnet.g.alchemy.com"; + case "matic-amoy": + return "polygon-amoy.g.alchemy.com"; case "matic-mumbai": return "polygon-mumbai.g.alchemy.com"; case "optimism": return "opt-mainnet.g.alchemy.com"; case "optimism-goerli": return "opt-goerli.g.alchemy.com"; + case "optimism-sepolia": + return "opt-sepolia.g.alchemy.com"; } (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); } @@ -234459,8 +238565,18 @@ exports.AnkrProvider = void 0; * * - Ethereum Mainnet (``mainnet``) * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) + * - Sepolia Testnet (``sepolia``) * - Arbitrum (``arbitrum``) + * - Base (``base``) + * - Base Goerlia Testnet (``base-goerli``) + * - Base Sepolia Testnet (``base-sepolia``) + * - BNB (``bnb``) + * - BNB Testnet (``bnbt``) + * - Optimism (``optimism``) + * - Optimism Goerli Testnet (``optimism-goerli``) + * - Optimism Sepolia Testnet (``optimism-sepolia``) + * - Polygon (``matic``) + * - Polygon Mumbai Testnet (``matic-mumbai``) * * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] */ @@ -234475,10 +238591,30 @@ function getHost(name) { return "rpc.ankr.com/eth"; case "goerli": return "rpc.ankr.com/eth_goerli"; - case "matic": - return "rpc.ankr.com/polygon"; + case "sepolia": + return "rpc.ankr.com/eth_sepolia"; case "arbitrum": return "rpc.ankr.com/arbitrum"; + case "base": + return "rpc.ankr.com/base"; + case "base-goerli": + return "rpc.ankr.com/base_goerli"; + case "base-sepolia": + return "rpc.ankr.com/base_sepolia"; + case "bnb": + return "rpc.ankr.com/bsc"; + case "bnbt": + return "rpc.ankr.com/bsc_testnet_chapel"; + case "matic": + return "rpc.ankr.com/polygon"; + case "matic-mumbai": + return "rpc.ankr.com/polygon_mumbai"; + case "optimism": + return "rpc.ankr.com/optimism"; + case "optimism-goerli": + return "rpc.ankr.com/optimism_testnet"; + case "optimism-sepolia": + return "rpc.ankr.com/optimism_sepolia"; } (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); } @@ -234582,8 +238718,11 @@ class BrowserProvider extends provider_jsonrpc_js_1.JsonRpcApiPollingProvider { * Connnect to the %%ethereum%% provider, optionally forcing the * %%network%%. */ - constructor(ethereum, network) { - super(network, { batchMaxCount: 1 }); + constructor(ethereum, network, _options) { + // Copy the options + const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 }); + (0, index_js_1.assertArgument)(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum); + super(network, options); this.#request = async (method, params) => { const payload = { method, params }; this.emit("debug", { action: "sendEip1193Request", payload }); @@ -234670,6 +238809,118 @@ exports.BrowserProvider = BrowserProvider; /***/ }), +/***/ "./node_modules/ethers/lib.commonjs/providers/provider-chainstack.js": +/*!***************************************************************************!*\ + !*** ./node_modules/ethers/lib.commonjs/providers/provider-chainstack.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ChainstackProvider = void 0; +/** + * [[link-chainstack]] provides a third-party service for connecting to + * various blockchains over JSON-RPC. + * + * **Supported Networks** + * + * - Ethereum Mainnet (``mainnet``) + * - Arbitrum (``arbitrum``) + * - BNB Smart Chain Mainnet (``bnb``) + * - Polygon (``matic``) + * + * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] + */ +const index_js_1 = __webpack_require__(/*! ../utils/index.js */ "./node_modules/ethers/lib.commonjs/utils/index.js"); +const community_js_1 = __webpack_require__(/*! ./community.js */ "./node_modules/ethers/lib.commonjs/providers/community.js"); +const network_js_1 = __webpack_require__(/*! ./network.js */ "./node_modules/ethers/lib.commonjs/providers/network.js"); +const provider_jsonrpc_js_1 = __webpack_require__(/*! ./provider-jsonrpc.js */ "./node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js"); +function getApiKey(name) { + switch (name) { + case "mainnet": return "39f1d67cedf8b7831010a665328c9197"; + case "arbitrum": return "0550c209db33c3abf4cc927e1e18cea1"; + case "bnb": return "98b5a77e531614387366f6fc5da097f8"; + case "matic": return "cd9d4d70377471aa7c142ec4a4205249"; + } + (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); +} +function getHost(name) { + switch (name) { + case "mainnet": + return "ethereum-mainnet.core.chainstack.com"; + case "arbitrum": + return "arbitrum-mainnet.core.chainstack.com"; + case "bnb": + return "bsc-mainnet.core.chainstack.com"; + case "matic": + return "polygon-mainnet.core.chainstack.com"; + } + (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); +} +/** + * The **ChainstackProvider** connects to the [[link-chainstack]] + * JSON-RPC end-points. + * + * By default, a highly-throttled API key is used, which is + * appropriate for quick prototypes and simple scripts. To + * gain access to an increased rate-limit, it is highly + * recommended to [sign up here](link-chainstack). + */ +class ChainstackProvider extends provider_jsonrpc_js_1.JsonRpcProvider { + /** + * The API key for the Chainstack connection. + */ + apiKey; + /** + * Creates a new **ChainstackProvider**. + */ + constructor(_network, apiKey) { + if (_network == null) { + _network = "mainnet"; + } + const network = network_js_1.Network.from(_network); + if (apiKey == null) { + apiKey = getApiKey(network.name); + } + const request = ChainstackProvider.getRequest(network, apiKey); + super(request, network, { staticNetwork: network }); + (0, index_js_1.defineProperties)(this, { apiKey }); + } + _getProvider(chainId) { + try { + return new ChainstackProvider(chainId, this.apiKey); + } + catch (error) { } + return super._getProvider(chainId); + } + isCommunityResource() { + return (this.apiKey === getApiKey(this._network.name)); + } + /** + * Returns a prepared request for connecting to %%network%% + * with %%apiKey%% and %%projectSecret%%. + */ + static getRequest(network, apiKey) { + if (apiKey == null) { + apiKey = getApiKey(network.name); + } + const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); + request.allowGzip = true; + if (apiKey === getApiKey(network.name)) { + request.retryFunc = async (request, response, attempt) => { + (0, community_js_1.showThrottleMessage)("ChainstackProvider"); + return true; + }; + } + return request; + } +} +exports.ChainstackProvider = ChainstackProvider; +//# sourceMappingURL=provider-chainstack.js.map + +/***/ }), + /***/ "./node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js": /*!***************************************************************************!*\ !*** ./node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js ***! @@ -234724,12 +238975,18 @@ exports.CloudflareProvider = CloudflareProvider; * - Ethereum Mainnet (``mainnet``) * - Goerli Testnet (``goerli``) * - Sepolia Testnet (``sepolia``) + * - Holesky Testnet (``holesky``) * - Arbitrum (``arbitrum``) * - Arbitrum Goerli Testnet (``arbitrum-goerli``) + * - Base (``base``) + * - Base Sepolia Testnet (``base-sepolia``) + * - BNB Smart Chain Mainnet (``bnb``) + * - BNB Smart Chain Testnet (``bnbt``) * - Optimism (``optimism``) * - Optimism Goerli Testnet (``optimism-goerli``) * - Polygon (``matic``) * - Polygon Mumbai Testnet (``matic-mumbai``) + * - Polygon Amoy Testnet (``matic-amoy``) * * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] */ @@ -234824,22 +239081,30 @@ class EtherscanProvider extends abstract_provider_js_1.AbstractProvider { return "https:/\/api-goerli.etherscan.io"; case "sepolia": return "https:/\/api-sepolia.etherscan.io"; + case "holesky": + return "https:/\/api-holesky.etherscan.io"; case "arbitrum": return "https:/\/api.arbiscan.io"; case "arbitrum-goerli": return "https:/\/api-goerli.arbiscan.io"; + case "base": + return "https:/\/api.basescan.org"; + case "base-sepolia": + return "https:/\/api-sepolia.basescan.org"; + case "bnb": + return "https:/\/api.bscscan.com"; + case "bnbt": + return "https:/\/api-testnet.bscscan.com"; case "matic": return "https:/\/api.polygonscan.com"; + case "matic-amoy": + return "https:/\/api-amoy.polygonscan.com"; case "matic-mumbai": return "https:/\/api-testnet.polygonscan.com"; case "optimism": return "https:/\/api-optimistic.etherscan.io"; case "optimism-goerli": return "https:/\/api-goerli-optimistic.etherscan.io"; - case "bnb": - return "http:/\/api.bscscan.com"; - case "bnbt": - return "http:/\/api-testnet.bscscan.com"; default: } (0, index_js_4.assertArgument)(false, "unsupported network", "network", this.network); @@ -234982,6 +239247,16 @@ class EtherscanProvider extends abstract_provider_js_1.AbstractProvider { return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`; }).join(",") + "]"; } + else if (key === "blobVersionedHashes") { + if (value.length === 0) { + continue; + } + // @TODO: update this once the API supports blobs + (0, index_js_4.assert)(false, "Etherscan API does not support blobVersionedHashes", "UNSUPPORTED_OPERATION", { + operation: "_getTransactionPostData", + info: { transaction } + }); + } else { value = (0, index_js_4.hexlify)(value); } @@ -235061,6 +239336,44 @@ class EtherscanProvider extends abstract_provider_js_1.AbstractProvider { return this.fetch("proxy", { action: "eth_blockNumber" }); case "getGasPrice": return this.fetch("proxy", { action: "eth_gasPrice" }); + case "getPriorityFee": + // This is temporary until Etherscan completes support + if (this.network.name === "mainnet") { + return "1000000000"; + } + else if (this.network.name === "optimism") { + return "1000000"; + } + else { + throw new Error("fallback onto the AbstractProvider default"); + } + /* Working with Etherscan to get this added: + try { + const test = await this.fetch("proxy", { + action: "eth_maxPriorityFeePerGas" + }); + console.log(test); + return test; + } catch (e) { + console.log("DEBUG", e); + throw e; + } + */ + /* This might be safe; but due to rounding neither myself + or Etherscan are necessarily comfortable with this. :) + try { + const result = await this.fetch("gastracker", { action: "gasoracle" }); + console.log(result); + const gasPrice = parseUnits(result.SafeGasPrice, "gwei"); + const baseFee = parseUnits(result.suggestBaseFee, "gwei"); + const priorityFee = gasPrice - baseFee; + if (priorityFee < 0) { throw new Error("negative priority fee; defer to abstract provider default"); } + return priorityFee; + } catch (error) { + console.log("DEBUG", error); + throw error; + } + */ case "getBalance": // Returns base-10 result return this.fetch("account", { @@ -235248,11 +239561,12 @@ exports.EtherscanProvider = EtherscanProvider; /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FallbackProvider = void 0; /** - * A **FallbackProvider** providers resiliance, security and performatnce + * A **FallbackProvider** provides resilience, security and performance * in a way that is customizable and configurable. * * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] @@ -235454,7 +239768,7 @@ function getFuzzyMode(quorum, results) { } /** * A **FallbackProvider** manages several [[Providers]] providing - * resiliance by switching between slow or misbehaving nodes, security + * resilience by switching between slow or misbehaving nodes, security * by requiring multiple backends to aggree and performance by allowing * faster backends to respond earlier. * @@ -235506,7 +239820,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { } this.eventQuorum = 1; this.eventWorkers = 1; - (0, index_js_1.assertArgument)(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider wieght", "quorum", this.quorum); + (0, index_js_1.assertArgument)(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider weight", "quorum", this.quorum); } get providerConfigs() { return this.#configs.map((c) => { @@ -235551,6 +239865,8 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { return await provider.getCode(req.address, req.blockTag); case "getGasPrice": return (await provider.getFeeData()).gasPrice; + case "getPriorityFee": + return (await provider.getFeeData()).maxPriorityFeePerGas; case "getLogs": return await provider.getLogs(req.filter); case "getStorage": @@ -235696,6 +240012,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { return this.#height; } case "getGasPrice": + case "getPriorityFee": case "estimateGas": return getMedian(this.quorum, results); case "getBlock": @@ -235777,15 +240094,46 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { // a cost on the user, so spamming is safe-ish. Just send it to // every backend. if (req.method === "broadcastTransaction") { - const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => { + // Once any broadcast provides a positive result, use it. No + // need to wait for anyone else + const results = this.#configs.map((c) => null); + const broadcasts = this.#configs.map(async ({ provider, weight }, index) => { try { const result = await provider._perform(req); - return Object.assign(normalizeResult({ result }), { weight }); + results[index] = Object.assign(normalizeResult({ result }), { weight }); } catch (error) { - return Object.assign(normalizeResult({ error }), { weight }); + results[index] = Object.assign(normalizeResult({ error }), { weight }); } - })); + }); + // As each promise finishes... + while (true) { + // Check for a valid broadcast result + const done = results.filter((r) => (r != null)); + for (const { value } of done) { + if (!(value instanceof Error)) { + return value; + } + } + // Check for a legit broadcast error (one which we cannot + // recover from; some nodes may return the following red + // herring events: + // - alredy seend (UNKNOWN_ERROR) + // - NONCE_EXPIRED + // - REPLACEMENT_UNDERPRICED + const result = checkQuorum(this.quorum, results.filter((r) => (r != null))); + if ((0, index_js_1.isError)(result, "INSUFFICIENT_FUNDS")) { + throw result; + } + // Kick off the next provider (if any) + const waiting = broadcasts.filter((b, i) => (results[i] == null)); + if (waiting.length === 0) { + break; + } + await Promise.race(waiting); + } + // Use standard quorum results; any result was returned above, + // so this will find any error that met quorum if any const result = getAnyResult(this.quorum, results); (0, index_js_1.assert)(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { request: "%sub-requests", @@ -235799,8 +240147,16 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { await this.#initialSync(); // Bootstrap enough runners to meet quorum const running = new Set(); - for (let i = 0; i < this.quorum; i++) { - this.#addRunner(running, req); + let inflightQuorum = 0; + while (true) { + const runner = this.#addRunner(running, req); + if (runner == null) { + break; + } + inflightQuorum += runner.config.weight; + if (inflightQuorum >= this.quorum) { + break; + } } const result = await this.#waitForQuorum(running, req); // Track requests sent to a provider that are still @@ -235845,9 +240201,20 @@ exports.InfuraProvider = exports.InfuraWebSocketProvider = void 0; * - Sepolia Testnet (``sepolia``) * - Arbitrum (``arbitrum``) * - Arbitrum Goerli Testnet (``arbitrum-goerli``) + * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) + * - Base (``base``) + * - Base Goerlia Testnet (``base-goerli``) + * - Base Sepolia Testnet (``base-sepolia``) + * - BNB Smart Chain Mainnet (``bnb``) + * - BNB Smart Chain Testnet (``bnbt``) + * - Linea (``linea``) + * - Linea Goerli Testnet (``linea-goerli``) + * - Linea Sepolia Testnet (``linea-sepolia``) * - Optimism (``optimism``) * - Optimism Goerli Testnet (``optimism-goerli``) + * - Optimism Sepolia Testnet (``optimism-sepolia``) * - Polygon (``matic``) + * - Polygon Amoy Testnet (``matic-amoy``) * - Polygon Mumbai Testnet (``matic-mumbai``) * * @_subsection: api/providers/thirdparty:INFURA [providers-infura] @@ -235870,18 +240237,36 @@ function getHost(name) { return "arbitrum-mainnet.infura.io"; case "arbitrum-goerli": return "arbitrum-goerli.infura.io"; + case "arbitrum-sepolia": + return "arbitrum-sepolia.infura.io"; + case "base": + return "base-mainnet.infura.io"; + case "base-goerlia": + return "base-goerli.infura.io"; + case "base-sepolia": + return "base-sepolia.infura.io"; + case "bnb": + return "bnbsmartchain-mainnet.infura.io"; + case "bnbt": + return "bnbsmartchain-testnet.infura.io"; case "linea": return "linea-mainnet.infura.io"; case "linea-goerli": return "linea-goerli.infura.io"; + case "linea-sepolia": + return "linea-sepolia.infura.io"; case "matic": return "polygon-mainnet.infura.io"; + case "matic-amoy": + return "polygon-amoy.infura.io"; case "matic-mumbai": return "polygon-mumbai.infura.io"; case "optimism": return "optimism-mainnet.infura.io"; case "optimism-goerli": return "optimism-goerli.infura.io"; + case "optimism-sepolia": + return "optimism-sepolia.infura.io"; } (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); } @@ -235914,7 +240299,7 @@ class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider const req = provider._getConnection(); (0, index_js_1.assert)(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, network); + super(url, provider._network); (0, index_js_1.defineProperties)(this, { projectId: provider.projectId, projectSecret: provider.projectSecret @@ -236033,6 +240418,7 @@ exports.IpcSocketProvider = IpcSocketProvider; /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); /** * One of the most common ways to interact with the blockchain is @@ -236171,12 +240557,45 @@ class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { // for it; it should show up very quickly return await (new Promise((resolve, reject) => { const timeouts = [1000, 100]; + let invalids = 0; const checkTx = async () => { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; + try { + // Try getting the transaction + const tx = await this.provider.getTransaction(hash); + if (tx != null) { + resolve(tx.replaceableTransaction(blockNumber)); + return; + } + } + catch (error) { + // If we were cancelled: stop polling. + // If the data is bad: the node returns bad transactions + // If the network changed: calling again will also fail + // If unsupported: likely destroyed + if ((0, index_js_5.isError)(error, "CANCELLED") || (0, index_js_5.isError)(error, "BAD_DATA") || + (0, index_js_5.isError)(error, "NETWORK_ERROR" || 0)) { + if (error.info == null) { + error.info = {}; + } + error.info.sendTransactionHash = hash; + reject(error); + return; + } + // Stop-gap for misbehaving backends; see #4513 + if ((0, index_js_5.isError)(error, "INVALID_ARGUMENT")) { + invalids++; + if (error.info == null) { + error.info = {}; + } + error.info.sendTransactionHash = hash; + if (invalids > 10) { + reject(error); + return; + } + } + // Notify anyone that cares; but we will try again, since + // it is likely an intermittent service error + this.provider.emit("error", (0, index_js_5.makeError)("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error })); } // Wait another 4 seconds this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000); @@ -236250,11 +240669,12 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { #drainTimer; #notReady; #network; + #pendingDetectNetwork; #scheduleDrain() { if (this.#drainTimer) { return; } - // If we aren't using batching, no hard in sending it immeidately + // If we aren't using batching, no harm in sending it immediately const stallTime = (this._getOption("batchMaxCount") === 1) ? 0 : this._getOption("batchStallTime"); this.#drainTimer = setTimeout(() => { this.#drainTimer = null; @@ -236325,6 +240745,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { this.#payloads = []; this.#drainTimer = null; this.#network = null; + this.#pendingDetectNetwork = null; { let resolve = null; const promise = new Promise((_resolve) => { @@ -236332,9 +240753,15 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { }); this.#notReady = { promise, resolve }; } - // Make sure any static network is compatbile with the provided netwrok const staticNetwork = this._getOption("staticNetwork"); - if (staticNetwork) { + if (typeof (staticNetwork) === "boolean") { + (0, index_js_5.assertArgument)(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options); + if (staticNetwork && network != null) { + this.#network = network_js_1.Network.from(network); + } + } + else if (staticNetwork) { + // Make sure any static network is compatbile with the provided netwrok (0, index_js_5.assertArgument)(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); this.#network = staticNetwork; } @@ -236367,7 +240794,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { if (req.method === "call" || req.method === "estimateGas") { let tx = req.transaction; if (tx && tx.type != null && (0, index_js_5.getBigInt)(tx.type)) { - // If there are no EIP-1559 properties, it might be non-EIP-a559 + // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559 if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { const feeData = await this.getFeeData(); if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) { @@ -236395,30 +240822,56 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { async _detectNetwork() { const network = this._getOption("staticNetwork"); if (network) { - return network; + if (network === true) { + if (this.#network) { + return this.#network; + } + } + else { + return network; + } + } + if (this.#pendingDetectNetwork) { + return await this.#pendingDetectNetwork; } // If we are ready, use ``send``, which enabled requests to be batched if (this.ready) { - return network_js_1.Network.from((0, index_js_5.getBigInt)(await this.send("eth_chainId", []))); + this.#pendingDetectNetwork = (async () => { + try { + const result = network_js_1.Network.from((0, index_js_5.getBigInt)(await this.send("eth_chainId", []))); + this.#pendingDetectNetwork = null; + return result; + } + catch (error) { + this.#pendingDetectNetwork = null; + throw error; + } + })(); + return await this.#pendingDetectNetwork; } // We are not ready yet; use the primitive _send - const payload = { - id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0" - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return network_js_1.Network.from((0, index_js_5.getBigInt)(result.result)); - } - throw this.getRpcError(payload, result); + this.#pendingDetectNetwork = (async () => { + const payload = { + id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0" + }; + this.emit("debug", { action: "sendRpcPayload", payload }); + let result; + try { + result = (await this._send(payload))[0]; + this.#pendingDetectNetwork = null; + } + catch (error) { + this.#pendingDetectNetwork = null; + this.emit("debug", { action: "receiveRpcError", error }); + throw error; + } + this.emit("debug", { action: "receiveRpcResult", result }); + if ("result" in result) { + return network_js_1.Network.from((0, index_js_5.getBigInt)(result.result)); + } + throw this.getRpcError(payload, result); + })(); + return await this.#pendingDetectNetwork; } /** * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls @@ -236520,6 +240973,14 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { if (tx.accessList) { result["accessList"] = (0, index_js_4.accessListify)(tx.accessList); } + if (tx.blobVersionedHashes) { + // @TODO: Remove this case once EIP-4844 added to prepared tx + result["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase()); + } + // @TODO: blobs should probably also be copied over, optionally + // accounting for the kzg property to backfill blobVersionedHashes + // using the commitment. Or should that be left as an exercise to + // the caller? return result; } /** @@ -236534,6 +240995,8 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { return { method: "eth_blockNumber", args: [] }; case "getGasPrice": return { method: "eth_gasPrice", args: [] }; + case "getPriorityFee": + return { method: "eth_maxPriorityFeePerGas", args: [] }; case "getBalance": return { method: "eth_getBalance", @@ -236785,7 +241248,11 @@ class JsonRpcApiPollingProvider extends JsonRpcApiProvider { #pollingInterval; constructor(network, options) { super(network, options); - this.#pollingInterval = 4000; + let pollingInterval = this._getOption("pollingInterval"); + if (pollingInterval == null) { + pollingInterval = defaultOptions.pollingInterval; + } + this.#pollingInterval = pollingInterval; } _getSubscriber(sub) { const subscriber = super._getSubscriber(sub); @@ -237051,10 +241518,19 @@ exports.PocketProvider = PocketProvider; * * - Ethereum Mainnet (``mainnet``) * - Goerli Testnet (``goerli``) + * - Sepolia Testnet (``sepolia``) + * - Holesky Testnet (``holesky``) * - Arbitrum (``arbitrum``) * - Arbitrum Goerli Testnet (``arbitrum-goerli``) + * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) + * - Base Mainnet (``base``); + * - Base Goerli Testnet (``base-goerli``); + * - Base Sepolia Testnet (``base-sepolia``); + * - BNB Smart Chain Mainnet (``bnb``) + * - BNB Smart Chain Testnet (``bnbt``) * - Optimism (``optimism``) * - Optimism Goerli Testnet (``optimism-goerli``) + * - Optimism Sepolia Testnet (``optimism-sepolia``) * - Polygon (``matic``) * - Polygon Mumbai Testnet (``matic-mumbai``) * @@ -237073,12 +241549,26 @@ function getHost(name) { return "ethers.quiknode.pro"; case "goerli": return "ethers.ethereum-goerli.quiknode.pro"; - //case "sepolia": - // return "sepolia.infura.io"; + case "sepolia": + return "ethers.ethereum-sepolia.quiknode.pro"; + case "holesky": + return "ethers.ethereum-holesky.quiknode.pro"; case "arbitrum": return "ethers.arbitrum-mainnet.quiknode.pro"; case "arbitrum-goerli": return "ethers.arbitrum-goerli.quiknode.pro"; + case "arbitrum-sepolia": + return "ethers.arbitrum-sepolia.quiknode.pro"; + case "base": + return "ethers.base-mainnet.quiknode.pro"; + case "base-goerli": + return "ethers.base-goerli.quiknode.pro"; + case "base-spolia": + return "ethers.base-sepolia.quiknode.pro"; + case "bnb": + return "ethers.bsc.quiknode.pro"; + case "bnbt": + return "ethers.bsc-testnet.quiknode.pro"; case "matic": return "ethers.matic.quiknode.pro"; case "matic-mumbai": @@ -237087,9 +241577,40 @@ function getHost(name) { return "ethers.optimism.quiknode.pro"; case "optimism-goerli": return "ethers.optimism-goerli.quiknode.pro"; + case "optimism-sepolia": + return "ethers.optimism-sepolia.quiknode.pro"; + case "xdai": + return "ethers.xdai.quiknode.pro"; } (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); } +/* +@TODO: + These networks are not currently present in the Network + default included networks. Research them and ensure they + are EVM compatible and work with ethers + + http://ethers.matic-amoy.quiknode.pro + + http://ethers.avalanche-mainnet.quiknode.pro + http://ethers.avalanche-testnet.quiknode.pro + http://ethers.blast-sepolia.quiknode.pro + http://ethers.celo-mainnet.quiknode.pro + http://ethers.fantom.quiknode.pro + http://ethers.imx-demo.quiknode.pro + http://ethers.imx-mainnet.quiknode.pro + http://ethers.imx-testnet.quiknode.pro + http://ethers.near-mainnet.quiknode.pro + http://ethers.near-testnet.quiknode.pro + http://ethers.nova-mainnet.quiknode.pro + http://ethers.scroll-mainnet.quiknode.pro + http://ethers.scroll-testnet.quiknode.pro + http://ethers.tron-mainnet.quiknode.pro + http://ethers.zkevm-mainnet.quiknode.pro + http://ethers.zkevm-testnet.quiknode.pro + http://ethers.zksync-mainnet.quiknode.pro + http://ethers.zksync-testnet.quiknode.pro +*/ /** * The **QuickNodeProvider** connects to the [[link-quicknode]] * JSON-RPC end-points. @@ -237211,6 +241732,9 @@ class SocketSubscriber { } stop() { (this.#filterId).then((filterId) => { + if (this.#provider.destroyed) { + return; + } this.#provider.send("eth_unsubscribe", [filterId]); }); this.#filterId = null; @@ -237327,8 +241851,21 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { * * If unspecified, the network will be discovered. */ - constructor(network) { - super(network, { batchMaxCount: 1 }); + constructor(network, _options) { + // Copy the options + const options = Object.assign({}, (_options != null) ? _options : {}); + // Support for batches is generally not supported for + // connection-base providers; if this changes in the future + // the _send should be updated to reflect this + (0, index_js_1.assertArgument)(options.batchMaxCount == null || options.batchMaxCount === 1, "sockets-based providers do not support batches", "options.batchMaxCount", _options); + options.batchMaxCount = 1; + // Socket-based Providers (generally) cannot change their network, + // since they have a long-lived connection; but let people override + // this if they have just cause. + if (options.staticNetwork == null) { + options.staticNetwork = true; + } + super(network, options); this.#callbacks = new Map(); this.#subs = new Map(); this.#pending = new Map(); @@ -237464,6 +242001,7 @@ exports.SocketProvider = SocketProvider; /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.WebSocketProvider = void 0; @@ -237488,8 +242026,8 @@ class WebSocketProvider extends provider_socket_js_1.SocketProvider { } return this.#websocket; } - constructor(url, network) { - super(network); + constructor(url, network, options) { + super(network, options); if (typeof (url) === "string") { this.#connect = () => { return new ws_js_1.WebSocket(url); }; this.#websocket = this.#connect(); @@ -237649,7 +242187,7 @@ function copyRequest(req) { if (req.data) { result.data = (0, index_js_1.hexlify)(req.data); } - const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); + const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); for (const key of bigIntKeys) { if (!(key in req) || req[key] == null) { continue; @@ -237675,6 +242213,20 @@ function copyRequest(req) { if ("customData" in req) { result.customData = req.customData; } + if ("blobVersionedHashes" in req && req.blobVersionedHashes) { + result.blobVersionedHashes = req.blobVersionedHashes.slice(); + } + if ("kzg" in req) { + result.kzg = req.kzg; + } + if ("blobs" in req && req.blobs) { + result.blobs = req.blobs.map((b) => { + if ((0, index_js_1.isBytesLike)(b)) { + return (0, index_js_1.hexlify)(b); + } + return Object.assign({}, b); + }); + } return result; } exports.copyRequest = copyRequest; @@ -237709,6 +242261,11 @@ class Block { * The block hash of the parent block. */ parentHash; + /** + * The hash tree root of the parent beacon block for the given + * execution block. See [[link-eip-4788]]. + */ + parentBeaconBlockRoot; /** * The nonce. * @@ -237734,11 +242291,35 @@ class Block { * The total gas used in this block. */ gasUsed; + /** + * The root hash for the global state after applying changes + * in this block. + */ + stateRoot; + /** + * The hash of the transaction receipts trie. + */ + receiptsRoot; + /** + * The total amount of blob gas consumed by the transactions + * within the block. See [[link-eip-4844]]. + */ + blobGasUsed; + /** + * The running total of blob gas consumed in excess of the + * target, prior to the block. See [[link-eip-4844]]. + */ + excessBlobGas; /** * The miner coinbase address, wihch receives any subsidies for * including this block. */ miner; + /** + * The latest RANDAO mix of the post beacon state of + * the previous block. + */ + prevRandao; /** * Any extra data the validator wished to include. */ @@ -237771,13 +242352,19 @@ class Block { number: block.number, timestamp: block.timestamp, parentHash: block.parentHash, + parentBeaconBlockRoot: block.parentBeaconBlockRoot, nonce: block.nonce, difficulty: block.difficulty, gasLimit: block.gasLimit, gasUsed: block.gasUsed, + blobGasUsed: block.blobGasUsed, + excessBlobGas: block.excessBlobGas, miner: block.miner, + prevRandao: getValue(block.prevRandao), extraData: block.extraData, - baseFeePerGas: getValue(block.baseFeePerGas) + baseFeePerGas: getValue(block.baseFeePerGas), + stateRoot: block.stateRoot, + receiptsRoot: block.receiptsRoot, }); } /** @@ -237816,7 +242403,7 @@ class Block { * Returns a JSON-friendly value. */ toJSON() { - const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, nonce, number, parentHash, timestamp, transactions } = this; + const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this; return { _type: "Block", baseFeePerGas: toJson(baseFeePerGas), @@ -237824,7 +242411,10 @@ class Block { extraData, gasLimit: toJson(gasLimit), gasUsed: toJson(gasUsed), - hash, miner, nonce, number, parentHash, timestamp, + blobGasUsed: toJson(this.blobGasUsed), + excessBlobGas: toJson(this.excessBlobGas), + hash, miner, prevRandao, nonce, number, parentHash, timestamp, + parentBeaconBlockRoot, stateRoot, receiptsRoot, transactions, }; } @@ -238084,7 +242674,7 @@ class TransactionReceipt { */ provider; /** - * The address the transaction was send to. + * The address the transaction was sent to. */ to; /** @@ -238129,6 +242719,10 @@ class TransactionReceipt { * entire gas limit. After the transaction, the difference is refunded. */ gasUsed; + /** + * The gas used for BLObs. See [[link-eip-4844]]. + */ + blobGasUsed; /** * The amount of gas used by all transactions within the block for this * and all transactions with a lower ``index``. @@ -238145,6 +242739,10 @@ class TransactionReceipt { * fee is protocol-enforced. */ gasPrice; + /** + * The price paid per BLOB in gas. See [[link-eip-4844]]. + */ + blobGasPrice; /** * The [[link-eip-2718]] transaction type. */ @@ -238192,7 +242790,9 @@ class TransactionReceipt { logsBloom: tx.logsBloom, gasUsed: tx.gasUsed, cumulativeGasUsed: tx.cumulativeGasUsed, + blobGasUsed: tx.blobGasUsed, gasPrice, + blobGasPrice: tx.blobGasPrice, type: tx.type, //byzantium: tx.byzantium, status: tx.status, @@ -238217,6 +242817,8 @@ class TransactionReceipt { cumulativeGasUsed: toJson(this.cumulativeGasUsed), from, gasPrice: toJson(this.gasPrice), + blobGasUsed: toJson(this.blobGasUsed), + blobGasPrice: toJson(this.blobGasPrice), gasUsed: toJson(this.gasUsed), hash, index, logs, logsBloom, root, status, to }; @@ -238386,6 +242988,10 @@ class TransactionResponse { * to charge the sender. */ maxFeePerGas; + /** + * The [[link-eip-4844]] max fee per BLOb gas. + */ + maxFeePerBlobGas; /** * The data. */ @@ -238408,6 +243014,10 @@ class TransactionResponse { * support it, otherwise ``null``. */ accessList; + /** + * The [[link-eip-4844]] BLOb versioned hashes. + */ + blobVersionedHashes; #startBlock; /** * @_ignore: @@ -238428,19 +243038,22 @@ class TransactionResponse { this.gasPrice = tx.gasPrice; this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null; this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null; + this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null; this.chainId = tx.chainId; this.signature = tx.signature; this.accessList = (tx.accessList != null) ? tx.accessList : null; + this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null; this.#startBlock = -1; } /** * Returns a JSON-compatible representation of this transaction. */ toJSON() { - const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList } = this; + const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this; return { - _type: "TransactionReceipt", + _type: "TransactionResponse", accessList, blockNumber, blockHash, + blobVersionedHashes, chainId: toJson(this.chainId), data, from, gasLimit: toJson(this.gasLimit), @@ -238448,6 +243061,7 @@ class TransactionResponse { hash, maxFeePerGas: toJson(this.maxFeePerGas), maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas), + maxFeePerBlobGas: toJson(this.maxFeePerBlobGas), nonce, signature, to, index, type, value: toJson(this.value), }; @@ -238729,6 +243343,13 @@ class TransactionResponse { isLondon() { return (this.type === 2); } + /** + * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) + * transaction. See [[link-eip-4844]]. + */ + isCancun() { + return (this.type === 3); + } /** * Returns a filter which can be used to listen for orphan events * that evict this transaction. @@ -238882,6 +243503,7 @@ exports.NonceManager = NonceManager; /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FilterIdPendingSubscriber = exports.FilterIdEventSubscriber = exports.FilterIdSubscriber = void 0; @@ -238984,6 +243606,9 @@ class FilterIdSubscriber { if (filterIdPromise) { this.#filterIdPromise = null; filterIdPromise.then((filterId) => { + if (this.#provider.destroyed) { + return; + } this.#provider.send("eth_uninstallFilter", [filterId]); }); } @@ -239069,9 +243694,10 @@ exports.FilterIdPendingSubscriber = FilterIdPendingSubscriber; /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PollingEventSubscriber = exports.PollingTransactionSubscriber = exports.PollingOrphanSubscriber = exports.OnBlockSubscriber = exports.PollingBlockSubscriber = exports.getPollingSubscriber = void 0; +exports.PollingEventSubscriber = exports.PollingTransactionSubscriber = exports.PollingOrphanSubscriber = exports.PollingBlockTagSubscriber = exports.OnBlockSubscriber = exports.PollingBlockSubscriber = exports.getPollingSubscriber = void 0; const index_js_1 = __webpack_require__(/*! ../utils/index.js */ "./node_modules/ethers/lib.commonjs/utils/index.js"); function copy(obj) { return JSON.parse(JSON.stringify(obj)); @@ -239222,6 +243848,35 @@ class OnBlockSubscriber { resume() { this.start(); } } exports.OnBlockSubscriber = OnBlockSubscriber; +class PollingBlockTagSubscriber extends OnBlockSubscriber { + #tag; + #lastBlock; + constructor(provider, tag) { + super(provider); + this.#tag = tag; + this.#lastBlock = -2; + } + pause(dropWhilePaused) { + if (dropWhilePaused) { + this.#lastBlock = -2; + } + super.pause(dropWhilePaused); + } + async _poll(blockNumber, provider) { + const block = await provider.getBlock(this.#tag); + if (block == null) { + return; + } + if (this.#lastBlock === -2) { + this.#lastBlock = block.number; + } + else if (block.number > this.#lastBlock) { + provider.emit(this.#tag, block.number); + this.#lastBlock = block.number; + } + } +} +exports.PollingBlockTagSubscriber = PollingBlockTagSubscriber; /** * @_ignore: * @@ -239504,6 +244159,7 @@ Object.defineProperty(exports, "Transaction", ({ enumerable: true, get: function Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Transaction = void 0; const index_js_1 = __webpack_require__(/*! ../address/index.js */ "./node_modules/ethers/lib.commonjs/address/index.js"); +const addresses_js_1 = __webpack_require__(/*! ../constants/addresses.js */ "./node_modules/ethers/lib.commonjs/constants/addresses.js"); const index_js_2 = __webpack_require__(/*! ../crypto/index.js */ "./node_modules/ethers/lib.commonjs/crypto/index.js"); const index_js_3 = __webpack_require__(/*! ../utils/index.js */ "./node_modules/ethers/lib.commonjs/utils/index.js"); const accesslist_js_1 = __webpack_require__(/*! ./accesslist.js */ "./node_modules/ethers/lib.commonjs/transaction/accesslist.js"); @@ -239514,6 +244170,15 @@ const BN_27 = BigInt(27); const BN_28 = BigInt(28); const BN_35 = BigInt(35); const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); +const BLOB_SIZE = 4096 * 32; +function getVersionedHash(version, hash) { + let versioned = version.toString(16); + while (versioned.length < 2) { + versioned = "0" + versioned; + } + versioned += (0, index_js_2.sha256)(hash).substring(4); + return "0x" + versioned; +} function handleAddress(value) { if (value === "0x") { return null; @@ -239551,6 +244216,13 @@ function formatNumber(_value, name) { function formatAccessList(value) { return (0, accesslist_js_1.accessListify)(value).map((set) => [set.address, set.storageKeys]); } +function formatHashes(value, param) { + (0, index_js_3.assertArgument)(Array.isArray(value), `invalid ${param}`, "value", value); + for (let i = 0; i < value.length; i++) { + (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(value[i], 32), "invalid ${ param } hash", `value[${i}]`, value[i]); + } + return value; +} function _parseLegacy(data) { const fields = (0, index_js_3.decodeRlp)(data); (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); @@ -239589,18 +244261,18 @@ function _parseLegacy(data) { s: (0, index_js_3.zeroPadValue)(fields[8], 32), v }); - tx.hash = (0, index_js_2.keccak256)(data); + //tx.hash = keccak256(data); } return tx; } function _serializeLegacy(tx, sig) { const fields = [ - formatNumber(tx.nonce || 0, "nonce"), + formatNumber(tx.nonce, "nonce"), formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit || 0, "gasLimit"), - ((tx.to != null) ? (0, index_js_1.getAddress)(tx.to) : "0x"), - formatNumber(tx.value || 0, "value"), - (tx.data || "0x"), + formatNumber(tx.gasLimit, "gasLimit"), + (tx.to || "0x"), + formatNumber(tx.value, "value"), + tx.data, ]; let chainId = BN_0; if (tx.chainId != BN_0) { @@ -239663,14 +244335,12 @@ function _parseEipSignature(tx, fields) { function _parseEip1559(data) { const fields = (0, index_js_3.decodeRlp)((0, index_js_3.getBytes)(data).slice(1)); (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", (0, index_js_3.hexlify)(data)); - const maxPriorityFeePerGas = handleUint(fields[2], "maxPriorityFeePerGas"); - const maxFeePerGas = handleUint(fields[3], "maxFeePerGas"); const tx = { type: 2, chainId: handleUint(fields[0], "chainId"), nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: maxPriorityFeePerGas, - maxFeePerGas: maxFeePerGas, + maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), + maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), gasPrice: null, gasLimit: handleUint(fields[4], "gasLimit"), to: handleAddress(fields[5]), @@ -239682,21 +244352,21 @@ function _parseEip1559(data) { if (fields.length === 9) { return tx; } - tx.hash = (0, index_js_2.keccak256)(data); + //tx.hash = keccak256(data); _parseEipSignature(tx, fields.slice(9)); return tx; } function _serializeEip1559(tx, sig) { const fields = [ - formatNumber(tx.chainId || 0, "chainId"), - formatNumber(tx.nonce || 0, "nonce"), + formatNumber(tx.chainId, "chainId"), + formatNumber(tx.nonce, "nonce"), formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit || 0, "gasLimit"), - ((tx.to != null) ? (0, index_js_1.getAddress)(tx.to) : "0x"), - formatNumber(tx.value || 0, "value"), - (tx.data || "0x"), - (formatAccessList(tx.accessList || [])) + formatNumber(tx.gasLimit, "gasLimit"), + (tx.to || "0x"), + formatNumber(tx.value, "value"), + tx.data, + formatAccessList(tx.accessList || []) ]; if (sig) { fields.push(formatNumber(sig.yParity, "yParity")); @@ -239723,20 +244393,20 @@ function _parseEip2930(data) { if (fields.length === 8) { return tx; } - tx.hash = (0, index_js_2.keccak256)(data); + //tx.hash = keccak256(data); _parseEipSignature(tx, fields.slice(8)); return tx; } function _serializeEip2930(tx, sig) { const fields = [ - formatNumber(tx.chainId || 0, "chainId"), - formatNumber(tx.nonce || 0, "nonce"), + formatNumber(tx.chainId, "chainId"), + formatNumber(tx.nonce, "nonce"), formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit || 0, "gasLimit"), - ((tx.to != null) ? (0, index_js_1.getAddress)(tx.to) : "0x"), - formatNumber(tx.value || 0, "value"), - (tx.data || "0x"), - (formatAccessList(tx.accessList || [])) + formatNumber(tx.gasLimit, "gasLimit"), + (tx.to || "0x"), + formatNumber(tx.value, "value"), + tx.data, + formatAccessList(tx.accessList || []) ]; if (sig) { fields.push(formatNumber(sig.yParity, "recoveryParam")); @@ -239745,6 +244415,96 @@ function _serializeEip2930(tx, sig) { } return (0, index_js_3.concat)(["0x01", (0, index_js_3.encodeRlp)(fields)]); } +function _parseEip4844(data) { + let fields = (0, index_js_3.decodeRlp)((0, index_js_3.getBytes)(data).slice(1)); + let typeName = "3"; + let blobs = null; + // Parse the network format + if (fields.length === 4 && Array.isArray(fields[0])) { + typeName = "3 (network format)"; + const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; + (0, index_js_3.assertArgument)(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); + (0, index_js_3.assertArgument)(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); + (0, index_js_3.assertArgument)(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); + (0, index_js_3.assertArgument)(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); + (0, index_js_3.assertArgument)(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); + blobs = []; + for (let i = 0; i < fields[1].length; i++) { + blobs.push({ + data: fBlobs[i], + commitment: fCommits[i], + proof: fProofs[i], + }); + } + fields = fields[0]; + } + (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", (0, index_js_3.hexlify)(data)); + const tx = { + type: 3, + chainId: handleUint(fields[0], "chainId"), + nonce: handleNumber(fields[1], "nonce"), + maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), + maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), + gasPrice: null, + gasLimit: handleUint(fields[4], "gasLimit"), + to: handleAddress(fields[5]), + value: handleUint(fields[6], "value"), + data: (0, index_js_3.hexlify)(fields[7]), + accessList: handleAccessList(fields[8], "accessList"), + maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), + blobVersionedHashes: fields[10] + }; + if (blobs) { + tx.blobs = blobs; + } + (0, index_js_3.assertArgument)(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); + (0, index_js_3.assertArgument)(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); + for (let i = 0; i < tx.blobVersionedHashes.length; i++) { + (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, "data", data); + } + // Unsigned EIP-4844 Transaction + if (fields.length === 11) { + return tx; + } + // @TODO: Do we need to do this? This is only called internally + // and used to verify hashes; it might save time to not do this + //tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ])); + _parseEipSignature(tx, fields.slice(11)); + return tx; +} +function _serializeEip4844(tx, sig, blobs) { + const fields = [ + formatNumber(tx.chainId, "chainId"), + formatNumber(tx.nonce, "nonce"), + formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), + formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), + formatNumber(tx.gasLimit, "gasLimit"), + (tx.to || addresses_js_1.ZeroAddress), + formatNumber(tx.value, "value"), + tx.data, + formatAccessList(tx.accessList || []), + formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), + formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes") + ]; + if (sig) { + fields.push(formatNumber(sig.yParity, "yParity")); + fields.push((0, index_js_3.toBeArray)(sig.r)); + fields.push((0, index_js_3.toBeArray)(sig.s)); + // We have blobs; return the network wrapped format + if (blobs) { + return (0, index_js_3.concat)([ + "0x03", + (0, index_js_3.encodeRlp)([ + fields, + blobs.map((b) => b.data), + blobs.map((b) => b.commitment), + blobs.map((b) => b.proof), + ]) + ]); + } + } + return (0, index_js_3.concat)(["0x03", (0, index_js_3.encodeRlp)(fields)]); +} /** * A **Transaction** describes an operation to be executed on * Ethereum by an Externally Owned Account (EOA). It includes @@ -239771,6 +244531,10 @@ class Transaction { #chainId; #sig; #accessList; + #maxFeePerBlobGas; + #blobVersionedHashes; + #kzg; + #blobs; /** * The transaction type. * @@ -239797,6 +244561,11 @@ class Transaction { case "eip-1559": this.#type = 2; break; + case 3: + case "cancun": + case "eip-4844": + this.#type = 3; + break; default: (0, index_js_3.assertArgument)(false, "unsupported transaction type", "type", value); } @@ -239809,6 +244578,7 @@ class Transaction { case 0: return "legacy"; case 1: return "eip-2930"; case 2: return "eip-1559"; + case 3: return "eip-4844"; } return null; } @@ -239816,7 +244586,13 @@ class Transaction { * The ``to`` address for the transaction or ``null`` if the * transaction is an ``init`` transaction. */ - get to() { return this.#to; } + get to() { + const value = this.#to; + if (value == null && this.type === 3) { + return addresses_js_1.ZeroAddress; + } + return value; + } set to(value) { this.#to = (value == null) ? null : (0, index_js_1.getAddress)(value); } @@ -239853,7 +244629,7 @@ class Transaction { get maxPriorityFeePerGas() { const value = this.#maxPriorityFeePerGas; if (value == null) { - if (this.type === 2) { + if (this.type === 2 || this.type === 3) { return BN_0; } return null; @@ -239870,7 +244646,7 @@ class Transaction { get maxFeePerGas() { const value = this.#maxFeePerGas; if (value == null) { - if (this.type === 2) { + if (this.type === 2 || this.type === 3) { return BN_0; } return null; @@ -239914,7 +244690,9 @@ class Transaction { get accessList() { const value = this.#accessList || null; if (value == null) { - if (this.type === 1 || this.type === 2) { + if (this.type === 1 || this.type === 2 || this.type === 3) { + // @TODO: in v7, this should assign the value or become + // a live object itself, otherwise mutation is inconsistent return []; } return null; @@ -239924,6 +244702,122 @@ class Transaction { set accessList(value) { this.#accessList = (value == null) ? null : (0, accesslist_js_1.accessListify)(value); } + /** + * The max fee per blob gas for Cancun transactions. + */ + get maxFeePerBlobGas() { + const value = this.#maxFeePerBlobGas; + if (value == null && this.type === 3) { + return BN_0; + } + return value; + } + set maxFeePerBlobGas(value) { + this.#maxFeePerBlobGas = (value == null) ? null : (0, index_js_3.getBigInt)(value, "maxFeePerBlobGas"); + } + /** + * The BLOb versioned hashes for Cancun transactions. + */ + get blobVersionedHashes() { + // @TODO: Mutation is inconsistent; if unset, the returned value + // cannot mutate the object, if set it can + let value = this.#blobVersionedHashes; + if (value == null && this.type === 3) { + return []; + } + return value; + } + set blobVersionedHashes(value) { + if (value != null) { + (0, index_js_3.assertArgument)(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); + value = value.slice(); + for (let i = 0; i < value.length; i++) { + (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(value[i], 32), "invalid blobVersionedHash", `value[${i}]`, value[i]); + } + } + this.#blobVersionedHashes = value; + } + /** + * The BLObs for the Transaction, if any. + * + * If ``blobs`` is non-``null``, then the [[seriailized]] + * will return the network formatted sidecar, otherwise it + * will return the standard [[link-eip-2718]] payload. The + * [[unsignedSerialized]] is unaffected regardless. + * + * When setting ``blobs``, either fully valid [[Blob]] objects + * may be specified (i.e. correctly padded, with correct + * committments and proofs) or a raw [[BytesLike]] may + * be provided. + * + * If raw [[BytesLike]] are provided, the [[kzg]] property **must** + * be already set. The blob will be correctly padded and the + * [[KzgLibrary]] will be used to compute the committment and + * proof for the blob. + * + * A BLOb is a sequence of field elements, each of which must + * be within the BLS field modulo, so some additional processing + * may be required to encode arbitrary data to ensure each 32 byte + * field is within the valid range. + * + * Setting this automatically populates [[blobVersionedHashes]], + * overwriting any existing values. Setting this to ``null`` + * does **not** remove the [[blobVersionedHashes]], leaving them + * present. + */ + get blobs() { + if (this.#blobs == null) { + return null; + } + return this.#blobs.map((b) => Object.assign({}, b)); + } + set blobs(_blobs) { + if (_blobs == null) { + this.#blobs = null; + return; + } + const blobs = []; + const versionedHashes = []; + for (let i = 0; i < _blobs.length; i++) { + const blob = _blobs[i]; + if ((0, index_js_3.isBytesLike)(blob)) { + (0, index_js_3.assert)(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { + operation: "set blobs()" + }); + let data = (0, index_js_3.getBytes)(blob); + (0, index_js_3.assertArgument)(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i}]`, blob); + // Pad blob if necessary + if (data.length !== BLOB_SIZE) { + const padded = new Uint8Array(BLOB_SIZE); + padded.set(data); + data = padded; + } + const commit = this.#kzg.blobToKzgCommitment(data); + const proof = (0, index_js_3.hexlify)(this.#kzg.computeBlobKzgProof(data, commit)); + blobs.push({ + data: (0, index_js_3.hexlify)(data), + commitment: (0, index_js_3.hexlify)(commit), + proof + }); + versionedHashes.push(getVersionedHash(1, commit)); + } + else { + const commit = (0, index_js_3.hexlify)(blob.commitment); + blobs.push({ + data: (0, index_js_3.hexlify)(blob.data), + commitment: commit, + proof: (0, index_js_3.hexlify)(blob.proof) + }); + versionedHashes.push(getVersionedHash(1, commit)); + } + } + this.#blobs = blobs; + this.#blobVersionedHashes = versionedHashes; + } + get kzg() { return this.#kzg; } + set kzg(kzg) { + this.#kzg = kzg; + } /** * Creates a new Transaction with default values. */ @@ -239931,15 +244825,19 @@ class Transaction { this.#type = null; this.#to = null; this.#nonce = 0; - this.#gasLimit = BigInt(0); + this.#gasLimit = BN_0; this.#gasPrice = null; this.#maxPriorityFeePerGas = null; this.#maxFeePerGas = null; this.#data = "0x"; - this.#value = BigInt(0); - this.#chainId = BigInt(0); + this.#value = BN_0; + this.#chainId = BN_0; this.#sig = null; this.#accessList = null; + this.#maxFeePerBlobGas = null; + this.#blobVersionedHashes = null; + this.#blobs = null; + this.#kzg = null; } /** * The transaction hash, if signed. Otherwise, ``null``. @@ -239948,7 +244846,7 @@ class Transaction { if (this.signature == null) { return null; } - return (0, index_js_2.keccak256)(this.serialized); + return (0, index_js_2.keccak256)(this.#getSerialized(true, false)); } /** * The pre-image hash of this transaction. @@ -239984,9 +244882,23 @@ class Transaction { * transaction are non-null. */ isSigned() { - //isSigned(): this is SignedTransaction { return this.signature != null; } + #getSerialized(signed, sidecar) { + (0, index_js_3.assert)(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); + const sig = signed ? this.signature : null; + switch (this.inferType()) { + case 0: + return _serializeLegacy(this, sig); + case 1: + return _serializeEip2930(this, sig); + case 2: + return _serializeEip1559(this, sig); + case 3: + return _serializeEip4844(this, sig, sidecar ? this.blobs : null); + } + (0, index_js_3.assert)(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); + } /** * The serialized transaction. * @@ -239994,16 +244906,7 @@ class Transaction { * use [[unsignedSerialized]]. */ get serialized() { - (0, index_js_3.assert)(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - switch (this.inferType()) { - case 0: - return _serializeLegacy(this, this.signature); - case 1: - return _serializeEip2930(this, this.signature); - case 2: - return _serializeEip1559(this, this.signature); - } - (0, index_js_3.assert)(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); + return this.#getSerialized(true, true); } /** * The transaction pre-image. @@ -240012,22 +244915,20 @@ class Transaction { * authorize this transaction. */ get unsignedSerialized() { - switch (this.inferType()) { - case 0: - return _serializeLegacy(this); - case 1: - return _serializeEip2930(this); - case 2: - return _serializeEip1559(this); - } - (0, index_js_3.assert)(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".unsignedSerialized" }); + return this.#getSerialized(false, false); } /** * Return the most "likely" type; currently the highest * supported transaction type. */ inferType() { - return (this.inferTypes().pop()); + const types = this.inferTypes(); + // Prefer London (EIP-1559) over Cancun (BLOb) + if (types.indexOf(2) >= 0) { + return 2; + } + // Return the highest inferred type + return (types.pop()); } /** * Validates the explicit properties and returns a list of compatible @@ -240038,6 +244939,7 @@ class Transaction { const hasGasPrice = this.gasPrice != null; const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null); const hasAccessList = (this.accessList != null); + const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes); //if (hasGasPrice && hasFee) { // throw new Error("transaction cannot have gasPrice and maxFeePerGas"); //} @@ -240068,10 +244970,14 @@ class Transaction { types.push(1); types.push(2); } + else if (hasBlob && this.to) { + types.push(3); + } else { types.push(0); types.push(1); types.push(2); + types.push(3); } } types.sort(); @@ -240107,6 +245013,16 @@ class Transaction { isLondon() { return (this.type === 2); } + /** + * Returns true if this transaction is an [[link-eip-4844]] BLOB + * transaction. + * + * This provides a Type Guard that the related properties are + * non-null. + */ + isCancun() { + return (this.type === 3); + } /** * Create a copy of this transaciton. */ @@ -240155,6 +245071,7 @@ class Transaction { switch (payload[0]) { case 1: return Transaction.from(_parseEip2930(payload)); case 2: return Transaction.from(_parseEip1559(payload)); + case 3: return Transaction.from(_parseEip4844(payload)); } (0, index_js_3.assert)(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); } @@ -240180,6 +245097,9 @@ class Transaction { if (tx.maxFeePerGas != null) { result.maxFeePerGas = tx.maxFeePerGas; } + if (tx.maxFeePerBlobGas != null) { + result.maxFeePerBlobGas = tx.maxFeePerBlobGas; + } if (tx.data != null) { result.data = tx.data; } @@ -240195,12 +245115,24 @@ class Transaction { if (tx.accessList != null) { result.accessList = tx.accessList; } + // This will get overwritten by blobs, if present + if (tx.blobVersionedHashes != null) { + result.blobVersionedHashes = tx.blobVersionedHashes; + } + // Make sure we assign the kzg before assigning blobs, which + // require the library in the event raw blob data is provided. + if (tx.kzg != null) { + result.kzg = tx.kzg; + } + if (tx.blobs != null) { + result.blobs = tx.blobs; + } if (tx.hash != null) { - (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); + (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); (0, index_js_3.assertArgument)(result.hash === tx.hash, "hash mismatch", "tx", tx); } if (tx.from != null) { - (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); + (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); (0, index_js_3.assertArgument)(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); } return result; @@ -240256,12 +245188,20 @@ const BN_58 = BigInt(58); * Encode %%value%% as a Base58-encoded string. */ function encodeBase58(_value) { - let value = (0, maths_js_1.toBigInt)((0, data_js_1.getBytes)(_value)); + const bytes = (0, data_js_1.getBytes)(_value); + let value = (0, maths_js_1.toBigInt)(bytes); let result = ""; while (value) { result = Alphabet[Number(value % BN_58)] + result; value /= BN_58; } + // Account for leading padding zeros + for (let i = 0; i < bytes.length; i++) { + if (bytes[i]) { + break; + } + result = Alphabet[0] + result; + } return result; } exports.encodeBase58 = encodeBase58; @@ -240339,7 +245279,7 @@ function _getBytes(value, name, copy) { } return value; } - if (typeof (value) === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { + if (typeof (value) === "string" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) { const result = new Uint8Array((value.length - 2) / 2); let offset = 2; for (let i = 0; i < result.length; i++) { @@ -240571,7 +245511,7 @@ function stringify(value) { * Returns true if the %%error%% matches an error thrown by ethers * that matches the error %%code%%. * - * In TypeScript envornoments, this can be used to check that %%error%% + * In TypeScript environments, this can be used to check that %%error%% * matches an EthersError type, which means the expected properties will * be set. * @@ -240599,13 +245539,13 @@ function isCallException(error) { exports.isCallException = isCallException; /** * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties + * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties * for the corresponding EthersError. * * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * ethers version, %%code%% and all aditional properties, serialized. + * machine-readable [[ErrorCode]], and depending on %%code%%, additional + * required properties. The error message will also include the %%message%%, + * ethers version, %%code%% and all additional properties, serialized. */ function makeError(message, code, info) { let shortMessage = message; @@ -240690,7 +245630,7 @@ function assertArgumentCount(count, expectedCount, message) { count: count, expectedCount: expectedCount }); - assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { + assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", { count: count, expectedCount: expectedCount }); @@ -240822,7 +245762,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FetchResponse = exports.FetchRequest = exports.FetchCancelSignal = void 0; /** * Fetching content from the web is environment-specific, so Ethers - * provides an abstraction the each environment can implement to provide + * provides an abstraction that each environment can implement to provide * this service. * * On [Node.js](link-node), the ``http`` and ``https`` libs are used to @@ -240830,10 +245770,10 @@ exports.FetchResponse = exports.FetchRequest = exports.FetchCancelSignal = void * and populate the [[FetchResponse]]. * * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting - * ``Promise`` is waited on to retreive the payload. + * ``Promise`` is waited on to retrieve the payload. * * The [[FetchRequest]] is responsible for handling many common situations, - * such as redirects, server throttling, authentcation, etc. + * such as redirects, server throttling, authentication, etc. * * It also handles common gateways, such as IPFS and data URIs. * @@ -240964,7 +245904,7 @@ class FetchRequest { #throttle; #getUrlFunc; /** - * The fetch URI to requrest. + * The fetch URL to request. */ get url() { return this.#url; } set url(url) { @@ -240978,15 +245918,15 @@ class FetchRequest { * header. * * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . + * intrinsic ``Content-Type``). * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to + * If %%body%% is a string, the intrinsic ``Content-Type`` is set to * ``text/plain``. * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to + * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to * ``application/octet-stream``. * - * If %%body%% is any other object, the intrincis ``Content-Type`` is + * If %%body%% is any other object, the intrinsic ``Content-Type`` is * set to ``application/json``. */ get body() { @@ -241046,7 +245986,7 @@ class FetchRequest { * The headers that will be used when requesting the URI. All * keys are lower-case. * - * This object is a copy, so any chnages will **NOT** be reflected + * This object is a copy, so any changes will **NOT** be reflected * in the ``FetchRequest``. * * To set a header entry, use the ``setHeader`` method. @@ -241139,7 +246079,7 @@ class FetchRequest { this.#allowInsecure = !!value; } /** - * The timeout (in milliseconds) to wait for a complere response. + * The timeout (in milliseconds) to wait for a complete response. * //(default: 5 minutes)// */ get timeout() { return this.#timeout; } @@ -241347,7 +246287,7 @@ class FetchRequest { * to %%location%%. */ redirect(location) { - // Redirection; for now we only support absolute locataions + // Redirection; for now we only support absolute locations const current = this.url.split(":")[0].toLowerCase(); const target = location.split(":")[0].toLowerCase(); // Don't allow redirecting: @@ -241399,6 +246339,7 @@ class FetchRequest { clone.#preflight = this.#preflight; clone.#process = this.#process; clone.#retry = this.#retry; + clone.#throttle = Object.assign({}, this.#throttle); clone.#getUrlFunc = this.#getUrlFunc; return clone; } @@ -241487,7 +246428,7 @@ class FetchRequest { exports.FetchRequest = FetchRequest; ; /** - * The response for a FetchREquest. + * The response for a FetchRequest. */ class FetchResponse { #statusCode; @@ -241617,7 +246558,7 @@ class FetchResponse { return this.headers[key.toLowerCase()]; } /** - * Returns true of the response has a body. + * Returns true if the response has a body. */ hasBody() { return (this.#body != null); @@ -241643,8 +246584,23 @@ class FetchResponse { if (message === "") { message = `server response ${this.statusCode} ${this.statusMessage}`; } + let requestUrl = null; + if (this.request) { + requestUrl = this.request.url; + } + let responseBody = null; + try { + if (this.#body) { + responseBody = (0, utf8_js_1.toUtf8String)(this.#body); + } + } + catch (e) { } (0, errors_js_1.assert)(false, message, "SERVER_ERROR", { - request: (this.request || "unknown request"), response: this, error + request: (this.request || "unknown request"), response: this, error, + info: { + requestUrl, responseBody, + responseStatus: `${this.statusCode} ${this.statusMessage}` + } }); } } @@ -242213,9 +247169,9 @@ exports.FixedNumber = FixedNumber; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getUrl = exports.createGetUrl = void 0; const errors_js_1 = __webpack_require__(/*! ./errors.js */ "./node_modules/ethers/lib.commonjs/utils/errors.js"); -// @TODO: timeout is completely ignored; start a Promise.any with a reject? function createGetUrl(options) { async function getUrl(req, _signal) { + (0, errors_js_1.assert)(_signal == null || !_signal.cancelled, "request cancelled before sending", "CANCELLED"); const protocol = req.url.split(":")[0].toLowerCase(); (0, errors_js_1.assert)(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { info: { protocol }, @@ -242224,19 +247180,36 @@ function createGetUrl(options) { (0, errors_js_1.assert)(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { operation: "request" }); - let signal = undefined; + let error = null; + const controller = new AbortController(); + const timer = setTimeout(() => { + error = (0, errors_js_1.makeError)("request timeout", "TIMEOUT"); + controller.abort(); + }, req.timeout); if (_signal) { - const controller = new AbortController(); - signal = controller.signal; - _signal.addListener(() => { controller.abort(); }); + _signal.addListener(() => { + error = (0, errors_js_1.makeError)("request cancelled", "CANCELLED"); + controller.abort(); + }); } const init = { method: req.method, headers: new Headers(Array.from(req)), body: req.body || undefined, - signal + signal: controller.signal }; - const resp = await fetch(req.url, init); + let resp; + try { + resp = await fetch(req.url, init); + } + catch (_error) { + clearTimeout(timer); + if (error) { + throw error; + } + throw _error; + } + clearTimeout(timer); const headers = {}; resp.headers.forEach((value, key) => { headers[key.toLowerCase()] = value; @@ -242534,7 +247507,7 @@ function toBeHex(_value, _width) { } else { const width = getNumber(_width, "width"); - (0, errors_js_1.assert)(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { + (0, errors_js_1.assert)(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { operation: "toBeHex", fault: "overflow", value: _value @@ -243081,6 +248054,7 @@ function getUtf8CodePoints(_bytes, onError) { * If %%form%% is specified, the string is normalized. */ function toUtf8Bytes(str, form) { + (0, errors_js_1.assertArgument)(typeof (str) === "string", "invalid string value", "str", str); if (form != null) { (0, errors_js_1.assertNormalize)(form); str = str.normalize(form); @@ -243255,6 +248229,7 @@ class BaseWallet extends index_js_3.AbstractSigner { return new BaseWallet(this.#signingKey, provider); } async signTransaction(tx) { + tx = (0, index_js_3.copyRequest)(tx); // Replace any Addressable or ENS name with an address const { to, from } = await (0, index_js_5.resolveProperties)({ to: (tx.to ? (0, index_js_1.resolveAddress)(tx.to, this.provider) : undefined), @@ -243381,8 +248356,9 @@ function ser_I(index, chainCode, publicKey, privateKey) { } function derivePath(node, path) { const components = path.split("/"); - (0, index_js_4.assertArgument)(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); + (0, index_js_4.assertArgument)(components.length > 0, "invalid path", "path", path); if (components[0] === "m") { + (0, index_js_4.assertArgument)(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path); components.shift(); } let result = node; @@ -243444,9 +248420,9 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { /** * The derivation path of this wallet. * - * Since extended keys do not provider full path details, this + * Since extended keys do not provide full path details, this * may be ``null``, if instantiated from a source that does not - * enocde it. + * encode it. */ path; /** @@ -244597,6 +249573,7 @@ export function uuidV4(randomBytes: BytesLike): string { /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Wallet = void 0; @@ -244720,7 +249697,7 @@ class Wallet extends base_wallet_js_1.BaseWallet { return Wallet.#fromAccount(account); } /** - * Creates a new random [[HDNodeWallet]] using the avavilable + * Creates a new random [[HDNodeWallet]] using the available * [cryptographic random source](randomBytes). * * If there is no crytographic random source, this will throw. @@ -245205,7 +250182,7 @@ exports.wordlists = { /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}'); /***/ }), @@ -245216,7 +250193,7 @@ module.exports = JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mo /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}'); /***/ }), @@ -245227,7 +250204,7 @@ module.exports = JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sh /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}'); +module.exports = /*#__PURE__*/JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}'); /***/ }), @@ -245238,7 +250215,7 @@ module.exports = JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224"," /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}'); /***/ }), @@ -245249,7 +250226,7 @@ module.exports = JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fd /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny ","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"name":"elliptic","version":"6.5.7","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny ","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}'); /***/ }), @@ -245260,7 +250237,7 @@ module.exports = JSON.parse('{"name":"elliptic","version":"6.5.4","description": /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}'); +module.exports = /*#__PURE__*/JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}'); /***/ }) diff --git a/v4-client-js/__tests__/helpers/constants.ts b/v4-client-js/__tests__/helpers/constants.ts index 148bb376..8dd1dcc2 100644 --- a/v4-client-js/__tests__/helpers/constants.ts +++ b/v4-client-js/__tests__/helpers/constants.ts @@ -10,6 +10,7 @@ import { IPlaceOrder, Order_Side, Order_TimeInForce, + IBatchCancelOrder, } from '../../src/types'; export const TEST_ADDRESS: string = 'dydx1vl9h9nkmau4e9v7tm30wekespu3d2qhd9404wa'; @@ -45,6 +46,17 @@ export const defaultCancelOrder: ICancelOrder = { goodTilBlock: 4250, }; +// BatchCancelOrder variables +export const defaultBatchCancelOrder: IBatchCancelOrder = { + shortTermOrders: [ + { + clobPairId: ClobPairId.PERPETUAL_PAIR_BTC_USD, + clientIds: [generateRandomClientId(), generateRandomClientId()], + }, + ], + goodTilBlock: 4250, +}; + // Transfer variables export const defaultTransfer: Transfer = { sender: { diff --git a/v4-client-js/__tests__/lib/helpers.test.ts b/v4-client-js/__tests__/lib/helpers.test.ts index 4e0879f9..e8b5bdbc 100644 --- a/v4-client-js/__tests__/lib/helpers.test.ts +++ b/v4-client-js/__tests__/lib/helpers.test.ts @@ -2,15 +2,21 @@ import { PartialTransactionOptions, TransactionOptions } from '../../src'; import { DEFAULT_SEQUENCE } from '../../src/lib/constants'; import { convertPartialTransactionOptionsToFull, stripHexPrefix } from '../../src/lib/helpers'; import { defaultTransactionOptions } from '../helpers/constants'; -import { calculateSubticks } from '../../src/clients/helpers/chain-helpers'; +import { calculateSubticks, calculateQuantums } from '../../src/clients/helpers/chain-helpers'; import Long from 'long'; describe('helpers', () => { describe('calculateSubticks', () => { - it('test test', () => { + it('correctly handles decimals', () => { expect(calculateSubticks(8.45, -7, -9, 1000000)).toEqual(new Long(845_000_000)); }); }); + + describe('calculateQuantums', () => { + it('correctly handles decimals', () => { + expect(calculateQuantums(0.0003, -10, 1000000)).toEqual(new Long(3_000_000)); + }); + }); describe('convertPartialTransactionOptionsToFull', () => it.each([ diff --git a/v4-client-js/__tests__/lib/validation.test.ts b/v4-client-js/__tests__/lib/validation.test.ts index bb96b0bf..7d8000de 100644 --- a/v4-client-js/__tests__/lib/validation.test.ts +++ b/v4-client-js/__tests__/lib/validation.test.ts @@ -1,8 +1,16 @@ -import { ICancelOrder, IPlaceOrder, OrderFlags, Transfer } from '../../src/types'; +import { + ClobPairId, + IBatchCancelOrder, + ICancelOrder, + IPlaceOrder, + OrderFlags, + Transfer, +} from '../../src/types'; import { MAX_SUBACCOUNT_NUMBER, MAX_UINT_32 } from '../../src/lib/constants'; import { UserError } from '../../src/lib/errors'; import { isValidAddress, + validateBatchCancelOrderMessage, validateCancelOrderMessage, validatePlaceOrderMessage, validateTransferMessage, @@ -10,6 +18,7 @@ import { import { TEST_ADDRESS, defaultCancelOrder, + defaultBatchCancelOrder, defaultOrder, defaultTransfer, } from '../helpers/constants'; @@ -150,6 +159,45 @@ describe('Validations', () => { }, ); + it.each([ + ['valid', defaultBatchCancelOrder, undefined], + [ + 'overflow clientId', + { + ...defaultBatchCancelOrder, + shortTermOrders: [ + ...defaultBatchCancelOrder.shortTermOrders, + { + clobPairId: ClobPairId.PERPETUAL_PAIR_ETH_USD, + clientIds: [MAX_UINT_32_PLUS_1], + }, + ], + }, + new UserError(`clientId: ${MAX_UINT_32_PLUS_1} is not a valid uint32`), + ], + [ + 'underflow goodTilBlock', + { ...defaultBatchCancelOrder, goodTilBlock: -1 }, + new UserError(`goodTilBlock: ${-1} is not a valid uint32 or is 0`), + ], + [ + 'overflow goodTilBlock', + { ...defaultBatchCancelOrder, goodTilBlock: MAX_UINT_32_PLUS_1 }, + new UserError(`goodTilBlock: ${MAX_UINT_32_PLUS_1} is not a valid uint32 or is 0`), + ], + [ + '0 goodTilBlock', + { ...defaultBatchCancelOrder, goodTilBlock: 0 }, + new UserError(`goodTilBlock: ${0} is not a valid uint32 or is 0`), + ], + ])( + 'Validate batch cancel orders: %s', + (_name: string, orders: IBatchCancelOrder, expectedError: UserError | undefined) => { + const validationError: UserError | void = validateBatchCancelOrderMessage(0, orders); + expect(validationError).toEqual(expectedError); + }, + ); + it.each([ ['valid', defaultTransfer, undefined], [ diff --git a/v4-client-js/commitlint.config.js b/v4-client-js/commitlint.config.js new file mode 100644 index 00000000..1d603464 --- /dev/null +++ b/v4-client-js/commitlint.config.js @@ -0,0 +1,8 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'subject-case': [0, 'never'], + 'header-max-length': [2, 'always', 120], + 'body-max-line-length': [0, 'always', 120], + }, +}; diff --git a/v4-client-js/examples/batch_cancel_orders_example.ts b/v4-client-js/examples/batch_cancel_orders_example.ts new file mode 100644 index 00000000..bfb4ec05 --- /dev/null +++ b/v4-client-js/examples/batch_cancel_orders_example.ts @@ -0,0 +1,130 @@ +import _ from 'lodash'; + +import { BECH32_PREFIX, Order_TimeInForce } from '../src'; +import { CompositeClient, OrderBatchWithMarketId } from '../src/clients/composite-client'; +import { Network, OrderSide } from '../src/clients/constants'; +import LocalWallet from '../src/clients/modules/local-wallet'; +import { SubaccountInfo } from '../src/clients/subaccount'; +import { randomInt, sleep } from '../src/lib/utils'; +import { DYDX_TEST_MNEMONIC, MAX_CLIENT_ID } from './constants'; + +type OrderInfo = { + marketId: string; + clientId: number; + side: OrderSide; + price: number; + size: number; +}; + +const generateShortTermOrdersInfo = (): OrderInfo[] => [ + { + marketId: 'ETH-USD', + clientId: randomInt(MAX_CLIENT_ID), + side: OrderSide.SELL, + price: 4000, + size: 0.01, + }, + { + marketId: 'ETH-USD', + clientId: randomInt(MAX_CLIENT_ID), + side: OrderSide.SELL, + price: 4200, + size: 0.02, + }, + { + marketId: 'BTC-USD', + clientId: randomInt(MAX_CLIENT_ID), + side: OrderSide.BUY, + price: 40000, + size: 0.01, + }, +]; + +const generateBatchCancelShortTermOrders = (ordersInfo: OrderInfo[]): OrderBatchWithMarketId[] => { + const ordersGroupedByMarketIds = _.groupBy(ordersInfo, (info) => info.marketId); + return Object.keys(ordersGroupedByMarketIds).map((marketId) => ({ + marketId, + clientIds: ordersGroupedByMarketIds[marketId].map((info) => info.clientId), + })); +}; + +async function test(): Promise { + try { + const wallet = await LocalWallet.fromMnemonic(DYDX_TEST_MNEMONIC, BECH32_PREFIX); + console.log('**Wallet**', wallet); + + const network = Network.testnet(); + const client = await CompositeClient.connect(network); + console.log('**Client**', client); + + const subaccount = new SubaccountInfo(wallet, 0); + const currentBlock = await client.validatorClient.get.latestBlockHeight(); + const goodTilBlock = currentBlock + 10; + + const shortTermOrdersInfo = generateShortTermOrdersInfo(); + await placeShortTermOrders(client, subaccount, shortTermOrdersInfo, goodTilBlock); + await sleep(5000); + await batchCancelOrders(client, subaccount, shortTermOrdersInfo, goodTilBlock); + } catch (error) { + console.error('**Test Failed**', error.message); + } +} + +const placeShortTermOrders = async ( + client: CompositeClient, + subaccount: SubaccountInfo, + shortTermOrdersInfo: OrderInfo[], + goodTilBlock: number, +): Promise => { + const orderPromises = shortTermOrdersInfo.map(async (order) => { + try { + const tx = await client.placeShortTermOrder( + subaccount, + order.marketId, + order.side, + order.price, + order.size, + order.clientId, + goodTilBlock, + Order_TimeInForce.TIME_IN_FORCE_UNSPECIFIED, + false, + ); + console.log('**Short Term Order Tx**', tx.hash); + } catch (error) { + console.error( + `**Short Term Order Failed for Market ${order.marketId}, Client ID ${order.clientId}**`, + error.message, + ); + } + }); + + // Wait for all order placements to complete + await Promise.all(orderPromises); +} + +const batchCancelOrders = async ( + client: CompositeClient, + subaccount: SubaccountInfo, + shortTermOrdersInfo: OrderInfo[], + goodTilBlock: number, +): Promise => { + const shortTermOrdersPayload = generateBatchCancelShortTermOrders(shortTermOrdersInfo); + try { + const tx = await client.batchCancelShortTermOrdersWithMarketId( + subaccount, + shortTermOrdersPayload, + goodTilBlock + 10, + ); + console.log('**Batch Cancel Short Term Orders Tx**', tx); + } catch (error) { + console.error('**Batch Cancel Short Term Orders Failed**', error.message); + } +} + +test() + .then(() => { + console.log('**Batch Cancel Test Completed Successfully**'); + }) + .catch((error) => { + console.error('**Batch Cancel Test Execution Error**', error.message); + }); diff --git a/v4-client-js/examples/native_examples.ts b/v4-client-js/examples/native_examples.ts index 9c782ed9..78b17cab 100644 --- a/v4-client-js/examples/native_examples.ts +++ b/v4-client-js/examples/native_examples.ts @@ -15,6 +15,9 @@ import { withdraw, withdrawToIBC, wrappedError, + getMegavaultOwnerShares, + depositToMegavault, + withdrawFromMegavault, } from '../src/clients/native'; import { DYDX_TEST_ADDRESS, DYDX_TEST_MNEMONIC } from './constants'; @@ -23,7 +26,7 @@ async function test(): Promise { const paramsInJson = `{ "endpointUrls":[ "https://dydx-testnet.nodefleet.org", - "https://test-dydx.kingnodes.com", + "https://test-dydx-rpc.kingnodes.com", "https://dydx-rpc.liquify.com/api=8878132/dydx" ], "chainId":"dydx-testnet-4" @@ -47,6 +50,19 @@ async function test(): Promise { const userStats = await getUserStats(payload); console.log(userStats); + const balances1 = await getAccountBalances(); + console.log(balances1); + + const vaultOwnerShares = await getMegavaultOwnerShares(payload); + console.log(vaultOwnerShares); + + const depositResult = await depositToMegavault(0, 2); + console.log(depositResult); + + const withdrawResult = await withdrawFromMegavault(0, 1, 0); + console.log(withdrawResult); + + const sendTokenPayload = { subaccountNumber: 0, amount: '10', // Dydx Token diff --git a/v4-client-js/package-lock.json b/v4-client-js/package-lock.json index 023a6720..7c446c36 100644 --- a/v4-client-js/package-lock.json +++ b/v4-client-js/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dydxprotocol/v4-client-js", - "version": "1.1.31", + "version": "1.3.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dydxprotocol/v4-client-js", - "version": "1.1.31", + "version": "1.3.15", "license": "AGPL-3.0", "dependencies": { "@cosmjs/amino": "^0.32.1", @@ -16,7 +16,7 @@ "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", "@cosmjs/utils": "^0.32.1", - "@dydxprotocol/v4-proto": "5.0.0-dev.0", + "@dydxprotocol/v4-proto": "7.0.0-dev.0", "@osmonauts/lcd": "^0.6.0", "@scure/bip32": "^1.1.5", "@scure/bip39": "^1.1.1", @@ -31,10 +31,13 @@ "ws": "^8.14.2" }, "devDependencies": { + "@commitlint/cli": "^19.5.0", + "@commitlint/config-conventional": "^19.5.0", "@dydxprotocol/node-service-base-dev": "^0.2.6", - "@osmonauts/telescope": "0.80.0", "@protobufs/cosmos": "^0.0.11", "@protobufs/gogoproto": "^0.0.10", + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/npm": "^12.0.1", "@types/ffi-napi": "^4.0.4", "@types/ws": "8.5.4", "@typescript-eslint/eslint-plugin": "v5.42.0", @@ -52,18 +55,20 @@ "node-polyfill-webpack-plugin": "^2.0.1", "path-browserify": "^1.0.1", "prettier": "3.2.5", + "semantic-release": "^24.1.1", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "ts-loader": "^9.4.2", "ts-proto": "^1.165.1", + "util": "^0.12.5", "webpack": "^5.77.0", "webpack-cli": "^5.0.1" } }, "node_modules/@adraffy/ens-normalize": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", - "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==" + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" }, "node_modules/@ampproject/remapping": { "version": "2.2.0", @@ -139,9 +144,9 @@ } }, "node_modules/@babel/core/node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -151,9 +156,9 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -187,31 +192,6 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", - "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", - "integrity": "sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==", - "dev": true, - "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.18.6", - "@babel/types": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-compilation-targets": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz", @@ -231,130 +211,88 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" } }, - "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz", - "integrity": "sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-member-expression-to-functions": "^7.18.9", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.19.1", - "@babel/helper-split-export-declaration": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz", - "integrity": "sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==", + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.1.0" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz", - "integrity": "sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==", + "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-plugin-utils": "^7.16.7", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" }, - "peerDependencies": { - "@babel/core": "^7.4.0-0" - } - }, - "node_modules/@babel/helper-define-polyfill-provider/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", - "dev": true, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz", - "integrity": "sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==", + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-function-name": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", - "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz", - "integrity": "sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==", + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.9" + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" @@ -392,25 +330,27 @@ } }, "node_modules/@babel/helper-module-transforms/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms/node_modules/@babel/generator": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.3.tgz", - "integrity": "sha512-Wl5ilw2UD1+ZYprHVprxHZJCFeBWlzZYOovE4SDYLZnqCOD11j+0QzNeEWKLLTWM7nixrZEh7vNIyb76MyJg3A==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", + "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2", - "@jridgewell/gen-mapping": "^0.3.2", + "@babel/types": "^7.25.6", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -418,20 +358,17 @@ } }, "node_modules/@babel/helper-module-transforms/node_modules/@babel/traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.1.tgz", - "integrity": "sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", + "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", - "debug": "^4.1.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -439,13 +376,13 @@ } }, "node_modules/@babel/helper-module-transforms/node_modules/@babel/types": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.2.tgz", - "integrity": "sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -453,14 +390,14 @@ } }, "node_modules/@babel/helper-module-transforms/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -475,57 +412,11 @@ "node": ">=4" } }, - "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", - "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz", - "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-wrap-function": "^7.18.9", - "@babel/types": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-replace-supers": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.19.1.tgz", - "integrity": "sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.18.9", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/traverse": "^7.19.1", - "@babel/types": "^7.19.0" - }, "engines": { "node": ">=6.9.0" } @@ -556,57 +447,45 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz", - "integrity": "sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==", + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dev": true, "dependencies": { - "@babel/types": "^7.20.0" + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/types": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.2.tgz", - "integrity": "sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==", + "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -621,21 +500,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-wrap-function": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.19.0.tgz", - "integrity": "sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==", - "dev": true, - "dependencies": { - "@babel/helper-function-name": "^7.19.0", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helpers": { "version": "7.20.1", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.1.tgz", @@ -651,25 +515,27 @@ } }, "node_modules/@babel/helpers/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers/node_modules/@babel/generator": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.3.tgz", - "integrity": "sha512-Wl5ilw2UD1+ZYprHVprxHZJCFeBWlzZYOovE4SDYLZnqCOD11j+0QzNeEWKLLTWM7nixrZEh7vNIyb76MyJg3A==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", + "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2", - "@jridgewell/gen-mapping": "^0.3.2", + "@babel/types": "^7.25.6", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -677,20 +543,17 @@ } }, "node_modules/@babel/helpers/node_modules/@babel/traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.1.tgz", - "integrity": "sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", + "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", - "debug": "^4.1.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -698,13 +561,13 @@ } }, "node_modules/@babel/helpers/node_modules/@babel/types": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.2.tgz", - "integrity": "sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -712,14 +575,14 @@ } }, "node_modules/@babel/helpers/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -735,14 +598,15 @@ } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -820,10 +684,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.3.tgz", - "integrity": "sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", "dev": true, + "dependencies": { + "@babel/types": "^7.25.6" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -831,101 +698,78 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz", - "integrity": "sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==", + "node_modules/@babel/parser/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, - "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.18.9.tgz", - "integrity": "sha512-AHrP9jadvH7qlOj6PINbgSuphjQUAK7AOT7DPjBo9EHoLhQTnnK5u45e1Hd4DbSQEO9nqPWtQ89r+XEOWFScKg==", + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", - "@babel/plugin-proposal-optional-chaining": "^7.18.9" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { - "@babel/core": "^7.13.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.1.tgz", - "integrity": "sha512-Gh5rchzSwE4kC+o/6T8waD0WHEQIsDmjltY8WnWRXHUdH8axZhuH86Ov9M72YhJfDrZseQwuuWaaIT/TmePp3g==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.", + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-remap-async-to-generator": "^7.18.9", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", - "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.", + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.12.13" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-class-static-block": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.18.6.tgz", - "integrity": "sha512-+I3oIiNxrCpup3Gi8n5IGMwj0gOCAjcJUSQEcotNnCCPMEnixawOQ+KeJPlgfjzx+FKQ1QSyZOWe7wmoJp7vhw==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-static-block instead.", + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-class-static-block": "^7.14.5" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.12.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", - "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-dynamic-import instead.", + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.6.tgz", + "integrity": "sha512-sXaDXaJN9SNLymBdlWFA+bjzBhFD617ZaFiY13dGt7TVslVvVgA6fkZOP7Ki3IGElC45lwHdOTrCtKZGVAWeLQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -934,154 +778,109 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-export-default-from": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.10.tgz", - "integrity": "sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow==", + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-export-default-from": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.10.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", - "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.", + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", - "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-json-strings instead.", + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.10.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.18.9.tgz", - "integrity": "sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead.", + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.", + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.10.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", - "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.", + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz", - "integrity": "sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.", + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.18.8", - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.18.8" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", - "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.", + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.9.tgz", - "integrity": "sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.", + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { "node": ">=6.9.0" @@ -1090,15 +889,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-private-methods": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", - "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.", + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { "node": ">=6.9.0" @@ -1107,17 +904,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz", - "integrity": "sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", + "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + "@babel/helper-plugin-utils": "^7.19.0" }, "engines": { "node": ">=6.9.0" @@ -1126,3059 +919,2684 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", - "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead.", - "dev": true, + "node_modules/@babel/runtime": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", + "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "regenerator-runtime": "^0.14.0" }, "engines": { - "node": ">=4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=6.9.0" } }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "node_modules/@babel/template": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "node_modules/@babel/template/node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "node_modules/@babel/traverse": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz", + "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.19.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.19.3", + "@babel/types": "^7.19.3", + "debug": "^4.1.0", + "globals": "^11.1.0" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "node_modules/@babel/traverse/node_modules/@babel/code-frame": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@babel/highlight": "^7.18.6" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@babel/plugin-syntax-export-default-from": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.18.6.tgz", - "integrity": "sha512-Kr//z3ujSVNx6E9z9ih5xXXMqK07VVTuqPmqGe6Mss/zW5XPeLZeSDZoP9ab/hT4wPKqAgjl2PnhPrcpk8Seew==", + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.3.tgz", + "integrity": "sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-string-parser": "^7.18.10", + "@babel/helper-validator-identifier": "^7.19.1", + "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "engines": { + "node": ">=0.1.90" } }, - "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz", - "integrity": "sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==", + "node_modules/@commitlint/cli": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.5.0.tgz", + "integrity": "sha512-gaGqSliGwB86MDmAAKAtV9SV1SHdmN8pnGq4EJU4+hLisQ7IFfx4jvU4s+pk6tl0+9bv6yT+CaZkufOinkSJIQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@commitlint/format": "^19.5.0", + "@commitlint/lint": "^19.5.0", + "@commitlint/load": "^19.5.0", + "@commitlint/read": "^19.5.0", + "@commitlint/types": "^19.5.0", + "tinyexec": "^0.3.0", + "yargs": "^17.0.0" }, - "engines": { - "node": ">=6.9.0" + "bin": { + "commitlint": "cli.js" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "node_modules/@commitlint/config-conventional": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-19.5.0.tgz", + "integrity": "sha512-OBhdtJyHNPryZKg0fFpZNOBM1ZDbntMvqMuSmpfyP86XSfwzGw4CaoYRG4RutUPg0BTK07VMRIkNJT6wi2zthg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "@commitlint/types": "^19.5.0", + "conventional-changelog-conventionalcommits": "^7.0.2" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "node_modules/@commitlint/config-validator": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-19.5.0.tgz", + "integrity": "sha512-CHtj92H5rdhKt17RmgALhfQt95VayrUo2tSqY9g2w+laAXyk7K/Ef6uPm9tn5qSIwSmrLjKaXK9eiNuxmQrDBw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@commitlint/types": "^19.5.0", + "ajv": "^8.11.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "node_modules/@commitlint/config-validator/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "node_modules/@commitlint/config-validator/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/@commitlint/ensure": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-19.5.0.tgz", + "integrity": "sha512-Kv0pYZeMrdg48bHFEU5KKcccRfKmISSm9MvgIgkpI6m+ohFTB55qZlBW6eYqh/XDfRuIO0x4zSmvBjmOwWTwkg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@commitlint/types": "^19.5.0", + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "lodash.startcase": "^4.4.0", + "lodash.upperfirst": "^4.3.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "node_modules/@commitlint/execute-rule": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-19.5.0.tgz", + "integrity": "sha512-aqyGgytXhl2ejlk+/rfgtwpPexYyri4t8/n4ku6rRJoRhGZpLFMqrZ+YaubeGysCP6oz4mMA34YSTaSOKEeNrg==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "node_modules/@commitlint/format": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-19.5.0.tgz", + "integrity": "sha512-yNy088miE52stCI3dhG/vvxFo9e4jFkU1Mj3xECfzp/bIS/JUay4491huAlVcffOoMK1cd296q0W92NlER6r3A==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@commitlint/types": "^19.5.0", + "chalk": "^5.3.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "node_modules/@commitlint/format/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "node_modules/@commitlint/is-ignored": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-19.5.0.tgz", + "integrity": "sha512-0XQ7Llsf9iL/ANtwyZ6G0NGp5Y3EQ8eDQSxv/SRcfJ0awlBY4tHFAvwWbw66FVUaWICH7iE5en+FD9TQsokZ5w==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@commitlint/types": "^19.5.0", + "semver": "^7.6.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "node_modules/@commitlint/lint": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-19.5.0.tgz", + "integrity": "sha512-cAAQwJcRtiBxQWO0eprrAbOurtJz8U6MgYqLz+p9kLElirzSCc0vGMcyCaA1O7AqBuxo11l1XsY3FhOFowLAAg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@commitlint/is-ignored": "^19.5.0", + "@commitlint/parse": "^19.5.0", + "@commitlint/rules": "^19.5.0", + "@commitlint/types": "^19.5.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "node_modules/@commitlint/load": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-19.5.0.tgz", + "integrity": "sha512-INOUhkL/qaKqwcTUvCE8iIUf5XHsEPCLY9looJ/ipzi7jtGhgmtH7OOFiNvwYgH7mA8osUWOUDV8t4E2HAi4xA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@commitlint/config-validator": "^19.5.0", + "@commitlint/execute-rule": "^19.5.0", + "@commitlint/resolve-extends": "^19.5.0", + "@commitlint/types": "^19.5.0", + "chalk": "^5.3.0", + "cosmiconfig": "^9.0.0", + "cosmiconfig-typescript-loader": "^5.0.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "lodash.uniq": "^4.5.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "node_modules/@commitlint/load/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" - }, "engines": { - "node": ">=6.9.0" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz", - "integrity": "sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ==", + "node_modules/@commitlint/message": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-19.5.0.tgz", + "integrity": "sha512-R7AM4YnbxN1Joj1tMfCyBryOC5aNJBdxadTZkuqtWi3Xj0kMdutq16XQwuoGbIzL2Pk62TALV1fZDCv36+JhTQ==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.18.6.tgz", - "integrity": "sha512-ARE5wZLKnTgPW7/1ftQmSi1CmkqqHo2DNmtztFhvgtOWSDfq0Cq9/9L+KnZNYSNrydBekhW3rwShduf59RoXag==", + "node_modules/@commitlint/parse": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-19.5.0.tgz", + "integrity": "sha512-cZ/IxfAlfWYhAQV0TwcbdR1Oc0/r0Ik1GEessDJ3Lbuma/MRO8FRQX76eurcXtmhJC//rj52ZSZuXUg0oIX0Fw==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-remap-async-to-generator": "^7.18.6" + "@commitlint/types": "^19.5.0", + "conventional-changelog-angular": "^7.0.0", + "conventional-commits-parser": "^5.0.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz", - "integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==", + "node_modules/@commitlint/read": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-19.5.0.tgz", + "integrity": "sha512-TjS3HLPsLsxFPQj6jou8/CZFAmOP2y+6V4PGYt3ihbQKTY1Jnv0QG28WRKl/d1ha6zLODPZqsxLEov52dhR9BQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@commitlint/top-level": "^19.5.0", + "@commitlint/types": "^19.5.0", + "git-raw-commits": "^4.0.0", + "minimist": "^1.2.8", + "tinyexec": "^0.3.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz", - "integrity": "sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ==", + "node_modules/@commitlint/resolve-extends": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-19.5.0.tgz", + "integrity": "sha512-CU/GscZhCUsJwcKTJS9Ndh3AKGZTNFIOoQB2n8CmFnizE0VnEuJoum+COW+C1lNABEeqk6ssfc1Kkalm4bDklA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@commitlint/config-validator": "^19.5.0", + "@commitlint/types": "^19.5.0", + "global-directory": "^4.0.1", + "import-meta-resolve": "^4.0.0", + "lodash.mergewith": "^4.6.2", + "resolve-from": "^5.0.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.2.tgz", - "integrity": "sha512-9rbPp0lCVVoagvtEyQKSo5L8oo0nQS/iif+lwlAz29MccX2642vWDlSZK+2T2buxbopotId2ld7zZAzRfz9j1g==", + "node_modules/@commitlint/resolve-extends/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-replace-supers": "^7.19.1", - "@babel/helper-split-export-declaration": "^7.18.6", - "globals": "^11.1.0" - }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=8" } }, - "node_modules/@babel/plugin-transform-classes/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@commitlint/rules": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-19.5.0.tgz", + "integrity": "sha512-hDW5TPyf/h1/EufSHEKSp6Hs+YVsDMHazfJ2azIk9tHPXS6UqSz1dIRs1gpqS3eMXgtkT7JH6TW4IShdqOwhAw==", "dev": true, + "dependencies": { + "@commitlint/ensure": "^19.5.0", + "@commitlint/message": "^19.5.0", + "@commitlint/to-lines": "^19.5.0", + "@commitlint/types": "^19.5.0" + }, "engines": { - "node": ">=4" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.18.9.tgz", - "integrity": "sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw==", + "node_modules/@commitlint/to-lines": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-19.5.0.tgz", + "integrity": "sha512-R772oj3NHPkodOSRZ9bBVNq224DOxQtNef5Pl8l2M8ZnkkzQfeSTr4uxawV2Sd3ui05dUVzvLNnzenDBO1KBeQ==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.2.tgz", - "integrity": "sha512-mENM+ZHrvEgxLTBXUiQ621rRXZes3KWUv6NdQlrnr1TkWVw+hUjQBZuP2X32qKlrlG2BzgR95gkuCRSkJl8vIw==", + "node_modules/@commitlint/top-level": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-19.5.0.tgz", + "integrity": "sha512-IP1YLmGAk0yWrImPRRc578I3dDUI5A2UBJx9FbSOjxe9sTlzFiwVJ+zeMLgAtHMtGZsC8LUnzmW1qRemkFU4ng==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "find-up": "^7.0.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz", - "integrity": "sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==", + "node_modules/@commitlint/top-level/node_modules/find-up": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", + "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "locate-path": "^7.2.0", + "path-exists": "^5.0.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=18" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz", - "integrity": "sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==", + "node_modules/@commitlint/top-level/node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "p-locate": "^6.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz", - "integrity": "sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==", + "node_modules/@commitlint/top-level/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "yocto-queue": "^1.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/plugin-transform-for-of": { - "version": "7.18.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz", - "integrity": "sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==", + "node_modules/@commitlint/top-level/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "p-limit": "^4.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/plugin-transform-function-name": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz", - "integrity": "sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==", + "node_modules/@commitlint/top-level/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "dependencies": { - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9" - }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/@babel/plugin-transform-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz", - "integrity": "sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==", + "node_modules/@commitlint/top-level/node_modules/yocto-queue": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, "engines": { - "node": ">=6.9.0" + "node": ">=12.20" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz", - "integrity": "sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==", + "node_modules/@commitlint/types": { + "version": "19.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-19.5.0.tgz", + "integrity": "sha512-DSHae2obMSMkAtTBSOulg5X7/z+rGLxcXQIkg3OmWvY6wifojge5uVMydfhUvs7yQj+V7jNmRZ2Xzl8GJyqRgg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@types/conventional-commits-parser": "^5.0.0", + "chalk": "^5.3.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=v18" } }, - "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.19.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.19.6.tgz", - "integrity": "sha512-uG3od2mXvAtIFQIh0xrpLH6r5fpSQN04gIVovl+ODLdUMANokxQLZnPBHcjmv3GxRjnqwLuHvppjjcelqUFZvg==", + "node_modules/@commitlint/types/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.19.6", - "@babel/helper-plugin-utils": "^7.19.0" - }, "engines": { - "node": ">=6.9.0" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.19.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.19.6.tgz", - "integrity": "sha512-8PIa1ym4XRTKuSsOUXqDG0YaOlEuTVvHMe5JCfgBMOtHvJKw/4NGovEGN33viISshG/rZNVrACiBmPQLvWN8xQ==", - "dev": true, + "node_modules/@confio/ics23": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", + "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", "dependencies": { - "@babel/helper-module-transforms": "^7.19.6", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-simple-access": "^7.19.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" } }, - "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.19.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.6.tgz", - "integrity": "sha512-fqGLBepcc3kErfR9R3DnVpURmckXP7gj7bAlrTQyBxrigFqszZCkFkcoxzCp2v32XmwXLvbw+8Yq9/b+QqksjQ==", - "dev": true, + "node_modules/@cosmjs/amino": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.32.1.tgz", + "integrity": "sha512-5l2xQ2XuAhV/B3kTIMPBcVZ/OQ+9Yyddzw/lIVs4qE5e/oBI0PVNWXw1oyR0wgfGHrMUxgKjsoOOqE2IbXVyCw==", "dependencies": { - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-module-transforms": "^7.19.6", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-validator-identifier": "^7.19.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@cosmjs/crypto": "^0.32.1", + "@cosmjs/encoding": "^0.32.1", + "@cosmjs/math": "^0.32.1", + "@cosmjs/utils": "^0.32.1" } }, - "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz", - "integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==", - "dev": true, + "node_modules/@cosmjs/crypto": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.32.1.tgz", + "integrity": "sha512-AsKucEg5o8evU0wXF/lDwX+ZSwCKF4bbc57nFzraHywlp3sNu4dfPPURoMrT0r7kT7wQZAy4Pdnvmm9nnCCm/Q==", "dependencies": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@cosmjs/encoding": "^0.32.1", + "@cosmjs/math": "^0.32.1", + "@cosmjs/utils": "^0.32.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers-sumo": "^0.7.11" } }, - "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.1.tgz", - "integrity": "sha512-oWk9l9WItWBQYS4FgXD4Uyy5kq898lvkXpXQxoJEY1RnvPk4R/Dvu2ebXU9q8lP+rlMwUQTFf2Ok6d78ODa0kw==", - "dev": true, + "node_modules/@cosmjs/encoding": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.32.1.tgz", + "integrity": "sha512-x60Lfds+Eq42rVV29NaoIAson3kBhATBI3zPp7X3GJTryBc5HFHQ6L/976tE1WB2DrvkfUdWS3ayCMVOY/qm1g==", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.19.0", - "@babel/helper-plugin-utils": "^7.19.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" } }, - "node_modules/@babel/plugin-transform-new-target": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz", - "integrity": "sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==", - "dev": true, + "node_modules/@cosmjs/json-rpc": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.32.1.tgz", + "integrity": "sha512-Hsj3Sg+m/JF8qfISp/G4TXQ0FAO01mzDKtNcgKufIHCrvJNDiE69xGyGgSm/qKwsXLBmzRTSxHWK0+yZef3LNQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@cosmjs/stream": "^0.32.1", + "xstream": "^11.14.0" } }, - "node_modules/@babel/plugin-transform-object-super": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", - "integrity": "sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==", - "dev": true, + "node_modules/@cosmjs/math": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.32.1.tgz", + "integrity": "sha512-sqJgDjPh49rxe06apzwKYLxAw4LLFKmEd4yQtHqH16BxVVUrvK5UH9TEBpUrRErdjqENowekecDCDBZspGXHNA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-replace-supers": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "bn.js": "^5.2.0" } }, - "node_modules/@babel/plugin-transform-parameters": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz", - "integrity": "sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA==", - "dev": true, + "node_modules/@cosmjs/proto-signing": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.32.1.tgz", + "integrity": "sha512-IHJMXQ8XnfzR5K1hWb8VV/jEfJof6BL2mgGIA7X4hSPegwoVfb9hnFKPEPgFjGCTTvGZ8SfnCdXxpsOjianVIA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@cosmjs/amino": "^0.32.1", + "@cosmjs/crypto": "^0.32.1", + "@cosmjs/encoding": "^0.32.1", + "@cosmjs/math": "^0.32.1", + "@cosmjs/utils": "^0.32.1", + "cosmjs-types": "^0.9.0" } }, - "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz", - "integrity": "sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==", - "dev": true, + "node_modules/@cosmjs/socket": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.32.1.tgz", + "integrity": "sha512-thPCLCmnCuZvrsDW4YmsADI/MliOXWuMnflbzX+3OhoTuEav2I4/1aOXY0jdy0bbqL0l1opx+JfmwdWptMgKzg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" - }, + "@cosmjs/stream": "^0.32.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/socket/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "engines": { - "node": ">=6.9.0" + "node": ">=8.3.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, - "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz", - "integrity": "sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==", - "dev": true, + "node_modules/@cosmjs/stargate": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.32.1.tgz", + "integrity": "sha512-S0E1qKQ2CMJU79G8bQTquTyrbU03gFsvCkbo3RvK8v2OltVCByjFNh+0nGN5do+uDOzwwmDvnNLhR+SaIyNQoQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "regenerator-transform": "^0.15.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.32.1", + "@cosmjs/encoding": "^0.32.1", + "@cosmjs/math": "^0.32.1", + "@cosmjs/proto-signing": "^0.32.1", + "@cosmjs/stream": "^0.32.1", + "@cosmjs/tendermint-rpc": "^0.32.1", + "@cosmjs/utils": "^0.32.1", + "cosmjs-types": "^0.9.0", + "xstream": "^11.14.0" } }, - "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz", - "integrity": "sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==", - "dev": true, + "node_modules/@cosmjs/stream": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.32.1.tgz", + "integrity": "sha512-6RwHaGxWbIG0y++aCYP/doa4ex/Up8Q8G+ehwDzAq3aKl3zbDe9L0FmycclnMuwPm/baPIkEZ6+IVmJoNLX79Q==", + "dependencies": { + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.1.tgz", + "integrity": "sha512-4uGSxB2JejWhwBUgxca4GqcK/BGnCFMIP7ptwEledrC3AY/shPeIYcPXWEBwO7sfwCta8DhAOCLrc9zhVC+VAQ==", + "dependencies": { + "@cosmjs/crypto": "^0.32.1", + "@cosmjs/encoding": "^0.32.1", + "@cosmjs/json-rpc": "^0.32.1", + "@cosmjs/math": "^0.32.1", + "@cosmjs/socket": "^0.32.1", + "@cosmjs/stream": "^0.32.1", + "@cosmjs/utils": "^0.32.1", + "axios": "^1.6.0", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">= 6" } }, - "node_modules/@babel/plugin-transform-runtime": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.19.1.tgz", - "integrity": "sha512-2nJjTUFIzBMP/f/miLxEK9vxwW/KUXsdvN4sR//TmuDhe6yU2h57WmIOE12Gng3MDP/xpjUV/ToZRdcf8Yj4fA==", + "node_modules/@cosmjs/utils": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.32.1.tgz", + "integrity": "sha512-PV9pa0cVPFCNgfQKEOc6RcNFHr5wMQLcDqWoo/ekIoj1AfzAaqnojdnL80u1C9Qf+vOfRGIXubqiU7Tl7QZuig==" + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.19.0", - "babel-plugin-polyfill-corejs2": "^0.3.3", - "babel-plugin-polyfill-corejs3": "^0.6.0", - "babel-plugin-polyfill-regenerator": "^0.4.1", - "semver": "^6.3.0" - }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=10.0.0" } }, - "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/@dydxprotocol/node-service-base-dev": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@dydxprotocol/node-service-base-dev/-/node-service-base-dev-0.2.11.tgz", + "integrity": "sha512-fF2q0B4QRyflvRXO92YSo6rn8yb3MOPXWOt65gQMbOPssBvvC4ip7/HuCf4TrOP29wkAVY2TW+BUtRvVHc6I/w==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "@types/ffi-napi": "^4.0.5", + "@types/jest": "^28.1.1", + "@types/lodash": "^4.14.161", + "@types/node": "^14.6.4", + "@typescript-eslint/eslint-plugin": "^4.32.0", + "@typescript-eslint/parser": "^4.32.0", + "coveralls": "^3.1.0", + "dotenv-flow": "^3.2.0", + "eslint": "^7.8.0", + "eslint-config-airbnb-typescript": "^9.0.0", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-no-only-tests": "2.4.0", + "jest": "^28.1.1", + "nodemon": "^2.0.4", + "typescript": "^4.7.3" } }, - "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz", - "integrity": "sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/eslint-plugin": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", + "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@typescript-eslint/experimental-utils": "4.33.0", + "@typescript-eslint/scope-manager": "4.33.0", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { - "node": ">=6.9.0" + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@typescript-eslint/parser": "^4.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@babel/plugin-transform-spread": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.19.0.tgz", - "integrity": "sha512-RsuMk7j6n+r752EtzyScnWkQyuJdli6LdO5Klv8Yx0OfPVTcQkIUfS8clx5e9yHXzlnhOZF3CbQ8C2uP5j074w==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/experimental-utils": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", + "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.18.9" + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": "*" } }, - "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz", - "integrity": "sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": ">=5" } }, - "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz", - "integrity": "sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/parser": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", + "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "debug": "^4.3.1" }, "engines": { - "node": ">=6.9.0" + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz", - "integrity": "sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/types": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" - }, "engines": { - "node": ">=6.9.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@babel/plugin-transform-typescript": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.2.tgz", - "integrity": "sha512-jvS+ngBfrnTUBfOQq8NfGnSbF9BrqlR6hjJ2yVxMkmO5nL/cdifNbI30EfjRlN4g5wYWNnMPyj5Sa6R1pbLeag==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/typescript-estree": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.20.2", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-typescript": "^7.20.0" + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { - "node": ">=6.9.0" + "node": "^10.12.0 || >=12.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz", - "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/visitor-keys": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@typescript-eslint/types": "4.33.0", + "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz", - "integrity": "sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-9.0.0.tgz", + "integrity": "sha512-BxckAZU4rwfOidZVucAO120fTSGQAugimS8HFp7OoiordpyNkq5bxSlTPZ2XxSY8Q2NWDIygqtJKqupZld/TXA==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" + "@typescript-eslint/parser": "^3.6.1", + "eslint-config-airbnb": "^18.2.0", + "eslint-config-airbnb-base": "^14.2.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@typescript-eslint/eslint-plugin": "^3.6.1" } }, - "node_modules/@babel/preset-env": { - "version": "7.19.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.19.3.tgz", - "integrity": "sha512-ziye1OTc9dGFOAXSWKUqQblYHNlBOaDl8wzqf2iKXJAltYiR3hKHUKmkt+S9PppW7RQpq4fFCrwwpIDj/f5P4w==", - "dev": true, + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/experimental-utils": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz", + "integrity": "sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==", + "dev": true, "dependencies": { - "@babel/compat-data": "^7.19.3", - "@babel/helper-compilation-targets": "^7.19.3", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-async-generator-functions": "^7.19.1", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-class-static-block": "^7.18.6", - "@babel/plugin-proposal-dynamic-import": "^7.18.6", - "@babel/plugin-proposal-export-namespace-from": "^7.18.9", - "@babel/plugin-proposal-json-strings": "^7.18.6", - "@babel/plugin-proposal-logical-assignment-operators": "^7.18.9", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", - "@babel/plugin-proposal-numeric-separator": "^7.18.6", - "@babel/plugin-proposal-object-rest-spread": "^7.18.9", - "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-proposal-private-property-in-object": "^7.18.6", - "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.18.6", - "@babel/plugin-transform-async-to-generator": "^7.18.6", - "@babel/plugin-transform-block-scoped-functions": "^7.18.6", - "@babel/plugin-transform-block-scoping": "^7.18.9", - "@babel/plugin-transform-classes": "^7.19.0", - "@babel/plugin-transform-computed-properties": "^7.18.9", - "@babel/plugin-transform-destructuring": "^7.18.13", - "@babel/plugin-transform-dotall-regex": "^7.18.6", - "@babel/plugin-transform-duplicate-keys": "^7.18.9", - "@babel/plugin-transform-exponentiation-operator": "^7.18.6", - "@babel/plugin-transform-for-of": "^7.18.8", - "@babel/plugin-transform-function-name": "^7.18.9", - "@babel/plugin-transform-literals": "^7.18.9", - "@babel/plugin-transform-member-expression-literals": "^7.18.6", - "@babel/plugin-transform-modules-amd": "^7.18.6", - "@babel/plugin-transform-modules-commonjs": "^7.18.6", - "@babel/plugin-transform-modules-systemjs": "^7.19.0", - "@babel/plugin-transform-modules-umd": "^7.18.6", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.19.1", - "@babel/plugin-transform-new-target": "^7.18.6", - "@babel/plugin-transform-object-super": "^7.18.6", - "@babel/plugin-transform-parameters": "^7.18.8", - "@babel/plugin-transform-property-literals": "^7.18.6", - "@babel/plugin-transform-regenerator": "^7.18.6", - "@babel/plugin-transform-reserved-words": "^7.18.6", - "@babel/plugin-transform-shorthand-properties": "^7.18.6", - "@babel/plugin-transform-spread": "^7.19.0", - "@babel/plugin-transform-sticky-regex": "^7.18.6", - "@babel/plugin-transform-template-literals": "^7.18.9", - "@babel/plugin-transform-typeof-symbol": "^7.18.9", - "@babel/plugin-transform-unicode-escapes": "^7.18.10", - "@babel/plugin-transform-unicode-regex": "^7.18.6", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.19.3", - "babel-plugin-polyfill-corejs2": "^0.3.3", - "babel-plugin-polyfill-corejs3": "^0.6.0", - "babel-plugin-polyfill-regenerator": "^0.4.1", - "core-js-compat": "^3.25.1", - "semver": "^6.3.0" + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "eslint": "*" } }, - "node_modules/@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/parser": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.1.tgz", + "integrity": "sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "3.10.1", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@babel/preset-typescript": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz", - "integrity": "sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/types": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.10.1.tgz", + "integrity": "sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-transform-typescript": "^7.18.6" - }, "engines": { - "node": ">=6.9.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@babel/runtime": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", - "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/typescript-estree": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz", + "integrity": "sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w==", + "dev": true, "dependencies": { - "regenerator-runtime": "^0.14.0" + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/visitor-keys": "3.10.1", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" }, "engines": { - "node": ">=6.9.0" + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/visitor-keys": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz", + "integrity": "sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "eslint-visitor-keys": "^1.1.0" }, "engines": { - "node": ">=6.9.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@babel/template/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, - "dependencies": { - "@babel/highlight": "^7.18.6" - }, "engines": { - "node": ">=6.9.0" + "node": ">=4" } }, - "node_modules/@babel/traverse": { - "version": "7.19.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz", - "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==", - "dev": true, + "node_modules/@dydxprotocol/v4-proto": { + "version": "7.0.0-dev.0", + "resolved": "https://registry.npmjs.org/@dydxprotocol/v4-proto/-/v4-proto-7.0.0-dev.0.tgz", + "integrity": "sha512-yQ3xMW8GmKCCwtzXF1E/TMYvPYDPRmAR2T/AFXKlE2YF/P/yQMrz/IySzX4Z+wyAMI+G4Sr+AML7V8ehvAcjog==", "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.3", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.19.3", - "@babel/types": "^7.19.3", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" + "protobufjs": "^6.11.2" } }, - "node_modules/@babel/traverse/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "node_modules/@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">=6.9.0" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true, "engines": { - "node": ">=4" + "node": ">= 4" } }, - "node_modules/@babel/types": { - "version": "7.19.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.3.tgz", - "integrity": "sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw==", + "node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.19.1", - "to-fast-properties": "^2.0.0" + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" }, "engines": { - "node": ">=6.9.0" + "node": ">=10.10.0" } }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "node_modules/@cnakazawa/watch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", - "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "dependencies": { - "exec-sh": "^0.3.2", - "minimist": "^1.2.0" - }, - "bin": { - "watch": "cli.js" + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" }, "engines": { - "node": ">=0.1.95" + "node": ">=8" } }, - "node_modules/@confio/ics23": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", - "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "dependencies": { - "@noble/hashes": "^1.0.0", - "protobufjs": "^6.8.8" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@cosmjs/amino": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.32.1.tgz", - "integrity": "sha512-5l2xQ2XuAhV/B3kTIMPBcVZ/OQ+9Yyddzw/lIVs4qE5e/oBI0PVNWXw1oyR0wgfGHrMUxgKjsoOOqE2IbXVyCw==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "dependencies": { - "@cosmjs/crypto": "^0.32.1", - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/math": "^0.32.1", - "@cosmjs/utils": "^0.32.1" + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@cosmjs/crypto": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.32.1.tgz", - "integrity": "sha512-AsKucEg5o8evU0wXF/lDwX+ZSwCKF4bbc57nFzraHywlp3sNu4dfPPURoMrT0r7kT7wQZAy4Pdnvmm9nnCCm/Q==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "dependencies": { - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/math": "^0.32.1", - "@cosmjs/utils": "^0.32.1", - "@noble/hashes": "^1", - "bn.js": "^5.2.0", - "elliptic": "^6.5.4", - "libsodium-wrappers-sumo": "^0.7.11" + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@cosmjs/encoding": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.32.1.tgz", - "integrity": "sha512-x60Lfds+Eq42rVV29NaoIAson3kBhATBI3zPp7X3GJTryBc5HFHQ6L/976tE1WB2DrvkfUdWS3ayCMVOY/qm1g==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@cosmjs/json-rpc": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.32.1.tgz", - "integrity": "sha512-Hsj3Sg+m/JF8qfISp/G4TXQ0FAO01mzDKtNcgKufIHCrvJNDiE69xGyGgSm/qKwsXLBmzRTSxHWK0+yZef3LNQ==", - "dependencies": { - "@cosmjs/stream": "^0.32.1", - "xstream": "^11.14.0" + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" } }, - "node_modules/@cosmjs/math": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.32.1.tgz", - "integrity": "sha512-sqJgDjPh49rxe06apzwKYLxAw4LLFKmEd4yQtHqH16BxVVUrvK5UH9TEBpUrRErdjqENowekecDCDBZspGXHNA==", - "dependencies": { - "bn.js": "^5.2.0" + "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/@cosmjs/proto-signing": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.32.1.tgz", - "integrity": "sha512-IHJMXQ8XnfzR5K1hWb8VV/jEfJof6BL2mgGIA7X4hSPegwoVfb9hnFKPEPgFjGCTTvGZ8SfnCdXxpsOjianVIA==", - "dependencies": { - "@cosmjs/amino": "^0.32.1", - "@cosmjs/crypto": "^0.32.1", - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/math": "^0.32.1", - "@cosmjs/utils": "^0.32.1", - "cosmjs-types": "^0.9.0" + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/@cosmjs/socket": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.32.1.tgz", - "integrity": "sha512-thPCLCmnCuZvrsDW4YmsADI/MliOXWuMnflbzX+3OhoTuEav2I4/1aOXY0jdy0bbqL0l1opx+JfmwdWptMgKzg==", + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-28.1.3.tgz", + "integrity": "sha512-QPAkP5EwKdK/bxIr6C1I4Vs0rm2nHiANzj/Z5X2JQkrZo6IqvC4ldZ9K95tF0HdidhA8Bo6egxSzUFPYKcEXLw==", + "dev": true, "dependencies": { - "@cosmjs/stream": "^0.32.1", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" + "@jest/types": "^28.1.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^28.1.3", + "jest-util": "^28.1.3", + "slash": "^3.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmjs/socket/node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "node_modules/@jest/core": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-28.1.3.tgz", + "integrity": "sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA==", + "dev": true, + "dependencies": { + "@jest/console": "^28.1.3", + "@jest/reporters": "^28.1.3", + "@jest/test-result": "^28.1.3", + "@jest/transform": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^28.1.3", + "jest-config": "^28.1.3", + "jest-haste-map": "^28.1.3", + "jest-message-util": "^28.1.3", + "jest-regex-util": "^28.0.2", + "jest-resolve": "^28.1.3", + "jest-resolve-dependencies": "^28.1.3", + "jest-runner": "^28.1.3", + "jest-runtime": "^28.1.3", + "jest-snapshot": "^28.1.3", + "jest-util": "^28.1.3", + "jest-validate": "^28.1.3", + "jest-watcher": "^28.1.3", + "micromatch": "^4.0.4", + "pretty-format": "^28.1.3", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, "engines": { - "node": ">=8.3.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" }, "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" }, "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { + "node-notifier": { "optional": true } } }, - "node_modules/@cosmjs/stargate": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.32.1.tgz", - "integrity": "sha512-S0E1qKQ2CMJU79G8bQTquTyrbU03gFsvCkbo3RvK8v2OltVCByjFNh+0nGN5do+uDOzwwmDvnNLhR+SaIyNQoQ==", - "dependencies": { - "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.32.1", - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/math": "^0.32.1", - "@cosmjs/proto-signing": "^0.32.1", - "@cosmjs/stream": "^0.32.1", - "@cosmjs/tendermint-rpc": "^0.32.1", - "@cosmjs/utils": "^0.32.1", - "cosmjs-types": "^0.9.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/stream": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.32.1.tgz", - "integrity": "sha512-6RwHaGxWbIG0y++aCYP/doa4ex/Up8Q8G+ehwDzAq3aKl3zbDe9L0FmycclnMuwPm/baPIkEZ6+IVmJoNLX79Q==", - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/tendermint-rpc": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.1.tgz", - "integrity": "sha512-4uGSxB2JejWhwBUgxca4GqcK/BGnCFMIP7ptwEledrC3AY/shPeIYcPXWEBwO7sfwCta8DhAOCLrc9zhVC+VAQ==", - "dependencies": { - "@cosmjs/crypto": "^0.32.1", - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/json-rpc": "^0.32.1", - "@cosmjs/math": "^0.32.1", - "@cosmjs/socket": "^0.32.1", - "@cosmjs/stream": "^0.32.1", - "@cosmjs/utils": "^0.32.1", - "axios": "^1.6.0", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/@cosmjs/tendermint-rpc/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "node_modules/@jest/environment": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-28.1.3.tgz", + "integrity": "sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA==", + "dev": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "@jest/fake-timers": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/node": "*", + "jest-mock": "^28.1.3" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/@cosmjs/utils": { - "version": "0.32.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.32.1.tgz", - "integrity": "sha512-PV9pa0cVPFCNgfQKEOc6RcNFHr5wMQLcDqWoo/ekIoj1AfzAaqnojdnL80u1C9Qf+vOfRGIXubqiU7Tl7QZuig==" - }, - "node_modules/@cosmwasm/ts-codegen": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.21.1.tgz", - "integrity": "sha512-6Rp1zKJLL08H0wMpXuEcvTWx29mR/pNlBS/2S6jTW8h+NzVlDfXQcLm42gpnpb7CzgW8rt1GMNZ3mCCdTDNuSA==", - "dev": true, - "dependencies": { - "@babel/core": "7.18.10", - "@babel/generator": "7.18.12", - "@babel/parser": "7.18.11", - "@babel/plugin-proposal-class-properties": "7.18.6", - "@babel/plugin-proposal-export-default-from": "7.18.10", - "@babel/plugin-proposal-object-rest-spread": "7.18.9", - "@babel/plugin-transform-runtime": "7.18.10", - "@babel/preset-env": "7.18.10", - "@babel/preset-typescript": "^7.18.6", - "@babel/runtime": "^7.18.9", - "@babel/traverse": "7.18.11", - "@babel/types": "7.18.10", - "@pyramation/json-schema-to-typescript": " 11.0.4", - "case": "1.6.3", - "dargs": "7.0.0", - "deepmerge": "4.2.2", - "dotty": "0.1.2", - "fuzzy": "0.1.3", - "glob": "8.0.3", - "inquirerer": "0.1.3", - "long": "^5.2.0", - "minimist": "1.2.6", - "mkdirp": "1.0.4", - "parse-package-name": "1.0.0", - "rimraf": "3.0.2", - "shelljs": "0.8.5", - "wasm-ast-types": "^0.15.0" - }, - "bin": { - "cosmwasm-ts-codegen": "main/ts-codegen.js" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "node_modules/@jest/expect": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-28.1.3.tgz", + "integrity": "sha512-lzc8CpUbSoE4dqT0U+g1qODQjBRHPpCPXissXD4mS9+sWQdmmpeJ9zSH1rS1HEkrsMN0fb7nKrJ9giAR1d3wBw==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "expect": "^28.1.3", + "jest-snapshot": "^28.1.3" }, "engines": { - "node": ">=6.9.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/core": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.10.tgz", - "integrity": "sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw==", + "node_modules/@jest/expect-utils": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-28.1.3.tgz", + "integrity": "sha512-wvbi9LUrHJLn3NlDW6wF2hvIMtd4JUl2QNVrjq+IBSHirgfrR3o9RnVtxzdEGO2n9JyIWwHnLfby5KzqBGg2YA==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.18.10", - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-module-transforms": "^7.18.9", - "@babel/helpers": "^7.18.9", - "@babel/parser": "^7.18.10", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.18.10", - "@babel/types": "^7.18.10", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.1", - "semver": "^6.3.0" + "jest-get-type": "^28.0.2" }, "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/generator": { - "version": "7.18.12", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.12.tgz", - "integrity": "sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg==", + "node_modules/@jest/fake-timers": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-28.1.3.tgz", + "integrity": "sha512-D/wOkL2POHv52h+ok5Oj/1gOG9HSywdoPtFsRCUmlCILXNn5eIWmcnd3DIiWlJnpGvQtmajqBP95Ei0EimxfLw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.10", - "@jridgewell/gen-mapping": "^0.3.2", - "jsesc": "^2.5.1" + "@jest/types": "^28.1.3", + "@sinonjs/fake-timers": "^9.1.2", + "@types/node": "*", + "jest-message-util": "^28.1.3", + "jest-mock": "^28.1.3", + "jest-util": "^28.1.3" }, "engines": { - "node": ">=6.9.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/parser": { - "version": "7.18.11", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz", - "integrity": "sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==", + "node_modules/@jest/globals": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-28.1.3.tgz", + "integrity": "sha512-XFU4P4phyryCXu1pbcqMO0GSQcYe1IsalYCDzRNyhetyeyxMcIxa11qPNDpVNLeretItNqEmYYQn1UYz/5x1NA==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" + "dependencies": { + "@jest/environment": "^28.1.3", + "@jest/expect": "^28.1.3", + "@jest/types": "^28.1.3" }, "engines": { - "node": ">=6.0.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/plugin-transform-runtime": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.10.tgz", - "integrity": "sha512-q5mMeYAdfEbpBAgzl7tBre/la3LeCxmDO1+wMXRdPWbcoMjR3GiXlCLk7JBZVVye0bqTGNMbt0yYVXX1B1jEWQ==", + "node_modules/@jest/reporters": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-28.1.3.tgz", + "integrity": "sha512-JuAy7wkxQZVNU/V6g9xKzCGC5LVXx9FDcABKsSXp5MiKPEE2144a/vXTEDoyzjUpZKfVwp08Wqg5A4WfTMAzjg==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.9", - "babel-plugin-polyfill-corejs2": "^0.3.2", - "babel-plugin-polyfill-corejs3": "^0.5.3", - "babel-plugin-polyfill-regenerator": "^0.4.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^28.1.3", + "@jest/test-result": "^28.1.3", + "@jest/transform": "^28.1.3", + "@jest/types": "^28.1.3", + "@jridgewell/trace-mapping": "^0.3.13", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^28.1.3", + "jest-util": "^28.1.3", + "jest-worker": "^28.1.3", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/preset-env": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.10.tgz", - "integrity": "sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA==", + "node_modules/@jest/schemas": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-28.1.3.tgz", + "integrity": "sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.18.8", - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-async-generator-functions": "^7.18.10", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-class-static-block": "^7.18.6", - "@babel/plugin-proposal-dynamic-import": "^7.18.6", - "@babel/plugin-proposal-export-namespace-from": "^7.18.9", - "@babel/plugin-proposal-json-strings": "^7.18.6", - "@babel/plugin-proposal-logical-assignment-operators": "^7.18.9", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", - "@babel/plugin-proposal-numeric-separator": "^7.18.6", - "@babel/plugin-proposal-object-rest-spread": "^7.18.9", - "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-proposal-private-property-in-object": "^7.18.6", - "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.18.6", - "@babel/plugin-transform-async-to-generator": "^7.18.6", - "@babel/plugin-transform-block-scoped-functions": "^7.18.6", - "@babel/plugin-transform-block-scoping": "^7.18.9", - "@babel/plugin-transform-classes": "^7.18.9", - "@babel/plugin-transform-computed-properties": "^7.18.9", - "@babel/plugin-transform-destructuring": "^7.18.9", - "@babel/plugin-transform-dotall-regex": "^7.18.6", - "@babel/plugin-transform-duplicate-keys": "^7.18.9", - "@babel/plugin-transform-exponentiation-operator": "^7.18.6", - "@babel/plugin-transform-for-of": "^7.18.8", - "@babel/plugin-transform-function-name": "^7.18.9", - "@babel/plugin-transform-literals": "^7.18.9", - "@babel/plugin-transform-member-expression-literals": "^7.18.6", - "@babel/plugin-transform-modules-amd": "^7.18.6", - "@babel/plugin-transform-modules-commonjs": "^7.18.6", - "@babel/plugin-transform-modules-systemjs": "^7.18.9", - "@babel/plugin-transform-modules-umd": "^7.18.6", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.18.6", - "@babel/plugin-transform-new-target": "^7.18.6", - "@babel/plugin-transform-object-super": "^7.18.6", - "@babel/plugin-transform-parameters": "^7.18.8", - "@babel/plugin-transform-property-literals": "^7.18.6", - "@babel/plugin-transform-regenerator": "^7.18.6", - "@babel/plugin-transform-reserved-words": "^7.18.6", - "@babel/plugin-transform-shorthand-properties": "^7.18.6", - "@babel/plugin-transform-spread": "^7.18.9", - "@babel/plugin-transform-sticky-regex": "^7.18.6", - "@babel/plugin-transform-template-literals": "^7.18.9", - "@babel/plugin-transform-typeof-symbol": "^7.18.9", - "@babel/plugin-transform-unicode-escapes": "^7.18.10", - "@babel/plugin-transform-unicode-regex": "^7.18.6", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.18.10", - "babel-plugin-polyfill-corejs2": "^0.3.2", - "babel-plugin-polyfill-corejs3": "^0.5.3", - "babel-plugin-polyfill-regenerator": "^0.4.0", - "core-js-compat": "^3.22.1", - "semver": "^6.3.0" + "@sinclair/typebox": "^0.24.1" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/traverse": { - "version": "7.18.11", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.11.tgz", - "integrity": "sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ==", + "node_modules/@jest/source-map": { + "version": "28.1.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-28.1.2.tgz", + "integrity": "sha512-cV8Lx3BeStJb8ipPHnqVw/IM2VCMWO3crWZzYodSIkxXnRcXJipCdx1JCK0K5MsJJouZQTH73mzf4vgxRaH9ww==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.18.10", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.18.11", - "@babel/types": "^7.18.10", - "debug": "^4.1.0", - "globals": "^11.1.0" + "@jridgewell/trace-mapping": "^0.3.13", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" }, "engines": { - "node": ">=6.9.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/types": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.10.tgz", - "integrity": "sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==", + "node_modules/@jest/test-result": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-28.1.3.tgz", + "integrity": "sha512-kZAkxnSE+FqE8YjW8gNuoVkkC9I7S1qmenl8sGcDOLropASP+BkcGKwhXoyqQuGOGeYY0y/ixjrd/iERpEXHNg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", - "to-fast-properties": "^2.0.0" + "@jest/console": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" }, "engines": { - "node": ">=6.9.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "node_modules/@jest/test-sequencer": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-28.1.3.tgz", + "integrity": "sha512-NIMPEqqa59MWnDi1kvXXpYbqsfQmSJsIbnd85mdVGkiDfQ9WQQTXOLsvISUfonmnBT+w85WEgneCigEEdHDFxw==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jest/test-result": "^28.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^28.1.3", + "slash": "^3.0.0" }, "engines": { - "node": ">=6.0.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz", - "integrity": "sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw==", + "node_modules/@jest/transform": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-28.1.3.tgz", + "integrity": "sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.2", - "core-js-compat": "^3.21.0" + "@babel/core": "^7.11.6", + "@jest/types": "^28.1.3", + "@jridgewell/trace-mapping": "^0.3.13", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^28.1.3", + "jest-regex-util": "^28.0.2", + "jest-util": "^28.1.3", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@jest/types": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz", + "integrity": "sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "@jest/schemas": "^28.1.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=6.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, "engines": { - "node": ">=4" + "node": ">=6.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, - "bin": { - "json5": "lib/cli.js" - }, "engines": { - "node": ">=6" + "node": ">=6.0.0" } }, - "node_modules/@cosmwasm/ts-codegen/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "dev": true - }, - "node_modules/@cosmwasm/ts-codegen/node_modules/minimatch": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", - "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@cosmwasm/ts-codegen/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, "engines": { - "node": ">=10.0.0" + "node": ">=6.0.0" } }, - "node_modules/@dydxprotocol/node-service-base-dev": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@dydxprotocol/node-service-base-dev/-/node-service-base-dev-0.2.6.tgz", - "integrity": "sha512-TKcqsWj1NvNWEucac7yasBixwJqASsuz1Av1F0EsRyCnAsGzU6GNG05hn/Xwf83llLmCC9JEpEBC9LnfJ+IQOg==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "@types/jest": "^26.0.19", - "@types/lodash": "^4.14.161", - "@types/node": "^14.6.4", - "@typescript-eslint/eslint-plugin": "^4.32.0", - "@typescript-eslint/parser": "^4.32.0", - "coveralls": "^3.1.0", - "dotenv-flow": "^3.2.0", - "eslint": "^7.8.0", - "eslint-config-airbnb-typescript": "^9.0.0", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-no-only-tests": "2.4.0", - "jest": "^26.6.3", - "nodemon": "^2.0.4", - "typescript": "^4.4.3" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", - "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "4.33.0", - "@typescript-eslint/scope-manager": "4.33.0", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.1.0", + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "tar": "^6.1.11" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/experimental-utils": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", - "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "abbrev": "1" }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "bin": { + "nopt": "bin/nopt.js" }, - "peerDependencies": { - "eslint": "*" + "engines": { + "node": ">=6" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "node_modules/@noble/curves": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.0.0.tgz", + "integrity": "sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "1.3.0" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz", + "integrity": "sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^2.0.0" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" + "node": ">= 8" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/parser": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", - "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "debug": "^4.3.1" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 8" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/types": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", - "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "node_modules/@octokit/auth-token": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-5.1.1.tgz", + "integrity": "sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==", "dev": true, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">= 18" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/typescript-estree": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", - "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "node_modules/@octokit/core": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.2.tgz", + "integrity": "sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" + "@octokit/auth-token": "^5.0.0", + "@octokit/graphql": "^8.0.0", + "@octokit/request": "^9.0.0", + "@octokit/request-error": "^6.0.1", + "@octokit/types": "^13.0.0", + "before-after-hook": "^3.0.2", + "universal-user-agent": "^7.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 18" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/@typescript-eslint/visitor-keys": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", - "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "node_modules/@octokit/endpoint": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.1.tgz", + "integrity": "sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.33.0", - "eslint-visitor-keys": "^2.0.0" + "@octokit/types": "^13.0.0", + "universal-user-agent": "^7.0.2" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">= 18" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-9.0.0.tgz", - "integrity": "sha512-BxckAZU4rwfOidZVucAO120fTSGQAugimS8HFp7OoiordpyNkq5bxSlTPZ2XxSY8Q2NWDIygqtJKqupZld/TXA==", + "node_modules/@octokit/graphql": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-8.1.1.tgz", + "integrity": "sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==", "dev": true, "dependencies": { - "@typescript-eslint/parser": "^3.6.1", - "eslint-config-airbnb": "^18.2.0", - "eslint-config-airbnb-base": "^14.2.0" + "@octokit/request": "^9.0.0", + "@octokit/types": "^13.0.0", + "universal-user-agent": "^7.0.0" }, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^3.6.1" + "engines": { + "node": ">= 18" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/experimental-utils": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz", - "integrity": "sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==", + "node_modules/@octokit/openapi-types": { + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz", + "integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "11.3.3", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.3.tgz", + "integrity": "sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.10.1", - "@typescript-eslint/typescript-estree": "3.10.1", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@octokit/types": "^13.5.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">= 18" }, "peerDependencies": { - "eslint": "*" + "@octokit/core": ">=6" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/parser": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.1.tgz", - "integrity": "sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==", + "node_modules/@octokit/plugin-retry": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-7.1.1.tgz", + "integrity": "sha512-G9Ue+x2odcb8E1XIPhaFBnTTIrrUDfXN05iFXiqhR+SeeeDMMILcAnysOsxUpEWcQp2e5Ft397FCXTcPkiPkLw==", "dev": true, "dependencies": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.10.1", - "@typescript-eslint/types": "3.10.1", - "@typescript-eslint/typescript-estree": "3.10.1", - "eslint-visitor-keys": "^1.1.0" + "@octokit/request-error": "^6.0.0", + "@octokit/types": "^13.0.0", + "bottleneck": "^2.15.3" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">= 18" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@octokit/core": ">=6" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/types": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.10.1.tgz", - "integrity": "sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ==", + "node_modules/@octokit/plugin-throttling": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-9.3.1.tgz", + "integrity": "sha512-Qd91H4liUBhwLB2h6jZ99bsxoQdhgPk6TdwnClPyTBSDAdviGPceViEgUwj+pcQDmB/rfAXAXK7MTochpHM3yQ==", "dev": true, + "dependencies": { + "@octokit/types": "^13.0.0", + "bottleneck": "^2.15.3" + }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": ">= 18" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "peerDependencies": { + "@octokit/core": "^6.0.0" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/typescript-estree": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz", - "integrity": "sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w==", + "node_modules/@octokit/request": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-9.1.3.tgz", + "integrity": "sha512-V+TFhu5fdF3K58rs1pGUJIDH5RZLbZm5BI+MNF+6o/ssFNT4vWlCh/tVpF3NxGtP15HUxTTMUbsG5llAuU2CZA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "3.10.1", - "@typescript-eslint/visitor-keys": "3.10.1", - "debug": "^4.1.1", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@octokit/endpoint": "^10.0.0", + "@octokit/request-error": "^6.0.1", + "@octokit/types": "^13.1.0", + "universal-user-agent": "^7.0.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 18" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/@typescript-eslint/visitor-keys": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz", - "integrity": "sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ==", + "node_modules/@octokit/request-error": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.4.tgz", + "integrity": "sha512-VpAhIUxwhWZQImo/dWAN/NpPqqojR6PSLgLYAituLM6U+ddx9hCioFGwBr5Mi+oi5CLeJkcAs3gJ0PYYzU6wUg==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "@octokit/types": "^13.0.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">= 18" } }, - "node_modules/@dydxprotocol/node-service-base-dev/node_modules/eslint-config-airbnb-typescript/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "node_modules/@octokit/types": { + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz", + "integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "@octokit/openapi-types": "^22.2.0" } }, - "node_modules/@dydxprotocol/v4-proto": { - "version": "5.0.0-dev.0", - "resolved": "https://registry.npmjs.org/@dydxprotocol/v4-proto/-/v4-proto-5.0.0-dev.0.tgz", - "integrity": "sha512-AdwfSF/nWyunEyhJudY1b3tniFLZJDs5XtRZAH9uIw76TYeBaDtuF3NQZhgyFJgWAnrPh2a4YphPTUeaqe1feQ==", + "node_modules/@osmonauts/lcd": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@osmonauts/lcd/-/lcd-0.6.0.tgz", + "integrity": "sha512-vz9VavXrEfxZoXbSAfNfk90MLpn34XtBYPV3L9YilE+s56AhqYxUh83nne9J5somnTRfGnyR3oeV8C+lHkqiuA==", "dependencies": { - "protobufjs": "^6.11.2" + "@babel/runtime": "^7.18.9", + "axios": "0.27.2" } }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", - "dev": true, + "node_modules/@osmonauts/lcd/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/@osmonauts/lcd/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">= 6" } }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "node_modules/@pnpm/config.env-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", "dev": true, "engines": { - "node": ">= 4" + "node": ">=12.22.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "graceful-fs": "4.2.10" }, "engines": { - "node": ">=10.10.0" + "node": ">=12.22.0" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "node_modules/@pnpm/npm-conf": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", + "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", "dev": true, "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@protobufs/cosmos": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/@protobufs/cosmos/-/cosmos-0.0.11.tgz", + "integrity": "sha512-r9XQikxQ3qaWVJ4EYePP7r/QL/lEEpgSeHiD0U5t4bOXux5gIWrz3AMLe5PIdFxBwkeqkF21Vz4JnVd3/XdC7Q==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" + "@protobufs/cosmos_proto": "^0.0.10", + "@protobufs/gogoproto": "^0.0.10", + "@protobufs/google": "^0.0.10", + "@protobufs/tendermint": "^0.0.10" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/@protobufs/cosmos_proto": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@protobufs/cosmos_proto/-/cosmos_proto-0.0.10.tgz", + "integrity": "sha512-4nMopXxN23udy1HEe+vS49zD9dxrA7i0E3n15QUz1x0tbrowYLHzJKeyCUNlsh5PKpEIXGxHXpPZWXs7vVCwUw==", "dev": true, "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "@protobufs/google": "^0.0.10" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/@protobufs/gogoproto": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@protobufs/gogoproto/-/gogoproto-0.0.10.tgz", + "integrity": "sha512-u3eK1aSO3KOuX4RVFpqKPTaT/WLV50GFLuIC3slVGfD7Z1CfZ5ivHbFYUib96gihu1Mq2OZpNVj3dNws9YsVoQ==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" + "@protobufs/google": "^0.0.10" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/@protobufs/google": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@protobufs/google/-/google-0.0.10.tgz", + "integrity": "sha512-3yo+liabFM1519smwwfzh1C535CntXVsS7zT98xmo21tZUX7vxeFpQDMx38EzMGYSy/Reo8wEMWJUHqZzYsCUw==", + "dev": true + }, + "node_modules/@protobufs/tendermint": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@protobufs/tendermint/-/tendermint-0.0.10.tgz", + "integrity": "sha512-hAAMLFhKdAovslKeWnLTp2gGn5bxSTDVcQLKs4C4cC91R/KfHOh+Klt4PqSGUv/APINAmREzsX2LDUbIQ2dCpg==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "@protobufs/gogoproto": "^0.0.10", + "@protobufs/google": "^0.0.10" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@scure/bip32": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.0.tgz", + "integrity": "sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/curves": "~1.0.0", + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/@scure/bip39": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.0.tgz", + "integrity": "sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", + "dev": true + }, + "node_modules/@semantic-release/changelog": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", + "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", "dev": true, + "dependencies": { + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "fs-extra": "^11.0.0", + "lodash": "^4.17.4" + }, "engines": { - "node": ">=8" + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@semantic-release/commit-analyzer": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-13.0.0.tgz", + "integrity": "sha512-KtXWczvTAB1ZFZ6B4O+w8HkfYm/OgQb1dUGNFZtDgQ0csggrmkq8sTxhd+lwGF8kMb59/RnG9o4Tn7M/I8dQ9Q==", "dev": true, + "dependencies": { + "conventional-changelog-angular": "^8.0.0", + "conventional-changelog-writer": "^8.0.0", + "conventional-commits-filter": "^5.0.0", + "conventional-commits-parser": "^6.0.0", + "debug": "^4.0.0", + "import-from-esm": "^1.0.3", + "lodash-es": "^4.17.21", + "micromatch": "^4.0.2" + }, "engines": { - "node": ">=8" + "node": ">=20.8.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@jest/console": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", - "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", + "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-changelog-angular": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-8.0.0.tgz", + "integrity": "sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^26.6.2", - "jest-util": "^26.6.2", - "slash": "^3.0.0" + "compare-func": "^2.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=18" } }, - "node_modules/@jest/core": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", - "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", + "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-commits-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.0.0.tgz", + "integrity": "sha512-TbsINLp48XeMXR8EvGjTnKGsZqBemisPoyWESlpRyR8lif0lcwzqz+NMtYSj1ooF/WYjSuu7wX0CtdeeMEQAmA==", "dev": true, "dependencies": { - "@jest/console": "^26.6.2", - "@jest/reporters": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.2", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-resolve-dependencies": "^26.6.3", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "jest-watcher": "^26.6.2", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" + "meow": "^13.0.0" }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/@jest/environment": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", - "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", - "dev": true, - "dependencies": { - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2" + "bin": { + "conventional-commits-parser": "dist/cli/index.js" }, "engines": { - "node": ">= 10.14.2" + "node": ">=18" } }, - "node_modules/@jest/fake-timers": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", - "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", + "node_modules/@semantic-release/commit-analyzer/node_modules/meow": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz", + "integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "@sinonjs/fake-timers": "^6.0.1", - "@types/node": "*", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" - }, "engines": { - "node": ">= 10.14.2" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jest/globals": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", - "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", + "node_modules/@semantic-release/error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", "dev": true, - "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/types": "^26.6.2", - "expect": "^26.6.2" - }, "engines": { - "node": ">= 10.14.2" + "node": ">=14.17" } }, - "node_modules/@jest/reporters": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", - "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", + "node_modules/@semantic-release/github": { + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-10.3.4.tgz", + "integrity": "sha512-JghCkEk7e2u+iauMje8lgHH11pbtaz9yTdMn/PyfulCdBshIwpp+Mu/NR8Ml216auEUtvmBpQX5+Cth2TsVUVw==", "dev": true, "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.2.4", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.3", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "slash": "^3.0.0", - "source-map": "^0.6.0", - "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^7.0.0" + "@octokit/core": "^6.0.0", + "@octokit/plugin-paginate-rest": "^11.0.0", + "@octokit/plugin-retry": "^7.0.0", + "@octokit/plugin-throttling": "^9.0.0", + "@semantic-release/error": "^4.0.0", + "aggregate-error": "^5.0.0", + "debug": "^4.3.4", + "dir-glob": "^3.0.1", + "globby": "^14.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "issue-parser": "^7.0.0", + "lodash-es": "^4.17.21", + "mime": "^4.0.0", + "p-filter": "^4.0.0", + "url-join": "^5.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=20.8.1" }, - "optionalDependencies": { - "node-notifier": "^8.0.0" + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@jest/schemas": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-28.1.3.tgz", - "integrity": "sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg==", + "node_modules/@semantic-release/github/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.24.1" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + "node": ">=18" } }, - "node_modules/@jest/source-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", - "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", + "node_modules/@semantic-release/github/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dev": true, "dependencies": { - "callsites": "^3.0.0", - "graceful-fs": "^4.2.4", - "source-map": "^0.6.0" + "debug": "^4.3.4" }, "engines": { - "node": ">= 10.14.2" + "node": ">= 14" } }, - "node_modules/@jest/test-result": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", - "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", + "node_modules/@semantic-release/github/node_modules/aggregate-error": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, "dependencies": { - "@jest/console": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "clean-stack": "^5.2.0", + "indent-string": "^5.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jest/test-sequencer": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", - "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", + "node_modules/@semantic-release/github/node_modules/clean-stack": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "dev": true, "dependencies": { - "@jest/test-result": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3" + "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jest/transform": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", - "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "node_modules/@semantic-release/github/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "dependencies": { - "@babel/core": "^7.1.0", - "@jest/types": "^26.6.2", - "babel-plugin-istanbul": "^6.0.0", - "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.2", - "micromatch": "^4.0.2", - "pirates": "^4.0.1", - "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" - }, "engines": { - "node": ">= 10.14.2" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "node_modules/@semantic-release/github/node_modules/globby": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", + "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", "dev": true, "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "node_modules/@semantic-release/github/node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "agent-base": "^7.0.2", + "debug": "4" }, "engines": { - "node": ">=6.0.0" + "node": ">= 14" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "node_modules/@semantic-release/github/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, "engines": { - "node": ">=6.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", - "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", + "node_modules/@semantic-release/github/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "dev": true, "engines": { - "node": ">=6.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", - "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "node_modules/@semantic-release/github/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "node_modules/@semantic-release/npm": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-12.0.1.tgz", + "integrity": "sha512-/6nntGSUGK2aTOI0rHPwY3ZjgY9FkXmEHbW9Kr+62NVOsyqpKKeP0lrCH+tphv+EsNdJNmqqwijTEnVWUMQ2Nw==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@semantic-release/error": "^4.0.0", + "aggregate-error": "^5.0.0", + "execa": "^9.0.0", + "fs-extra": "^11.0.0", + "lodash-es": "^4.17.21", + "nerf-dart": "^1.0.0", + "normalize-url": "^8.0.0", + "npm": "^10.5.0", + "rc": "^1.2.8", + "read-pkg": "^9.0.0", + "registry-auth-token": "^5.0.0", + "semver": "^7.1.2", + "tempy": "^3.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=20.8.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "node_modules/@semantic-release/npm/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "engines": { + "node": ">=18" } }, - "node_modules/@jsdevtools/ono": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", - "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", - "dev": true - }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "node_modules/@semantic-release/npm/node_modules/@sindresorhus/merge-streams": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", + "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", "dev": true, - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" + "engines": { + "node": ">=18" }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { + "node_modules/@semantic-release/npm/node_modules/aggregate-error": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" + "clean-stack": "^5.2.0", + "indent-string": "^5.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/@noble/curves": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.0.0.tgz", - "integrity": "sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/hashes": "1.3.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@noble/hashes": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz", - "integrity": "sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@semantic-release/npm/node_modules/clean-stack": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">= 8" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@semantic-release/npm/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { - "node": ">= 8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@semantic-release/npm/node_modules/execa": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-9.4.0.tgz", + "integrity": "sha512-yKHlle2YGxZE842MERVIplWwNH5VYmqqcPFgtnlU//K8gxuFFXu0pwd/CrfXTumFpeEiufsP7+opT/bPJa1yVw==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@sindresorhus/merge-streams": "^4.0.0", + "cross-spawn": "^7.0.3", + "figures": "^6.1.0", + "get-stream": "^9.0.0", + "human-signals": "^8.0.0", + "is-plain-obj": "^4.1.0", + "is-stream": "^4.0.1", + "npm-run-path": "^6.0.0", + "pretty-ms": "^9.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^4.0.0", + "yoctocolors": "^2.0.0" }, "engines": { - "node": ">= 8" + "node": "^18.19.0 || >=20.5.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/@osmonauts/ast": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/@osmonauts/ast/-/ast-0.68.0.tgz", - "integrity": "sha512-kLTfVNtPtdaIWjvRp6BvCXYYtnMBxEq1fzGa5i2Hsqs7yhuC7E8kAJqj+ozbgs5ut/ix56D8Q3mxSX+2CMTzuw==", + "node_modules/@semantic-release/npm/node_modules/get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", "dev": true, "dependencies": { - "@babel/parser": "^7.19.3", - "@babel/runtime": "^7.19.0", - "@babel/types": "7.19.3", - "@osmonauts/proto-parser": "^0.34.0", - "@osmonauts/types": "^0.26.0", - "@osmonauts/utils": "^0.8.0", - "case": "1.6.3", - "dotty": "0.1.2" + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@osmonauts/lcd": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@osmonauts/lcd/-/lcd-0.6.0.tgz", - "integrity": "sha512-vz9VavXrEfxZoXbSAfNfk90MLpn34XtBYPV3L9YilE+s56AhqYxUh83nne9J5somnTRfGnyR3oeV8C+lHkqiuA==", - "dependencies": { - "@babel/runtime": "^7.18.9", - "axios": "0.27.2" + "node_modules/@semantic-release/npm/node_modules/human-signals": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz", + "integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==", + "dev": true, + "engines": { + "node": ">=18.18.0" } }, - "node_modules/@osmonauts/lcd/node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "node_modules/@semantic-release/npm/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@osmonauts/lcd/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "node_modules/@semantic-release/npm/node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/npm-run-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", + "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", + "dev": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "path-key": "^4.0.0", + "unicorn-magic": "^0.3.0" }, "engines": { - "node": ">= 6" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@osmonauts/proto-parser": { - "version": "0.34.0", - "resolved": "https://registry.npmjs.org/@osmonauts/proto-parser/-/proto-parser-0.34.0.tgz", - "integrity": "sha512-aUfrZO4aBm6me+jxHZcZdhrvlMQuJOhyDC96N0/mfHnUR2wY5iARZBMHMYwap8Dp6JZy2wwqQI8lKqAg2Mm9YQ==", + "node_modules/@semantic-release/npm/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "dependencies": { - "@babel/runtime": "^7.19.0", - "@osmonauts/types": "^0.26.0", - "@pyramation/protobufjs": "6.11.5", - "dotty": "0.1.2", - "glob": "8.0.3", - "mkdirp": "1.0.4" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@osmonauts/proto-parser/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@semantic-release/npm/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@osmonauts/proto-parser/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", + "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "engines": { + "node": ">=18" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", + "dev": true, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@osmonauts/proto-parser/node_modules/minimatch": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", - "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "node_modules/@semantic-release/release-notes-generator": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-14.0.1.tgz", + "integrity": "sha512-K0w+5220TM4HZTthE5dDpIuFrnkN1NfTGPidJFm04ULT1DEZ9WG89VNXN7F0c+6nMEpWgqmPvb7vY7JkB2jyyA==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "conventional-changelog-angular": "^8.0.0", + "conventional-changelog-writer": "^8.0.0", + "conventional-commits-filter": "^5.0.0", + "conventional-commits-parser": "^6.0.0", + "debug": "^4.0.0", + "get-stream": "^7.0.0", + "import-from-esm": "^1.0.3", + "into-stream": "^7.0.0", + "lodash-es": "^4.17.21", + "read-package-up": "^11.0.0" }, "engines": { - "node": ">=10" + "node": ">=20.8.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@osmonauts/telescope": { - "version": "0.80.0", - "resolved": "https://registry.npmjs.org/@osmonauts/telescope/-/telescope-0.80.0.tgz", - "integrity": "sha512-HTNRVRomkX3+t0lQANyg2Sp21aCtoJjIUhrvNp2hdil6ZLvwPeI41Tt2ubnstBWLlEP7UzLBDzbZAfR7I3qqFg==", + "node_modules/@semantic-release/release-notes-generator/node_modules/conventional-changelog-angular": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-8.0.0.tgz", + "integrity": "sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==", "dev": true, "dependencies": { - "@babel/core": "7.19.3", - "@babel/generator": "7.19.3", - "@babel/parser": "^7.19.3", - "@babel/plugin-proposal-class-properties": "7.18.6", - "@babel/plugin-proposal-export-default-from": "7.18.10", - "@babel/plugin-proposal-object-rest-spread": "7.18.9", - "@babel/plugin-transform-runtime": "7.19.1", - "@babel/preset-env": "7.19.3", - "@babel/preset-typescript": "^7.17.12", - "@babel/runtime": "^7.19.0", - "@babel/traverse": "7.19.3", - "@babel/types": "7.19.3", - "@cosmwasm/ts-codegen": "0.21.1", - "@osmonauts/ast": "^0.68.0", - "@osmonauts/proto-parser": "^0.34.0", - "@osmonauts/types": "^0.26.0", - "@osmonauts/utils": "^0.8.0", - "@types/parse-package-name": "0.1.0", - "case": "1.6.3", - "dargs": "7.0.0", - "deepmerge": "4.2.2", - "dotty": "0.1.2", - "fuzzy": "0.1.3", - "glob": "8.0.3", - "inquirerer": "0.1.3", - "long": "^5.2.0", - "minimatch": "5.1.0", - "minimist": "1.2.6", - "mkdirp": "1.0.4", - "parse-package-name": "1.0.0", - "rimraf": "3.0.2", - "shelljs": "0.8.5" + "compare-func": "^2.0.0" }, - "bin": { - "telescope": "main/telescope.js" + "engines": { + "node": ">=18" } }, - "node_modules/@osmonauts/telescope/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@semantic-release/release-notes-generator/node_modules/conventional-commits-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.0.0.tgz", + "integrity": "sha512-TbsINLp48XeMXR8EvGjTnKGsZqBemisPoyWESlpRyR8lif0lcwzqz+NMtYSj1ooF/WYjSuu7wX0CtdeeMEQAmA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "meow": "^13.0.0" + }, + "bin": { + "conventional-commits-parser": "dist/cli/index.js" + }, + "engines": { + "node": ">=18" } }, - "node_modules/@osmonauts/telescope/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "node_modules/@semantic-release/release-notes-generator/node_modules/get-stream": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", + "integrity": "sha512-3M8C1EOFN6r8AMUhwUAACIoXZJEOufDU5+0gFFN5uNs6XYOralD2Pqkl7m046va6x77FwposWXbAhPPIOus7mQ==", "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "engines": { + "node": ">=16" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/release-notes-generator/node_modules/meow": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz", + "integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==", + "dev": true, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@osmonauts/telescope/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "node_modules/@sinclair/typebox": { + "version": "0.24.51", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", + "integrity": "sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==", "dev": true }, - "node_modules/@osmonauts/telescope/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@osmonauts/types": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@osmonauts/types/-/types-0.26.0.tgz", - "integrity": "sha512-mofknWnWhN2qaqCELRdWHbqU4sNNOSimag7FrGPtYMhJkRvU74/+zOu97F6oUlMv9B8jGwTVdmsqEyAvWQr7Lw==", + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", "dev": true, - "dependencies": { - "@babel/runtime": "^7.19.0", - "@osmonauts/utils": "^0.8.0", - "case": "1.6.3" + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@osmonauts/utils": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@osmonauts/utils/-/utils-0.8.0.tgz", - "integrity": "sha512-EO6dSqr9pvczYzuVL/wEvdu4xub1tV4wttJcrgT8lrgq08PK6e7frX816OlBFUv7qQk8eEYPnIVpsN12ZxFwwQ==", + "node_modules/@sinonjs/commons": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", + "integrity": "sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==", "dev": true, "dependencies": { - "@babel/runtime": "^7.19.0" + "type-detect": "4.0.8" } }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "node_modules/@sinonjs/fake-timers": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", + "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", + "dev": true, "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" + "@sinonjs/commons": "^1.7.0" } }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, - "node_modules/@protobufs/cosmos": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@protobufs/cosmos/-/cosmos-0.0.11.tgz", - "integrity": "sha512-r9XQikxQ3qaWVJ4EYePP7r/QL/lEEpgSeHiD0U5t4bOXux5gIWrz3AMLe5PIdFxBwkeqkF21Vz4JnVd3/XdC7Q==", + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { - "@protobufs/cosmos_proto": "^0.0.10", - "@protobufs/gogoproto": "^0.0.10", - "@protobufs/google": "^0.0.10", - "@protobufs/tendermint": "^0.0.10" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" } }, - "node_modules/@protobufs/cosmos_proto": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@protobufs/cosmos_proto/-/cosmos_proto-0.0.10.tgz", - "integrity": "sha512-4nMopXxN23udy1HEe+vS49zD9dxrA7i0E3n15QUz1x0tbrowYLHzJKeyCUNlsh5PKpEIXGxHXpPZWXs7vVCwUw==", + "node_modules/@types/babel__core/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@protobufs/google": "^0.0.10" + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@protobufs/gogoproto": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@protobufs/gogoproto/-/gogoproto-0.0.10.tgz", - "integrity": "sha512-u3eK1aSO3KOuX4RVFpqKPTaT/WLV50GFLuIC3slVGfD7Z1CfZ5ivHbFYUib96gihu1Mq2OZpNVj3dNws9YsVoQ==", + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "dependencies": { - "@protobufs/google": "^0.0.10" + "@babel/types": "^7.0.0" } }, - "node_modules/@protobufs/google": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@protobufs/google/-/google-0.0.10.tgz", - "integrity": "sha512-3yo+liabFM1519smwwfzh1C535CntXVsS7zT98xmo21tZUX7vxeFpQDMx38EzMGYSy/Reo8wEMWJUHqZzYsCUw==", - "dev": true - }, - "node_modules/@protobufs/tendermint": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@protobufs/tendermint/-/tendermint-0.0.10.tgz", - "integrity": "sha512-hAAMLFhKdAovslKeWnLTp2gGn5bxSTDVcQLKs4C4cC91R/KfHOh+Klt4PqSGUv/APINAmREzsX2LDUbIQ2dCpg==", + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { - "@protobufs/gogoproto": "^0.0.10", - "@protobufs/google": "^0.0.10" + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } }, - "node_modules/@pyramation/json-schema-ref-parser": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/@pyramation/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz", - "integrity": "sha512-L5kToHAEc1Q87R8ZwWFaNa4tPHr8Hnm+U+DRdUVq3tUtk+EX4pCqSd34Z6EMxNi/bjTzt1syAG9J2Oo1YFlqSg==", + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.13.1" + "@babel/types": "^7.20.7" } }, - "node_modules/@pyramation/json-schema-to-typescript": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@pyramation/json-schema-to-typescript/-/json-schema-to-typescript-11.0.4.tgz", - "integrity": "sha512-+aSzXDLhMHOEdV2cJ7Tjg/9YenjHU5BCmClVygzwxJZ1R16NOfEn7lTAwVzb/2jivOSnhjHzMJbnSf8b6rd1zg==", + "node_modules/@types/babel__traverse/node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@pyramation/json-schema-ref-parser": "9.0.6", - "@types/json-schema": "^7.0.11", - "@types/lodash": "^4.14.182", - "@types/prettier": "^2.6.1", - "cli-color": "^2.0.2", - "get-stdin": "^8.0.0", - "glob": "^7.1.6", - "glob-promise": "^4.2.2", - "is-glob": "^4.0.3", - "lodash": "^4.17.21", - "minimist": "^1.2.6", - "mkdirp": "^1.0.4", - "mz": "^2.7.0", - "prettier": "^2.6.2" - }, - "bin": { - "json2ts": "dist/src/cli.js" + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=6.9.0" } }, - "node_modules/@pyramation/json-schema-to-typescript/node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "node_modules/@types/conventional-commits-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==", "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" + "dependencies": { + "@types/node": "*" } }, - "node_modules/@pyramation/protobufjs": { - "version": "6.11.5", - "resolved": "https://registry.npmjs.org/@pyramation/protobufjs/-/protobufjs-6.11.5.tgz", - "integrity": "sha512-gr+Iv6d7Iwq3PmNsTeQtL6TUONJs0WqbHFikett4zLquRK7egWuifZSKsqV8+o1UBNZcv52Z1HhgwTqNJe75Ag==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/@scure/base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", - "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/@scure/bip32": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.0.tgz", - "integrity": "sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/curves": "~1.0.0", - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/@scure/bip39": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.0.tgz", - "integrity": "sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/@sinclair/typebox": { - "version": "0.24.51", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", - "integrity": "sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==", - "dev": true - }, - "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, - "dependencies": { - "defer-to-connect": "^1.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@types/babel__core": { - "version": "7.1.19", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz", - "integrity": "sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.17.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.17.1.tgz", - "integrity": "sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.3.0" - } - }, - "node_modules/@types/eslint": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", - "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "node_modules/@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, - "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true - }, - "node_modules/@types/ffi-napi": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/ffi-napi/-/ffi-napi-4.0.5.tgz", - "integrity": "sha512-WDPpCcHaPhHmP1FIw3ds/+OLt8bYQ/h3SO7o+8kH771PL21kHVzTwii7+WyMBXMQrBsR6xVU2y7w+h+9ggpaQw==", + "node_modules/@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@types/ffi-napi": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/ffi-napi/-/ffi-napi-4.0.5.tgz", + "integrity": "sha512-WDPpCcHaPhHmP1FIw3ds/+OLt8bYQ/h3SO7o+8kH771PL21kHVzTwii7+WyMBXMQrBsR6xVU2y7w+h+9ggpaQw==", "dev": true, "dependencies": { "@types/node": "*", @@ -4186,20 +3604,10 @@ "@types/ref-struct-di": "*" } }, - "node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "dev": true, - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, "node_modules/@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { "@types/node": "*" @@ -4230,13 +3638,13 @@ } }, "node_modules/@types/jest": { - "version": "26.0.24", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.24.tgz", - "integrity": "sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w==", + "version": "28.1.8", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-28.1.8.tgz", + "integrity": "sha512-8TJkV++s7B6XqnDrzR1m/TT0A0h948Pnl/097veySPN67VRAgQ4gZ7n2KfJo2rVq6njQjdxU3GCCyDvAeuHoiw==", "dev": true, "dependencies": { - "jest-diff": "^26.0.0", - "pretty-format": "^26.0.0" + "expect": "^28.0.0", + "pretty-format": "^28.0.0" } }, "node_modules/@types/json-schema": { @@ -4262,27 +3670,15 @@ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true - }, "node_modules/@types/node": { "version": "14.18.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.20.tgz", "integrity": "sha512-Q8KKwm9YqEmUBRsqJ2GWJDtXltBDxTdC4m5vTdXBolu2PeQh8LX+f6BTwU+OuXPu37fLxoN6gidqBmnky36FXA==" }, "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "dev": true - }, - "node_modules/@types/parse-package-name": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@types/parse-package-name/-/parse-package-name-0.1.0.tgz", - "integrity": "sha512-+vF4M3Cd3Ec22Uwb+OKhDrSAcXQ5I6evRx+1letx4KzfzycU+AOEDHnCifus8In11i8iYNFXPfzg9HWTcC1h+Q==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, "node_modules/@types/prettier": { @@ -4310,15 +3706,15 @@ } }, "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "node_modules/@types/ws": { @@ -4331,18 +3727,18 @@ } }, "node_modules/@types/yargs": { - "version": "15.0.14", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz", - "integrity": "sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==", + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -4641,9 +4037,9 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", @@ -4663,9 +4059,9 @@ "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { @@ -4686,15 +4082,15 @@ "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { @@ -4722,28 +4118,28 @@ "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -4751,24 +4147,24 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -4777,12 +4173,12 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -4842,13 +4238,6 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "deprecated": "Use your platform's native atob() and btoa() methods instead", - "dev": true - }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -4879,26 +4268,13 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, - "node_modules/acorn-globals/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" + "peerDependencies": { + "acorn": "^8" } }, "node_modules/acorn-jsx": { @@ -4910,15 +4286,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/aes-js": { "version": "4.0.0-beta.5", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", @@ -4936,6 +4303,19 @@ "node": ">= 6.0.0" } }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -5000,15 +4380,6 @@ "ajv": "^6.9.1" } }, - "node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "dependencies": { - "string-width": "^4.1.0" - } - }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", @@ -5131,6 +4502,12 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/argv-formatter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", + "integrity": "sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==", + "dev": true + }, "node_modules/aria-query": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", @@ -5141,33 +4518,6 @@ "dequal": "^2.0.3" } }, - "node_modules/arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", @@ -5184,6 +4534,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true + }, "node_modules/array-includes": { "version": "3.1.8", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", @@ -5213,15 +4569,6 @@ "node": ">=8" } }, - "node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array.prototype.findlast": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", @@ -5339,15 +4686,14 @@ } }, "node_modules/asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" + "minimalistic-assert": "^1.0.0" } }, "node_modules/asn1.js/node_modules/bn.js": { @@ -5377,48 +4723,17 @@ "node": ">=0.8" } }, - "node_modules/assert/node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "node_modules/ast-types-flow": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } + "peer": true }, - "node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ast-stringify": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ast-stringify/-/ast-stringify-0.1.0.tgz", - "integrity": "sha512-J1PgFYV3RG6r37+M6ySZJH406hR82okwGvFM9hLXpOvdx4WC4GEW8/qiw6pi1hKTrqcRvoHP8a7mp87egYr6iA==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.11.2" - } - }, - "node_modules/ast-types-flow": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", - "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", - "dev": true, - "peer": true - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, "engines": { "node": ">=8" @@ -5429,18 +4744,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -5688,25 +4991,24 @@ } }, "node_modules/babel-jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", - "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-28.1.3.tgz", + "integrity": "sha512-epUaPOEWMk3cWX0M/sPvCHHCe9fMFAa/9hXEgKP8nFfNl/jlGkE9ucq9NqkZGXLDduCJYS0UvSlPUwC0S+rH6Q==", "dev": true, "dependencies": { - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.6.2", + "@jest/transform": "^28.1.3", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^28.1.3", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", + "graceful-fs": "^4.2.9", "slash": "^3.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.8.0" } }, "node_modules/babel-loader": { @@ -5813,92 +5115,19 @@ "node": ">=8" } }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", - "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", - "dev": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/babel-plugin-jest-hoist": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", - "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.3.tgz", + "integrity": "sha512-Ys3tUKAmfnkRUpPdpa98eYrAR0nV+sSFUZZEGuQ2EbFd1y4SOLtD5QDNHAq+bb9a+bbXvYQC4b+ID/THIMcU6Q==", "dev": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", + "@types/babel__core": "^7.1.14", "@types/babel__traverse": "^7.0.6" }, "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz", - "integrity": "sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-define-polyfill-provider": "^0.3.3", - "semver": "^6.1.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz", - "integrity": "sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==", - "dev": true, - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.3", - "core-js-compat": "^3.25.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", - "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", - "dev": true, - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, "node_modules/babel-plugin-transform-es2015-arrow-functions": { @@ -6221,23 +5450,26 @@ "dev": true }, "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", + "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", "dev": true, "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" }, "peerDependencies": { "@babel/core": "^7.0.0" @@ -6277,16 +5509,16 @@ } }, "node_modules/babel-preset-jest": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", - "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-28.1.3.tgz", + "integrity": "sha512-L+fupJvlWAHbQfn74coNX3zf60LXMJsezNvvx8eIh7iOR1luJ1poxYgQk1F8PYtNq/6QODDHCqsSnTFSWC491A==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^26.6.2", + "babel-plugin-jest-hoist": "^28.1.3", "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0" @@ -6398,76 +5630,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "deprecated": "Please upgrade to v1.0.1", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "deprecated": "Please upgrade to v1.0.1", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -6501,6 +5663,12 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" }, + "node_modules/before-after-hook": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz", + "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==", + "dev": true + }, "node_modules/bignumber.js": { "version": "9.1.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz", @@ -6523,56 +5691,11 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, - "node_modules/boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } + "node_modules/bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "dev": true }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -6585,12 +5708,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -6601,12 +5724,6 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, - "node_modules/browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, "node_modules/browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", @@ -6655,36 +5772,75 @@ } }, "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", "dev": true, "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.5", + "hash-base": "~3.0", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" } }, - "node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/browserify-sign/node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" }, "engines": { - "node": ">= 6" + "node": ">=4" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, + "node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/browserify-sign/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/browserify-zlib": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", @@ -6695,9 +5851,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", - "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "funding": [ { @@ -6707,13 +5863,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -6773,115 +5933,47 @@ "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", "dev": true }, - "node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-me-maybe": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", - "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", - "dev": true - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001431", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz", - "integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==", + "version": "1.0.30001657", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001657.tgz", + "integrity": "sha512-DPbJAlP8/BAXy3IgiWmZKItubb3TYGP0WscQQlVGIfT4s/YlFYVuJgyOsQNP7rJRChx/qdMeLJQJP0Sgg2yjNA==", "dev": true, "funding": [ { @@ -6891,30 +5983,13 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, - "node_modules/capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", - "dev": true, - "dependencies": { - "rsvp": "^4.8.4" - }, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/case": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", - "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/case-anything": { "version": "2.1.13", "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", @@ -6958,12 +6033,6 @@ "node": ">=10" } }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -7010,10 +6079,19 @@ } }, "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } }, "node_modules/cipher-base": { "version": "1.0.4", @@ -7026,93 +6104,106 @@ } }, "node_modules/cjs-module-lexer": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", - "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.0.tgz", + "integrity": "sha512-N1NGmowPlGBLsOZLPvm48StN04V4YvQRL0i6b7ctrVY3epjP/ct7hFLOItz6pDIvRjwpfPxi52a2UWV2ziir8g==", "dev": true }, - "node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" }, "engines": { - "node": ">=0.10.0" + "node": ">=8.0.0", + "npm": ">=5.0.0" } }, - "node_modules/cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, - "node_modules/cli-color": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.3.tgz", - "integrity": "sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ==", + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.61", - "es6-iterator": "^2.0.3", - "memoizee": "^0.4.15", - "timers-ext": "^0.1.7" + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, "engines": { - "node": ">=0.10" + "node": ">=10" } }, - "node_modules/cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", "dev": true, "dependencies": { - "restore-cursor": "^2.0.0" + "string-width": "^4.2.0" }, "engines": { - "node": ">=4" + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" } }, - "node_modules/cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, "node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/clone-deep": { @@ -7129,15 +6220,6 @@ "node": ">=6" } }, - "node_modules/clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - } - }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -7149,24 +6231,11 @@ } }, "node_modules/collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, - "node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", - "dev": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -7200,15 +6269,6 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -7232,11 +6292,15 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true + "node_modules/compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } }, "node_modules/concat-map": { "version": "0.0.1", @@ -7244,23 +6308,22 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/configstore": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", - "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "dev": true, "dependencies": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" + "ini": "^1.3.4", + "proto-list": "~1.2.1" } }, + "node_modules/config-chain/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, "node_modules/confusing-browser-globals": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", @@ -7285,6 +6348,100 @@ "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", "dev": true }, + "node_modules/conventional-changelog-angular": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-changelog-conventionalcommits": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", + "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-changelog-writer": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-8.0.0.tgz", + "integrity": "sha512-TQcoYGRatlAnT2qEWDON/XSfnVG38JzA7E0wcGScu7RElQBkg9WWgZd1peCWFcWDh1xfb2CfsrcvOn1bbSzztA==", + "dev": true, + "dependencies": { + "@types/semver": "^7.5.5", + "conventional-commits-filter": "^5.0.0", + "handlebars": "^4.7.7", + "meow": "^13.0.0", + "semver": "^7.5.2" + }, + "bin": { + "conventional-changelog-writer": "dist/cli/index.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/conventional-changelog-writer/node_modules/meow": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz", + "integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/conventional-commits-filter": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-5.0.0.tgz", + "integrity": "sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/conventional-commits-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", + "dev": true, + "dependencies": { + "is-text-path": "^2.0.0", + "JSONStream": "^1.3.5", + "meow": "^12.0.1", + "split2": "^4.0.0" + }, + "bin": { + "conventional-commits-parser": "cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/convert-hrtime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/convert-hrtime/-/convert-hrtime-5.0.0.tgz", + "integrity": "sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/convert-source-map": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", @@ -7294,817 +6451,2199 @@ "safe-buffer": "~5.1.1" } }, - "node_modules/convert-source-map/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", + "node_modules/convert-source-map/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "dev": true, + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cosmiconfig-typescript-loader": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-5.0.0.tgz", + "integrity": "sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==", + "dev": true, + "dependencies": { + "jiti": "^1.19.1" + }, + "engines": { + "node": ">=v16" + }, + "peerDependencies": { + "@types/node": "*", + "cosmiconfig": ">=8.2", + "typescript": ">=4" + } + }, + "node_modules/cosmiconfig/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/cosmiconfig/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/cosmjs-types": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.9.0.tgz", + "integrity": "sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ==" + }, + "node_modules/coveralls": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.1.tgz", + "integrity": "sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww==", + "dev": true, + "dependencies": { + "js-yaml": "^3.13.1", + "lcov-parse": "^1.0.0", + "log-driver": "^1.2.7", + "minimist": "^1.2.5", + "request": "^2.88.2" + }, + "bin": { + "coveralls": "bin/coveralls.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/damerau-levenshtein": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", + "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", + "dev": true, + "peer": true + }, + "node_modules/dargs": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-8.1.0.tgz", + "integrity": "sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "28.1.1", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-28.1.1.tgz", + "integrity": "sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + } + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/domain-browser": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", + "integrity": "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", + "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/dotenv-flow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/dotenv-flow/-/dotenv-flow-3.2.0.tgz", + "integrity": "sha512-GEB6RrR4AbqDJvNSFrYHqZ33IKKbzkvLYiD5eo4+9aFXr4Y4G+QaFrB/fNp0y6McWBmvaPn3ZNjIufnj8irCtg==", + "dev": true, + "dependencies": { + "dotenv": "^8.0.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/dprint-node": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz", + "integrity": "sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==", + "dev": true, + "dependencies": { + "detect-libc": "^1.0.3" + } + }, + "node_modules/dprint-node/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.2" + } + }, + "node_modules/duplexer2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexer2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/duplexer2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dev": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.15", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.15.tgz", + "integrity": "sha512-Z4rIDoImwEJW+YYKnPul4DzqsWVqYetYVN3XqDmRpgV0mjz0hYTaeeh+8/9CL1bk3AHYmF4freW/NTiVoXA2gA==", + "dev": true + }, + "node_modules/elliptic": { + "version": "6.5.7", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", + "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/emittery": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.2.tgz", + "integrity": "sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/emojilib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", + "dev": true + }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/env-ci": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.1.0.tgz", + "integrity": "sha512-Z8dnwSDbV1XYM9SBF2J0GcNVvmfmfh3a49qddGIROhBoVro6MZVTji15z/sJbQ2ko2ei8n988EU1wzoLU/tF+g==", + "dev": true, + "dependencies": { + "execa": "^8.0.0", + "java-properties": "^1.0.2" + }, + "engines": { + "node": "^18.17 || >=20.6.1" + } + }, + "node_modules/env-ci/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/env-ci/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/env-ci/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/env-ci/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", + "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.2.1.tgz", + "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", + "dev": true + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-airbnb": { + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz", + "integrity": "sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg==", + "dev": true, + "dependencies": { + "eslint-config-airbnb-base": "^14.2.1", + "object.assign": "^4.1.2", + "object.entries": "^1.1.2" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-react": "^7.21.5", + "eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0" + } + }, + "node_modules/eslint-config-airbnb-base": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", + "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", + "dev": true, + "dependencies": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.2" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", + "eslint-plugin-import": "^2.22.1" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", + "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/eslint-plugin-jsx-a11y": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", + "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/runtime": "^7.23.2", + "aria-query": "^5.3.0", + "array-includes": "^3.1.7", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "=4.7.0", + "axobject-query": "^3.2.1", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "es-iterator-helpers": "^1.0.15", + "hasown": "^2.0.0", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "peer": true + }, + "node_modules/eslint-plugin-no-only-tests": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.4.0.tgz", + "integrity": "sha512-azP9PwQYfGtXJjW273nIxQH9Ygr+5/UyeW2wEjYoDtVYPI+WPKwbj0+qcAKYUXFZLRumq4HKkFaoDBAwBoXImQ==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.34.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz", + "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==", + "dev": true, + "peer": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlast": "^1.2.4", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.toreversed": "^1.1.2", + "array.prototype.tosorted": "^1.1.3", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.17", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7", + "object.hasown": "^1.1.3", + "object.values": "^1.1.7", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.10" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", + "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "peer": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "peer": true, + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", - "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", - "dev": true, - "hasInstallScript": true - }, - "node_modules/core-js-compat": { - "version": "3.26.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.26.0.tgz", - "integrity": "sha512-piOX9Go+Z4f9ZiBFLnZ5VrOpBl0h7IGCkiFUN11QTe6LjAvOT3ifL/5TdoizMh99hcGy5SoLyWbapIY/PIb/3A==", + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { - "browserslist": "^4.21.4" + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" + "engines": { + "node": ">=8.0.0" } }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, - "node_modules/cosmjs-types": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.9.0.tgz", - "integrity": "sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ==" - }, - "node_modules/coveralls": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.1.tgz", - "integrity": "sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww==", + "node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "dependencies": { - "js-yaml": "^3.13.1", - "lcov-parse": "^1.0.0", - "log-driver": "^1.2.7", - "minimist": "^1.2.5", - "request": "^2.88.2" - }, - "bin": { - "coveralls": "bin/coveralls.js" + "eslint-visitor-keys": "^1.1.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" + "engines": { + "node": ">=4" } }, - "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" + "engines": { + "node": ">=10" } }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "node_modules/eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "engines": { + "node": ">= 4" } }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" }, "engines": { - "node": ">= 8" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "node_modules/espree/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" + "bin": { + "acorn": "bin/acorn" }, "engines": { - "node": "*" + "node": ">=0.4.0" } }, - "node_modules/crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } }, - "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "dependencies": { - "cssom": "~0.3.6" + "estraverse": "^5.1.0" }, "engines": { - "node": ">=8" + "node": ">=0.10" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" } }, - "node_modules/damerau-levenshtein": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", - "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "peer": true + "engines": { + "node": ">=4.0" + } }, - "node_modules/dargs": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", - "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=4.0" } }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ethereum-cryptography": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.0.0.tgz", + "integrity": "sha512-g25m4EtfQGjstWgVE1aIz7XYYjf3kH5kG17ULWVB5dH6uLahsoltOhACzSxyDV+fhn4gbR4xRrOXGe6r2uh4Bg==", + "dependencies": { + "@noble/curves": "1.0.0", + "@noble/hashes": "1.3.0", + "@scure/bip32": "1.3.0", + "@scure/bip39": "1.2.0" + } + }, + "node_modules/ethers": { + "version": "6.13.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.2.tgz", + "integrity": "sha512-9VkriTTed+/27BGuY1s0hf441kqwHJ1wtN2edksEtiRvXx+soxRX3iSXTfFqq2+YwrOqbDoTHjIhQnjJRlzKmg==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], "dependencies": { - "assert-plus": "^1.0.0" + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "18.15.13", + "aes-js": "4.0.0-beta.5", + "tslib": "2.4.0", + "ws": "8.17.1" }, "engines": { - "node": ">=0.10" + "node": ">=14.0.0" } }, - "node_modules/data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", - "dev": true, + "node_modules/ethers/node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", "dependencies": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" + "@noble/hashes": "1.3.2" }, - "engines": { - "node": ">=10" + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, + "node_modules/ethers/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", "engines": { - "node": ">= 0.4" + "node": ">= 16" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://paulmillr.com/funding/" } }, - "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "node_modules/ethers/node_modules/@types/node": { + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" + }, + "node_modules/ethers/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6" } }, - "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", - "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.8.x" } }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", - "dev": true - }, - "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==", + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "dev": true, "engines": { - "node": ">=0.10" + "node": ">= 0.8.0" } }, - "node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", + "node_modules/expect": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/expect/-/expect-28.1.3.tgz", + "integrity": "sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g==", "dev": true, "dependencies": { - "mimic-response": "^1.0.0" + "@jest/expect-utils": "^28.1.3", + "jest-get-type": "^28.0.2", + "jest-matcher-utils": "^28.1.3", + "jest-message-util": "^28.1.3", + "jest-util": "^28.1.3" }, "engines": { - "node": ">=4" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "engines": { - "node": ">=4.0.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "engines": [ + "node >=0.6.0" + ] }, - "node_modules/defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8.6.0" } }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, - "node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">= 4.9.1" } }, - "node_modules/define-property/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "deprecated": "Please upgrade to v1.0.1", + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" + "reusify": "^1.0.4" } }, - "node_modules/define-property/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "deprecated": "Please upgrade to v1.0.1", + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" + "bser": "2.1.1" } }, - "node_modules/define-property/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "node_modules/figures": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", + "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "is-unicode-supported": "^2.0.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "dev": true - }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, - "peer": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, "engines": { - "node": ">=6" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/detect-libc": { + "node_modules/filter-obj": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-2.0.2.tgz", + "integrity": "sha512-lO3ttPjHZRfjMcxWKb1j1eDhTFsu4meeR3lnMcnBFhk6RuLhvEiuALu2TlfL310ph4lCYYwgF/ElIjdP739tdg==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, "engines": { - "node": ">= 10.14.2" + "node": ">=4" } }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "node_modules/find-up-simple": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/find-versions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-6.0.0.tgz", + "integrity": "sha512-2kCCtc+JvcZ86IGAz3Z2Y0A1baIz9fL31pH/0S1IqZr9Iwnjq8izfPtrCyQKO6TLMPELLsQMre7VDqeIKCsHkA==", "dev": true, "dependencies": { - "path-type": "^4.0.0" + "semver-regex": "^4.0.5", + "super-regex": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "dependencies": { - "esutils": "^2.0.2" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=6.0.0" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/domain-browser": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", - "integrity": "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw==", - "dev": true, + "node_modules/flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.8.tgz", + "integrity": "sha512-xgrmBhBToVKay1q2Tao5LI26B83UhrB/vM1avwVSDzt8rx3rO6AizBAaF46EgksTVr+rFTQaqZZ9MVBfUe4nig==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], "engines": { - "node": ">=10" + "node": ">=4.0" }, - "funding": { - "url": "https://bevry.me/fund" + "peerDependenciesMeta": { + "debug": { + "optional": true + } } }, - "node_modules/domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "deprecated": "Use your platform's native DOMException instead", + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "dependencies": { - "webidl-conversions": "^5.0.0" - }, - "engines": { - "node": ">=8" + "is-callable": "^1.1.3" } }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "dependencies": { - "is-obj": "^2.0.0" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" }, "engines": { - "node": ">=8" + "node": ">= 0.12" } }, - "node_modules/dotenv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", - "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" } }, - "node_modules/dotenv-flow": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/dotenv-flow/-/dotenv-flow-3.2.0.tgz", - "integrity": "sha512-GEB6RrR4AbqDJvNSFrYHqZ33IKKbzkvLYiD5eo4+9aFXr4Y4G+QaFrB/fNp0y6McWBmvaPn3ZNjIufnj8irCtg==", + "node_modules/from2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "dependencies": { - "dotenv": "^8.0.0" - }, - "engines": { - "node": ">= 8.0.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/dotty": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dotty/-/dotty-0.1.2.tgz", - "integrity": "sha512-V0EWmKeH3DEhMwAZ+8ZB2Ao4OK6p++Z0hsDtZq3N0+0ZMVqkzrcEGROvOnZpLnvBg5PTNG23JEDLAm64gPaotQ==", + "node_modules/from2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/dprint-node": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz", - "integrity": "sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==", + "node_modules/from2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "dependencies": { - "detect-libc": "^1.0.3" + "safe-buffer": "~5.1.0" } }, - "node_modules/dprint-node/node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, - "bin": { - "detect-libc": "bin/detect-libc.js" + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=0.10" + "node": ">=14.14" } }, - "node_modules/duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA==", - "dev": true + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/electron-to-chromium": { - "version": "1.4.284", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", - "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "node_modules/function-timeout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/function-timeout/-/function-timeout-1.0.2.tgz", + "integrity": "sha512-939eZS4gJ3htTHAldmyyuzlrD58P03fHG49v2JfFXbV6OhvZKRC9j2yAtdHw/zrp2zXHuv05zMIy40F0ge7spA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", "dev": true }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, - "dependencies": { - "once": "^1.4.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/enhanced-resolve": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz", - "integrity": "sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==", + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" }, "engines": { - "node": ">=10.13.0" + "node": ">=10" } }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { - "ansi-colors": "^4.1.1" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "engines": { - "node": ">=8.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, "engines": { - "node": ">=4" + "node": ">=8.0.0" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", + "call-bind": "^1.0.5", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", - "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", - "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", - "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.6", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" + "get-intrinsic": "^1.2.4" }, "engines": { "node": ">= 0.4" @@ -8113,5155 +8652,5509 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-define-property": { + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/git-log-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.1.tgz", + "integrity": "sha512-PI+sPDvHXNPl5WNOErAK05s3j0lgwUzMN6o8cyQrDaKfT3qd7TmNJKeXX+SknI5I0QhG5fVPAEwSY4tRGDtYoQ==", + "dev": true, + "dependencies": { + "argv-formatter": "~1.0.0", + "spawn-error-forwarder": "~1.0.0", + "split2": "~1.0.0", + "stream-combiner2": "~1.1.1", + "through2": "~2.0.0", + "traverse": "0.6.8" + } + }, + "node_modules/git-log-parser/node_modules/split2": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", + "integrity": "sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==", + "dev": true, "dependencies": { - "get-intrinsic": "^1.2.4" + "through2": "~2.0.0" + } + }, + "node_modules/git-raw-commits": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-4.0.0.tgz", + "integrity": "sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==", + "dev": true, + "dependencies": { + "dargs": "^8.0.0", + "meow": "^12.0.1", + "split2": "^4.0.0" + }, + "bin": { + "git-raw-commits": "cli.mjs" }, "engines": { - "node": ">= 0.4" + "node": ">=16" } }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, "engines": { - "node": ">= 0.4" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/es-iterator-helpers": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", - "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "peer": true, "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3", - "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.0.3", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "globalthis": "^1.0.3", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.7", - "iterator.prototype": "^1.1.2", - "safe-array-concat": "^1.1.2" + "is-glob": "^4.0.1" }, "engines": { - "node": ">= 0.4" + "node": ">= 6" } }, - "node_modules/es-module-lexer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.2.1.tgz", - "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, - "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", "dev": true, "dependencies": { - "es-errors": "^1.3.0" + "ini": "4.1.1" }, "engines": { - "node": ">= 0.4" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "node_modules/globals": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", "dev": true, "dependencies": { - "get-intrinsic": "^1.2.4", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" + "type-fest": "^0.20.2" }, "engines": { - "node": ">= 0.4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", - "dev": true, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", "dependencies": { - "hasown": "^2.0.0" + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/grpc-tools": { + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.12.4.tgz", + "integrity": "sha512-5+mLAJJma3BjnW/KQp6JBjUMgvu7Mu3dBvBPd1dcbNIb+qiR0817zDpgPjS7gRb+l/8EVNIa3cB02xI9JLToKg==", "dev": true, "hasInstallScript": true, "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" + "@mapbox/node-pre-gyp": "^1.0.5" }, - "engines": { - "node": ">=0.10" + "bin": { + "grpc_tools_node_protoc": "bin/protoc.js", + "grpc_tools_node_protoc_plugin": "bin/protoc_plugin.js" } }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" } }, - "node_modules/es6-object-assign": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==", - "dev": true + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "dev": true, + "engines": { + "node": ">=4" + } }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", "dev": true, "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" } }, - "node_modules/es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" } }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/escape-goat": { + "node_modules/has-ansi/node_modules/ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/escape-string-regexp": { + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" + "has-symbols": "^1.0.3" }, "engines": { - "node": ">=6.0" + "node": ">= 0.4" }, - "optionalDependencies": { - "source-map": "~0.6.1" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/escodegen/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, "engines": { - "node": ">=4.0" + "node": ">=4" } }, - "node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "node_modules/hash-base/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" } }, - "node_modules/escodegen/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "function-bind": "^1.1.2" }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.4" } }, - "node_modules/escodegen/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", "dev": true, "engines": { - "node": ">= 0.8.0" + "node": "*" } }, - "node_modules/escodegen/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "node_modules/hook-std": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-config-airbnb": { - "version": "18.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz", - "integrity": "sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg==", + "node_modules/hosted-git-info": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.2.tgz", + "integrity": "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==", "dev": true, "dependencies": { - "eslint-config-airbnb-base": "^14.2.1", - "object.assign": "^4.1.2", - "object.entries": "^1.1.2" + "lru-cache": "^10.0.1" }, "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-react": "^7.21.5", - "eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/eslint-config-airbnb-base": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", - "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "dependencies": { - "confusing-browser-globals": "^1.0.10", - "object.assign": "^4.1.2", - "object.entries": "^1.1.2" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", - "eslint-plugin-import": "^2.22.1" + "node": ">= 14" } }, - "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dev": true, - "bin": { - "eslint-config-prettier": "bin/cli.js" + "dependencies": { + "debug": "^4.3.4" }, - "peerDependencies": { - "eslint": ">=7.0.0" + "engines": { + "node": ">= 14" } }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "resolve": "^1.20.0" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" } }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", + "dev": true }, - "node_modules/eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "agent-base": "6", + "debug": "4" }, "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" + "node": ">= 6" } }, - "node_modules/eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "dependencies": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", - "has": "^1.0.3", - "is-core-module": "^2.8.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", - "tsconfig-paths": "^3.14.1" - }, "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + "node": ">=10.17.0" } }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true, - "dependencies": { - "ms": "2.0.0" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, "engines": { - "node": ">=0.10.0" + "node": ">= 4" } }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "dev": true }, - "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", - "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "peer": true, "dependencies": { - "@babel/runtime": "^7.23.2", - "aria-query": "^5.3.0", - "array-includes": "^3.1.7", - "array.prototype.flatmap": "^1.3.2", - "ast-types-flow": "^0.0.8", - "axe-core": "=4.7.0", - "axobject-query": "^3.2.1", - "damerau-levenshtein": "^1.0.8", - "emoji-regex": "^9.2.2", - "es-iterator-helpers": "^1.0.15", - "hasown": "^2.0.0", - "jsx-ast-utils": "^3.3.5", - "language-tags": "^1.0.9", - "minimatch": "^3.1.2", - "object.entries": "^1.1.7", - "object.fromentries": "^2.0.7" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">=4.0" + "node": ">=6" }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "peer": true - }, - "node_modules/eslint-plugin-no-only-tests": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.4.0.tgz", - "integrity": "sha512-azP9PwQYfGtXJjW273nIxQH9Ygr+5/UyeW2wEjYoDtVYPI+WPKwbj0+qcAKYUXFZLRumq4HKkFaoDBAwBoXImQ==", + "node_modules/import-from-esm": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-1.3.4.tgz", + "integrity": "sha512-7EyUlPFC0HOlBDpUFGfYstsU7XHxZJKAAMzCT8wZ0hMW7b+hG51LIKTDcsgtz8Pu6YC0HqRVbX+rVUtsGMUKvg==", "dev": true, + "dependencies": { + "debug": "^4.3.4", + "import-meta-resolve": "^4.0.0" + }, "engines": { - "node": ">=4.0.0" + "node": ">=16.20" } }, - "node_modules/eslint-plugin-react": { - "version": "7.34.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz", - "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, - "peer": true, "dependencies": { - "array-includes": "^3.1.7", - "array.prototype.findlast": "^1.2.4", - "array.prototype.flatmap": "^1.3.2", - "array.prototype.toreversed": "^1.1.2", - "array.prototype.tosorted": "^1.1.3", - "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.0.17", - "estraverse": "^5.3.0", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.7", - "object.fromentries": "^2.0.7", - "object.hasown": "^1.1.3", - "object.values": "^1.1.7", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.5", - "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.10" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" }, "engines": { - "node": ">=4" + "node": ">=8" }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-react-hooks": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", - "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", + "node_modules/import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/eslint-plugin-react/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, "engines": { - "node": ">=0.10.0" + "node": ">=0.8.19" } }, - "node_modules/eslint-plugin-react/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, - "peer": true, "engines": { - "node": ">=4.0" + "node": ">=8" } }, - "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.5", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", - "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "node_modules/index-to-position": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", "dev": true, - "peer": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" + "engines": { + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, - "peer": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, "engines": { - "node": ">=8.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" + "node": ">= 0.4" } }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "node_modules/into-stream": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-7.0.0.tgz", + "integrity": "sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==", "dev": true, + "dependencies": { + "from2": "^2.3.0", + "p-is-promise": "^3.0.0" + }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "loose-envify": "^1.0.0" } }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, "engines": { - "node": ">= 4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/espree/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "peer": true, + "dependencies": { + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=0.4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "dependencies": { + "binary-extensions": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { - "estraverse": "^5.1.0" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=0.10" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { - "node": ">=4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "estraverse": "^5.2.0" + "hasown": "^2.0.0" }, - "engines": { - "node": ">=4.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, "engines": { - "node": ">=4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { - "node": ">=4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/ethereum-cryptography": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.0.0.tgz", - "integrity": "sha512-g25m4EtfQGjstWgVE1aIz7XYYjf3kH5kG17ULWVB5dH6uLahsoltOhACzSxyDV+fhn4gbR4xRrOXGe6r2uh4Bg==", - "dependencies": { - "@noble/curves": "1.0.0", - "@noble/hashes": "1.3.0", - "@scure/bip32": "1.3.0", - "@scure/bip39": "1.2.0" - } - }, - "node_modules/ethers": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.8.0.tgz", - "integrity": "sha512-zrFbmQRlraM+cU5mE4CZTLBurZTs2gdp2ld0nG/f3ecBK+x6lZ69KSxBqZ4NjclxwfTxl5LeNufcBbMsTdY53Q==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@adraffy/ens-normalize": "1.10.0", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "18.15.13", - "aes-js": "4.0.0-beta.5", - "tslib": "2.4.0", - "ws": "8.5.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/ethers/node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "peer": true, "dependencies": { - "@noble/hashes": "1.3.2" + "call-bind": "^1.0.2" }, "funding": { - "url": "https://paulmillr.com/funding/" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ethers/node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" + "node": ">=8" } }, - "node_modules/ethers/node_modules/@types/node": { - "version": "18.15.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" - }, - "node_modules/ethers/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "node_modules/ethers/node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "node": ">=6" } }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", "dev": true, "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "dev": true, + "peer": true, "engines": { - "node": ">=0.8.x" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", "dev": true, "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/exec-sh": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz", - "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==", - "dev": true - }, - "node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "engines": { + "node": ">= 0.4" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=0.12.0" } }, - "node_modules/execa/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=4.8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/execa/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/execa/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "dev": true, - "bin": { - "semver": "bin/semver" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/execa/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "dependencies": { - "shebang-regex": "^1.0.0" + "isobject": "^3.0.1" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/execa/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "dependencies": { - "isexe": "^2.0.0" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, - "bin": { - "which": "bin/which" + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "dev": true, + "peer": true, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "call-bind": "^1.0.7" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "dependencies": { - "ms": "2.0.0" + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "has-symbols": "^1.0.2" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/expand-brackets/node_modules/ms": { + "node_modules/is-text-path": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/expect": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", - "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", + "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "ansi-styles": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0" + "text-extensions": "^2.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, "dependencies": { - "type": "^2.7.2" + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ext/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==", - "dev": true - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, - "node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "node_modules/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" + "engines": { + "node": ">=18" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/extend-shallow/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "dependencies": { - "is-plain-object": "^2.0.4" + "call-bind": "^1.0.2" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "node_modules/is-weakset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", + "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", "dev": true, + "peer": true, "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4" }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, "engines": { "node": ">=0.10.0" } }, - "node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true + }, + "node_modules/issue-parser": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-7.0.1.tgz", + "integrity": "sha512-3YZcUUR2Wt1WsapF+S/WiA2WmlW0cWAoPccMqne7AxEBhCdFeTPjfv/Axb8V2gyCgY3nRw+ksZ3xSUX+R47iAg==", "dev": true, "dependencies": { - "is-descriptor": "^1.0.0" + "lodash.capitalize": "^4.2.1", + "lodash.escaperegexp": "^4.1.2", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.uniqby": "^4.7.0" }, "engines": { - "node": ">=0.10.0" + "node": "^18.17 || >=20.6.1" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/extglob/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "deprecated": "Please upgrade to v1.0.1", + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/extglob/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "deprecated": "Please upgrade to v1.0.1", + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { - "kind-of": "^6.0.0" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/extglob/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "semver": "^7.5.3" }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" }, "engines": { - "node": ">=8.6.0" + "node": ">=10" } }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, "engines": { - "node": ">= 4.9.1" + "node": ">=8" } }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", "dev": true, + "peer": true, "dependencies": { - "reusify": "^1.0.4" + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" } }, - "node_modules/fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "node_modules/java-properties": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", + "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", "dev": true, - "dependencies": { - "bser": "2.1.1" + "engines": { + "node": ">= 0.6.0" } }, - "node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "node_modules/jest": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest/-/jest-28.1.3.tgz", + "integrity": "sha512-N4GT5on8UkZgH0O5LUavMRV1EDEhNTL0KEfRmDIeZHSV7p2XgLoY9t9VDUgL6o+yfdgYHVxuz81G8oB9VG5uyA==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "@jest/core": "^28.1.3", + "@jest/types": "^28.1.3", + "import-local": "^3.0.2", + "jest-cli": "^28.1.3" + }, + "bin": { + "jest": "bin/jest.js" }, "engines": { - "node": ">=4" - } - }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "node_modules/jest-changed-files": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-28.1.3.tgz", + "integrity": "sha512-esaOfUWJXk2nfZt9SPyC8gA1kNfdKLkQWyzsMlqq8msYSlNKfmZxfRgZn4Cd4MGVUF+7v6dBs0d5TOAKa7iIiA==", "dev": true, "dependencies": { - "flat-cache": "^3.0.4" + "execa": "^5.0.0", + "p-limit": "^3.1.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/jest-changed-files/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/filter-obj": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-2.0.2.tgz", - "integrity": "sha512-lO3ttPjHZRfjMcxWKb1j1eDhTFsu4meeR3lnMcnBFhk6RuLhvEiuALu2TlfL310ph4lCYYwgF/ElIjdP739tdg==", + "node_modules/jest-circus": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-28.1.3.tgz", + "integrity": "sha512-cZ+eS5zc79MBwt+IhQhiEp0OeBddpc1n8MBo1nMB8A7oPMKEO+Sre+wHaLJexQUj9Ya/8NOBY0RESUgYjB6fow==", "dev": true, + "dependencies": { + "@jest/environment": "^28.1.3", + "@jest/expect": "^28.1.3", + "@jest/test-result": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^0.7.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^28.1.3", + "jest-matcher-utils": "^28.1.3", + "jest-message-util": "^28.1.3", + "jest-runtime": "^28.1.3", + "jest-snapshot": "^28.1.3", + "jest-util": "^28.1.3", + "p-limit": "^3.1.0", + "pretty-format": "^28.1.3", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "node_modules/jest-circus/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "node_modules/jest-cli": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-28.1.3.tgz", + "integrity": "sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ==", "dev": true, "dependencies": { - "locate-path": "^2.0.0" + "@jest/core": "^28.1.3", + "@jest/test-result": "^28.1.3", + "@jest/types": "^28.1.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^28.1.3", + "jest-util": "^28.1.3", + "jest-validate": "^28.1.3", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" }, "engines": { - "node": ">=4" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "node_modules/jest-config": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-28.1.3.tgz", + "integrity": "sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ==", "dev": true, "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^28.1.3", + "@jest/types": "^28.1.3", + "babel-jest": "^28.1.3", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^28.1.3", + "jest-environment-node": "^28.1.3", + "jest-get-type": "^28.0.2", + "jest-regex-util": "^28.0.2", + "jest-resolve": "^28.1.3", + "jest-runner": "^28.1.3", + "jest-util": "^28.1.3", + "jest-validate": "^28.1.3", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^28.1.3", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, - "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" }, "peerDependenciesMeta": { - "debug": { + "@types/node": { + "optional": true + }, + "ts-node": { "optional": true } } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "node_modules/jest-diff": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-28.1.3.tgz", + "integrity": "sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw==", "dev": true, "dependencies": { - "is-callable": "^1.1.3" + "chalk": "^4.0.0", + "diff-sequences": "^28.1.1", + "jest-get-type": "^28.0.2", + "pretty-format": "^28.1.3" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "node_modules/jest-docblock": { + "version": "28.1.1", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-28.1.1.tgz", + "integrity": "sha512-3wayBVNiOYx0cwAbl9rwm5kKFP8yHH3d/fkEaL02NPTkDojPtheGB7HZSFY4wzX+DxyrvhXz0KSCVksmCknCuA==", "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "node_modules/jest-each": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-28.1.3.tgz", + "integrity": "sha512-arT1z4sg2yABU5uogObVPvSlSMQlDA48owx07BDPAiasW0yYpYHYOo4HHLz9q0BVzDVU4hILFjzJw0So9aCL/g==", "dev": true, + "dependencies": { + "@jest/types": "^28.1.3", + "chalk": "^4.0.0", + "jest-get-type": "^28.0.2", + "jest-util": "^28.1.3", + "pretty-format": "^28.1.3" + }, "engines": { - "node": "*" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "node_modules/jest-environment-node": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-28.1.3.tgz", + "integrity": "sha512-ugP6XOhEpjAEhGYvp5Xj989ns5cB1K6ZdjBYuS30umT4CQEETaxSiPcZ/E1kFktX4GkrcM4qu07IIlDYX1gp+A==", "dev": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "@jest/environment": "^28.1.3", + "@jest/fake-timers": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/node": "*", + "jest-mock": "^28.1.3", + "jest-util": "^28.1.3" }, "engines": { - "node": ">= 0.12" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", + "node_modules/jest-get-type": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-28.0.2.tgz", + "integrity": "sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-28.1.3.tgz", + "integrity": "sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA==", "dev": true, "dependencies": { - "map-cache": "^0.2.2" + "@jest/types": "^28.1.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^28.0.2", + "jest-util": "^28.1.3", + "jest-worker": "^28.1.3", + "micromatch": "^4.0.4", + "walker": "^1.0.8" }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "node_modules/jest-leak-detector": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz", + "integrity": "sha512-WFVJhnQsiKtDEo5lG2mM0v40QWnBM+zMdHHyJs8AWZ7J0QZJS59MsyKeJHWhpBZBH32S48FOVvGyOFT1h0DlqA==", "dev": true, "dependencies": { - "minipass": "^3.0.0" + "jest-get-type": "^28.0.2", + "pretty-format": "^28.1.3" }, "engines": { - "node": ">= 8" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "node_modules/jest-matcher-utils": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz", + "integrity": "sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "chalk": "^4.0.0", + "jest-diff": "^28.1.3", + "jest-get-type": "^28.0.2", + "pretty-format": "^28.1.3" }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/jest-message-util": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.3.tgz", + "integrity": "sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^28.1.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^28.1.3", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node_modules/jest-message-util/node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "node_modules/jest-mock": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-28.1.3.tgz", + "integrity": "sha512-o3J2jr6dMMWYVH4Lh/NKmDXdosrsJgi4AviS8oXLujcjpCMBb1FMsblDnOXKZKfSiHLxYub1eS0IHuRXsio9eA==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "@jest/types": "^28.1.3", + "@types/node": "*" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, - "node_modules/functions-have-names": { + "node_modules/jest-pnp-resolver": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } } }, - "node_modules/fuzzy": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz", - "integrity": "sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==", + "node_modules/jest-regex-util": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz", + "integrity": "sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==", "dev": true, "engines": { - "node": ">= 0.6.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "deprecated": "This package is no longer supported.", + "node_modules/jest-resolve": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-28.1.3.tgz", + "integrity": "sha512-Z1W3tTjE6QaNI90qo/BJpfnvpxtaFTFw5CDgwpyE/Kz8U/06N1Hjf4ia9quUhCh39qIGWF1ZuxFiBiJQwSEYKQ==", "dev": true, "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^28.1.3", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^28.1.3", + "jest-validate": "^28.1.3", + "resolve": "^1.20.0", + "resolve.exports": "^1.1.0", + "slash": "^3.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "node_modules/jest-resolve-dependencies": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.3.tgz", + "integrity": "sha512-qa0QO2Q0XzQoNPouMbCc7Bvtsem8eQgVPNkwn9LnS+R2n8DaVDPL/U1gngC0LTl1RYXJU0uJa2BMC2DbTfFrHA==", "dev": true, + "dependencies": { + "jest-regex-util": "^28.0.2", + "jest-snapshot": "^28.1.3" + }, "engines": { - "node": ">=6.9.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/jest-runner": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-28.1.3.tgz", + "integrity": "sha512-GkMw4D/0USd62OVO0oEgjn23TM+YJa2U2Wu5zz9xsQB1MxWKDOlrnykPxnMsN0tnJllfLPinHTka61u0QhaxBA==", "dev": true, + "dependencies": { + "@jest/console": "^28.1.3", + "@jest/environment": "^28.1.3", + "@jest/test-result": "^28.1.3", + "@jest/transform": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.10.2", + "graceful-fs": "^4.2.9", + "jest-docblock": "^28.1.1", + "jest-environment-node": "^28.1.3", + "jest-haste-map": "^28.1.3", + "jest-leak-detector": "^28.1.3", + "jest-message-util": "^28.1.3", + "jest-resolve": "^28.1.3", + "jest-runtime": "^28.1.3", + "jest-util": "^28.1.3", + "jest-watcher": "^28.1.3", + "jest-worker": "^28.1.3", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "node_modules/jest-runner/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "node_modules/jest-runtime": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-28.1.3.tgz", + "integrity": "sha512-NU+881ScBQQLc1JHG5eJGU7Ui3kLKrmwCPPtYsJtBykixrM2OhVQlpMmFWJjMyDfdkGgBMNjXCGB/ebzsgNGQw==", "dev": true, + "dependencies": { + "@jest/environment": "^28.1.3", + "@jest/fake-timers": "^28.1.3", + "@jest/globals": "^28.1.3", + "@jest/source-map": "^28.1.2", + "@jest/test-result": "^28.1.3", + "@jest/transform": "^28.1.3", + "@jest/types": "^28.1.3", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "execa": "^5.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^28.1.3", + "jest-message-util": "^28.1.3", + "jest-mock": "^28.1.3", + "jest-regex-util": "^28.0.2", + "jest-resolve": "^28.1.3", + "jest-snapshot": "^28.1.3", + "jest-util": "^28.1.3", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, "engines": { - "node": ">=8.0.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/get-stdin": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", - "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "node_modules/jest-runtime/node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "node_modules/jest-snapshot": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-28.1.3.tgz", + "integrity": "sha512-4lzMgtiNlc3DU/8lZfmqxN3AYD6GGLbl+72rdBpXvcV+whX7mDrREzkPdp2RnmfIiWBg1YbuFSkXduF2JcafJg==", "dev": true, "dependencies": { - "pump": "^3.0.0" + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^28.1.3", + "@jest/transform": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/babel__traverse": "^7.0.6", + "@types/prettier": "^2.1.5", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^28.1.3", + "graceful-fs": "^4.2.9", + "jest-diff": "^28.1.3", + "jest-get-type": "^28.0.2", + "jest-haste-map": "^28.1.3", + "jest-matcher-utils": "^28.1.3", + "jest-message-util": "^28.1.3", + "jest-util": "^28.1.3", + "natural-compare": "^1.4.0", + "pretty-format": "^28.1.3", + "semver": "^7.3.5" }, "engines": { - "node": ">=6" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "node_modules/jest-util": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.1.3.tgz", + "integrity": "sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" + "@jest/types": "^28.1.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "node_modules/jest-validate": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-28.1.3.tgz", + "integrity": "sha512-SZbOGBWEsaTxBGCOpsRWlXlvNkvTkY0XxRfh7zYmvd8uL5Qzyg0CHAXiXKROflh801quA6+/DsT4ODDthOC/OA==", "dev": true, + "dependencies": { + "@jest/types": "^28.1.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^28.0.2", + "leven": "^3.1.0", + "pretty-format": "^28.1.3" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/jest-watcher": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-28.1.3.tgz", + "integrity": "sha512-t4qcqj9hze+jviFPUN3YAtAEeFnr/azITXQEMARf5cMwKY2SMBRnCQTXLixTl20OR6mLh9KLMrgVJgJISym+1g==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "@jest/test-result": "^28.1.3", + "@jest/types": "^28.1.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.10.2", + "jest-util": "^28.1.3", + "string-length": "^4.0.1" }, "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/jest-worker": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-28.1.3.tgz", + "integrity": "sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": ">= 6" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/glob-promise": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-4.2.2.tgz", - "integrity": "sha512-xcUzJ8NWN5bktoTIX7eOclO1Npxd/dyVqUJxlLIDasT4C7KZyqlPIwkdJ0Ypiy3p2ZKahTjK4M9uC3sNSfNMzw==", + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "@types/glob": "^7.1.3" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { - "type": "individual", - "url": "https://github.com/sponsors/ahmadnassri" - }, - "peerDependencies": { - "glob": "^7.1.6" + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "node_modules/jiti": { + "version": "1.21.6", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", + "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "node_modules/global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, - "dependencies": { - "type-fest": "^0.20.2" + "bin": { + "jsesc": "bin/jsesc" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, - "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, "dependencies": { - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" + "minimist": "^1.2.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "bin": { + "json5": "lib/cli.js" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" + "universalify": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "graceful-fs": "^4.1.6" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3" + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "*" } }, - "node_modules/got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" }, "engines": { - "node": ">=8.6" + "node": ">=0.6.0" } }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==", - "dev": true, - "optional": true - }, - "node_modules/grpc-tools": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.12.4.tgz", - "integrity": "sha512-5+mLAJJma3BjnW/KQp6JBjUMgvu7Mu3dBvBPd1dcbNIb+qiR0817zDpgPjS7gRb+l/8EVNIa3cB02xI9JLToKg==", + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", "dev": true, - "hasInstallScript": true, + "peer": true, "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5" + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" }, - "bin": { - "grpc_tools_node_protoc": "bin/protoc.js", - "grpc_tools_node_protoc_plugin": "bin/protoc_plugin.js" + "engines": { + "node": ">=4.0" } }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, "engines": { "node": ">=6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/language-subtag-registry": { + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", + "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==", + "dev": true, + "peer": true + }, + "node_modules/language-tags": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", "dev": true, + "peer": true, "dependencies": { - "function-bind": "^1.1.1" + "language-subtag-registry": "^0.3.20" }, "engines": { - "node": ">= 0.4.0" + "node": ">=0.10" } }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "node_modules/lcov-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", + "integrity": "sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==", "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" + "bin": { + "lcov-parse": "bin/cli.js" } }, - "node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/has-flag": { + "node_modules/libsodium-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz", + "integrity": "sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==" + }, + "node_modules/libsodium-wrappers-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz", + "integrity": "sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==", + "dependencies": { + "libsodium-sumo": "^0.7.13" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/load-json-file": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "node_modules/load-json-file/node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, "dependencies": { - "es-define-property": "^1.0.0" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6.11.5" } }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "dependencies": { - "has-symbols": "^1.0.3" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, + "node_modules/lodash.capitalize": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", + "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", + "dev": true + }, + "node_modules/lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "dev": true + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true + }, + "node_modules/lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true + }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", + "dev": true + }, + "node_modules/lodash.startcase": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", + "dev": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true + }, + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", "dev": true }, - "node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "node_modules/lodash.uniqby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", + "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", + "dev": true + }, + "node_modules/lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", + "dev": true + }, + "node_modules/log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", "dev": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=0.8.6" } }, - "node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" + "js-tokens": "^3.0.0 || ^4.0.0" }, - "engines": { - "node": ">=0.10.0" + "bin": { + "loose-envify": "cli.js" } }, - "node_modules/has-values/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "semver": "^6.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "tmpl": "1.0.5" } }, - "node_modules/has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "node_modules/marked": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.2.tgz", + "integrity": "sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==", "dev": true, + "bin": { + "marked": "bin/marked.js" + }, "engines": { - "node": ">=8" + "node": ">= 18" } }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "node_modules/marked-terminal": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.1.0.tgz", + "integrity": "sha512-+pvwa14KZL74MVXjYdPR3nSInhGhNvPce/3mqLVZT2oUvt654sL1XImFuLZ1pkA866IYZ3ikDTOFUIC7XzpZZg==", "dev": true, "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "ansi-escapes": "^7.0.0", + "chalk": "^5.3.0", + "cli-highlight": "^2.1.11", + "cli-table3": "^0.6.5", + "node-emoji": "^2.1.3", + "supports-hyperlinks": "^3.0.0" }, "engines": { - "node": ">=4" + "node": ">=16.0.0" + }, + "peerDependencies": { + "marked": ">=1 <14" } }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/marked-terminal/node_modules/ansi-escapes": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "environment": "^1.0.0" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dependencies": { - "function-bind": "^1.1.2" + "node": ">=18" }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "node_modules/marked-terminal/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, - "dependencies": { - "whatwg-encoding": "^1.0.5" - }, "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, - "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "node_modules/marked-terminal/node_modules/supports-hyperlinks": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.1.0.tgz", + "integrity": "sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==", "dev": true, "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" }, "engines": { - "node": ">= 6" + "node": ">=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" } }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", - "dev": true - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "node_modules/meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, "engines": { - "node": ">= 6" + "node": ">=16.10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "engines": { - "node": ">=8.12.0" + "node": ">= 8" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" + "node": ">=8.6" } }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "miller-rabin": "bin/miller-rabin" } }, - "node_modules/import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==", - "dev": true, - "engines": { - "node": ">=4" - } + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "node_modules/mime": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.0.4.tgz", + "integrity": "sha512-v8yqInVjhXyqP6+Kw4fV3ZzeMRqEW6FotRsKXjRS5VMTNIuXsdRoAvklpoRgSqXm6o9VNH4/C0mgedko9DdLsQ==", "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, + "funding": [ + "https://github.com/sponsors/broofa" + ], "bin": { - "import-local-fixture": "fixtures/cli.js" + "mime": "bin/cli.js" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=16" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "engines": { - "node": ">=0.8.19" + "node": ">= 0.6" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "engines": { - "node": ">=10" + "node": ">=6" } }, - "node_modules/inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=6.0.0" + "node": "*" } }, - "node_modules/inquirer-autocomplete-prompt": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-0.11.1.tgz", - "integrity": "sha512-VM4eNiyRD4CeUc2cyKni+F8qgHwL9WC4LdOr+mEC85qP/QNsDV+ysVqUrJYhw1TmDQu1QVhc8hbaL7wfk8SJxw==", + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "dependencies": { - "ansi-escapes": "^2.0.0", - "chalk": "^1.1.3", - "figures": "^2.0.0", - "inquirer": "3.1.1", - "lodash": "^4.17.4", - "run-async": "^2.3.0", - "util": "^0.10.3" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/ansi-escapes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", - "integrity": "sha512-tH/fSoQp4DrEodDK3QpdiWiZTSe7sBJ9eOqcQBZ0o9HTM+5M/viSEn+sPMoTuPjQQ8n++w3QJoPEjt8LVPcrCg==", + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "bin": { + "mkdirp": "bin/cmd.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==", + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/inquirer-autocomplete-prompt/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, - "engines": { - "node": ">=0.8.0" + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/nerf-dart": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", + "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", + "dev": true + }, + "node_modules/node-emoji": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", + "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", "dev": true, "dependencies": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" + "@sindresorhus/is": "^4.6.0", + "char-regex": "^1.0.2", + "emojilib": "^2.4.0", + "skin-tone": "^2.0.0" }, "engines": { - "node": ">=0.12" + "node": ">=18" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/inquirer": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.1.1.tgz", - "integrity": "sha512-H50sHQwgvvaTBd3HpKMVtL/u6LoHDvYym51gd7bGQe/+9HkCE+J0/3N5FJLfd6O6oz44hHewC2Pc2LodzWVafQ==", + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "dependencies": { - "ansi-escapes": "^2.0.0", - "chalk": "^1.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.0.0", - "strip-ansi": "^3.0.0", - "through": "^2.3.6" + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/node-polyfill-webpack-plugin": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz", + "integrity": "sha512-ZUMiCnZkP1LF0Th2caY6J/eKKoA0TefpoVa68m/LQU1I/mE8rGt4fNYGgNuCcK+aG8P8P43nbeJ2RqJMOL/Y1A==", "dev": true, "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "assert": "^2.0.0", + "browserify-zlib": "^0.2.0", + "buffer": "^6.0.3", + "console-browserify": "^1.2.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.12.0", + "domain-browser": "^4.22.0", + "events": "^3.3.0", + "filter-obj": "^2.0.2", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "process": "^0.11.10", + "punycode": "^2.1.1", + "querystring-es3": "^0.2.1", + "readable-stream": "^4.0.0", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "string_decoder": "^1.3.0", + "timers-browserify": "^2.0.12", + "tty-browserify": "^0.0.1", + "type-fest": "^2.14.0", + "url": "^0.11.0", + "util": "^0.12.4", + "vm-browserify": "^1.1.2" }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "peerDependencies": { + "webpack": ">=5" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "node_modules/node-polyfill-webpack-plugin/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer-autocomplete-prompt/node_modules/string-width/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" + "node": ">=12.20" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true + }, + "node_modules/nodemon": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", + "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", "dev": true, "dependencies": { - "ansi-regex": "^2.0.0" + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" } }, - "node_modules/inquirer-autocomplete-prompt/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, - "engines": { - "node": ">=0.8.0" + "dependencies": { + "ms": "^2.1.1" } }, - "node_modules/inquirer/node_modules/ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" } }, - "node_modules/inquirer/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "node_modules/nodemon/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "engines": { - "node": ">=6" + "bin": { + "semver": "bin/semver" } }, - "node_modules/inquirer/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "has-flag": "^3.0.0" }, "engines": { "node": ">=4" } }, - "node_modules/inquirer/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" }, "engines": { - "node": ">=4" + "node": "*" } }, - "node_modules/inquirer/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/normalize-package-data": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.2.tgz", + "integrity": "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==", "dev": true, "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/inquirer/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/inquirer/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, + "hosted-git-info": "^7.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, "engines": { - "node": ">=0.8.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/inquirer/node_modules/has-flag": { + "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/inquirer/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "node_modules/normalize-url": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", "dev": true, "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "node": ">=14.16" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "node_modules/npm": { + "version": "10.8.3", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.8.3.tgz", + "integrity": "sha512-0IQlyAYvVtQ7uOhDFYZCGK8kkut2nh8cpAdA9E6FvRSJaTgtZRZgNjlC5ZCct//L73ygrpY93CxXpRJDtNqPVg==", + "bundleDependencies": [ + "@isaacs/string-locale-compare", + "@npmcli/arborist", + "@npmcli/config", + "@npmcli/fs", + "@npmcli/map-workspaces", + "@npmcli/package-json", + "@npmcli/promise-spawn", + "@npmcli/redact", + "@npmcli/run-script", + "@sigstore/tuf", + "abbrev", + "archy", + "cacache", + "chalk", + "ci-info", + "cli-columns", + "fastest-levenshtein", + "fs-minipass", + "glob", + "graceful-fs", + "hosted-git-info", + "ini", + "init-package-json", + "is-cidr", + "json-parse-even-better-errors", + "libnpmaccess", + "libnpmdiff", + "libnpmexec", + "libnpmfund", + "libnpmhook", + "libnpmorg", + "libnpmpack", + "libnpmpublish", + "libnpmsearch", + "libnpmteam", + "libnpmversion", + "make-fetch-happen", + "minimatch", + "minipass", + "minipass-pipeline", + "ms", + "node-gyp", + "nopt", + "normalize-package-data", + "npm-audit-report", + "npm-install-checks", + "npm-package-arg", + "npm-pick-manifest", + "npm-profile", + "npm-registry-fetch", + "npm-user-validate", + "p-map", + "pacote", + "parse-conflict-json", + "proc-log", + "qrcode-terminal", + "read", + "semver", + "spdx-expression-parse", + "ssri", + "supports-color", + "tar", + "text-table", + "tiny-relative-date", + "treeverse", + "validate-npm-package-name", + "which", + "write-file-atomic" + ], "dev": true, "dependencies": { - "ansi-regex": "^3.0.0" + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/arborist": "^7.5.4", + "@npmcli/config": "^8.3.4", + "@npmcli/fs": "^3.1.1", + "@npmcli/map-workspaces": "^3.0.6", + "@npmcli/package-json": "^5.2.0", + "@npmcli/promise-spawn": "^7.0.2", + "@npmcli/redact": "^2.0.1", + "@npmcli/run-script": "^8.1.0", + "@sigstore/tuf": "^2.3.4", + "abbrev": "^2.0.0", + "archy": "~1.0.0", + "cacache": "^18.0.4", + "chalk": "^5.3.0", + "ci-info": "^4.0.0", + "cli-columns": "^4.0.0", + "fastest-levenshtein": "^1.0.16", + "fs-minipass": "^3.0.3", + "glob": "^10.4.5", + "graceful-fs": "^4.2.11", + "hosted-git-info": "^7.0.2", + "ini": "^4.1.3", + "init-package-json": "^6.0.3", + "is-cidr": "^5.1.0", + "json-parse-even-better-errors": "^3.0.2", + "libnpmaccess": "^8.0.6", + "libnpmdiff": "^6.1.4", + "libnpmexec": "^8.1.4", + "libnpmfund": "^5.0.12", + "libnpmhook": "^10.0.5", + "libnpmorg": "^6.0.6", + "libnpmpack": "^7.0.4", + "libnpmpublish": "^9.0.9", + "libnpmsearch": "^7.0.6", + "libnpmteam": "^6.0.5", + "libnpmversion": "^6.0.3", + "make-fetch-happen": "^13.0.1", + "minimatch": "^9.0.5", + "minipass": "^7.1.1", + "minipass-pipeline": "^1.2.4", + "ms": "^2.1.2", + "node-gyp": "^10.2.0", + "nopt": "^7.2.1", + "normalize-package-data": "^6.0.2", + "npm-audit-report": "^5.0.0", + "npm-install-checks": "^6.3.0", + "npm-package-arg": "^11.0.3", + "npm-pick-manifest": "^9.1.0", + "npm-profile": "^10.0.0", + "npm-registry-fetch": "^17.1.0", + "npm-user-validate": "^2.0.1", + "p-map": "^4.0.0", + "pacote": "^18.0.6", + "parse-conflict-json": "^3.0.1", + "proc-log": "^4.2.0", + "qrcode-terminal": "^0.12.0", + "read": "^3.0.1", + "semver": "^7.6.3", + "spdx-expression-parse": "^4.0.0", + "ssri": "^10.0.6", + "supports-color": "^9.4.0", + "tar": "^6.2.1", + "text-table": "~0.2.0", + "tiny-relative-date": "^1.3.0", + "treeverse": "^3.0.0", + "validate-npm-package-name": "^5.0.1", + "which": "^4.0.0", + "write-file-atomic": "^5.0.1" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" + "bin": { + "npm": "bin/npm-cli.js", + "npx": "bin/npx-cli.js" }, "engines": { - "node": ">=6" + "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/inquirer/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "path-key": "^3.0.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/inquirerer": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/inquirerer/-/inquirerer-0.1.3.tgz", - "integrity": "sha512-yGgLUOqPxTsINBjZNZeLi3cv2zgxXtw9feaAOSJf2j6AqIT5Uxs5ZOqOrfAf+xP65Sicla1FD3iDxa3D6TsCAQ==", - "dev": true, - "dependencies": { - "colors": "^1.1.2", - "inquirer": "^6.0.0", - "inquirer-autocomplete-prompt": "^0.11.1" + "node": ">=8" } }, - "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "node_modules/npm/node_modules/@isaacs/cliui": { + "version": "8.0.2", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=12" } }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", "dev": true, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">= 0.10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", "dev": true, - "dependencies": { - "loose-envify": "^1.0.0" - } + "inBundle": true, + "license": "MIT" }, - "node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", - "deprecated": "Please upgrade to v0.1.7", + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "kind-of": "^3.0.2" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "is-buffer": "^1.1.5" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "node_modules/npm/node_modules/@isaacs/string-locale-compare": { + "version": "1.1.0", "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/@npmcli/agent": { + "version": "2.2.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/arborist": { + "version": "7.5.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/fs": "^3.1.1", + "@npmcli/installed-package-contents": "^2.1.0", + "@npmcli/map-workspaces": "^3.0.2", + "@npmcli/metavuln-calculator": "^7.1.1", + "@npmcli/name-from-folder": "^2.0.0", + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/package-json": "^5.1.0", + "@npmcli/query": "^3.1.0", + "@npmcli/redact": "^2.0.0", + "@npmcli/run-script": "^8.1.0", + "bin-links": "^4.0.4", + "cacache": "^18.0.3", + "common-ancestor-path": "^1.0.1", + "hosted-git-info": "^7.0.2", + "json-parse-even-better-errors": "^3.0.2", + "json-stringify-nice": "^1.1.4", + "lru-cache": "^10.2.2", + "minimatch": "^9.0.4", + "nopt": "^7.2.1", + "npm-install-checks": "^6.2.0", + "npm-package-arg": "^11.0.2", + "npm-pick-manifest": "^9.0.1", + "npm-registry-fetch": "^17.0.1", + "pacote": "^18.0.6", + "parse-conflict-json": "^3.0.0", + "proc-log": "^4.2.0", + "proggy": "^2.0.0", + "promise-all-reject-late": "^1.0.0", + "promise-call-limit": "^3.0.1", + "read-package-json-fast": "^3.0.2", + "semver": "^7.3.7", + "ssri": "^10.0.6", + "treeverse": "^3.0.0", + "walk-up-path": "^3.0.1" }, - "engines": { - "node": ">= 0.4" + "bin": { + "arborist": "bin/index.js" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "node_modules/npm/node_modules/@npmcli/config": { + "version": "8.3.4", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" + "@npmcli/map-workspaces": "^3.0.2", + "@npmcli/package-json": "^5.1.1", + "ci-info": "^4.0.0", + "ini": "^4.1.2", + "nopt": "^7.2.1", + "proc-log": "^4.2.0", + "semver": "^7.3.5", + "walk-up-path": "^3.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-async-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", - "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "node_modules/npm/node_modules/@npmcli/fs": { + "version": "3.1.1", "dev": true, - "peer": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "has-tostringtag": "^1.0.0" + "semver": "^7.3.5" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + }, + "node_modules/npm/node_modules/@npmcli/git": { + "version": "5.0.8", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "has-bigints": "^1.0.1" + "@npmcli/promise-spawn": "^7.0.0", + "ini": "^4.1.3", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", + "proc-log": "^4.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-binary-path": { + "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "binary-extensions": "^2.0.0" + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "bin": { + "installed-package-contents": "bin/index.js" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "node_modules/npm/node_modules/@npmcli/map-workspaces": { + "version": "3.0.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "@npmcli/name-from-folder": "^2.0.0", + "glob": "^10.2.2", + "minimatch": "^9.0.0", + "read-package-json-fast": "^3.0.0" }, "engines": { - "node": ">= 0.4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { + "version": "7.1.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "cacache": "^18.0.0", + "json-parse-even-better-errors": "^3.0.0", + "pacote": "^18.0.0", + "proc-log": "^4.1.0", + "semver": "^7.3.5" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "node_modules/npm/node_modules/@npmcli/name-from-folder": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "node_modules/npm/node_modules/@npmcli/node-gyp": { + "version": "3.0.0", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "node_modules/npm/node_modules/@npmcli/package-json": { + "version": "5.2.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "ci-info": "^2.0.0" + "@npmcli/git": "^5.0.0", + "glob": "^10.2.2", + "hosted-git-info": "^7.0.0", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^6.0.0", + "proc-log": "^4.0.0", + "semver": "^7.5.3" }, - "bin": { - "is-ci": "bin.js" + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "node_modules/npm/node_modules/@npmcli/promise-spawn": { + "version": "7.0.2", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "hasown": "^2.0.0" + "which": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", - "deprecated": "Please upgrade to v0.1.5", + "node_modules/npm/node_modules/@npmcli/query": { + "version": "3.1.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "kind-of": "^3.0.2" + "postcss-selector-parser": "^6.0.10" }, "engines": { - "node": ">=0.10.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/redact": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/npm/node_modules/@npmcli/run-script": { + "version": "8.1.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "is-buffer": "^1.1.5" + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/package-json": "^5.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "node-gyp": "^10.0.0", + "proc-log": "^4.0.0", + "which": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-data-view": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", - "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "node_modules/npm/node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/npm/node_modules/@sigstore/bundle": { + "version": "2.3.2", "dev": true, + "inBundle": true, + "license": "Apache-2.0", "dependencies": { - "is-typed-array": "^1.1.13" + "@sigstore/protobuf-specs": "^0.3.2" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "node_modules/npm/node_modules/@sigstore/core": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/protobuf-specs": { + "version": "0.3.2", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/sign": { + "version": "2.3.2", "dev": true, + "inBundle": true, + "license": "Apache-2.0", "dependencies": { - "has-tostringtag": "^1.0.0" + "@sigstore/bundle": "^2.3.2", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.2", + "make-fetch-happen": "^13.0.1", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "node_modules/npm/node_modules/@sigstore/tuf": { + "version": "2.3.4", "dev": true, + "inBundle": true, + "license": "Apache-2.0", "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "@sigstore/protobuf-specs": "^0.3.2", + "tuf-js": "^2.2.1" }, "engines": { - "node": ">=0.10.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "node_modules/npm/node_modules/@sigstore/verify": { + "version": "1.2.1", "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.3.2", + "@sigstore/core": "^1.1.0", + "@sigstore/protobuf-specs": "^0.3.2" + }, "engines": { - "node": ">=0.10.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "node_modules/npm/node_modules/@tufjs/canonical-json": { + "version": "2.0.0", "dev": true, - "optional": true, - "bin": { - "is-docker": "cli.js" - }, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "node_modules/npm/node_modules/@tufjs/models": { + "version": "2.0.1", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.4" + }, "engines": { - "node": ">=0.10.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/npm/node_modules/abbrev": { + "version": "2.0.0", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=0.10.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-finalizationregistry": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", - "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "node_modules/npm/node_modules/agent-base": { + "version": "7.1.1", "dev": true, - "peer": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "debug": "^4.3.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">= 14" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/npm/node_modules/aggregate-error": { + "version": "3.1.0", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, "engines": { "node": ">=8" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "node_modules/npm/node_modules/ansi-regex": { + "version": "5.0.1", "dev": true, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "node_modules/npm/node_modules/ansi-styles": { + "version": "6.2.1", "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/npm/node_modules/aproba": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/archy": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/balanced-match": { + "version": "1.0.2", "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/bin-links": { + "version": "4.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "is-extglob": "^2.1.1" + "cmd-shim": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "read-cmd-shim": "^4.0.0", + "write-file-atomic": "^5.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "node_modules/npm/node_modules/binary-extensions": { + "version": "2.3.0", "dev": true, - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", - "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "node_modules/npm/node_modules/brace-expansion": { + "version": "2.0.1", "dev": true, - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "inBundle": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/is-nan": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", - "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "node_modules/npm/node_modules/cacache": { + "version": "18.0.4", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "node_modules/npm/node_modules/chalk": { + "version": "5.3.0", "dev": true, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">= 0.4" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/is-npm": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", - "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", + "node_modules/npm/node_modules/chownr": { + "version": "2.0.0", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/npm/node_modules/ci-info": { + "version": "4.0.0", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=0.12.0" + "node": ">=8" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "node_modules/npm/node_modules/cidr-regex": { + "version": "4.1.1", "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", "dependencies": { - "has-tostringtag": "^1.0.0" + "ip-regex": "^5.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=14" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "node_modules/npm/node_modules/clean-stack": { + "version": "2.2.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/npm/node_modules/cli-columns": { + "version": "4.0.0", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=8" + "node": ">= 10" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "node_modules/npm/node_modules/cmd-shim": { + "version": "6.0.3", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "node_modules/npm/node_modules/color-convert": { + "version": "2.0.1", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "isobject": "^3.0.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=7.0.0" } }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true + "node_modules/npm/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "inBundle": true, + "license": "MIT" }, - "node_modules/is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", - "dev": true + "node_modules/npm/node_modules/common-ancestor-path": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "ISC" }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "node_modules/npm/node_modules/cross-spawn": { + "version": "7.0.3", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 8" } }, - "node_modules/is-set": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", - "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "node_modules/npm/node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", "dev": true, - "peer": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, "engines": { - "node": ">= 0.4" + "node": ">= 8" + } + }, + "node_modules/npm/node_modules/cssesc": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=4" } }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "node_modules/npm/node_modules/debug": { + "version": "4.3.6", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7" + "ms": "2.1.2" }, "engines": { - "node": ">= 0.4" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "node_modules/npm/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/diff": { + "version": "5.2.0", "dev": true, + "inBundle": true, + "license": "BSD-3-Clause", "engines": { - "node": ">=0.10.0" + "node": ">=0.3.1" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "node_modules/npm/node_modules/eastasianwidth": { + "version": "0.2.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/encoding": { + "version": "0.1.13", "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "iconv-lite": "^0.6.2" } }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "node_modules/npm/node_modules/env-paths": { + "version": "2.2.1", "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6" } }, - "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "node_modules/npm/node_modules/err-code": { + "version": "2.0.3", "dev": true, - "dependencies": { - "which-typed-array": "^1.1.14" - }, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/exponential-backoff": { + "version": "3.1.1", + "dev": true, + "inBundle": true, + "license": "Apache-2.0" + }, + "node_modules/npm/node_modules/fastest-levenshtein": { + "version": "1.0.16", + "dev": true, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 4.9.1" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "node_modules/is-weakmap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", - "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "node_modules/npm/node_modules/foreground-child": { + "version": "3.3.0", "dev": true, - "peer": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, "engines": { - "node": ">= 0.4" + "node": ">=14" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "node_modules/npm/node_modules/fs-minipass": { + "version": "3.0.3", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "call-bind": "^1.0.2" + "minipass": "^7.0.3" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-weakset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", - "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", + "node_modules/npm/node_modules/glob": { + "version": "10.4.5", "dev": true, - "peer": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": ">= 0.4" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "node_modules/npm/node_modules/graceful-fs": { + "version": "4.2.11", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "inBundle": true, + "license": "ISC" }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "node_modules/npm/node_modules/hosted-git-info": { + "version": "7.0.2", "dev": true, - "optional": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "is-docker": "^2.0.0" + "lru-cache": "^10.0.1" }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "node_modules/npm/node_modules/http-cache-semantics": { + "version": "4.1.1", "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", - "peerDependencies": { - "ws": "*" - } - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true + "inBundle": true, + "license": "BSD-2-Clause" }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "node_modules/npm/node_modules/http-proxy-agent": { + "version": "7.0.2", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, "engines": { - "node": ">=8" + "node": ">= 14" } }, - "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "node_modules/npm/node_modules/https-proxy-agent": { + "version": "7.0.5", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "agent-base": "^7.0.2", + "debug": "4" }, "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">= 14" } }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "node_modules/npm/node_modules/iconv-lite": { + "version": "0.6.3", "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "node_modules/npm/node_modules/ignore-walk": { + "version": "6.0.5", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "minimatch": "^9.0.0" }, "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/imurmurhash": { + "version": "0.1.4", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" } }, - "node_modules/istanbul-reports": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", - "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", + "node_modules/npm/node_modules/indent-string": { + "version": "4.0.0", "dev": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, + "inBundle": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/iterator.prototype": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", - "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "node_modules/npm/node_modules/ini": { + "version": "4.1.3", "dev": true, - "peer": true, - "dependencies": { - "define-properties": "^1.2.1", - "get-intrinsic": "^1.2.1", - "has-symbols": "^1.0.3", - "reflect.getprototypeof": "^1.0.4", - "set-function-name": "^2.0.1" + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", - "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", + "node_modules/npm/node_modules/init-package-json": { + "version": "6.0.3", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/core": "^26.6.3", - "import-local": "^3.0.2", - "jest-cli": "^26.6.3" - }, - "bin": { - "jest": "bin/jest.js" + "@npmcli/package-json": "^5.0.0", + "npm-package-arg": "^11.0.0", + "promzard": "^1.0.0", + "read": "^3.0.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-changed-files": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", - "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", + "node_modules/npm/node_modules/ip-address": { + "version": "9.0.5", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "@jest/types": "^26.6.2", - "execa": "^4.0.0", - "throat": "^5.0.0" + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" }, "engines": { - "node": ">= 10.14.2" + "node": ">= 12" } }, - "node_modules/jest-changed-files/node_modules/execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "node_modules/npm/node_modules/ip-regex": { + "version": "5.0.0", "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - }, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-changed-files/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "node_modules/npm/node_modules/is-cidr": { + "version": "5.1.0", "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", "dependencies": { - "pump": "^3.0.0" + "cidr-regex": "^4.1.1" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=14" } }, - "node_modules/jest-changed-files/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/npm/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", "dev": true, + "inBundle": true, + "license": "MIT", "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-changed-files/node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "node_modules/npm/node_modules/is-lambda": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/jackspeak": { + "version": "3.4.3", "dev": true, + "inBundle": true, + "license": "BlueOak-1.0.0", "dependencies": { - "path-key": "^3.0.0" + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/npm/node_modules/jsbn": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/json-parse-even-better-errors": { + "version": "3.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/jest-config": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", - "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", + "node_modules/npm/node_modules/json-stringify-nice": { + "version": "1.1.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/jsonparse": { + "version": "1.3.1", + "dev": true, + "engines": [ + "node >= 0.2.0" + ], + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/just-diff": { + "version": "6.0.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/just-diff-apply": { + "version": "5.5.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/libnpmaccess": { + "version": "8.0.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.3", - "@jest/types": "^26.6.2", - "babel-jest": "^26.6.3", - "chalk": "^4.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.2", - "jest-environment-node": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.3", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2" + "npm-package-arg": "^11.0.2", + "npm-registry-fetch": "^17.0.1" }, "engines": { - "node": ">= 10.14.2" - }, - "peerDependencies": { - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "ts-node": { - "optional": true - } + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "node_modules/npm/node_modules/libnpmdiff": { + "version": "6.1.4", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "@npmcli/arborist": "^7.5.4", + "@npmcli/installed-package-contents": "^2.1.0", + "binary-extensions": "^2.3.0", + "diff": "^5.1.0", + "minimatch": "^9.0.4", + "npm-package-arg": "^11.0.2", + "pacote": "^18.0.6", + "tar": "^6.2.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-docblock": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", - "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", + "node_modules/npm/node_modules/libnpmexec": { + "version": "8.1.4", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "detect-newline": "^3.0.0" + "@npmcli/arborist": "^7.5.4", + "@npmcli/run-script": "^8.1.0", + "ci-info": "^4.0.0", + "npm-package-arg": "^11.0.2", + "pacote": "^18.0.6", + "proc-log": "^4.2.0", + "read": "^3.0.1", + "read-package-json-fast": "^3.0.2", + "semver": "^7.3.7", + "walk-up-path": "^3.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-each": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", - "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", + "node_modules/npm/node_modules/libnpmfund": { + "version": "5.0.12", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2" + "@npmcli/arborist": "^7.5.4" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-environment-jsdom": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", - "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", + "node_modules/npm/node_modules/libnpmhook": { + "version": "10.0.5", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2", - "jsdom": "^16.4.0" + "aproba": "^2.0.0", + "npm-registry-fetch": "^17.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-environment-node": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", - "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", + "node_modules/npm/node_modules/libnpmorg": { + "version": "6.0.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" + "aproba": "^2.0.0", + "npm-registry-fetch": "^17.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-get-type": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", - "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", + "node_modules/npm/node_modules/libnpmpack": { + "version": "7.0.4", "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/arborist": "^7.5.4", + "@npmcli/run-script": "^8.1.0", + "npm-package-arg": "^11.0.2", + "pacote": "^18.0.6" + }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-haste-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", - "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", + "node_modules/npm/node_modules/libnpmpublish": { + "version": "9.0.9", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/types": "^26.6.2", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "micromatch": "^4.0.2", - "sane": "^4.0.3", - "walker": "^1.0.7" + "ci-info": "^4.0.0", + "normalize-package-data": "^6.0.1", + "npm-package-arg": "^11.0.2", + "npm-registry-fetch": "^17.0.1", + "proc-log": "^4.2.0", + "semver": "^7.3.7", + "sigstore": "^2.2.0", + "ssri": "^10.0.6" }, "engines": { - "node": ">= 10.14.2" - }, - "optionalDependencies": { - "fsevents": "^2.1.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-jasmine2": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", - "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", + "node_modules/npm/node_modules/libnpmsearch": { + "version": "7.0.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^26.6.2", - "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2", - "throat": "^5.0.0" + "npm-registry-fetch": "^17.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-leak-detector": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", - "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", + "node_modules/npm/node_modules/libnpmteam": { + "version": "6.0.5", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "aproba": "^2.0.0", + "npm-registry-fetch": "^17.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-matcher-utils": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", - "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "node_modules/npm/node_modules/libnpmversion": { + "version": "6.0.3", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "@npmcli/git": "^5.0.7", + "@npmcli/run-script": "^8.1.0", + "json-parse-even-better-errors": "^3.0.2", + "proc-log": "^4.2.0", + "semver": "^7.3.7" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-message-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", - "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "node_modules/npm/node_modules/lru-cache": { + "version": "10.4.3", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/make-fetch-happen": { + "version": "13.0.1", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2", - "slash": "^3.0.0", - "stack-utils": "^2.0.2" + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest-mock": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", - "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "node_modules/npm/node_modules/minimatch": { + "version": "9.0.5", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">= 10.14.2" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "node_modules/npm/node_modules/minipass": { + "version": "7.1.2", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" - }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } + "node": ">=16 || 14 >=14.17" } }, - "node_modules/jest-regex-util": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", - "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", + "node_modules/npm/node_modules/minipass-collect": { + "version": "2.0.1", "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, "engines": { - "node": ">= 10.14.2" + "node": ">=16 || 14 >=14.17" } }, - "node_modules/jest-resolve": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", - "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", + "node_modules/npm/node_modules/minipass-fetch": { + "version": "3.0.5", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.2", - "read-pkg-up": "^7.0.1", - "resolve": "^1.18.1", - "slash": "^3.0.0" + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" } }, - "node_modules/jest-resolve-dependencies": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", - "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", + "node_modules/npm/node_modules/minipass-flush": { + "version": "1.0.5", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/types": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.2" + "minipass": "^3.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">= 8" } }, - "node_modules/jest-runner": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", - "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", + "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.7.1", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.2", - "jest-leak-detector": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "source-map-support": "^0.5.6", - "throat": "^5.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-runtime": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", - "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", - "dev": true, - "dependencies": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/globals": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0", - "cjs-module-lexer": "^0.6.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "slash": "^3.0.0", - "strip-bom": "^4.0.0", - "yargs": "^15.4.1" - }, - "bin": { - "jest-runtime": "bin/jest-runtime.js" + "node_modules/npm/node_modules/minipass-pipeline": { + "version": "1.2.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-runtime/node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { "node": ">=8" } }, - "node_modules/jest-serializer": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", - "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", + "node_modules/npm/node_modules/minipass-sized": { + "version": "1.0.3", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@types/node": "*", - "graceful-fs": "^4.2.4" + "minipass": "^3.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-snapshot": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", - "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", + "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@babel/types": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.0.0", - "chalk": "^4.0.0", - "expect": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "natural-compare": "^1.4.0", - "pretty-format": "^26.6.2", - "semver": "^7.3.2" + "yallist": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", - "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", + "node_modules/npm/node_modules/minizlib": { + "version": "2.1.2", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "micromatch": "^4.0.2" + "minipass": "^3.0.0", + "yallist": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">= 8" } }, - "node_modules/jest-validate": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", - "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", + "node_modules/npm/node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/types": "^26.6.2", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "leven": "^3.1.0", - "pretty-format": "^26.6.2" + "yallist": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "node_modules/npm/node_modules/mkdirp": { + "version": "1.0.4", "dev": true, + "inBundle": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-watcher": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", - "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", + "node_modules/npm/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/mute-stream": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/negotiator": { + "version": "0.6.3", "dev": true, - "dependencies": { - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "jest-util": "^26.6.2", - "string-length": "^4.0.1" - }, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">= 10.14.2" + "node": ">= 0.6" } }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "node_modules/npm/node_modules/node-gyp": { + "version": "10.2.0", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^4.1.0", + "semver": "^7.3.5", + "tar": "^6.2.1", + "which": "^4.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": ">= 10.13.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jest/node_modules/jest-cli": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", - "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", + "node_modules/npm/node_modules/nopt": { + "version": "7.2.1", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "@jest/core": "^26.6.3", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "import-local": "^3.0.2", - "is-ci": "^2.0.0", - "jest-config": "^26.6.3", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "prompts": "^2.0.1", - "yargs": "^15.4.1" + "abbrev": "^2.0.0" }, "bin": { - "jest": "bin/jest.js" + "nopt": "bin/nopt.js" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "node_modules/npm/node_modules/normalize-package-data": { + "version": "6.0.2", "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "hosted-git-info": "^7.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, - "node_modules/jsdom": { - "version": "16.7.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", - "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", - "dev": true, - "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", - "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.6", - "xml-name-validator": "^3.0.0" - }, + "node_modules/npm/node_modules/npm-audit-report": { + "version": "5.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=10" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/jsdom/node_modules/form-data": { + "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": ">= 6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/jsdom/node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "node_modules/npm/node_modules/npm-install-checks": { + "version": "6.3.0", "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" + "semver": "^7.1.1" }, "engines": { - "node": ">=6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/jsdom/node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "node_modules/npm/node_modules/npm-normalize-package-bin": { + "version": "3.0.1", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/npm/node_modules/npm-package-arg": { + "version": "11.0.3", "dev": true, - "bin": { - "jsesc": "bin/jsesc" + "inBundle": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^7.0.0", + "proc-log": "^4.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": ">=4" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==", - "dev": true - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, - "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "node_modules/npm/node_modules/npm-packlist": { + "version": "8.0.2", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "minimist": "^1.2.0" + "ignore-walk": "^6.0.4" }, - "bin": { - "json5": "lib/cli.js" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "node_modules/npm/node_modules/npm-pick-manifest": { + "version": "9.1.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^11.0.0", + "semver": "^7.3.5" }, "engines": { - "node": ">=0.6.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/jsx-ast-utils": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", - "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "node_modules/npm/node_modules/npm-profile": { + "version": "10.0.0", "dev": true, - "peer": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "object.assign": "^4.1.4", - "object.values": "^1.1.6" + "npm-registry-fetch": "^17.0.1", + "proc-log": "^4.0.0" }, "engines": { - "node": ">=4.0" + "node": ">=18.0.0" } }, - "node_modules/keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "node_modules/npm/node_modules/npm-registry-fetch": { + "version": "17.1.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "json-buffer": "3.0.0" + "@npmcli/redact": "^2.0.0", + "jsonparse": "^1.3.1", + "make-fetch-happen": "^13.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minizlib": "^2.1.2", + "npm-package-arg": "^11.0.0", + "proc-log": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "node_modules/npm/node_modules/npm-user-validate": { + "version": "2.0.1", "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", "engines": { - "node": ">=0.10.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "node_modules/npm/node_modules/p-map": { + "version": "4.0.0", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/language-subtag-registry": { - "version": "0.3.23", - "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", - "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==", - "dev": true, - "peer": true - }, - "node_modules/language-tags": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", - "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", + "node_modules/npm/node_modules/package-json-from-dist": { + "version": "1.0.0", "dev": true, - "peer": true, - "dependencies": { - "language-subtag-registry": "^0.3.20" + "inBundle": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/npm/node_modules/pacote": { + "version": "18.0.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^5.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/package-json": "^5.1.0", + "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/run-script": "^8.0.0", + "cacache": "^18.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^11.0.0", + "npm-packlist": "^8.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^17.0.0", + "proc-log": "^4.0.0", + "promise-retry": "^2.0.1", + "sigstore": "^2.2.0", + "ssri": "^10.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "bin/index.js" }, "engines": { - "node": ">=0.10" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "node_modules/npm/node_modules/parse-conflict-json": { + "version": "3.0.1", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "package-json": "^6.3.0" + "json-parse-even-better-errors": "^3.0.0", + "just-diff": "^6.0.0", + "just-diff-apply": "^5.2.0" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lcov-parse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", - "integrity": "sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==", + "node_modules/npm/node_modules/path-key": { + "version": "3.1.1", "dev": true, - "bin": { - "lcov-parse": "bin/cli.js" + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, - "node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "node_modules/npm/node_modules/path-scurry": { + "version": "1.11.1", "dev": true, + "inBundle": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, "engines": { - "node": ">=6" + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "node_modules/npm/node_modules/postcss-selector-parser": { + "version": "6.1.2", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" }, "engines": { - "node": ">= 0.8.0" + "node": ">=4" } }, - "node_modules/libsodium-sumo": { - "version": "0.7.13", - "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz", - "integrity": "sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==" + "node_modules/npm/node_modules/proc-log": { + "version": "4.2.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, - "node_modules/libsodium-wrappers-sumo": { - "version": "0.7.13", - "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz", - "integrity": "sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==", - "dependencies": { - "libsodium-sumo": "^0.7.13" + "node_modules/npm/node_modules/proggy": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true + "node_modules/npm/node_modules/promise-all-reject-late": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, - "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "node_modules/npm/node_modules/promise-call-limit": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/promise-inflight": { + "version": "1.0.1", "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/promise-retry": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, "engines": { - "node": ">=6.11.5" + "node": ">=10" } }, - "node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "node_modules/npm/node_modules/promzard": { + "version": "1.0.2", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "read": "^3.0.1" }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true + "node_modules/npm/node_modules/qrcode-terminal": { + "version": "0.12.0", + "dev": true, + "inBundle": true, + "bin": { + "qrcode-terminal": "bin/qrcode-terminal.js" + } }, - "node_modules/log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", + "node_modules/npm/node_modules/read": { + "version": "3.0.1", "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "mute-stream": "^1.0.0" + }, "engines": { - "node": ">=0.8.6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/long": { + "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "node_modules/npm/node_modules/read-package-json-fast": { + "version": "3.0.2", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" }, - "bin": { - "loose-envify": "cli.js" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "node_modules/npm/node_modules/retry": { + "version": "0.12.0", "dev": true, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 4" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/npm/node_modules/safer-buffer": { + "version": "2.1.2", "dev": true, - "dependencies": { - "yallist": "^4.0.0" + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/npm/node_modules/semver": { + "version": "7.6.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" }, "engines": { "node": ">=10" } }, - "node_modules/lru-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==", + "node_modules/npm/node_modules/shebang-command": { + "version": "2.0.0", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "es5-ext": "~0.10.2" + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "node_modules/npm/node_modules/shebang-regex": { + "version": "3.0.0", "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, + "inBundle": true, + "license": "MIT", "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/npm/node_modules/signal-exit": { + "version": "4.1.0", "dev": true, - "bin": { - "semver": "bin/semver.js" + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "node_modules/npm/node_modules/sigstore": { + "version": "2.3.1", "dev": true, + "inBundle": true, + "license": "Apache-2.0", "dependencies": { - "tmpl": "1.0.5" + "@sigstore/bundle": "^2.3.2", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.2", + "@sigstore/sign": "^2.3.2", + "@sigstore/tuf": "^2.3.4", + "@sigstore/verify": "^1.2.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", + "node_modules/npm/node_modules/smart-buffer": { + "version": "4.2.0", "dev": true, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 6.0.0", + "npm": ">= 3.0.0" } }, - "node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", + "node_modules/npm/node_modules/socks": { + "version": "2.8.3", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "object-visit": "^1.0.0" + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 10.0.0", + "npm": ">= 3.0.0" } }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "node_modules/npm/node_modules/socks-proxy-agent": { + "version": "8.0.4", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" } }, - "node_modules/memoizee": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", - "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", + "node_modules/npm/node_modules/spdx-correct": { + "version": "3.2.0", "dev": true, + "inBundle": true, + "license": "Apache-2.0", "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.53", - "es6-weak-map": "^2.0.3", - "event-emitter": "^0.3.5", - "is-promise": "^2.2.2", - "lru-queue": "^0.1.0", - "next-tick": "^1.1.0", - "timers-ext": "^0.1.7" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { + "version": "3.0.1", "dev": true, - "engines": { - "node": ">= 8" + "inBundle": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "node_modules/npm/node_modules/spdx-exceptions": { + "version": "2.5.0", "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } + "inBundle": true, + "license": "CC-BY-3.0" }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "node_modules/npm/node_modules/spdx-expression-parse": { + "version": "4.0.0", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true + "node_modules/npm/node_modules/spdx-license-ids": { + "version": "3.0.18", + "dev": true, + "inBundle": true, + "license": "CC0-1.0" }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } + "node_modules/npm/node_modules/sprintf-js": { + "version": "1.1.3", + "dev": true, + "inBundle": true, + "license": "BSD-3-Clause" }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "node_modules/npm/node_modules/ssri": { + "version": "10.0.6", + "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "mime-db": "1.52.0" + "minipass": "^7.0.3" }, "engines": { - "node": ">= 0.6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "node_modules/npm/node_modules/string-width": { + "version": "4.2.3", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "node_modules/npm/node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/npm/node_modules/strip-ansi": { + "version": "6.0.1", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "brace-expansion": "^1.1.7" + "ansi-regex": "^5.0.1" }, "engines": { - "node": "*" + "node": ">=8" } }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "node_modules/npm/node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { "node": ">=8" } }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "node_modules/npm/node_modules/supports-color": { + "version": "9.4.0", "dev": true, - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, + "inBundle": true, + "license": "MIT", "engines": { - "node": ">= 8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "node_modules/npm/node_modules/tar": { + "version": "6.2.1", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" + "minipass": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, - "node_modules/mixin-deep/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "is-plain-object": "^2.0.4" + "yallist": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "node_modules/npm/node_modules/tar/node_modules/minipass": { + "version": "5.0.0", "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/npm/node_modules/text-table": { + "version": "0.2.0", + "dev": true, + "inBundle": true, + "license": "MIT" }, - "node_modules/mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", - "dev": true + "node_modules/npm/node_modules/tiny-relative-date": { + "version": "1.3.0", + "dev": true, + "inBundle": true, + "license": "MIT" }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "node_modules/npm/node_modules/treeverse": { + "version": "3.0.0", "dev": true, - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "node_modules/npm/node_modules/tuf-js": { + "version": "2.2.1", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "@tufjs/models": "2.0.1", + "debug": "^4.3.4", + "make-fetch-happen": "^13.0.1" }, "engines": { - "node": ">=0.10.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true - }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "node_modules/npm/node_modules/unique-filename": { + "version": "3.0.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "whatwg-url": "^5.0.0" + "unique-slug": "^4.0.0" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "node_modules/npm/node_modules/unique-slug": { + "version": "4.0.0", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true - }, - "node_modules/node-notifier": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.2.tgz", - "integrity": "sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg==", + "node_modules/npm/node_modules/util-deprecate": { + "version": "1.0.2", "dev": true, - "optional": true, - "dependencies": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" - } + "inBundle": true, + "license": "MIT" }, - "node_modules/node-notifier/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "node_modules/npm/node_modules/validate-npm-package-license": { + "version": "3.0.4", "dev": true, - "optional": true, - "bin": { - "uuid": "dist/bin/uuid" + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, - "node_modules/node-polyfill-webpack-plugin": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz", - "integrity": "sha512-ZUMiCnZkP1LF0Th2caY6J/eKKoA0TefpoVa68m/LQU1I/mE8rGt4fNYGgNuCcK+aG8P8P43nbeJ2RqJMOL/Y1A==", + "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { + "version": "3.0.1", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "assert": "^2.0.0", - "browserify-zlib": "^0.2.0", - "buffer": "^6.0.3", - "console-browserify": "^1.2.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.12.0", - "domain-browser": "^4.22.0", - "events": "^3.3.0", - "filter-obj": "^2.0.2", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "^1.0.1", - "process": "^0.11.10", - "punycode": "^2.1.1", - "querystring-es3": "^0.2.1", - "readable-stream": "^4.0.0", - "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0", - "string_decoder": "^1.3.0", - "timers-browserify": "^2.0.12", - "tty-browserify": "^0.0.1", - "type-fest": "^2.14.0", - "url": "^0.11.0", - "util": "^0.12.4", - "vm-browserify": "^1.1.2" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "webpack": ">=5" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/node-polyfill-webpack-plugin/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "node_modules/npm/node_modules/validate-npm-package-name": { + "version": "5.0.1", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/node-polyfill-webpack-plugin/node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "node_modules/npm/node_modules/walk-up-path": { + "version": "3.0.1", "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, - "node_modules/node-releases": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", - "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", - "dev": true + "inBundle": true, + "license": "ISC" }, - "node_modules/nodemon": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.16.tgz", - "integrity": "sha512-zsrcaOfTWRuUzBn3P44RDliLlp263Z/76FPoHFr3cFFkOz0lTPAcIw8dCzfdVIx/t3AtDYCZRCDkoCojJqaG3w==", + "node_modules/npm/node_modules/which": { + "version": "4.0.0", "dev": true, - "hasInstallScript": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "chokidar": "^3.5.2", - "debug": "^3.2.7", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.0.4", - "pstree.remy": "^1.1.8", - "semver": "^5.7.1", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5", - "update-notifier": "^5.1.0" + "isexe": "^3.1.1" }, "bin": { - "nodemon": "bin/nodemon.js" + "node-which": "bin/which.js" }, "engines": { - "node": ">=8.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } - }, - "node_modules/nodemon/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" + "node": "^16.13.0 || >=18.0.0" } }, - "node_modules/nodemon/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/npm/node_modules/which/node_modules/isexe": { + "version": "3.1.1", "dev": true, + "inBundle": true, + "license": "ISC", "engines": { - "node": ">=4" + "node": ">=16" } }, - "node_modules/nodemon/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/npm/node_modules/wrap-ansi": { + "version": "8.1.0", "dev": true, - "bin": { - "semver": "bin/semver" + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/nodemon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/npm/node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", "dev": true, + "inBundle": true, + "license": "MIT", "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" + "color-convert": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "9.2.2", "dev": true, - "bin": { - "semver": "bin/semver" - } + "inBundle": true, + "license": "MIT" }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", + "node_modules/npm/node_modules/write-file-atomic": { + "version": "5.0.1", "dev": true, + "inBundle": true, + "license": "ISC", "dependencies": { - "path-key": "^2.0.0" + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "node_modules/npm/node_modules/yallist": { + "version": "4.0.0", "dev": true, - "engines": { - "node": ">=4" - } + "inBundle": true, + "license": "ISC" }, "node_modules/npmlog": { "version": "5.0.1", @@ -13276,12 +14169,6 @@ "set-blocking": "^2.0.0" } }, - "node_modules/nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -13300,44 +14187,6 @@ "node": ">=0.10.0" } }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -13371,18 +14220,6 @@ "node": ">= 0.4" } }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object.assign": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", @@ -13452,18 +14289,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object.values": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", @@ -13528,43 +14353,40 @@ "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", "dev": true }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "node_modules/p-each-series": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", "dev": true, "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "node_modules/p-filter": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-4.1.0.tgz", + "integrity": "sha512-37/tPdZ3oJwHaS3gNJdenCDB3Tz26i9sjhnguBtvN0vYlRIiDNnvTWkuh+0hETV9rLPdJ3rlL3yVOYPIAnM8rw==", "dev": true, + "dependencies": { + "p-map": "^7.0.1" + }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "node_modules/p-is-promise": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/p-limit": { @@ -13591,6 +14413,18 @@ "node": ">=4" } }, + "node_modules/p-map": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz", + "integrity": "sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", @@ -13600,30 +14434,6 @@ "node": ">=4" } }, - "node_modules/package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "dependencies": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/package-json/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -13643,16 +14453,33 @@ } }, "node_modules/parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", "dev": true, "dependencies": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse-asn1/node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": ">=4" } }, "node_modules/parse-json": { @@ -13673,27 +14500,39 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse-package-name": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-package-name/-/parse-package-name-1.0.0.tgz", - "integrity": "sha512-kBeTUtcj+SkyfaW4+KBe0HtsloBJ/mKTPoxpVdA57GZiPerREsUWJOhVj9anXweFiJkm5y8FG1sxFZkZ0SN6wg==", - "dev": true + "node_modules/parse-ms": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", + "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", "dev": true }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "parse5": "^6.0.1" } }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -13765,9 +14604,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", "dev": true }, "node_modules/picomatch": { @@ -13782,6 +14621,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/pirates": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", @@ -13791,6 +14639,19 @@ "node": ">= 6" } }, + "node_modules/pkg-conf": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", + "dev": true, + "dependencies": { + "find-up": "^2.0.0", + "load-json-file": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -13873,15 +14734,6 @@ "node": ">=8" } }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -13900,15 +14752,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/prettier": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", @@ -13925,18 +14768,45 @@ } }, "node_modules/pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", + "integrity": "sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" + "@jest/schemas": "^28.1.3", + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" }, "engines": { - "node": ">= 10" + "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/pretty-ms": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.1.0.tgz", + "integrity": "sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==", + "dev": true, + "dependencies": { + "parse-ms": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/private": { @@ -13957,6 +14827,12 @@ "node": ">= 0.6.0" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -13998,6 +14874,12 @@ "dev": true, "peer": true }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, "node_modules/protobufjs": { "version": "6.11.4", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", @@ -14060,16 +14942,6 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "dev": true }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -14079,18 +14951,6 @@ "node": ">=6" } }, - "node_modules/pupa": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", - "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", - "dev": true, - "dependencies": { - "escape-goat": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/qs": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", @@ -14182,136 +15042,106 @@ "node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, - "node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/read-package-up": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-11.0.0.tgz", + "integrity": "sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==", "dev": true, "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "find-up-simple": "^1.0.0", + "read-pkg": "^9.0.0", + "type-fest": "^4.6.0" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/read-package-up/node_modules/type-fest": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" + "node": ">=16" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/read-pkg": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "@types/normalize-package-data": "^2.4.3", + "normalize-package-data": "^6.0.0", + "parse-json": "^8.0.0", + "type-fest": "^4.6.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/read-pkg/node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/read-pkg-up/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "node_modules/read-pkg/node_modules/parse-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "index-to-position": "^0.1.2", + "type-fest": "^4.7.1" + }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/readable-stream": { @@ -14346,18 +15176,6 @@ "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==" }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dev": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/reflect.getprototypeof": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", @@ -14386,45 +15204,11 @@ "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", "dev": true }, - "node_modules/regenerate-unicode-properties": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", - "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, - "node_modules/regenerator-transform": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz", - "integrity": "sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -14455,96 +15239,16 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/regexpu-core": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.2.1.tgz", - "integrity": "sha512-HrnlNtpvqP1Xkb28tMhBUO2EbyUHdQlsnlAhzWcwHy8WJR53UWr7/MAvqrsQKMbV4qdpv03oTMG8iIhfsPFktQ==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.1.0", - "regjsgen": "^0.7.1", - "regjsparser": "^0.9.1", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/registry-auth-token": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", - "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", - "dev": true, - "dependencies": { - "rc": "^1.2.8" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", "dev": true, "dependencies": { - "rc": "^1.2.8" + "@pnpm/npm-conf": "^2.1.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/regjsgen": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.7.1.tgz", - "integrity": "sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA==", - "dev": true - }, - "node_modules/regjsparser": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", - "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "engines": { - "node": ">=0.10" + "node": ">=14" } }, "node_modules/request": { @@ -14582,7 +15286,7 @@ "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -14597,12 +15301,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "node_modules/resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -14650,63 +15348,13 @@ "node": ">=4" } }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true - }, - "node_modules/responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", - "dev": true, - "dependencies": { - "lowercase-keys": "^1.0.0" - } - }, - "node_modules/restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", - "dev": true, - "dependencies": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/restore-cursor/node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/restore-cursor/node_modules/onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "node_modules/resolve.exports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz", + "integrity": "sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ==", "dev": true, "engines": { - "node": ">=0.12" + "node": ">=10" } }, "node_modules/reusify": { @@ -14744,24 +15392,6 @@ "inherits": "^2.0.1" } }, - "node_modules/rsvp": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", - "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", - "dev": true, - "engines": { - "node": "6.* || >= 7.*" - } - }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -14785,33 +15415,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA==", - "dev": true - }, - "node_modules/rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha512-3xPNZGW93oCjiO7PtKxRK6iOVYBWBvtf9QHDfU23Oc+dLIQmAV//UnyXV/yihv81VS/UqoQPk4NegS8EFi55Hg==", - "dev": true, - "dependencies": { - "rx-lite": "*" - } - }, - "node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, "node_modules/safe-array-concat": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", @@ -14856,15 +15459,6 @@ } ] }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, "node_modules/safe-regex-test": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", @@ -14888,211 +15482,308 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, - "node_modules/sane": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", - "deprecated": "some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added", + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semantic-release": { + "version": "24.1.1", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.1.1.tgz", + "integrity": "sha512-4Ax2GxD411jUe9IdhOjMLuN+6wAj+aKjvOGngByrpD/iKL+UKN/2puQglhyI4gxNyy9XzEBMzBwbqpnEwbXGEg==", + "dev": true, + "dependencies": { + "@semantic-release/commit-analyzer": "^13.0.0-beta.1", + "@semantic-release/error": "^4.0.0", + "@semantic-release/github": "^10.0.0", + "@semantic-release/npm": "^12.0.0", + "@semantic-release/release-notes-generator": "^14.0.0-beta.1", + "aggregate-error": "^5.0.0", + "cosmiconfig": "^9.0.0", + "debug": "^4.0.0", + "env-ci": "^11.0.0", + "execa": "^9.0.0", + "figures": "^6.0.0", + "find-versions": "^6.0.0", + "get-stream": "^6.0.0", + "git-log-parser": "^1.2.0", + "hook-std": "^3.0.0", + "hosted-git-info": "^8.0.0", + "import-from-esm": "^1.3.1", + "lodash-es": "^4.17.21", + "marked": "^12.0.0", + "marked-terminal": "^7.0.0", + "micromatch": "^4.0.2", + "p-each-series": "^3.0.0", + "p-reduce": "^3.0.0", + "read-package-up": "^11.0.0", + "resolve-from": "^5.0.0", + "semver": "^7.3.2", + "semver-diff": "^4.0.0", + "signale": "^1.2.1", + "yargs": "^17.5.1" + }, + "bin": { + "semantic-release": "bin/semantic-release.js" + }, + "engines": { + "node": ">=20.8.1" + } + }, + "node_modules/semantic-release/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/semantic-release/node_modules/@sindresorhus/merge-streams": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", + "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/aggregate-error": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", + "dev": true, + "dependencies": { + "clean-stack": "^5.2.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/clean-stack": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "dev": true, "dependencies": { - "@cnakazawa/watch": "^1.0.3", - "anymatch": "^2.0.0", - "capture-exit": "^2.0.0", - "exec-sh": "^0.3.2", - "execa": "^1.0.0", - "fb-watchman": "^2.0.0", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5" - }, - "bin": { - "sane": "src/cli.js" + "escape-string-regexp": "5.0.0" }, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sane/node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "node_modules/semantic-release/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sane/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "node_modules/semantic-release/node_modules/execa": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-9.4.0.tgz", + "integrity": "sha512-yKHlle2YGxZE842MERVIplWwNH5VYmqqcPFgtnlU//K8gxuFFXu0pwd/CrfXTumFpeEiufsP7+opT/bPJa1yVw==", "dev": true, "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" + "@sindresorhus/merge-streams": "^4.0.0", + "cross-spawn": "^7.0.3", + "figures": "^6.1.0", + "get-stream": "^9.0.0", + "human-signals": "^8.0.0", + "is-plain-obj": "^4.1.0", + "is-stream": "^4.0.1", + "npm-run-path": "^6.0.0", + "pretty-ms": "^9.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^4.0.0", + "yoctocolors": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "^18.19.0 || >=20.5.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/sane/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/semantic-release/node_modules/execa/node_modules/get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sane/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "node_modules/semantic-release/node_modules/hosted-git-info": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.0.0.tgz", + "integrity": "sha512-4nw3vOVR+vHUOT8+U4giwe2tcGv+R3pwwRidUe67DoMBTjhrfr6rZYJVVwdkBE+Um050SG+X9tf0Jo4fOpn01w==", "dev": true, "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "lru-cache": "^10.0.1" }, "engines": { - "node": ">=0.10.0" + "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/sane/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/semantic-release/node_modules/human-signals": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz", + "integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=18.18.0" } }, - "node_modules/sane/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "node_modules/semantic-release/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sane/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/semantic-release/node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, "engines": { - "node": ">=0.10.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sane/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "node_modules/semantic-release/node_modules/npm-run-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", + "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", "dev": true, "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "path-key": "^4.0.0", + "unicorn-magic": "^0.3.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sane/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "node_modules/semantic-release/node_modules/p-reduce": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sane/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "node_modules/semantic-release/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "node_modules/semantic-release/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "dependencies": { - "xmlchars": "^2.2.0" - }, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/schema-utils": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.2.tgz", - "integrity": "sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg==", + "node_modules/semantic-release/node_modules/strip-final-newline": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", + "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" + "engines": { + "node": ">=18" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", + "dev": true, "engines": { - "node": ">= 10.13.0" + "node": ">=18" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -15101,30 +15792,36 @@ } }, "node_modules/semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, "dependencies": { - "semver": "^6.3.0" + "semver": "^7.3.5" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/semver-regex": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -15168,33 +15865,6 @@ "node": ">= 0.4" } }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -15247,30 +15917,6 @@ "node": ">=8" } }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true, - "optional": true - }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", @@ -15295,193 +15941,166 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "node_modules/signale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", + "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "chalk": "^2.3.2", + "figures": "^2.0.0", + "pkg-conf": "^2.1.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" + "node": ">=6" } }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "node_modules/signale/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" + "color-convert": "^1.9.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "node_modules/signale/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "node_modules/signale/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "color-name": "1.1.3" } }, - "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "deprecated": "Please upgrade to v1.0.1", + "node_modules/signale/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/signale/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=0.8.0" } }, - "node_modules/snapdragon-node/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "deprecated": "Please upgrade to v1.0.1", + "node_modules/signale/node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", "dev": true, "dependencies": { - "kind-of": "^6.0.0" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/snapdragon-node/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "node_modules/signale/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "node_modules/signale/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "kind-of": "^3.2.0" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "semver": "~7.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8.10.0" } }, - "node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", "dev": true, - "dependencies": { - "ms": "2.0.0" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/skin-tone": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "unicode-emoji-modifier-base": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/snapdragon/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/snapdragon/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/source-map": { @@ -15493,41 +16112,26 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, - "node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "deprecated": "See https://github.com/lydell/source-map-url#deprecated", + "node_modules/spawn-error-forwarder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", + "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", "dev": true }, "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0", @@ -15535,9 +16139,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true }, "node_modules/spdx-expression-parse": { @@ -15551,21 +16155,18 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", "dev": true }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">= 10.x" } }, "node_modules/sprintf-js": { @@ -15600,9 +16201,9 @@ } }, "node_modules/stack-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", - "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, "dependencies": { "escape-string-regexp": "^2.0.0" @@ -15620,31 +16221,6 @@ "node": ">=8" } }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/stream-browserify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", @@ -15669,6 +16245,46 @@ "node": ">= 6" } }, + "node_modules/stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", + "dev": true, + "dependencies": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, + "node_modules/stream-combiner2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/stream-combiner2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/stream-combiner2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/stream-http": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", @@ -15828,15 +16444,6 @@ "node": ">=4" } }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -15858,6 +16465,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/super-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-1.0.0.tgz", + "integrity": "sha512-CY8u7DtbvucKuquCmOFEKhr9Besln7n9uN8eFbwcoGYWXOMW07u2o8njWaiXt11ylS3qoGF55pILjRmPlbodyg==", + "dev": true, + "dependencies": { + "function-timeout": "^1.0.1", + "time-span": "^5.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -15871,9 +16494,9 @@ } }, "node_modules/supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", "dev": true, "dependencies": { "has-flag": "^4.0.0", @@ -15903,12 +16526,6 @@ "node": ">=0.10" } }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, "node_modules/table": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", @@ -15957,9 +16574,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "dependencies": { "chownr": "^2.0.0", @@ -15973,6 +16590,57 @@ "node": ">=10" } }, + "node_modules/temp-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/tempy": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", + "dev": true, + "dependencies": { + "is-stream": "^3.0.0", + "temp-dir": "^3.0.0", + "type-fest": "^2.12.2", + "unique-string": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tempy/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tempy/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -15990,13 +16658,13 @@ } }, "node_modules/terser": { - "version": "5.17.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.3.tgz", - "integrity": "sha512-AudpAZKmZHkG9jueayypz4duuCFJMMNGRMwaPvQKWfxKedh8Z2x3OCoDqIIi1xx5+iwx1u6Au8XQcc9Lke65Yg==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -16008,16 +16676,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.8.tgz", - "integrity": "sha512-WiHL3ElchZMsK27P8uIUh4604IgJyAW47LVXGbEoB21DbQcZ+OuMpGjVYnEUaqcWM6dO8uS2qUbA7LSCWqvsbg==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -16070,6 +16738,16 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/terser/node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -16084,6 +16762,18 @@ "node": ">=8" } }, + "node_modules/text-extensions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -16111,113 +16801,98 @@ "node": ">=0.8" } }, - "node_modules/throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, - "node_modules/timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "dependencies": { - "setimmediate": "^1.0.4" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/timers-ext": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", - "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "dependencies": { - "es5-ext": "~0.10.46", - "next-tick": "1" + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "safe-buffer": "~5.1.0" } }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "node_modules/time-span": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", + "integrity": "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "convert-hrtime": "^5.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "setimmediate": "^1.0.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.6.0" } }, - "node_modules/to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true, - "engines": { - "node": ">=6" - } + "node_modules/tinyexec": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.0.tgz", + "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==", + "dev": true }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/to-regex-range": { @@ -16257,16 +16932,16 @@ "node": ">=0.8" } }, - "node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "node_modules/traverse": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", + "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", "dev": true, - "dependencies": { - "punycode": "^2.1.1" - }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/ts-loader": { @@ -16436,13 +17111,7 @@ "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, "node_modules/type-check": { @@ -16551,19 +17220,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/typescript": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz", - "integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -16573,6 +17233,19 @@ "node": ">=4.2.0" } }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -16594,134 +17267,61 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, - "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", - "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", - "dev": true, - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^2.0.0", - "unicode-property-aliases-ecmascript": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-value-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", - "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", + "node_modules/unicode-emoji-modifier-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", "dev": true, "engines": { "node": ">=4" } }, - "node_modules/unicode-property-aliases-ecmascript": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", - "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", "dev": true, "engines": { - "node": ">=4" - } - }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" + "node": ">=18" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, - "dependencies": { - "crypto-random-string": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", "dev": true, "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" + "crypto-random-string": "^4.0.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" + "node": ">=12" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "node_modules/universal-user-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.2.tgz", + "integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==", + "dev": true }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 10.0.0" } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "funding": [ { @@ -16731,47 +17331,23 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" } }, - "node_modules/update-notifier": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", - "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", - "dev": true, - "dependencies": { - "boxen": "^5.0.0", - "chalk": "^4.1.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.4.0", - "is-npm": "^5.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.1.0", - "pupa": "^2.1.1", - "semver": "^7.3.4", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -16781,13 +17357,6 @@ "punycode": "^2.1.0" } }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, "node_modules/url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -16798,16 +17367,13 @@ "querystring": "0.2.0" } }, - "node_modules/url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "node_modules/url-join": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", "dev": true, - "dependencies": { - "prepend-http": "^2.0.0" - }, "engines": { - "node": ">=4" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/url/node_modules/punycode": { @@ -16816,22 +17382,17 @@ "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", "dev": true }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", "dev": true, "dependencies": { - "inherits": "2.0.3" + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" } }, "node_modules/util-deprecate": { @@ -16840,298 +17401,85 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, - "node_modules/util/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true - }, "node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/v8-to-istanbul": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", - "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/v8-to-istanbul/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "node_modules/w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "deprecated": "Use your platform's native performance.now() and performance.timeOrigin.", - "dev": true, - "dependencies": { - "browser-process-hrtime": "^1.0.0" - } - }, - "node_modules/w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, - "dependencies": { - "xml-name-validator": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "dependencies": { - "makeerror": "1.0.12" - } - }, - "node_modules/wasm-ast-types": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.15.0.tgz", - "integrity": "sha512-A3wgW3mlqK3irUjHqMkA26ADFA1z55LgQKl+KXRf1ylN5DValI3t/R9Sv3grSa7vpCAeG6E+XWCd7pGRNDsylw==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.18.9", - "@babel/types": "7.18.10", - "@jest/transform": "28.1.3", - "ast-stringify": "0.1.0", - "case": "1.6.3", - "deepmerge": "4.2.2" - } - }, - "node_modules/wasm-ast-types/node_modules/@babel/types": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.10.tgz", - "integrity": "sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/wasm-ast-types/node_modules/@jest/transform": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-28.1.3.tgz", - "integrity": "sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^28.1.3", - "@jridgewell/trace-mapping": "^0.3.13", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^28.1.3", - "jest-regex-util": "^28.0.2", - "jest-util": "^28.1.3", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - } - }, - "node_modules/wasm-ast-types/node_modules/@jest/types": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz", - "integrity": "sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^28.1.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - } - }, - "node_modules/wasm-ast-types/node_modules/@types/yargs": { - "version": "17.0.15", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.15.tgz", - "integrity": "sha512-ZHc4W2dnEQPfhn06TBEdWaiUHEZAocYaiVMfwOipY5jcJt/251wVrKCBWBetGZWO5CF8tdb7L3DmdxVlZ2BOIg==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, - "dependencies": { - "@types/yargs-parser": "*" + "bin": { + "uuid": "bin/uuid" } }, - "node_modules/wasm-ast-types/node_modules/ci-info": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz", - "integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true }, - "node_modules/wasm-ast-types/node_modules/jest-haste-map": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-28.1.3.tgz", - "integrity": "sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA==", + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, "dependencies": { - "@jest/types": "^28.1.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^28.0.2", - "jest-util": "^28.1.3", - "jest-worker": "^28.1.3", - "micromatch": "^4.0.4", - "walker": "^1.0.8" + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" + "node": ">=10.12.0" } }, - "node_modules/wasm-ast-types/node_modules/jest-regex-util": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz", - "integrity": "sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==", - "dev": true, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - } + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true }, - "node_modules/wasm-ast-types/node_modules/jest-util": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.1.3.tgz", - "integrity": "sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ==", + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "dependencies": { - "@jest/types": "^28.1.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, - "node_modules/wasm-ast-types/node_modules/jest-worker": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-28.1.3.tgz", - "integrity": "sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==", + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, + "engines": [ + "node >=0.6.0" + ], "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" } }, - "node_modules/wasm-ast-types/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true }, - "node_modules/wasm-ast-types/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "makeerror": "1.0.12" } }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -17141,44 +17489,34 @@ "node": ">=10.13.0" } }, - "node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true, - "engines": { - "node": ">=10.4" - } - }, "node_modules/webpack": { - "version": "5.82.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.82.1.tgz", - "integrity": "sha512-C6uiGQJ+Gt4RyHXXYt+v9f+SN1v83x68URwgxNQ98cvH8kxiuywWGP4XeNZ1paOzZ63aY3cTciCEQJNFUljlLw==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.14.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.2", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -17294,44 +17632,6 @@ "node": ">=10.13.0" } }, - "node_modules/webpack/node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", - "dev": true, - "peerDependencies": { - "acorn": "^8" - } - }, - "node_modules/whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "dependencies": { - "iconv-lite": "0.4.24" - } - }, - "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", - "dev": true, - "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -17416,12 +17716,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "node_modules/which-typed-array": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", @@ -17450,18 +17744,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "node_modules/widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wildcard": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", @@ -17469,18 +17751,24 @@ "dev": true }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, "node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", @@ -17488,7 +17776,10 @@ "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/wrappy": { @@ -17498,21 +17789,22 @@ "dev": true }, "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "engines": { "node": ">=10.0.0" }, @@ -17529,27 +17821,6 @@ } } }, - "node_modules/xdg-basedir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, "node_modules/xstream": { "version": "11.14.0", "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", @@ -17569,10 +17840,13 @@ } }, "node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } }, "node_modules/yallist": { "version": "4.0.0", @@ -17581,109 +17855,55 @@ "dev": true }, "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, "engines": { - "node": ">=6" + "node": ">=12" } }, - "node_modules/yargs/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" + "node": ">=10" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yargs/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/yoctocolors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz", + "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==", "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, "engines": { - "node": ">=6" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/yargs/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } } } } diff --git a/v4-client-js/package.json b/v4-client-js/package.json index 4556944c..16b73aac 100644 --- a/v4-client-js/package.json +++ b/v4-client-js/package.json @@ -1,18 +1,19 @@ { "name": "@dydxprotocol/v4-client-js", - "version": "1.1.31", + "version": "1.3.16", "description": "General client library for the new dYdX system (v4 decentralized)", "main": "build/src/index.js", "scripts": { "build": "rm -rf build/ && npm run compile", + "commitlint": "commitlint --edit", "compile": "tsc", "compile:watch": "npm run compile -- --watch", "coverage": "npm run test -- --coverage", "fix": "npm run lint -- --fix", "lint": "eslint --ext .ts,.js .", "prepublishOnly": "npm run compile", + "release": "semantic-release", "start": "node build/src/index.js", - "transpile": "rm -rf src/codegen && telescope transpile --protoDirs ./proto --outPath ./src/codegen --no-includeAminos --includeLCDClients --includeRPCClients", "test": "NODE_ENV=test jest --testPathIgnorePatterns=__tests__/modules/client/*", "test:watch": "npm test -- --watch", "test-integration": "NODE_ENV=test jest", @@ -37,8 +38,8 @@ "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", "@cosmjs/utils": "^0.32.1", - "@dydxprotocol/v4-proto": "5.0.0-dev.0", "@osmonauts/lcd": "^0.6.0", + "@dydxprotocol/v4-proto": "7.0.0-dev.0", "@scure/bip32": "^1.1.5", "@scure/bip39": "^1.1.1", "axios": "1.1.3", @@ -52,10 +53,13 @@ "ws": "^8.14.2" }, "devDependencies": { + "@commitlint/cli": "^19.5.0", + "@commitlint/config-conventional": "^19.5.0", "@dydxprotocol/node-service-base-dev": "^0.2.6", - "@osmonauts/telescope": "0.80.0", "@protobufs/cosmos": "^0.0.11", "@protobufs/gogoproto": "^0.0.10", + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/npm": "^12.0.1", "@types/ffi-napi": "^4.0.4", "@types/ws": "8.5.4", "@typescript-eslint/eslint-plugin": "v5.42.0", @@ -73,10 +77,12 @@ "node-polyfill-webpack-plugin": "^2.0.1", "path-browserify": "^1.0.1", "prettier": "3.2.5", + "semantic-release": "^24.1.1", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "ts-loader": "^9.4.2", "ts-proto": "^1.165.1", + "util": "^0.12.5", "webpack": "^5.77.0", "webpack-cli": "^5.0.1" } diff --git a/v4-client-js/src/clients/composite-client.ts b/v4-client-js/src/clients/composite-client.ts index fe832717..02fd3783 100644 --- a/v4-client-js/src/clients/composite-client.ts +++ b/v4-client-js/src/clients/composite-client.ts @@ -13,6 +13,7 @@ import { parseUnits } from 'ethers'; import Long from 'long'; import protobuf from 'protobufjs'; +import { bigIntToBytes } from '../lib/helpers'; import { isStatefulOrder, verifyOrderFlags } from '../lib/validation'; import { GovAddNewMarketParams, OrderFlags } from '../types'; import { @@ -34,13 +35,14 @@ import { calculateClientMetadata, calculateConditionType, calculateConditionalOrderTriggerSubticks, + calculateVaultQuantums, } from './helpers/chain-helpers'; import { IndexerClient } from './indexer-client'; import { UserError } from './lib/errors'; import { generateRegistry } from './lib/registry'; import LocalWallet from './modules/local-wallet'; import { SubaccountInfo } from './subaccount'; -import { BroadcastMode } from './types'; +import { BroadcastMode, OrderBatch } from './types'; import { ValidatorClient } from './validator-client'; // Required for encoding and decoding queries that are of type Long. @@ -58,6 +60,12 @@ export interface MarketInfo { subticksPerTick: number; } +export interface OrderBatchWithMarketId { + marketId: string; + clobPairId?: number; + clientIds: number[]; +} + export class CompositeClient { public readonly network: Network; public gasDenom: SelectedGasDenom = SelectedGasDenom.USDC; @@ -103,6 +111,11 @@ export class CompositeClient { this._validatorClient.setSelectedGasDenom(gasDenom); } + async populateAccountNumberCache(address: string): Promise { + if (!this._validatorClient) throw new Error('Validator client not initialized'); + await this._validatorClient.populateAccountNumberCache(address); + } + /** * @description Sign a list of messages with a wallet. * the calling function is responsible for creating the messages. @@ -391,7 +404,7 @@ export class CompositeClient { msg .then((it) => resolve([it])) .catch((err) => { - console.log(err); + throw err; }); }); const orderFlags = calculateOrderFlags(type, timeInForce); @@ -696,6 +709,60 @@ export class CompositeClient { ); } + /** + * @description Batch cancel short term orders using marketId to clobPairId translation. + * + * @param subaccount The subaccount to cancel the order from + * @param shortTermOrders The list of short term order batches to cancel with marketId + * @param goodTilBlock The goodTilBlock of the order to cancel + * @returns The transaction hash. + */ + async batchCancelShortTermOrdersWithMarketId( + subaccount: SubaccountInfo, + shortTermOrders: OrderBatchWithMarketId[], + goodTilBlock: number, + broadcastMode?: BroadcastMode, + ): Promise { + const orderBatches = await Promise.all( + shortTermOrders.map(async ({ marketId, clobPairId, clientIds }) => ({ + clobPairId: ( + clobPairId ?? + (await this.indexerClient.markets.getPerpetualMarkets(marketId)).markets[marketId] + ).clobPairId, + clientIds, + })), + ); + + return this.validatorClient.post.batchCancelShortTermOrders( + subaccount, + orderBatches, + goodTilBlock, + broadcastMode, + ); + } + + /** + * @description Batch cancel short term orders using clobPairId. + * + * @param subaccount The subaccount to cancel the order from + * @param shortTermOrders The list of short term order batches to cancel with clobPairId + * @param goodTilBlock The goodTilBlock of the order to cancel + * @returns The transaction hash. + */ + async batchCancelShortTermOrdersWithClobPairId( + subaccount: SubaccountInfo, + shortTermOrders: OrderBatch[], + goodTilBlock: number, + broadcastMode?: BroadcastMode, + ): Promise { + return this.validatorClient.post.batchCancelShortTermOrders( + subaccount, + shortTermOrders, + goodTilBlock, + broadcastMode, + ); + } + /** * @description Transfer from a subaccount to another subaccount * @@ -992,6 +1059,55 @@ export class CompositeClient { return Buffer.from(signature).toString('base64'); } + // vaults + + async depositToMegavault( + subaccount: SubaccountInfo, + amountUsdc: number, + broadcastMode?: BroadcastMode, + ): Promise { + return this.validatorClient.post.depositToMegavault( + subaccount, + bigIntToBytes(calculateVaultQuantums(amountUsdc)), + broadcastMode, + ); + } + + depositToMegavaultMessage(subaccount: SubaccountInfo, amountUsdc: number): EncodeObject { + return this.validatorClient.post.depositToMegavaultMsg( + subaccount.address, + subaccount.subaccountNumber, + bigIntToBytes(calculateVaultQuantums(amountUsdc)), + ); + } + + async withdrawFromMegavault( + subaccount: SubaccountInfo, + shares: number, + minAmount: number, + broadcastMode?: BroadcastMode, + ): Promise { + return this.validatorClient.post.withdrawFromMegavault( + subaccount, + bigIntToBytes(BigInt(Math.floor(shares))), + bigIntToBytes(calculateVaultQuantums(minAmount)), + broadcastMode, + ); + } + + withdrawFromMegavaultMessage( + subaccount: SubaccountInfo, + shares: number, + minAmount: number, + ): EncodeObject { + return this.validatorClient.post.withdrawFromMegavaultMsg( + subaccount.address, + subaccount.subaccountNumber, + bigIntToBytes(BigInt(Math.floor(shares))), + bigIntToBytes(calculateVaultQuantums(minAmount)), + ); + } + /** * @description Submit a governance proposal to add a new market. * @@ -1091,4 +1207,14 @@ export class CompositeClient { return this.send(wallet, () => msg, false, undefined, memo); } + + async createMarketPermissionless( + subaccount: SubaccountInfo, + ticker: string, + broadcastMode?: BroadcastMode, + gasAdjustment?: number, + memo?: string, + ): Promise { + return this.validatorClient.post.createMarketPermissionless(ticker, subaccount, broadcastMode, gasAdjustment, memo); + } } diff --git a/v4-client-js/src/clients/constants.ts b/v4-client-js/src/clients/constants.ts index 4c350ce6..297e85a6 100644 --- a/v4-client-js/src/clients/constants.ts +++ b/v4-client-js/src/clients/constants.ts @@ -23,13 +23,15 @@ export const MAINNET_CHAIN_ID = 'dydx-mainnet-1'; // ------------ API URLs ------------ export enum IndexerApiHost { TESTNET = 'https://indexer.v4testnet.dydx.exchange/', + STAGING = 'https://indexer.v4staging.dydx.exchange/', LOCAL = 'http://localhost:3002', // For the deployment by DYDX token holders MAINNET = 'https://indexer.dydx.trade', } export enum IndexerWSHost { - TESTNET = 'wss://dydx-testnet.imperator.co/v4/ws', + TESTNET = 'wss://indexer.v4testnet.dydx.exchange/v4/ws', + STAGING = 'wss://indexer.v4staging.dydx.exchange/v4/ws', LOCAL = 'ws://localhost:3003', // For the deployment by DYDX token holders MAINNET = 'wss://indexer.dydx.trade/v4/ws', @@ -40,7 +42,8 @@ export enum FaucetApiHost { } export enum ValidatorApiHost { - TESTNET = 'https://test-dydx.kingnodes.com', + TESTNET = 'https://test-dydx-rpc.kingnodes.com', + STAGING = 'https://validator.v4staging.dydx.exchange', LOCAL = 'http://localhost:26657', // For the deployment by DYDX token holders MAINNET = 'https://dydx-ops-rpc.kingnodes.com:443', @@ -75,12 +78,17 @@ export const TYPE_URL_MSG_SUBMIT_PROPOSAL = '/cosmos.gov.v1.MsgSubmitProposal'; // x/clob export const TYPE_URL_MSG_PLACE_ORDER = '/dydxprotocol.clob.MsgPlaceOrder'; export const TYPE_URL_MSG_CANCEL_ORDER = '/dydxprotocol.clob.MsgCancelOrder'; +export const TYPE_URL_BATCH_CANCEL = '/dydxprotocol.clob.MsgBatchCancel'; export const TYPE_URL_MSG_CREATE_CLOB_PAIR = '/dydxprotocol.clob.MsgCreateClobPair'; export const TYPE_URL_MSG_UPDATE_CLOB_PAIR = '/dydxprotocol.clob.MsgUpdateClobPair'; // x/delaymsg export const TYPE_URL_MSG_DELAY_MESSAGE = '/dydxprotocol.delaymsg.MsgDelayMessage'; +// x/listing +export const TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS = + '/dydxprotocol.listing.MsgCreateMarketPermissionless'; + // x/perpetuals export const TYPE_URL_MSG_CREATE_PERPETUAL = '/dydxprotocol.perpetuals.MsgCreatePerpetual'; @@ -93,6 +101,13 @@ export const TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT = '/dydxprotocol.sending.MsgWithdrawFromSubaccount'; export const TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT = '/dydxprotocol.sending.MsgDepositToSubaccount'; +// x/affiliates +export const TYPE_URL_MSG_REGISTER_AFFILIATE = '/dydxprotocol.affiliates.MsgRegisterAffiliate'; + +// x/vault +export const TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT = '/dydxprotocol.vault.MsgDepositToMegavault'; +export const TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT = '/dydxprotocol.vault.MsgWithdrawFromMegavault'; + // x/staking export const TYPE_URL_MSG_DELEGATE = '/cosmos.staking.v1beta1.MsgDelegate'; export const TYPE_URL_MSG_UNDELEGATE = '/cosmos.staking.v1beta1.MsgUndelegate'; @@ -101,10 +116,11 @@ export const TYPE_URL_MSG_UNDELEGATE = '/cosmos.staking.v1beta1.MsgUndelegate'; export const TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD = '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward'; - // ------------ Chain Constants ------------ +// ------------ Chain Constants ------------ // The following are same across different networks / deployments. export const GOV_MODULE_ADDRESS = 'dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky'; export const DELAYMSG_MODULE_ADDRESS = 'dydx1mkkvp26dngu6n8rmalaxyp3gwkjuzztq5zx6tr'; +export const MEGAVAULT_MODULE_ADDRESS = 'dydx18tkxrnrkqc2t0lr3zxr5g6a4hdvqksylxqje4r'; // ------------ Market Statistic Day Types ------------ export enum MarketStatisticDay { @@ -175,6 +191,17 @@ export enum TimePeriod { SEVEN_DAYS = 'SEVEN_DAYS', } +export enum PnlTickInterval { + HOUR = 'hour', + day = 'day', +} + +export enum TradingRewardAggregationPeriod { + DAILY = 'DAILY', + WEEKLY = 'WEEKLY', + MONTHLY = 'MONTHLY', +} + // ------------ API Defaults ------------ export const DEFAULT_API_TIMEOUT: number = 3_000; @@ -209,6 +236,7 @@ export class ValidatorConfig { public denoms: DenomConfig; public broadcastOptions?: BroadcastOptions; public defaultClientMemo?: string; + public useTimestampNonce?: boolean; constructor( restEndpoint: string, @@ -216,6 +244,7 @@ export class ValidatorConfig { denoms: DenomConfig, broadcastOptions?: BroadcastOptions, defaultClientMemo?: string, + useTimestampNonce?: boolean, ) { this.restEndpoint = restEndpoint?.endsWith('/') ? restEndpoint.slice(0, -1) : restEndpoint; this.chainId = chainId; @@ -223,6 +252,7 @@ export class ValidatorConfig { this.denoms = denoms; this.broadcastOptions = broadcastOptions; this.defaultClientMemo = defaultClientMemo; + this.useTimestampNonce = useTimestampNonce; } } @@ -251,6 +281,24 @@ export class Network { return new Network('testnet', indexerConfig, validatorConfig); } + static staging(): Network { + const indexerConfig = new IndexerConfig(IndexerApiHost.STAGING, IndexerWSHost.STAGING); + const validatorConfig = new ValidatorConfig( + ValidatorApiHost.STAGING, + TESTNET_CHAIN_ID, + { + CHAINTOKEN_DENOM: 'adv4tnt', + USDC_DENOM: 'ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5', + USDC_GAS_DENOM: 'uusdc', + USDC_DECIMALS: 6, + CHAINTOKEN_DECIMALS: 18, + }, + undefined, + 'Client Example', + ); + return new Network('staging', indexerConfig, validatorConfig); + } + static local(): Network { const indexerConfig = new IndexerConfig(IndexerApiHost.LOCAL, IndexerWSHost.LOCAL); const validatorConfig = new ValidatorConfig( diff --git a/v4-client-js/src/clients/helpers/chain-helpers.ts b/v4-client-js/src/clients/helpers/chain-helpers.ts index 261a5f40..aa850f3e 100644 --- a/v4-client-js/src/clients/helpers/chain-helpers.ts +++ b/v4-client-js/src/clients/helpers/chain-helpers.ts @@ -6,7 +6,11 @@ import { Order_ConditionType, Order_Side, Order_TimeInForce } from '../modules/p import { OrderFlags } from '../types'; export function round(input: number, base: number): number { - return Math.floor(input / base) * base; + return BigNumber(input) + .div(BigNumber(base)) + .integerValue(BigNumber.ROUND_FLOOR) + .times(BigNumber(base)) + .toNumber(); } export function calculateQuantums( @@ -14,13 +18,19 @@ export function calculateQuantums( atomicResolution: number, stepBaseQuantums: number, ): Long { - const rawQuantums = size * 10 ** (-1 * atomicResolution); - const quantums = round(rawQuantums, stepBaseQuantums); + const rawQuantums = BigNumber(size).times( + BigNumber(10).pow(BigNumber(atomicResolution).negated()), + ); + const quantums = round(rawQuantums.toNumber(), stepBaseQuantums); // stepBaseQuantums functions as minimum order size const result = Math.max(quantums, stepBaseQuantums); return Long.fromNumber(result); } +export function calculateVaultQuantums(size: number): bigint { + return BigInt(BigNumber(size).times(1_000_000).toFixed(0, BigNumber.ROUND_FLOOR)); +} + export function calculateSubticks( price: number, atomicResolution: number, diff --git a/v4-client-js/src/clients/helpers/request-helpers.ts b/v4-client-js/src/clients/helpers/request-helpers.ts index ccf41dc7..40382a87 100644 --- a/v4-client-js/src/clients/helpers/request-helpers.ts +++ b/v4-client-js/src/clients/helpers/request-helpers.ts @@ -1,3 +1,6 @@ +import Long from "long"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ export function generateQueryPath(url: string, params: {}): string { const definedEntries = Object.entries(params).filter( ([_key, value]: [string, unknown]) => value !== undefined, @@ -12,3 +15,57 @@ export function generateQueryPath(url: string, params: {}): string { .join('&'); return `${url}?${paramsString}`; } + +export function parseToPrimitives(x: T): T { + if (typeof x === 'number' || typeof x === 'string' || typeof x === 'boolean' || x === null) { + return x; + } + + if (Array.isArray(x)) { + return x.map((item) => parseToPrimitives(item)) as T; + } + + if (Long.isLong(x)) { + return x.toString() as T; + } + + if (x instanceof Uint8Array) { + return bytesToBigInt(x).toString() as T; + } + + if (x instanceof Date) { + return x.toString() as T; + } + + if (typeof x === 'object') { + const parsedObj: { [key: string]: any } = {}; + // eslint-disable-next-line no-restricted-syntax + for (const key in x) { + if (Object.prototype.hasOwnProperty.call(x, key)) { + parsedObj[key] = parseToPrimitives((x as any)[key]); + } + } + return parsedObj as T; + } + + if (typeof x === 'bigint') { + return x.toString() as T; + } + + throw new Error(`Unsupported data type: ${typeof x}`); +} + +/** + * Converts a byte array (representing an arbitrary-size signed integer) into a bigint. + * @param u Array of bytes represented as a Uint8Array. + */ +function bytesToBigInt(u: Uint8Array): bigint { + if (u.length <= 1) { + return BigInt(0); + } + // eslint-disable-next-line no-bitwise + const negated: boolean = (u[0] & 1) === 1; + const hex: string = Buffer.from(u.slice(1)).toString('hex'); + const abs: bigint = BigInt(`0x${hex}`); + return negated ? -abs : abs; +} diff --git a/v4-client-js/src/clients/indexer-client.ts b/v4-client-js/src/clients/indexer-client.ts index 95b2c22a..14c941c1 100644 --- a/v4-client-js/src/clients/indexer-client.ts +++ b/v4-client-js/src/clients/indexer-client.ts @@ -2,6 +2,7 @@ import { IndexerConfig, DEFAULT_API_TIMEOUT } from './constants'; import AccountClient from './modules/account'; import MarketsClient from './modules/markets'; import UtilityClient from './modules/utility'; +import VaultClient from './modules/vault'; /** * @description Client for Indexer @@ -12,6 +13,7 @@ export class IndexerClient { readonly _markets: MarketsClient; readonly _account: AccountClient; readonly _utility: UtilityClient; + readonly _vault: VaultClient; constructor(config: IndexerConfig, apiTimeout?: number) { this.config = config; @@ -20,6 +22,7 @@ export class IndexerClient { this._markets = new MarketsClient(config.restEndpoint); this._account = new AccountClient(config.restEndpoint); this._utility = new UtilityClient(config.restEndpoint); + this._vault = new VaultClient(config.restEndpoint); } /** @@ -46,4 +49,13 @@ export class IndexerClient { get utility(): UtilityClient { return this._utility; } + + /** + * @description Get the vault module, used for interacting with vault endpoints. + * + * @returns The vault module + */ + get vault(): VaultClient { + return this._vault; + } } diff --git a/v4-client-js/src/clients/lib/registry.ts b/v4-client-js/src/clients/lib/registry.ts index c31acec6..8a93b870 100644 --- a/v4-client-js/src/clients/lib/registry.ts +++ b/v4-client-js/src/clients/lib/registry.ts @@ -1,12 +1,15 @@ import { GeneratedType, Registry } from '@cosmjs/proto-signing'; import { defaultRegistryTypes } from '@cosmjs/stargate'; +import { MsgRegisterAffiliate } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/tx'; import { MsgPlaceOrder, MsgCancelOrder, MsgCreateClobPair, MsgUpdateClobPair, + MsgBatchCancel, } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/tx'; import { MsgDelayMessage } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/delaymsg/tx'; +import { MsgCreateMarketPermissionless } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx'; import { MsgCreatePerpetual } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx'; import { MsgCreateOracleMarket } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx'; import { @@ -14,6 +17,10 @@ import { MsgDepositToSubaccount, } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer'; import { MsgCreateTransfer } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx'; +import { + MsgDepositToMegavault, + MsgWithdrawFromMegavault, +} from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/tx'; import { TYPE_URL_MSG_PLACE_ORDER, @@ -26,6 +33,11 @@ import { TYPE_URL_MSG_CREATE_TRANSFER, TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT, TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT, + TYPE_URL_BATCH_CANCEL, + TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT, + TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT, + TYPE_URL_MSG_REGISTER_AFFILIATE, + TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS, } from '../constants'; export const registry: ReadonlyArray<[string, GeneratedType]> = []; @@ -34,23 +46,34 @@ export function generateRegistry(): Registry { // clob [TYPE_URL_MSG_PLACE_ORDER, MsgPlaceOrder as GeneratedType], [TYPE_URL_MSG_CANCEL_ORDER, MsgCancelOrder as GeneratedType], + [TYPE_URL_BATCH_CANCEL, MsgBatchCancel as GeneratedType], [TYPE_URL_MSG_CREATE_CLOB_PAIR, MsgCreateClobPair as GeneratedType], [TYPE_URL_MSG_UPDATE_CLOB_PAIR, MsgUpdateClobPair as GeneratedType], // delaymsg [TYPE_URL_MSG_DELAY_MESSAGE, MsgDelayMessage as GeneratedType], + // listing + [TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS, MsgCreateMarketPermissionless as GeneratedType], + // perpetuals [TYPE_URL_MSG_CREATE_PERPETUAL, MsgCreatePerpetual as GeneratedType], // prices [TYPE_URL_MSG_CREATE_ORACLE_MARKET, MsgCreateOracleMarket as GeneratedType], + // vaults + [TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT, MsgDepositToMegavault as GeneratedType], + [TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT, MsgWithdrawFromMegavault as GeneratedType], + // sending [TYPE_URL_MSG_CREATE_TRANSFER, MsgCreateTransfer as GeneratedType], [TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT, MsgWithdrawFromSubaccount as GeneratedType], [TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT, MsgDepositToSubaccount as GeneratedType], + // affiliates + [TYPE_URL_MSG_REGISTER_AFFILIATE, MsgRegisterAffiliate as GeneratedType], + // default types ...defaultRegistryTypes, ]); diff --git a/v4-client-js/src/clients/modules/account.ts b/v4-client-js/src/clients/modules/account.ts index 4c8dbe86..e4e0c37c 100644 --- a/v4-client-js/src/clients/modules/account.ts +++ b/v4-client-js/src/clients/modules/account.ts @@ -1,4 +1,11 @@ -import { OrderSide, OrderStatus, OrderType, PositionStatus, TickerType } from '../constants'; +import { + OrderSide, + OrderStatus, + OrderType, + PositionStatus, + TickerType, + TradingRewardAggregationPeriod, +} from '../constants'; import { Data } from '../types'; import RestClient from './rest'; @@ -6,6 +13,8 @@ import RestClient from './rest'; * @description REST endpoints for data related to a particular address. */ export default class AccountClient extends RestClient { + // ------ Subaccount ------ // + async getSubaccounts(address: string, limit?: number): Promise { const uri = `/v4/addresses/${address}`; return this.get(uri, { limit }); @@ -16,6 +25,13 @@ export default class AccountClient extends RestClient { return this.get(uri); } + async getParentSubaccount(address: string, parentSubaccountNumber: number): Promise { + const uri = `/v4/addresses/${address}/subaccountNumber/${parentSubaccountNumber}`; + return this.get(uri); + } + + // ------ Positions ------ // + async getSubaccountPerpetualPositions( address: string, subaccountNumber: number, @@ -54,6 +70,27 @@ export default class AccountClient extends RestClient { }); } + // ------ Transfers ------ // + + async getTransfersBetween( + sourceAddress: string, + sourceSubaccountNumber: string, + recipientAddress: string, + recipientSubaccountNumber: string, + createdBeforeOrAtHeight?: number | null, + createdBeforeOrAt?: string | null, + ): Promise { + const uri = '/v4/transfers/between'; + return this.get(uri, { + sourceAddress, + sourceSubaccountNumber, + recipientAddress, + recipientSubaccountNumber, + createdBeforeOrAtHeight, + createdBeforeOrAt, + }); + } + async getSubaccountTransfers( address: string, subaccountNumber: number, @@ -92,6 +129,8 @@ export default class AccountClient extends RestClient { }); } + // ------ Orders ------ // + async getSubaccountOrders( address: string, subaccountNumber: number, @@ -121,11 +160,40 @@ export default class AccountClient extends RestClient { }); } + async getParentSubaccountNumberOrders( + address: string, + parentSubaccountNumber: number, + ticker?: string | null, + side?: OrderSide | null, + status?: OrderStatus | null, + type?: OrderType | null, + limit?: number | null, + goodTilBlockBeforeOrAt?: number | null, + goodTilBlockTimeBeforeOrAt?: string | null, + returnLatestOrders?: boolean | null, + ): Promise { + const uri = '/v4/orders/parentSubaccountNumber'; + return this.get(uri, { + address, + parentSubaccountNumber, + ticker, + side, + status, + type, + limit, + goodTilBlockBeforeOrAt, + goodTilBlockTimeBeforeOrAt, + returnLatestOrders, + }); + } + async getOrder(orderId: string): Promise { const uri = `/v4/orders/${orderId}`; return this.get(uri); } + // ------ Fills ------ // + async getSubaccountFills( address: string, subaccountNumber: number, @@ -172,6 +240,8 @@ export default class AccountClient extends RestClient { }); } + // ------ Pnl ------ // + async getSubaccountHistoricalPNLs( address: string, subaccountNumber: number, @@ -194,4 +264,50 @@ export default class AccountClient extends RestClient { page, }); } + + async getParentSubaccountNumberHistoricalPNLs( + address: string, + parentSubaccountNumber: number, + createdBeforeOrAtHeight?: number | null, + createdBeforeOrAt?: string | null, + createdOnOrAfterHeight?: number | null, + createdOnOrAfter?: string | null, + limit?: number | null, + page?: number | null, + ): Promise { + const uri = '/v4//historical-pnl/parentSubaccount'; + return this.get(uri, { + address, + parentSubaccountNumber, + createdBeforeOrAtHeight, + createdBeforeOrAt, + createdOnOrAfterHeight, + createdOnOrAfter, + limit, + page, + }); + } + + // ------ Rewards ------ // + + async getHistoricalTradingRewardsAggregations( + address: string, + period: TradingRewardAggregationPeriod, + limit?: number, + startingBeforeOrAt?: string, + startingBeforeOrAtHeight?: string, + ): Promise { + const uri = `/v4/historicalTradingRewardAggregations/${address}`; + return this.get(uri, { period, limit, startingBeforeOrAt, startingBeforeOrAtHeight }); + } + + async getHistoricalBlockTradingRewards( + address: string, + limit?: number, + startingBeforeOrAt?: string, + startingBeforeOrAtHeight?: string, + ): Promise { + const uri = `/v4/historicalBlockTradingRewards/${address}`; + return this.get(uri, { limit, startingBeforeOrAt, startingBeforeOrAtHeight }); + } } diff --git a/v4-client-js/src/clients/modules/composer.ts b/v4-client-js/src/clients/modules/composer.ts index 38401c8d..7c1fee8c 100644 --- a/v4-client-js/src/clients/modules/composer.ts +++ b/v4-client-js/src/clients/modules/composer.ts @@ -7,15 +7,22 @@ import { MsgDelegate, MsgUndelegate, } from '@dydxprotocol/v4-proto/src/codegen/cosmos/staking/v1beta1/tx'; +import { MsgRegisterAffiliate } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/tx'; import { ClobPair_Status } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/clob_pair'; import { + MsgBatchCancel, MsgCreateClobPair, MsgUpdateClobPair, + OrderBatch, } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/tx'; import { MsgDelayMessage } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/delaymsg/tx'; import { PerpetualMarketType } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/perpetual'; import { MsgCreatePerpetual } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/perpetuals/tx'; import { MsgCreateOracleMarket } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/prices/tx'; +import { + MsgDepositToMegavault, + MsgWithdrawFromMegavault, +} from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/tx'; import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx'; import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin'; import { Any } from 'cosmjs-types/google/protobuf/any'; @@ -40,6 +47,11 @@ import { TYPE_URL_MSG_DELEGATE, TYPE_URL_MSG_UNDELEGATE, TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD, + TYPE_URL_BATCH_CANCEL, + TYPE_URL_MSG_REGISTER_AFFILIATE, + TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT, + TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT, + TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS, } from '../constants'; import { DenomConfig } from '../types'; import { @@ -51,6 +63,7 @@ import { MsgPlaceOrder, MsgCancelOrder, SubaccountId, + MsgCreateMarketPermissionless, MsgCreateTransfer, Transfer, MsgDepositToSubaccount, @@ -149,6 +162,29 @@ export class Composer { }; } + public composeMsgBatchCancelShortTermOrders( + address: string, + subaccountNumber: number, + shortTermCancels: OrderBatch[], + goodTilBlock: number, + ): EncodeObject { + const subaccountId: SubaccountId = { + owner: address, + number: subaccountNumber, + }; + + const msg: MsgBatchCancel = { + subaccountId, + shortTermCancels, + goodTilBlock, + }; + + return { + typeUrl: TYPE_URL_BATCH_CANCEL, + value: msg, + }; + } + public composeMsgCreateClobPair( clobId: number, perpetualId: number, @@ -419,6 +455,51 @@ export class Composer { }; } + // ------------ x/vault ------------ + public composeMsgDepositToMegavault( + address: string, + subaccountNumber: number, + quoteQuantums: Uint8Array, + ): EncodeObject { + const subaccountId: SubaccountId = { + owner: address, + number: subaccountNumber, + }; + + const msg: MsgDepositToMegavault = { + quoteQuantums, + subaccountId, + }; + + return { + typeUrl: TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT, + value: msg, + }; + } + + public composeMsgWithdrawFromMegavault( + address: string, + subaccountNumber: number, + shares: Uint8Array, + minQuoteQuantums: Uint8Array, + ): EncodeObject { + const subaccountId: SubaccountId = { + owner: address, + number: subaccountNumber, + }; + + const msg: MsgWithdrawFromMegavault = { + minQuoteQuantums, + shares: { numShares: shares }, + subaccountId, + }; + + return { + typeUrl: TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT, + value: msg, + }; + } + // ------------ x/staking ------------ public composeMsgDelegate(delegator: string, validator: string, amount: Coin): EncodeObject { const msg: MsgDelegate = { @@ -459,6 +540,41 @@ export class Composer { }; } + // ------------ x/affiliates ------------ + public composeMsgRegisterAffiliate(referee: string, affiliate: string): EncodeObject { + const msg: MsgRegisterAffiliate = { + referee, + affiliate, + }; + + return { + typeUrl: TYPE_URL_MSG_REGISTER_AFFILIATE, + value: msg, + }; + } + + // ------------ x/listing ------------ + public composeMsgCreateMarketPermissionless( + address: string, + ticker: string, + subaccountNumber: number, + ): EncodeObject { + const subaccountId: SubaccountId = { + owner: address, + number: subaccountNumber, + }; + + const msg: MsgCreateMarketPermissionless = { + ticker, + subaccountId + }; + + return { + typeUrl: TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS, + value: msg, + } + } + // ------------ util ------------ public validateGoodTilBlockAndTime( orderFlags: number, diff --git a/v4-client-js/src/clients/modules/get.ts b/v4-client-js/src/clients/modules/get.ts index a79f92da..04c15d9d 100644 --- a/v4-client-js/src/clients/modules/get.ts +++ b/v4-client-js/src/clients/modules/get.ts @@ -13,9 +13,11 @@ import { Any } from 'cosmjs-types/google/protobuf/any'; import Long from 'long'; import protobuf from 'protobufjs'; +import { bigIntToBytes } from '../../lib/helpers'; import { PAGE_REQUEST } from '../constants'; import { UnexpectedClientError } from '../lib/errors'; import { + AffiliateModule, BridgeModule, ClobModule, DistributionModule, @@ -29,6 +31,7 @@ import { StakingModule, StatsModule, SubaccountsModule, + VaultModule, } from './proto-includes'; import { TendermintClient } from './tendermintClient'; @@ -415,8 +418,7 @@ export class Get { const requestData = Uint8Array.from( DistributionModule.QueryDelegationTotalRewardsRequest.encode({ delegatorAddress, - }) - .finish(), + }).finish(), ); const data: Uint8Array = await this.sendQuery( @@ -491,9 +493,13 @@ export class Get { return GovV1Module.QueryProposalsResponse.decode(data); } - async getWithdrawalAndTransferGatingStatus(): Promise { + async getWithdrawalAndTransferGatingStatus( + perpetualId: number, + ): Promise { const requestData = Uint8Array.from( - SubaccountsModule.QueryGetWithdrawalAndTransfersBlockedInfoRequest.encode({}).finish(), + SubaccountsModule.QueryGetWithdrawalAndTransfersBlockedInfoRequest.encode({ + perpetualId, + }).finish(), ); const data = await this.sendQuery( @@ -518,6 +524,92 @@ export class Get { return RateLimitModule.QueryCapacityByDenomResponse.decode(data); } + async getMegavaultOwnerShares( + address: string, + ): Promise { + const requestData: Uint8Array = Uint8Array.from( + VaultModule.QueryMegavaultOwnerSharesRequest.encode({ + address, + }).finish(), + ); + + const data: Uint8Array = await this.sendQuery( + '/dydxprotocol.vault.Query/MegavaultOwnerShares', + requestData, + ); + + return VaultModule.QueryMegavaultOwnerSharesResponse.decode(data); + } + + async getMegavaultWithdrawalInfo( + sharesToWithdraw: bigint, + ): Promise { + const requestData: Uint8Array = Uint8Array.from( + VaultModule.QueryMegavaultWithdrawalInfoRequest.encode({ + sharesToWithdraw: { + numShares: bigIntToBytes(sharesToWithdraw), + }, + }).finish(), + ); + + const data: Uint8Array = await this.sendQuery( + '/dydxprotocol.vault.Query/MegavaultWithdrawalInfo', + requestData, + ); + + return VaultModule.QueryMegavaultWithdrawalInfoResponse.decode(data); + } + + async getAffiliateInfo(address: string): Promise { + const requestData = Uint8Array.from( + AffiliateModule.AffiliateInfoRequest.encode({ + address, + }).finish(), + ); + + const data = await this.sendQuery('/dydxprotocol.affiliates.Query/AffiliateInfo', requestData); + + return AffiliateModule.AffiliateInfoResponse.decode(data); + } + + async getReferredBy(address: string): Promise { + const requestData = Uint8Array.from( + AffiliateModule.ReferredByRequest.encode({ + address, + }).finish(), + ); + + const data = await this.sendQuery('/dydxprotocol.affiliates.Query/ReferredBy', requestData); + + return AffiliateModule.ReferredByResponse.decode(data); + } + + async getAllAffiliateTiers(): Promise { + const requestData = Uint8Array.from( + AffiliateModule.AllAffiliateTiersRequest.encode({}).finish(), + ); + + const data = await this.sendQuery( + '/dydxprotocol.affiliates.Query/AllAffiliateTiers', + requestData, + ); + + return AffiliateModule.AllAffiliateTiersResponse.decode(data); + } + + async getAffiliateWhitelist(): Promise { + const requestData = Uint8Array.from( + AffiliateModule.AffiliateWhitelistRequest.encode({}).finish(), + ); + + const data = await this.sendQuery( + '/dydxprotocol.affiliates.Query/AffiliateWhitelist', + requestData, + ); + + return AffiliateModule.AffiliateWhitelistResponse.decode(data); + } + private async sendQuery(requestUrl: string, requestData: Uint8Array): Promise { // eslint-disable-next-line max-len const resp: QueryAbciResponse = await this.stargateQueryClient.queryAbci( diff --git a/v4-client-js/src/clients/modules/local-wallet.ts b/v4-client-js/src/clients/modules/local-wallet.ts index 7bca43fe..22e38b2d 100644 --- a/v4-client-js/src/clients/modules/local-wallet.ts +++ b/v4-client-js/src/clients/modules/local-wallet.ts @@ -42,7 +42,7 @@ export default class LocalWallet { registry: generateRegistry(), }); const accountData = await signer.getAccounts(); - const firstAccount = accountData[0]; + const firstAccount = accountData[0]!; this.accounts = [...accountData]; this.address = firstAccount.address; this.pubKey = encodeSecp256k1Pubkey(firstAccount.pubkey); diff --git a/v4-client-js/src/clients/modules/post.ts b/v4-client-js/src/clients/modules/post.ts index 8137c397..af47fa4d 100644 --- a/v4-client-js/src/clients/modules/post.ts +++ b/v4-client-js/src/clients/modules/post.ts @@ -33,6 +33,7 @@ import { MsgPlaceOrder, MsgCancelOrder, Order_ConditionType, + OrderBatch, } from './proto-includes'; // Required for encoding and decoding queries that are of type Long. @@ -54,9 +55,16 @@ export class Post { public readonly defaultGasPrice: GasPrice; public readonly defaultDydxGasPrice: GasPrice; + public useTimestampNonce: boolean = false; private accountNumberCache: Map = new Map(); - constructor(get: Get, chainId: string, denoms: DenomConfig, defaultClientMemo?: string) { + constructor( + get: Get, + chainId: string, + denoms: DenomConfig, + defaultClientMemo?: string, + useTimestampNonce?: boolean, + ) { this.get = get; this.chainId = chainId; this.registry = generateRegistry(); @@ -73,6 +81,19 @@ export class Post { : denoms.CHAINTOKEN_DENOM }`, ); + if (useTimestampNonce === true) this.useTimestampNonce = useTimestampNonce; + } + + /** + * @description Retrieves the account number for the given wallet address and populates the accountNumberCache. + * The account number is required for txOptions when signing a transaction. + * Pre-populating the cache avoids a round-trip request during the first transaction creation in the session, preventing it from being a performance blocker. + */ + public async populateAccountNumberCache(address: string): Promise { + if (this.accountNumberCache.has(address)) return; + + const account = await this.get.getAccount(address); + this.accountNumberCache.set(address, account); } setSelectedGasDenom(selectedGasDenom: SelectedGasDenom): void { @@ -100,18 +121,21 @@ export class Post { memo?: string, account?: () => Promise, ): Promise { - const msgsPromise = messaging(); - const accountPromise = account ? await account() : this.account(wallet.address!); - const msgsAndAccount = await Promise.all([msgsPromise, accountPromise]); - const msgs = msgsAndAccount[0]; + let msgs: EncodeObject[]; + // protocol expects timestamp nonce in UTC milliseconds, which is the unit returned by Date.now() + let sequence = Date.now(); + + if (this.useTimestampNonce) { + msgs = await messaging(); + } else { + const msgsPromise = messaging(); + const accountPromise = account ? await account() : this.account(wallet.address!); + const msgsAndAccount = await Promise.all([msgsPromise, accountPromise]); + msgs = msgsAndAccount[0]; + sequence = msgsAndAccount[1].sequence; + } - return this.simulateTransaction( - wallet.pubKey!, - msgsAndAccount[1].sequence, - msgs, - gasPrice, - memo, - ); + return this.simulateTransaction(wallet.pubKey!, sequence, msgs, gasPrice, memo); } /** @@ -153,6 +177,7 @@ export class Post { memo?: string, broadcastMode?: BroadcastMode, account?: () => Promise, + gasAdjustment: number = GAS_MULTIPLIER, ): Promise { const msgsPromise = messaging(); const accountPromise = account ? await account() : this.account(wallet.address!); @@ -167,6 +192,7 @@ export class Post { gasPrice, memo ?? this.defaultClientMemo, broadcastMode ?? this.defaultBroadcastMode(msgs), + gasAdjustment, ); } @@ -211,17 +237,27 @@ export class Post { zeroFee: boolean, gasPrice: GasPrice = this.getGasPrice(), memo?: string, + gasAdjustment: number = GAS_MULTIPLIER, ): Promise { + // protocol expects timestamp nonce in UTC milliseconds, which is the unit returned by Date.now() + const sequence = this.useTimestampNonce ? Date.now() : account.sequence; // Simulate transaction if no fee is specified. const fee: StdFee = zeroFee ? { amount: [], gas: '1000000', } - : await this.simulateTransaction(wallet.pubKey!, account.sequence, messages, gasPrice, memo); + : await this.simulateTransaction( + wallet.pubKey!, + sequence, + messages, + gasPrice, + memo, + gasAdjustment, + ); const txOptions: TransactionOptions = { - sequence: account.sequence, + sequence, accountNumber: account.accountNumber, chainId: this.chainId, }; @@ -233,11 +269,12 @@ export class Post { * @description Retrieve an account structure for transactions. * For short term orders, the sequence doesn't matter. Use cached if available. * For long term and conditional orders, a round trip to validator must be made. + * when timestamp nonce is supported, no need to fetch account sequence number */ public async account(address: string, orderFlags?: OrderFlags): Promise { - if (orderFlags === OrderFlags.SHORT_TERM) { + if (orderFlags === OrderFlags.SHORT_TERM || this.useTimestampNonce) { if (this.accountNumberCache.has(address)) { - // For SHORT_TERM orders, the sequence doesn't matter + // If order is SHORT_TERM or if timestamp nonce is enabled, the sequence doesn't matter return this.accountNumberCache.get(address)!; } } @@ -259,6 +296,7 @@ export class Post { gasPrice: GasPrice = this.getGasPrice(), memo?: string, broadcastMode?: BroadcastMode, + gasAdjustment: number = GAS_MULTIPLIER, ): Promise { const signedTransaction = await this.signTransaction( wallet, @@ -267,6 +305,7 @@ export class Post { zeroFee, gasPrice, memo, + gasAdjustment, ); return this.sendSignedTransaction(signedTransaction, broadcastMode); } @@ -299,6 +338,7 @@ export class Post { messages: readonly EncodeObject[], gasPrice: GasPrice = this.getGasPrice(), memo?: string, + gasAdjustment: number = GAS_MULTIPLIER, ): Promise { // Get simulated response. const encodedMessages: Any[] = messages.map((message: EncodeObject) => @@ -320,7 +360,7 @@ export class Post { const gasEstimate: number = Uint53.fromString( simulationResponse.gasInfo.gasUsed.toString(), ).toNumber(); - const fee = calculateFee(Math.floor(gasEstimate * GAS_MULTIPLIER), gasPrice); + const fee = calculateFee(Math.floor(gasEstimate * gasAdjustment), gasPrice); // TODO(TRCL-2550): Temporary workaround before IBC denom is supported in '@cosmjs/stargate'. // The '@cosmjs/stargate' does not support denom with '/', so currently GAS_PRICE is @@ -520,6 +560,45 @@ export class Post { ); } + async batchCancelShortTermOrders( + subaccount: SubaccountInfo, + shortTermOrders: OrderBatch[], + goodTilBlock: number, + broadcastMode?: BroadcastMode, + ): Promise { + const msg = await this.batchCancelShortTermOrdersMsg( + subaccount.address, + subaccount.subaccountNumber, + shortTermOrders, + goodTilBlock, + ); + return this.send( + subaccount.wallet, + () => Promise.resolve([msg]), + true, + undefined, + undefined, + broadcastMode, + ); + } + + async batchCancelShortTermOrdersMsg( + address: string, + subaccountNumber: number, + shortTermOrders: OrderBatch[], + goodTilBlock: number, + ): Promise { + return new Promise((resolve) => { + const msg = this.composer.composeMsgBatchCancelShortTermOrders( + address, + subaccountNumber, + shortTermOrders, + goodTilBlock, + ); + resolve(msg); + }); + } + async transfer( subaccount: SubaccountInfo, recipientAddress: string, @@ -760,4 +839,109 @@ export class Post { withdrawDelegatorRewardMsg(delegator: string, validator: string): EncodeObject { return this.composer.composeMsgWithdrawDelegatorReward(delegator, validator); } + + // vaults + async depositToMegavault( + subaccount: SubaccountInfo, + quoteQuantums: Uint8Array, + broadcastMode?: BroadcastMode, + ): Promise { + const msg = await this.depositToMegavaultMsg( + subaccount.address, + subaccount.subaccountNumber, + quoteQuantums, + ); + return this.send( + subaccount.wallet, + () => Promise.resolve([msg]), + false, + undefined, + undefined, + broadcastMode, + ); + } + + depositToMegavaultMsg( + ...args: Parameters + ): EncodeObject { + return this.composer.composeMsgDepositToMegavault(...args); + } + + async withdrawFromMegavault( + subaccount: SubaccountInfo, + shares: Uint8Array, + minQuoteQuantums: Uint8Array, + broadcastMode?: BroadcastMode, + ): Promise { + const msg = await this.withdrawFromMegavaultMsg( + subaccount.address, + subaccount.subaccountNumber, + shares, + minQuoteQuantums, + ); + return this.send( + subaccount.wallet, + () => Promise.resolve([msg]), + false, + undefined, + undefined, + broadcastMode, + ); + } + + withdrawFromMegavaultMsg( + ...args: Parameters + ): EncodeObject { + return this.composer.composeMsgWithdrawFromMegavault(...args); + } + + async registerAffiliate( + subaccount: SubaccountInfo, + affiliate: string, + broadcastMode?: BroadcastMode, + gasAdjustment: number = 2, + ): Promise { + const msg = this.registerAffiliateMsg(subaccount.address, affiliate); + return this.send( + subaccount.wallet, + () => Promise.resolve([msg]), + false, + undefined, + undefined, + broadcastMode, + undefined, + gasAdjustment, + ); + } + + registerAffiliateMsg(...args: Parameters): EncodeObject { + return this.composer.composeMsgRegisterAffiliate(...args); + } + + launchMarketMsg( + ...args: Parameters + ): EncodeObject { + return this.composer.composeMsgCreateMarketPermissionless(...args); + } + + async createMarketPermissionless( + ticker: string, + subaccount: SubaccountInfo, + broadcastMode?: BroadcastMode, + gasAdjustment?: number, + memo?: string, + ): Promise { + const msg = this.launchMarketMsg(subaccount.address, ticker, subaccount.subaccountNumber); + + return this.send( + subaccount.wallet, + () => Promise.resolve([msg]), + false, + undefined, + memo, + broadcastMode, + undefined, + gasAdjustment, + ); + } } diff --git a/v4-client-js/src/clients/modules/proto-includes.ts b/v4-client-js/src/clients/modules/proto-includes.ts index ce18b0fc..768786d3 100644 --- a/v4-client-js/src/clients/modules/proto-includes.ts +++ b/v4-client-js/src/clients/modules/proto-includes.ts @@ -11,6 +11,9 @@ export * as RewardsModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/ export * as StakingModule from '@dydxprotocol/v4-proto/src/codegen/cosmos/staking/v1beta1/query'; export * as BridgeModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/bridge/query'; export * as DistributionModule from '@dydxprotocol/v4-proto/src/codegen/cosmos/distribution/v1beta1/query'; +export * as AffiliateModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/affiliates/query'; +export * as VaultModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/vault/query'; +export * as ListingModule from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/query'; export * from '@dydxprotocol/v4-proto/src/codegen/cosmos/base/abci/v1beta1/abci'; export * from '@dydxprotocol/v4-proto/src/codegen/cosmos/gov/v1/gov'; @@ -25,3 +28,4 @@ export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/tx'; export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/sending/transfer'; export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/genesis'; export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/assets/asset'; +export * from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/listing/tx'; diff --git a/v4-client-js/src/clients/modules/vault.ts b/v4-client-js/src/clients/modules/vault.ts new file mode 100644 index 00000000..4dff9e67 --- /dev/null +++ b/v4-client-js/src/clients/modules/vault.ts @@ -0,0 +1,23 @@ +import { PnlTickInterval } from '../constants'; +import { Data } from '../types'; +import RestClient from './rest'; + +/** + * @description REST endpoints for data unrelated to a particular address. + */ +export default class VaultClient extends RestClient { + async getMegavaultHistoricalPnl(resolution?: PnlTickInterval | null): Promise { + const uri = '/v4/vault/v1/megavault/historicalPnl'; + return this.get(uri, { resolution }); + } + + async getVaultsHistoricalPnl(resolution?: PnlTickInterval | null): Promise { + const uri = '/v4/vault/v1/vaults/historicalPnl'; + return this.get(uri, { resolution }); + } + + async getMegavaultPositions(): Promise { + const uri = '/v4/vault/v1/megavault/positions'; + return this.get(uri); + } +} diff --git a/v4-client-js/src/clients/native.ts b/v4-client-js/src/clients/native.ts index 356c7751..6578717e 100644 --- a/v4-client-js/src/clients/native.ts +++ b/v4-client-js/src/clients/native.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /* Native app can call JS functions with primitives. */ @@ -16,7 +17,7 @@ import Long from 'long'; import { BECH32_PREFIX, GAS_MULTIPLIER, NOBLE_BECH32_PREFIX } from '../lib/constants'; import { UserError } from '../lib/errors'; import { ByteArrayEncoding, encodeJson } from '../lib/helpers'; -import { deriveHDKeyFromEthereumSignature } from '../lib/onboarding'; +import { deriveHDKeyFromEthereumSignature, deriveHDKeyFromMnemonic } from '../lib/onboarding'; import { NetworkOptimizer } from '../network_optimizer'; import { CompositeClient, MarketInfo } from './composite-client'; import { @@ -30,6 +31,7 @@ import { SelectedGasDenom, } from './constants'; import { FaucetClient } from './faucet-client'; +import { parseToPrimitives } from './helpers/request-helpers'; import { Response } from './lib/axios'; import LocalWallet from './modules/local-wallet'; import { NobleClient } from './noble-client'; @@ -147,6 +149,12 @@ export async function connectWallet(mnemonic: string): Promise { globalThis.wallet = await LocalWallet.fromMnemonic(mnemonic, BECH32_PREFIX); globalThis.nobleWallet = await LocalWallet.fromMnemonic(mnemonic, NOBLE_BECH32_PREFIX); + const { privateKey, publicKey } = deriveHDKeyFromMnemonic(mnemonic); + globalThis.hdKey = { + privateKey, + publicKey, + }; + try { await globalThis.nobleClient?.connect(globalThis.nobleWallet); } catch (e) { @@ -212,12 +220,17 @@ export async function getFeeTiers(): Promise { } } -export async function getUserFeeTier(address: string): Promise { +export async function getUserFeeTier(payload: string): Promise { try { const client = globalThis.client; if (client === undefined) { throw new UserError('client is not connected. Call connectClient() first'); } + const json = JSON.parse(payload); + const address = json.address; + if (address === undefined) { + throw new UserError('address is not set'); + } const feeTiers = await globalThis.client?.validatorClient.get.getUserFeeTier(address); return encodeJson(feeTiers); } catch (e) { @@ -431,7 +444,7 @@ export async function withdraw(payload: string): Promise { } const subaccount = new SubaccountInfo(wallet, subaccountNumber); - const tx = await client.withdrawFromSubaccount(subaccount, amount, json.recipient); + const tx = await client.withdrawFromSubaccount(subaccount, amount, json.recipient, json.memo); return encodeJson(tx); } catch (error) { return wrappedError(error); @@ -552,7 +565,7 @@ export async function transferNativeToken(payload: string): Promise { }, false, client.validatorClient.post.defaultDydxGasPrice, - undefined, + json.memo, ); return encodeJson(tx); } catch (error) { @@ -1211,14 +1224,14 @@ export async function getWithdrawalCapacityByDenom(payload: string): Promise { +export async function getWithdrawalAndTransferGatingStatus(perpetualId: number): Promise { try { const client = globalThis.client; if (client === undefined) { throw new UserError('client is not connected. Call connectClient() first'); } - const response = await client.validatorClient.get.getWithdrawalAndTransferGatingStatus(); + const response = await client.validatorClient.get.getWithdrawalAndTransferGatingStatus(perpetualId); return encodeJson(response); } catch (error) { return wrappedError(error); @@ -1306,6 +1319,34 @@ export async function signCompliancePayload(payload: string): Promise { } } +export async function signPushNotificationTokenRegistrationPayload(payload: string): Promise { + try { + const json = JSON.parse(payload); + const message = json.message; + if (message === undefined) { + throw new UserError('message is not set'); + } + if (!globalThis.hdKey?.privateKey || !globalThis.hdKey?.publicKey) { + throw new Error('Missing hdKey'); + } + + const timestampInSeconds = Math.floor(Date.now() / 1000); + const messageToSign: string = `${message}:REGISTER_TOKEN"${''}:${timestampInSeconds}`; + const messageHash = sha256(Buffer.from(messageToSign)); + + const signed = await Secp256k1.createSignature(messageHash, globalThis.hdKey.privateKey); + const signedMessage = signed.toFixedLength(); + + return encodeJson({ + signedMessage: Buffer.from(signedMessage).toString('base64'), + publicKey: Buffer.from(globalThis.hdKey.publicKey).toString('base64'), + timestamp: timestampInSeconds, + }); + } catch (error) { + return wrappedError(error); + } +} + export async function setSelectedGasDenom(gasDenom: string): Promise { try { const client = globalThis.client; @@ -1318,3 +1359,90 @@ export async function setSelectedGasDenom(gasDenom: string): Promise { return wrappedError(error); } } + +export async function getMegavaultOwnerShares(payload: string): Promise { + try { + const client = globalThis.client; + if (client === undefined) { + throw new UserError('client is not connected. Call connectClient() first'); + } + const json = JSON.parse(payload); + const address = json.address; + if (address === undefined) { + throw new UserError('address is not set'); + } + const response = + await globalThis.client?.validatorClient.get.getMegavaultOwnerShares(address); + return encodeJson(parseToPrimitives(response)); + } catch (e) { + return wrappedError(e); + } +} + +export async function getMegavaultWithdrawalInfo( + sharesToWithdraw: bigint +): Promise { + try { + const client = globalThis.client; + if (client === undefined) { + throw new UserError('client is not connected. Call connectClient() first'); + } + const response = + await globalThis.client?.validatorClient.get.getMegavaultWithdrawalInfo(sharesToWithdraw); + return encodeJson(parseToPrimitives(response)); + } catch (e) { + return wrappedError(e); + } +} + +export async function depositToMegavault( + subaccountNumber: number, + amountUsdc: number +): Promise { + try { + const client = globalThis.client; + if (client === undefined) { + throw new UserError('client is not connected. Call connectNetwork() first'); + } + const wallet = globalThis.wallet; + if (wallet === undefined) { + throw new UserError('wallet is not set. Call connectWallet() first'); + } + const subaccount = new SubaccountInfo(wallet, subaccountNumber); + const tx = await client.depositToMegavault( + subaccount, + amountUsdc, + Method.BroadcastTxCommit, + ); + return encodeJson(parseToPrimitives(tx)); + } catch (error) { + return wrappedError(error); + } +} + +export async function withdrawFromMegavault( + subaccountNumber: number, + shares: number, + minAmount: number, +): Promise { + try { + const client = globalThis.client; + if (client === undefined) { + throw new UserError('client is not connected. Call connectNetwork() first'); + } + const wallet = globalThis.wallet; + if (wallet === undefined) { + throw new UserError('wallet is not set. Call connectWallet() first'); + } + const subaccount = new SubaccountInfo(wallet, subaccountNumber); + const tx = await client.withdrawFromMegavault( + subaccount, + shares, + minAmount, + Method.BroadcastTxCommit, + ); + return encodeJson(parseToPrimitives(tx)); + } catch (error) { + return wrappedError(error); + } +} \ No newline at end of file diff --git a/v4-client-js/src/clients/types.ts b/v4-client-js/src/clients/types.ts index d9f49e15..89c8cb5d 100644 --- a/v4-client-js/src/clients/types.ts +++ b/v4-client-js/src/clients/types.ts @@ -59,6 +59,11 @@ export interface IPlaceOrder extends IBasicOrder { export interface ICancelOrder extends IBasicOrder {} +export interface IBatchCancelOrder { + shortTermOrders: { clobPairId: number; clientIds: number[] }[]; + goodTilBlock: number; +} + // How long to wait and how often to check when calling Broadcast with // Method.BroadcastTxCommit export interface BroadcastOptions { diff --git a/v4-client-js/src/clients/validator-client.ts b/v4-client-js/src/clients/validator-client.ts index 9553328e..43ad1b91 100644 --- a/v4-client-js/src/clients/validator-client.ts +++ b/v4-client-js/src/clients/validator-client.ts @@ -69,6 +69,15 @@ export class ValidatorClient { this._post.setSelectedGasDenom(gasDenom); } + + /** + * @description populate account number cache in the Post module for performance. + */ + async populateAccountNumberCache(address: string): Promise { + if (!this._post) throw new Error('Post module not initialized'); + await this._post.populateAccountNumberCache(address); + } + private async initialize(): Promise { const tendermint37Client: Tendermint37Client = await Tendermint37Client.connect( this.config.restEndpoint, @@ -88,6 +97,7 @@ export class ValidatorClient { this.config.chainId, this.config.denoms, this.config.defaultClientMemo, + this.config.useTimestampNonce, ); } } diff --git a/v4-client-js/src/codegen/index.ts b/v4-client-js/src/codegen/index.ts deleted file mode 100644 index 587e80e1..00000000 --- a/v4-client-js/src/codegen/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This file and any referenced files were automatically generated by @osmonauts/telescope@0.80.0 - * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. - */ diff --git a/v4-client-js/src/index.ts b/v4-client-js/src/index.ts index 955b97d9..b74834c6 100644 --- a/v4-client-js/src/index.ts +++ b/v4-client-js/src/index.ts @@ -2,6 +2,7 @@ export * from './types'; // Utility functions. +export * as helpers from './lib/helpers'; export * as utils from './lib/utils'; export * as validation from './lib/validation'; export * as onboarding from './lib/onboarding'; diff --git a/v4-client-js/src/lib/constants.ts b/v4-client-js/src/lib/constants.ts index 612f2bb1..5349beb1 100644 --- a/v4-client-js/src/lib/constants.ts +++ b/v4-client-js/src/lib/constants.ts @@ -12,7 +12,7 @@ export const BROADCAST_TIMEOUT_MS: number = 8_000; export const API_TIMEOUT_DEFAULT_MS: number = 5_000; // Gas -export const GAS_MULTIPLIER: number = 1.4; +export const GAS_MULTIPLIER: number = 1.6; export const ZERO_FEE: StdFee = { amount: [], diff --git a/v4-client-js/src/lib/helpers.ts b/v4-client-js/src/lib/helpers.ts index fd7ea0b6..0df9df4b 100644 --- a/v4-client-js/src/lib/helpers.ts +++ b/v4-client-js/src/lib/helpers.ts @@ -49,6 +49,16 @@ function toBigInt(u: Uint8Array): BigInt { return negated ? -abs : abs; } +export function bigIntToBytes(value: bigint): Uint8Array { + const absoluteValue = value < 0 ? value * BigInt(-1) : value; + const nonPaddedHexValue = absoluteValue.toString(16); + const paddedHexValue = + nonPaddedHexValue.length % 2 === 0 ? nonPaddedHexValue : `0${nonPaddedHexValue}`; + const numberBytes = Buffer.from(paddedHexValue, 'hex'); + const signedBytes = Uint8Array.of(value < 0 ? 3 : 2, ...numberBytes); + return signedBytes; +} + export enum ByteArrayEncoding { HEX = 'hex', BIGINT = 'bigint', diff --git a/v4-client-js/src/lib/onboarding.ts b/v4-client-js/src/lib/onboarding.ts index 69eba323..2959d949 100644 --- a/v4-client-js/src/lib/onboarding.ts +++ b/v4-client-js/src/lib/onboarding.ts @@ -27,19 +27,11 @@ export const exportMnemonicAndPrivateKey = ( publicKey: Uint8Array | null; } => { const mnemonic = entropyToMnemonic(entropy, wordlist); - const seed = mnemonicToSeedSync(mnemonic); - - const hdkey = HDKey.fromMasterSeed(seed); - const derivedHdkey = hdkey.derive(path); - - if (!hdkey.privateKey) { - throw new Error('null hd key'); - } - + const { privateKey, publicKey } = deriveHDKeyFromMnemonic(mnemonic, path); return { mnemonic, - privateKey: derivedHdkey.privateKey, - publicKey: derivedHdkey.publicKey, + privateKey, + publicKey, }; }; @@ -67,3 +59,38 @@ export const deriveHDKeyFromEthereumSignature = ( const entropy = keccak256(rsValues); return exportMnemonicAndPrivateKey(entropy); }; + +/** + * @description Derive priv/pub keys from mnemonic and BIP44 HD path + * + * @url https://github.com/confio/cosmos-hd-key-derivation-spec#bip44 + * + * @param mnemonic used to generate seed + * + * @param path BIP44 HD Path. Default is The Cosmos Hub path + * + * @throws Error if the hdkey does not exist + * + * @returns Priv/pub keys + */ +export const deriveHDKeyFromMnemonic = ( + mnemonic: string, + path: string = "m/44'/118'/0'/0/0", +): { + privateKey: Uint8Array | null; + publicKey: Uint8Array | null; +} => { + const seed = mnemonicToSeedSync(mnemonic); + + const hdkey = HDKey.fromMasterSeed(seed); + const derivedHdkey = hdkey.derive(path); + + if (!hdkey.privateKey) { + throw new Error('null hd key'); + } + + return { + privateKey: derivedHdkey.privateKey, + publicKey: derivedHdkey.publicKey, + }; +}; diff --git a/v4-client-js/src/lib/validation.ts b/v4-client-js/src/lib/validation.ts index e7480c2d..55480ff9 100644 --- a/v4-client-js/src/lib/validation.ts +++ b/v4-client-js/src/lib/validation.ts @@ -2,7 +2,13 @@ import { decode } from 'bech32'; import Long from 'long'; import { MAX_SUBACCOUNT_NUMBER, MAX_UINT_32 } from '../clients/constants'; -import { Transfer, OrderFlags, ICancelOrder, IPlaceOrder } from '../clients/types'; +import { + Transfer, + OrderFlags, + ICancelOrder, + IPlaceOrder, + IBatchCancelOrder, +} from '../clients/types'; import { UserError } from './errors'; /** @@ -77,6 +83,35 @@ export function validateCancelOrderMessage( return undefined; } +/** + * @describe validateBatchCancelOrderMessage validates that orders to batch cancel have fields that would be + * valid on-chain. + */ +export function validateBatchCancelOrderMessage( + subaccountNumber: number, + orders: IBatchCancelOrder, +): UserError | undefined { + for (const orderBatch of orders.shortTermOrders) { + for (const clientId of orderBatch.clientIds) { + if (!verifyNumberIsUint32(clientId)) { + return new UserError(`clientId: ${clientId} is not a valid uint32`); + } + } + } + + if (!verifyGoodTilBlock(orders.goodTilBlock)) { + return new UserError(`goodTilBlock: ${orders.goodTilBlock} is not a valid uint32 or is 0`); + } + + if (!verifySubaccountNumber(subaccountNumber)) { + return new UserError( + `subaccountNumber: ${subaccountNumber} cannot be < 0 or > ${MAX_SUBACCOUNT_NUMBER}`, + ); + } + + return undefined; +} + /** * @describe validateTransferMessage validates that a transfer to place has fields that would be * valid on-chain. @@ -84,12 +119,16 @@ export function validateCancelOrderMessage( export function validateTransferMessage(transfer: Transfer): UserError | undefined { if (!verifySubaccountNumber(transfer.sender!!.number || 0)) { return new UserError( - `senderSubaccountNumber: ${transfer.sender!!.number || 0} cannot be < 0 or > ${MAX_SUBACCOUNT_NUMBER}`, + `senderSubaccountNumber: ${ + transfer.sender!!.number || 0 + } cannot be < 0 or > ${MAX_SUBACCOUNT_NUMBER}`, ); } if (!verifySubaccountNumber(transfer.recipient!!.number || 0)) { return new UserError( - `recipientSubaccountNumber: ${transfer.recipient!!.number || 0} cannot be < 0 or > ${MAX_SUBACCOUNT_NUMBER}`, + `recipientSubaccountNumber: ${ + transfer.recipient!!.number || 0 + } cannot be < 0 or > ${MAX_SUBACCOUNT_NUMBER}`, ); } if (transfer.assetId !== 0) { diff --git a/v4-client-js/src/types.ts b/v4-client-js/src/types.ts index 22124065..56f376a2 100644 --- a/v4-client-js/src/types.ts +++ b/v4-client-js/src/types.ts @@ -40,4 +40,5 @@ export interface Options { export enum ClobPairId { PERPETUAL_PAIR_BTC_USD = 0, + PERPETUAL_PAIR_ETH_USD = 1, } diff --git a/v4-client-js/tsconfig.json b/v4-client-js/tsconfig.json index 378db2f8..e1a47074 100644 --- a/v4-client-js/tsconfig.json +++ b/v4-client-js/tsconfig.json @@ -6,7 +6,6 @@ "examples", "scripts", "src", - "codegen.js", "node_modules/@dydxprotocol/v4-proto/**/**.ts" ], "compilerOptions": { diff --git a/v4-client-js/webpack.config.js b/v4-client-js/webpack.config.js index db3a63fe..7ba02ea0 100644 --- a/v4-client-js/webpack.config.js +++ b/v4-client-js/webpack.config.js @@ -1,5 +1,6 @@ const path = require('path'); +const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const webpack = require('webpack'); module.exports = { @@ -31,6 +32,7 @@ module.exports = { http: require.resolve('stream-http'), path: require.resolve('path-browserify'), crypto: require.resolve('crypto-browserify'), + util: require.resolve('util'), }, }, plugins: [ @@ -44,5 +46,6 @@ module.exports = { }, }, }), + new NodePolyfillPlugin(), ], }; diff --git a/v4-client-py-deprecated/v4_client_py/clients/modules/post.py b/v4-client-py-deprecated/v4_client_py/clients/modules/post.py index ec8395b4..4bfa61c0 100644 --- a/v4-client-py-deprecated/v4_client_py/clients/modules/post.py +++ b/v4-client-py-deprecated/v4_client_py/clients/modules/post.py @@ -15,6 +15,9 @@ from ...chain.aerial.client.utils import prepare_and_broadcast_basic_transaction +PY_V1_CLIENT_ID = 1 + + class Post: def __init__( self, @@ -134,7 +137,7 @@ def place_order( subticks=subticks, time_in_force=time_in_force, reduce_only=reduce_only, - client_metadata=client_metadata, + client_metadata=PY_V1_CLIENT_ID, condition_type=condition_type, conditional_order_trigger_subticks=conditional_order_trigger_subticks, ) diff --git a/v4-client-py-v2/README.md b/v4-client-py-v2/README.md index df7f7ea3..cb5521a9 100644 --- a/v4-client-py-v2/README.md +++ b/v4-client-py-v2/README.md @@ -32,6 +32,96 @@ Install from github: pip install git+https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-py-v2 ``` +Certainly! Here's the continued README section: + +--- + +## Installation + +### Install from PyPI: + +To install the client from PyPI, run: + +```bash +pip install dydx-v4-client +``` + +### Install from GitHub: + +To install directly from the GitHub repository, run: + +```bash +pip install git+https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-py-v2 +``` + +### Common Installation Issue on Ubuntu + +If you're using Ubuntu and encounter the following error when trying to install `dydx-v4-client`: + +``` +Failed building wheel for ed25519-blake2b +``` + +This error suggests there might be some compatibility issues or missing dependencies. The likely cause is that the `ed25519-blake2b` package requires Rust to be installed for building the necessary components. Here’s how you can fix this: + +1. **Ensure Necessary Build Tools Are Installed:** + + First, update your package list and install the essential build tools: + + ```bash + sudo apt-get update + sudo apt-get install build-essential python3-dev + ``` + +2. **Install Additional System Libraries:** + + Install the SSL development libraries: + + ```bash + sudo apt-get install libssl-dev + ``` + +3. **Install Rust Using rustup:** + + Rust is required to build certain packages. Install it using the following command: + + ```bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + + Follow the prompts to complete the installation. After installation, you may need to restart your terminal or run: + + ```bash + source $HOME/.cargo/env + ``` + + to update your PATH. + +4. **Upgrade pip, setuptools, and wheel:** + + Ensure you have the latest versions of pip, setuptools, and wheel: + + ```bash + pip install --upgrade pip setuptools wheel + ``` + +5. **Install the ed25519-blake2b Package Separately:** + + To isolate the issue, try installing the `ed25519-blake2b` package first: + + ```bash + pip install ed25519-blake2b + ``` + +6. **Reattempt Installation of dydx-v4-client:** + + If the above steps succeed, try installing `dydx-v4-client` again: + + ```bash + pip install dydx-v4-client + ``` + + ## Getting Started Guide **dYdX Python SDK Trading Documentation**: go-to resource for starting trades on dYdX using the Python SDK. Follow this guide to learn the basics and begin trading. diff --git a/v4-client-py-v2/documentation/account_details.md b/v4-client-py-v2/documentation/account_details.md index beb2b158..0da770a4 100644 --- a/v4-client-py-v2/documentation/account_details.md +++ b/v4-client-py-v2/documentation/account_details.md @@ -1,6 +1,26 @@ -# Getting Account Order Information +# Getting Account and Subaccount Information -This guide demonstrates how to retrieve information about your account's orders using the dYdX Python SDK. +This guide demonstrates how to retrieve information about your account, subaccounts, and orders using the dYdX Python SDK. + +## Understanding Accounts and Subaccounts + +**Accounts** +- Your primary identity on dYdX, linked to your blockchain wallet address. +- Acts as a container for all your trading activities and subaccounts. + +**Subaccounts** +- Separate trading entities within your main account. +- Each has its own balance, positions, orders, and trading history. +- Every account starts with subaccount 0; additional subaccounts can be created. + +**Key Points** +- Subaccounts allow segregation of trading strategies and risk management. +- Losses in one subaccount don't affect others. +- Useful for separating personal trading, algorithms, or different fund allocations. + +**API Usage** +- Most operations require both the account address and subaccount number. +- Example: `get_subaccount_orders(address, subaccount_number)` ## Setting Up @@ -23,7 +43,7 @@ To retrieve all open orders for an account: async def get_open_orders(address): orders = await client.account.get_subaccount_orders( address, - 0, + 0, # Subaccount ID status="OPEN" ) print("Open orders:", orders) diff --git a/v4-client-py-v2/documentation/cancelling_orders.md b/v4-client-py-v2/documentation/cancelling_orders.md new file mode 100644 index 00000000..1de8aab7 --- /dev/null +++ b/v4-client-py-v2/documentation/cancelling_orders.md @@ -0,0 +1,60 @@ +# Cancelling Orders + +This guide demonstrates how to cancel orders using the dYdX Python SDK. + +## Cancelling Orders + +There are two ways to cancel orders using the dYdX Python SDK: + +### 1. Cancel a Specific Order + +To cancel a specific order, you can use the `cancel_order` method. Here's an example: + +```python +from dydx_v4_client.node.message import cancel_order + +cancel_order_msg = cancel_order( + order_id, + good_til_block, + good_til_block_time +) + +response = await node_client.cancel_order( + wallet, + order_id, + good_til_block=good_til_block, + good_til_block_time=good_til_block_time +) +``` + +### 2. Batch Cancel Orders +For cancelling multiple orders at once, you can use the batch_cancel_orders method. Here's an example: +pythonCopyfrom dydx_v4_client.node.message import batch_cancel +from v4_proto.dydxprotocol.clob.order_pb2 import OrderBatch + +```python +PERPETUAL_PAIR_BTC_USD = 0 + +client_ids = [tx_client_id1, tx_client_id2] +short_term_cancels = [OrderBatch(clob_pair_id=PERPETUAL_PAIR_BTC_USD, client_ids=client_ids)] + +batch_cancel_msg = batch_cancel( + subaccount_id, + short_term_cancels, + good_til_block +) + +response = await node_client.batch_cancel_orders( + wallet, + subaccount_id, + short_term_cancels, + good_til_block +) +``` + +### Examples +For more detailed examples of how to cancel orders: +- **Cancelling a specific order**: See `examples/long_term_order_cancel_example.py` +- **Batch cancelling orders**: See `examples/batch_cancel_example.py` + + diff --git a/v4-client-py-v2/documentation/network_setup.md b/v4-client-py-v2/documentation/network_setup.md index cf19c36e..143ba35a 100644 --- a/v4-client-py-v2/documentation/network_setup.md +++ b/v4-client-py-v2/documentation/network_setup.md @@ -1,52 +1,133 @@ ### Networks -> **See [network resources](https://docs.dydx.exchange/infrastructure_providers-network/resources#networks-repositories) to find publicly available endpoints** +This guide explains how to connect to different dYdX networks using the Python SDK. + +#### Finding Network Endpoints + +> **Important:** For the most up-to-date list of publicly available endpoints, refer to our [network resources documentation](https://docs.dydx.exchange/infrastructure_providers-network/resources#networks-repositories). + +#### Connecting to Mainnet + +To connect to the mainnet, use the `make_mainnet` function: -To connect to the mainnet you can use `make_mainnet` function: ```python from dydx_v4_client.network import make_mainnet - NETWORK = make_mainnet( - node_url=NODE_URL, - rest_indexer=REST_URL, - websocket_indexer=WEBSOCKET_URL + node_url="NODE_URL", # No 'https://' prefix + rest_indexer="REST_INDEXER_URL", + websocket_indexer="WEBSOCKET_INDEXER_URL" ) ``` -For local and testnet networks there is a set of predefined networks: +> Note the above are just an example of the mainnet endpoints. Always use the most recent endpoints from our [network resources documentation](https://docs.dydx.exchange/infrastructure_providers-network/resources#indexer-endpoints). + +⚠️ **Important:** When specifying `node_url`, do not include the `https://` prefix. This is a common mistake that can cause connection issues. + +#### Connecting to Testnet + +For testnet, you can use the predefined `TESTNET` network: ```python -from dydx_v4_client.network import TESTNET, LOCAL +from dydx_v4_client.network import TESTNET + +# Use TESTNET directly in your client initialization ``` -If you want to use a custom API each network has its respective _make_ function: +To customize the testnet connection: + ```python -from dydx_v4_client.network import make_testnet, make_local +from dydx_v4_client.network import make_testnet + +CUSTOM_TESTNET = make_testnet( + node_url="your-custom-testnet-node-url", + rest_indexer="your-custom-testnet-rest-url", + websocket_indexer="your-custom-testnet-websocket-url" +) ``` -You can overwrite the default URL when calling the function: +> Find the latest testnet endpoints in our [network resources documentation](https://docs.dydx.exchange/infrastructure_providers-network/resources#networks-repositories). + +#### Local Development + +For local development, use the predefined `LOCAL` network: + ```python -NETWORK = make_local(node_url="http://localhost:26657") +from dydx_v4_client.network import LOCAL + +# Use LOCAL directly in your client initialization ``` -To create a custom network you can do it directly: +To customize the local network: + ```python -from dydx_v4_client.network import Network, NodeConfig, secure_channel +from dydx_v4_client.network import make_local + +CUSTOM_LOCAL = make_local(node_url="http://localhost:26657") +``` + +#### Creating a Custom Network +For advanced users who need to define a completely custom network: -CUSTOM_MAINNET = Network( - "https://dydx-testnet.imperator.co", - "wss://indexer.v4testnet.dydx.exchange/v4/ws", +```python +from dydx_v4_client.network import Network, NodeConfig, secure_channel + +CUSTOM_NETWORK = Network( + "https://your-custom-rest-url.com", + "wss://your-custom-websocket-url.com/ws", NodeConfig( - "dydx-testnet-4", - secure_channel("test-dydx-grpc.kingnodes.com"), - "adv4tnt", - "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", - ), + "dydx-testnet-4", + secure_channel("test-dydx-grpc.kingnodes.com"), + "adv4tnt", + "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5", + ), ) ``` -Or provide the URL directly to the client, e.g.: + +#### Direct URL Usage + +You can also provide URLs directly to specific clients: + ```python -indexer = IndexerClient("https://dydx-testnet.imperator.co") +from dydx_v4_client import IndexerClient + +indexer = IndexerClient("https://your-indexer-url.com") +``` + +Remember to always use the most recent endpoints from our [network resources documentation](https://docs.dydx.exchange/infrastructure_providers-network/resources#networks-repositories) when connecting to dYdX networks. + +#### Using Non-SSL Connections +The SDK supports both secure (SSL) and insecure (non-SSL) connections. By default, secure connections are used. However, for scenarios where you need to use a non-SSL node (e.g., local development), you can use the make_insecure function: + +###### Create a secure version of the testnet configuration +``` +from functools import partial + +make_testnet_secure = partial( + make_secure, + testnet_node, + rest_indexer="SECURE_REST_INDEXER_URL", + websocket_indexer="SECURE_WEBSOCKET_INDEXER_URL", + node_url="SECURE_NODE_URL", +) +TESTNET_SECURE = make_testnet_secure() +``` + +###### Create an insecure version of the testnet configuration ``` +from functools import partial + +make_testnet_insecure = partial( + make_insecure, + testnet_node, + rest_indexer="INSECURE_REST_INDEXER_URL", + websocket_indexer="INSECURE_WEBSOCKET_INDEXER_URL", + node_url="INSECURE_NODE_URL", +) +TESTNET_INSECURE = make_testnet_insecure() +``` +The difference between `make_secure` and `make_insecure` lies in the type of gRPC channel they use: + +- `make_secure`: This function uses `secure_channel`, which creates an SSL-encrypted connection. It's suitable for production environments and when connecting to nodes over public networks. +- `make_insecure`: This function uses `insecure_channel`, which creates a non-SSL connection. It's typically used for local development or in trusted network environments where encryption isn't necessary. diff --git a/v4-client-py-v2/documentation/placing_orders.md b/v4-client-py-v2/documentation/placing_orders.md index 127b2441..0ed2e235 100644 --- a/v4-client-py-v2/documentation/placing_orders.md +++ b/v4-client-py-v2/documentation/placing_orders.md @@ -33,4 +33,4 @@ Alternatively, you can use the market-based calculator, which provides more conv - Long term order + cancel: Example in `examples/long_term_order_cancel_example.py` ## Next Steps -Continue reading to learn how to [manage your positions](./account_order_information.md) using the dYdX Python SDK. +Continue reading to learn how to [cancel orders](./cancelling_orders.md) using the dYdX Python SDK. diff --git a/v4-client-py-v2/dydx_v4_client/__init__.py b/v4-client-py-v2/dydx_v4_client/__init__.py index 94c4918c..1d9402c8 100644 --- a/v4-client-py-v2/dydx_v4_client/__init__.py +++ b/v4-client-py-v2/dydx_v4_client/__init__.py @@ -1,13 +1,5 @@ from enum import IntEnum -from v4_proto.dydxprotocol.clob.order_pb2 import Order - -from dydx_v4_client.faucet_client import FaucetClient -from dydx_v4_client.indexer.rest.indexer_client import IndexerClient -from dydx_v4_client.indexer.socket.websocket import IndexerSocket -from dydx_v4_client.node.client import NodeClient, QueryNodeClient -from dydx_v4_client.wallet import Wallet - class OrderFlags(IntEnum): SHORT_TERM = 0 diff --git a/v4-client-py-v2/dydx_v4_client/indexer/rest/__init__.py b/v4-client-py-v2/dydx_v4_client/indexer/rest/__init__.py index e25297d8..e69de29b 100644 --- a/v4-client-py-v2/dydx_v4_client/indexer/rest/__init__.py +++ b/v4-client-py-v2/dydx_v4_client/indexer/rest/__init__.py @@ -1 +0,0 @@ -from dydx_v4_client.indexer.rest.indexer_client import IndexerClient diff --git a/v4-client-py-v2/dydx_v4_client/indexer/rest/constants.py b/v4-client-py-v2/dydx_v4_client/indexer/rest/constants.py index 70f0900b..f6679e23 100644 --- a/v4-client-py-v2/dydx_v4_client/indexer/rest/constants.py +++ b/v4-client-py-v2/dydx_v4_client/indexer/rest/constants.py @@ -40,6 +40,8 @@ class OrderStatus: FILLED = "FILLED" BEST_EFFORT_CANCELED = "BEST_EFFORT_CANCELED" CANCELED = "CANCELED" + UNTRIGGERED = "UNTRIGGERED" + PENDING = "PENDING" class TickerType: diff --git a/v4-client-py-v2/dydx_v4_client/indexer/socket/__init__.py b/v4-client-py-v2/dydx_v4_client/indexer/socket/__init__.py index fa7109a8..e69de29b 100644 --- a/v4-client-py-v2/dydx_v4_client/indexer/socket/__init__.py +++ b/v4-client-py-v2/dydx_v4_client/indexer/socket/__init__.py @@ -1,2 +0,0 @@ -from dydx_v4_client.indexer.socket.websocket import IndexerSocket -from dydx_v4_client.indexer.candles_resolution import CandlesResolution diff --git a/v4-client-py-v2/dydx_v4_client/network.py b/v4-client-py-v2/dydx_v4_client/network.py index e0ae9266..f8ec09c3 100644 --- a/v4-client-py-v2/dydx_v4_client/network.py +++ b/v4-client-py-v2/dydx_v4_client/network.py @@ -1,9 +1,12 @@ +import logging from dataclasses import dataclass from functools import partial import grpc from grpc import insecure_channel +logger = logging.getLogger(__name__) + secure_channel = partial( grpc.secure_channel, credentials=grpc.ssl_channel_credentials() ) @@ -27,6 +30,12 @@ class Network: def make_config( make_channel, make_node, rest_indexer: str, websocket_indexer: str, node_url: str ): + if node_url.startswith("http://") or node_url.startswith("https://"): + logger.warning( + "Node URL should not contain http(s)://. Stripping the prefix. In the future, consider providing the URL without the http(s) prefix." + ) + node_url = node_url.split("://", 1)[1] + return Network( rest_indexer, websocket_indexer, @@ -56,7 +65,7 @@ def make_config( make_testnet = partial( make_secure, testnet_node, - rest_indexer="https://dydx-testnet.imperator.co", + rest_indexer="https://indexer.v4testnet.dydx.exchange", websocket_indexer="wss://indexer.v4testnet.dydx.exchange/v4/ws", node_url="test-dydx-grpc.kingnodes.com", ) diff --git a/v4-client-py-v2/dydx_v4_client/node/builder.py b/v4-client-py-v2/dydx_v4_client/node/builder.py index 6822d8c5..1b8c8070 100644 --- a/v4-client-py-v2/dydx_v4_client/node/builder.py +++ b/v4-client-py-v2/dydx_v4_client/node/builder.py @@ -16,7 +16,7 @@ TxBody, ) -from dydx_v4_client.node.fee import calculate_fee +from dydx_v4_client.node.fee import calculate_fee, Denom from dydx_v4_client.wallet import Wallet @@ -60,7 +60,7 @@ class Builder: memo: str = "Client Example" def calculate_fee(self, gas_used) -> Fee: - gas_limit, amount = calculate_fee(gas_used) + gas_limit, amount = calculate_fee(gas_used, Denom(self.denomination)) return self.fee(gas_limit, self.coin(amount)) def coin(self, amount: int) -> Coin: diff --git a/v4-client-py-v2/dydx_v4_client/node/chain_helpers.py b/v4-client-py-v2/dydx_v4_client/node/chain_helpers.py index 829eaf7c..000f77b9 100644 --- a/v4-client-py-v2/dydx_v4_client/node/chain_helpers.py +++ b/v4-client-py-v2/dydx_v4_client/node/chain_helpers.py @@ -1,7 +1,6 @@ from dydx_v4_client.indexer.rest.constants import ( OrderType, OrderExecution, - OrderTimeInForce, ) from v4_proto.dydxprotocol.clob.order_pb2 import Order @@ -54,10 +53,13 @@ def calculate_client_metadata(order_type: OrderType) -> int: @staticmethod def calculate_condition_type(order_type: OrderType) -> Order.ConditionType: - if order_type in [OrderType.LIMIT, OrderType.MARKET]: + if order_type in [ + OrderType.LIMIT, + OrderType.MARKET, + OrderType.STOP_MARKET, + OrderType.STOP_LIMIT, + ]: return Order.ConditionType.CONDITION_TYPE_UNSPECIFIED - elif order_type in [OrderType.STOP_LIMIT, OrderType.STOP_MARKET]: - return Order.ConditionType.CONDITION_TYPE_STOP_LOSS elif order_type in [OrderType.TAKE_PROFIT_LIMIT, OrderType.TAKE_PROFIT_MARKET]: return Order.ConditionType.CONDITION_TYPE_TAKE_PROFIT else: diff --git a/v4-client-py-v2/dydx_v4_client/node/client.py b/v4-client-py-v2/dydx_v4_client/node/client.py index 6d3098c0..d8b77b77 100644 --- a/v4-client-py-v2/dydx_v4_client/node/client.py +++ b/v4-client-py-v2/dydx_v4_client/node/client.py @@ -5,7 +5,7 @@ import grpc from google._upb._message import Message -from google.protobuf.json_format import MessageToDict, MessageToJson +from google.protobuf.json_format import MessageToDict from typing_extensions import List, Optional, Self from v4_proto.cosmos.auth.v1beta1 import query_pb2_grpc as auth from v4_proto.cosmos.auth.v1beta1.auth_pb2 import BaseAccount @@ -66,10 +66,11 @@ QuerySubaccountAllResponse, ) from v4_proto.dydxprotocol.subaccounts.subaccount_pb2 import SubaccountId +from v4_proto.dydxprotocol.clob.tx_pb2 import OrderBatch from dydx_v4_client.network import NodeConfig from dydx_v4_client.node.builder import Builder -from dydx_v4_client.node.fee import Coin, Fee, calculate_fee +from dydx_v4_client.node.fee import Coin, Fee, calculate_fee, Denom from dydx_v4_client.node.message import ( cancel_order, deposit, @@ -77,6 +78,7 @@ send_token, transfer, withdraw, + batch_cancel, ) from dydx_v4_client.wallet import Wallet @@ -587,7 +589,7 @@ def calculate_fee(self, gas_used) -> Fee: Returns: Fee: The calculated fee. """ - gas_limit, amount = calculate_fee(gas_used) + gas_limit, amount = calculate_fee(gas_used, Denom(self.builder.denomination)) return Fee(gas_limit, [Coin(amount, self.builder.denomination)]) @@ -743,3 +745,29 @@ async def cancel_order( return await self.broadcast_message( wallet, cancel_order(order_id, good_til_block, good_til_block_time) ) + + async def batch_cancel_orders( + self, + wallet: Wallet, + subaccount_id: SubaccountId, + short_term_cancels: List[OrderBatch], + good_til_block: int, + ): + """ + Batch cancels orders for a subaccount. + + Args: + wallet (Wallet): The wallet to use for signing the transaction. + subaccount_id (SubaccountId): The subaccount ID for which to cancel orders. + short_term_cancels (List[OrderBatch]): List of OrderBatch objects containing the orders to cancel. + good_til_block (int): The last block the short term order cancellations can be executed at. + + Returns: + The response from the transaction broadcast. + """ + batch_cancel_msg = batch_cancel( + subaccount_id=subaccount_id, + short_term_cancels=short_term_cancels, + good_til_block=good_til_block, + ) + return await self.broadcast_message(wallet, batch_cancel_msg) diff --git a/v4-client-py-v2/dydx_v4_client/node/fee.py b/v4-client-py-v2/dydx_v4_client/node/fee.py index 1783eb9d..cec7c1f3 100644 --- a/v4-client-py-v2/dydx_v4_client/node/fee.py +++ b/v4-client-py-v2/dydx_v4_client/node/fee.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from math import ceil, floor from typing import List, Tuple +from enum import Enum from v4_proto.cosmos.base.v1beta1.coin_pb2 import Coin as ProtoCoin from v4_proto.cosmos.tx.v1beta1.tx_pb2 import Fee as ProtoFee @@ -11,6 +12,12 @@ DYDX_GAS_PRICE = 25000000000 +class Denom(Enum): + USDC = "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5" + DYDX = "adydx" + DYDX_TNT = "adv4tnt" + + @dataclass class Coin: amount: int @@ -32,6 +39,16 @@ def as_proto(self) -> ProtoFee: ) -def calculate_fee(gas_used) -> Tuple[int, int]: +def calculate_fee(gas_used: int, denom: Denom = Denom.USDC) -> Tuple[int, int]: gas_limit = floor(gas_used * GAS_MULTIPLIER) - return gas_limit, ceil(gas_limit * GAS_PRICE) + + if denom in [Denom.DYDX, Denom.DYDX_TNT]: + gas_price = DYDX_GAS_PRICE + elif denom == Denom.USDC: + gas_price = GAS_PRICE + else: + raise ValueError(f"{denom} cannot be used to cover gas fees") + + fee_amount = ceil(gas_limit * gas_price) + + return gas_limit, fee_amount diff --git a/v4-client-py-v2/dydx_v4_client/node/market.py b/v4-client-py-v2/dydx_v4_client/node/market.py index ee347bfc..7cfaaf6d 100644 --- a/v4-client-py-v2/dydx_v4_client/node/market.py +++ b/v4-client-py-v2/dydx_v4_client/node/market.py @@ -28,7 +28,10 @@ def calculate_quantums(self, size: float) -> int: result = max(quantums, self.market["stepBaseQuantums"]) return result - def calculate_subticks(self, price: float) -> int: + def calculate_subticks( + self, + price: float, + ) -> int: QUOTE_QUANTUMS_ATOMIC_RESOLUTION = -6 exponent = ( self.market["atomicResolution"] diff --git a/v4-client-py-v2/dydx_v4_client/node/message.py b/v4-client-py-v2/dydx_v4_client/node/message.py index 0466a115..89771bae 100644 --- a/v4-client-py-v2/dydx_v4_client/node/message.py +++ b/v4-client-py-v2/dydx_v4_client/node/message.py @@ -1,3 +1,5 @@ +from typing import List + from v4_proto.cosmos.bank.v1beta1.tx_pb2 import MsgSend from v4_proto.cosmos.base.v1beta1.coin_pb2 import Coin from v4_proto.dydxprotocol.clob.order_pb2 import Order, OrderId @@ -9,6 +11,9 @@ ) from v4_proto.dydxprotocol.sending.tx_pb2 import MsgCreateTransfer from v4_proto.dydxprotocol.subaccounts.subaccount_pb2 import SubaccountId +from v4_proto.dydxprotocol.clob.tx_pb2 import MsgBatchCancel, OrderBatch + +PY_V2_CLIENT_ID = 2 def order( @@ -33,7 +38,7 @@ def order( good_til_block_time=good_til_block_time, time_in_force=time_in_force, reduce_only=reduce_only, - client_metadata=client_metadata, + client_metadata=PY_V2_CLIENT_ID, condition_type=condition_type, conditional_order_trigger_subticks=conditional_order_trigger_subticks, ) @@ -75,6 +80,19 @@ def cancel_order( return message +def batch_cancel( + subaccount_id: SubaccountId, + short_term_cancels: List[OrderBatch], + good_til_block: int, +): + message = MsgBatchCancel( + subaccount_id=subaccount_id, + short_term_cancels=short_term_cancels, + good_til_block=good_til_block, + ) + return message + + def transfer( sender_subaccount: SubaccountId, recipient_subaccount: SubaccountId, diff --git a/v4-client-py-v2/examples/account_endpoints.py b/v4-client-py-v2/examples/account_endpoints.py index 4e9f5552..5c4c0349 100644 --- a/v4-client-py-v2/examples/account_endpoints.py +++ b/v4-client-py-v2/examples/account_endpoints.py @@ -1,7 +1,7 @@ import asyncio -from dydx_v4_client.indexer.rest import IndexerClient from dydx_v4_client.indexer.rest.constants import TradingRewardAggregationPeriod +from dydx_v4_client.indexer.rest.indexer_client import IndexerClient from dydx_v4_client.network import TESTNET from tests.conftest import TEST_ADDRESS diff --git a/v4-client-py-v2/examples/basic_adder.py b/v4-client-py-v2/examples/basic_adder.py index d346e65f..e8712a53 100644 --- a/v4-client-py-v2/examples/basic_adder.py +++ b/v4-client-py-v2/examples/basic_adder.py @@ -2,7 +2,7 @@ import logging from decimal import Decimal -from v4_proto.dydxprotocol.clob.order_pb2 import OrderId +from v4_proto.dydxprotocol.clob.order_pb2 import OrderId, Order from dydx_v4_client.indexer.rest.constants import OrderSide, OrderTimeInForce from dydx_v4_client.indexer.socket.websocket import ( @@ -176,7 +176,7 @@ async def place_order(self, side: OrderSide, size: float, px: Decimal): current_block = await self.node_client.latest_block_height() new_order = order( order_id=oid, - side=side, + side=Order.SIDE_BUY if side == OrderSide.BUY else Order.SIDE_SELL, quantums=(quantums // step_base_quantums) * step_base_quantums, subticks=(subticks // subticks_per_tick) * subticks_per_tick, time_in_force=time_in_force, diff --git a/v4-client-py-v2/examples/batch_cancel_example.py b/v4-client-py-v2/examples/batch_cancel_example.py new file mode 100644 index 00000000..b982d231 --- /dev/null +++ b/v4-client-py-v2/examples/batch_cancel_example.py @@ -0,0 +1,69 @@ +import asyncio +import random + +from v4_proto.dydxprotocol.clob.order_pb2 import Order + +from dydx_v4_client import MAX_CLIENT_ID, OrderFlags +from dydx_v4_client.indexer.rest.constants import OrderType +from dydx_v4_client.indexer.rest.indexer_client import IndexerClient +from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient +from dydx_v4_client.node.market import Market +from dydx_v4_client.wallet import Wallet +from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS +from v4_proto.dydxprotocol.clob.tx_pb2 import OrderBatch +from v4_proto.dydxprotocol.subaccounts.subaccount_pb2 import SubaccountId + + +MARKET_ID = "BTC-USD" +PERPETUAL_PAIR_BTC_USD = 0 + + +async def test_batch_cancel(): + node = await NodeClient.connect(TESTNET.node) + indexer = IndexerClient(TESTNET.rest_indexer) + + market = Market( + (await indexer.markets.get_perpetual_markets(MARKET_ID))["markets"][MARKET_ID] + ) + wallet = await Wallet.from_mnemonic(node, DYDX_TEST_MNEMONIC, TEST_ADDRESS) + + # Place multiple orders + orders = [] + client_ids = [] + for _ in range(3): + client_id = random.randint(0, MAX_CLIENT_ID) + order_id = market.order_id(TEST_ADDRESS, 0, client_id, OrderFlags.SHORT_TERM) + client_ids.append(client_id) + current_block = await node.latest_block_height() + order = market.order( + order_id, + side=Order.Side.SIDE_SELL, + order_type=OrderType.LIMIT, + size=0.01, + price=40000 + random.randint(-100, 100), + time_in_force=Order.TIME_IN_FORCE_IOC, + reduce_only=False, + good_til_block=current_block + 20, + ) + orders.append(order) + + # Place orders + for order in orders: + place = await node.place_order(wallet, order) + print(f"Placed order: {place}") + wallet.sequence += 1 + + # Prepare batch cancel + subaccount_id = SubaccountId(owner=TEST_ADDRESS, number=0) + order_batch = OrderBatch(clob_pair_id=PERPETUAL_PAIR_BTC_USD, client_ids=client_ids) + cancellation_current_block = await node.latest_block_height() + + # Execute batch cancel + batch_cancel_response = await node.batch_cancel_orders( + wallet, subaccount_id, [order_batch], cancellation_current_block + 10 + ) + print(f"Batch cancel response: {batch_cancel_response}") + + +asyncio.run(test_batch_cancel()) diff --git a/v4-client-py-v2/examples/calculate_fees_example.py b/v4-client-py-v2/examples/calculate_fees_example.py new file mode 100644 index 00000000..2aa3f181 --- /dev/null +++ b/v4-client-py-v2/examples/calculate_fees_example.py @@ -0,0 +1,18 @@ +import asyncio + +from dydx_v4_client.node.fee import Denom, calculate_fee + + +async def test(): + try: + for denom in Denom: + gas_limit, fee_amount = calculate_fee(100000, denom) + print(f"Denom: {denom.name}") + print(f"Gas Limit: {gas_limit}") + print(f"Amount: {fee_amount} {denom.name}") + print() + except ValueError as e: + print(f"Error: {e}") + + +asyncio.run(test()) diff --git a/v4-client-py-v2/examples/long_term_order_cancel_example.py b/v4-client-py-v2/examples/long_term_order_cancel_example.py index 2cd78a1b..b9008ac7 100644 --- a/v4-client-py-v2/examples/long_term_order_cancel_example.py +++ b/v4-client-py-v2/examples/long_term_order_cancel_example.py @@ -1,11 +1,17 @@ import asyncio import random +import time -from dydx_v4_client import MAX_CLIENT_ID, NodeClient, Order, OrderFlags +from v4_proto.dydxprotocol.clob.order_pb2 import Order + +from dydx_v4_client import MAX_CLIENT_ID, OrderFlags +from dydx_v4_client.indexer.rest.constants import OrderType from dydx_v4_client.indexer.rest.indexer_client import IndexerClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.market import Market, since_now from dydx_v4_client.wallet import Wallet +from dydx_v4_client.indexer.rest.constants import OrderType from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS MARKET_ID = "ETH-USD" @@ -29,6 +35,7 @@ async def test(): wallet, market.order( order_id, + OrderType.LIMIT, Order.Side.SIDE_SELL, size=0.01, price=40000, @@ -38,8 +45,11 @@ async def test(): ), ) print(place) - # FIXME(piwonskp): Remove + wallet.sequence += 1 + time.sleep(5) + + time.sleep(5) cancel = await node.cancel_order( wallet, diff --git a/v4-client-py-v2/examples/market_order_example.py b/v4-client-py-v2/examples/market_order_example.py index 54d879b7..e08b1446 100644 --- a/v4-client-py-v2/examples/market_order_example.py +++ b/v4-client-py-v2/examples/market_order_example.py @@ -1,13 +1,15 @@ import asyncio import random -from dydx_v4_client import MAX_CLIENT_ID, NodeClient, OrderFlags, Wallet +from dydx_v4_client import MAX_CLIENT_ID, OrderFlags from v4_proto.dydxprotocol.clob.order_pb2 import Order from dydx_v4_client.indexer.rest.constants import OrderType from dydx_v4_client.indexer.rest.indexer_client import IndexerClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.market import Market +from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS MARKET_ID = "ETH-USD" @@ -33,7 +35,7 @@ async def place_market_order(size: float): order_type=OrderType.MARKET, side=Order.Side.SIDE_SELL, size=size, - price=0, # Set to 0 for market orders + price=0, # Recommend set to oracle price - 5% or lower for SELL, oracle price + 5% for BUY time_in_force=Order.TimeInForce.TIME_IN_FORCE_UNSPECIFIED, reduce_only=False, good_til_block=current_block + 10, diff --git a/v4-client-py-v2/examples/short_term_order_cancel_example.py b/v4-client-py-v2/examples/short_term_order_cancel_example.py index 4d220a21..7578cf5c 100644 --- a/v4-client-py-v2/examples/short_term_order_cancel_example.py +++ b/v4-client-py-v2/examples/short_term_order_cancel_example.py @@ -2,11 +2,15 @@ import random import time -from dydx_v4_client import MAX_CLIENT_ID, NodeClient, Order, OrderFlags, Wallet +from v4_proto.dydxprotocol.clob.order_pb2 import Order + +from dydx_v4_client import MAX_CLIENT_ID, OrderFlags from dydx_v4_client.indexer.rest.constants import OrderType from dydx_v4_client.indexer.rest.indexer_client import IndexerClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.market import Market +from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS MARKET_ID = "ETH-USD" diff --git a/v4-client-py-v2/examples/short_term_order_composite_example.py b/v4-client-py-v2/examples/short_term_order_composite_example.py index 999d21f2..bac19194 100644 --- a/v4-client-py-v2/examples/short_term_order_composite_example.py +++ b/v4-client-py-v2/examples/short_term_order_composite_example.py @@ -4,11 +4,15 @@ import time from pathlib import Path -from dydx_v4_client import MAX_CLIENT_ID, NodeClient, Order, OrderFlags, Wallet +from v4_proto.dydxprotocol.clob.order_pb2 import Order + +from dydx_v4_client import MAX_CLIENT_ID, OrderFlags from dydx_v4_client.indexer.rest.constants import OrderType from dydx_v4_client.indexer.rest.indexer_client import IndexerClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.market import Market +from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS MARKET_ID = "ETH-USD" diff --git a/v4-client-py-v2/examples/stop_limit_order_example.py b/v4-client-py-v2/examples/stop_limit_order_example.py new file mode 100644 index 00000000..08e53644 --- /dev/null +++ b/v4-client-py-v2/examples/stop_limit_order_example.py @@ -0,0 +1,51 @@ +import random + +from dydx_v4_client import MAX_CLIENT_ID, OrderFlags +from v4_proto.dydxprotocol.clob.order_pb2 import Order + +from dydx_v4_client.indexer.rest.constants import OrderType, OrderExecution +from dydx_v4_client.indexer.rest.indexer_client import IndexerClient +from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient +from dydx_v4_client.node.market import Market +from dydx_v4_client.wallet import Wallet +from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS + +MARKET_ID = "ETH-USD" + + +async def test_place_stop_limit_order(): + size, trigger_price = 0.001, 1800 + node = await NodeClient.connect(TESTNET.node) + indexer = IndexerClient(TESTNET.rest_indexer) + + market = Market( + (await indexer.markets.get_perpetual_markets(MARKET_ID))["markets"][MARKET_ID] + ) + wallet = await Wallet.from_mnemonic(node, DYDX_TEST_MNEMONIC, TEST_ADDRESS) + + order_id = market.order_id( + TEST_ADDRESS, 0, random.randint(0, MAX_CLIENT_ID), OrderFlags.SHORT_TERM + ) + + current_block = await node.latest_block_height() + print(current_block) + new_order = market.order( + order_id=order_id, + order_type=OrderType.STOP_LIMIT, + side=Order.Side.SIDE_SELL, + size=size, + price=trigger_price, + time_in_force=Order.TimeInForce.TIME_IN_FORCE_IOC, + reduce_only=False, + execution=OrderExecution.IOC, + good_til_block=current_block + 10, + ) + print(new_order) + transaction = await node.place_order( + wallet=wallet, + order=new_order, + ) + + print(transaction) + wallet.sequence += 1 diff --git a/v4-client-py-v2/examples/stop_market_order_example.py b/v4-client-py-v2/examples/stop_market_order_example.py new file mode 100644 index 00000000..917c1e24 --- /dev/null +++ b/v4-client-py-v2/examples/stop_market_order_example.py @@ -0,0 +1,51 @@ +import random + +from dydx_v4_client import MAX_CLIENT_ID, OrderFlags +from v4_proto.dydxprotocol.clob.order_pb2 import Order + +from dydx_v4_client.indexer.rest.constants import OrderType, OrderExecution +from dydx_v4_client.indexer.rest.indexer_client import IndexerClient +from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient +from dydx_v4_client.node.market import Market +from dydx_v4_client.wallet import Wallet +from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS + +MARKET_ID = "ETH-USD" + + +async def test_place_stop_market_order(): + size, trigger_price = 0.001, 1800 + node = await NodeClient.connect(TESTNET.node) + indexer = IndexerClient(TESTNET.rest_indexer) + + market = Market( + (await indexer.markets.get_perpetual_markets(MARKET_ID))["markets"][MARKET_ID] + ) + wallet = await Wallet.from_mnemonic(node, DYDX_TEST_MNEMONIC, TEST_ADDRESS) + + order_id = market.order_id( + TEST_ADDRESS, 0, random.randint(0, MAX_CLIENT_ID), OrderFlags.SHORT_TERM + ) + + current_block = await node.latest_block_height() + print(current_block) + new_order = market.order( + order_id=order_id, + order_type=OrderType.STOP_MARKET, + side=Order.Side.SIDE_SELL, + size=size, + price=trigger_price, + time_in_force=Order.TimeInForce.TIME_IN_FORCE_IOC, + reduce_only=False, + execution=OrderExecution.IOC, + good_til_block=current_block + 10, + ) + print(new_order) + transaction = await node.place_order( + wallet=wallet, + order=new_order, + ) + + print(transaction) + wallet.sequence += 1 diff --git a/v4-client-py-v2/examples/transfer_example_deposit.py b/v4-client-py-v2/examples/transfer_example_deposit.py index d0deeb6d..8831d972 100644 --- a/v4-client-py-v2/examples/transfer_example_deposit.py +++ b/v4-client-py-v2/examples/transfer_example_deposit.py @@ -1,7 +1,7 @@ import asyncio -from dydx_v4_client import NodeClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.message import subaccount from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS diff --git a/v4-client-py-v2/examples/transfer_example_transfer.py b/v4-client-py-v2/examples/transfer_example_transfer.py index a415b298..21203575 100644 --- a/v4-client-py-v2/examples/transfer_example_transfer.py +++ b/v4-client-py-v2/examples/transfer_example_transfer.py @@ -1,7 +1,7 @@ import asyncio -from dydx_v4_client import NodeClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.message import subaccount from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS diff --git a/v4-client-py-v2/examples/transfer_example_withdraw.py b/v4-client-py-v2/examples/transfer_example_withdraw.py index aec9dc2b..2f6b7ae7 100644 --- a/v4-client-py-v2/examples/transfer_example_withdraw.py +++ b/v4-client-py-v2/examples/transfer_example_withdraw.py @@ -1,7 +1,7 @@ import asyncio -from dydx_v4_client import NodeClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.message import subaccount from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS diff --git a/v4-client-py-v2/examples/transfer_example_withdraw_other.py b/v4-client-py-v2/examples/transfer_example_withdraw_other.py index c69ce61b..8a1bcb6c 100644 --- a/v4-client-py-v2/examples/transfer_example_withdraw_other.py +++ b/v4-client-py-v2/examples/transfer_example_withdraw_other.py @@ -1,8 +1,8 @@ import asyncio from functools import partial -from dydx_v4_client import NodeClient from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.message import subaccount, withdraw from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS diff --git a/v4-client-py-v2/examples/validator_post_example.py b/v4-client-py-v2/examples/validator_post_example.py index d3dd32ec..fe53ff7a 100644 --- a/v4-client-py-v2/examples/validator_post_example.py +++ b/v4-client-py-v2/examples/validator_post_example.py @@ -4,9 +4,11 @@ import time from pathlib import Path -from dydx_v4_client import MAX_CLIENT_ID, NodeClient, Wallet +from dydx_v4_client import MAX_CLIENT_ID from dydx_v4_client.network import TESTNET +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.message import order, order_id +from dydx_v4_client.wallet import Wallet from tests.conftest import DYDX_TEST_MNEMONIC, TEST_ADDRESS from google.protobuf.json_format import MessageToJson diff --git a/v4-client-py-v2/poetry.lock b/v4-client-py-v2/poetry.lock index 0644604a..d2655998 100644 --- a/v4-client-py-v2/poetry.lock +++ b/v4-client-py-v2/poetry.lock @@ -614,61 +614,61 @@ typing = ["typing-extensions (>=4.8)"] [[package]] name = "grpcio" -version = "1.64.1" +version = "1.65.4" description = "HTTP/2-based RPC framework" optional = false python-versions = ">=3.8" files = [ - {file = "grpcio-1.64.1-cp310-cp310-linux_armv7l.whl", hash = "sha256:55697ecec192bc3f2f3cc13a295ab670f51de29884ca9ae6cd6247df55df2502"}, - {file = "grpcio-1.64.1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:3b64ae304c175671efdaa7ec9ae2cc36996b681eb63ca39c464958396697daff"}, - {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:bac71b4b28bc9af61efcdc7630b166440bbfbaa80940c9a697271b5e1dabbc61"}, - {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c024ffc22d6dc59000faf8ad781696d81e8e38f4078cb0f2630b4a3cf231a90"}, - {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7cd5c1325f6808b8ae31657d281aadb2a51ac11ab081ae335f4f7fc44c1721d"}, - {file = "grpcio-1.64.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:0a2813093ddb27418a4c99f9b1c223fab0b053157176a64cc9db0f4557b69bd9"}, - {file = "grpcio-1.64.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2981c7365a9353f9b5c864595c510c983251b1ab403e05b1ccc70a3d9541a73b"}, - {file = "grpcio-1.64.1-cp310-cp310-win32.whl", hash = "sha256:1262402af5a511c245c3ae918167eca57342c72320dffae5d9b51840c4b2f86d"}, - {file = "grpcio-1.64.1-cp310-cp310-win_amd64.whl", hash = "sha256:19264fc964576ddb065368cae953f8d0514ecc6cb3da8903766d9fb9d4554c33"}, - {file = "grpcio-1.64.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:58b1041e7c870bb30ee41d3090cbd6f0851f30ae4eb68228955d973d3efa2e61"}, - {file = "grpcio-1.64.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bbc5b1d78a7822b0a84c6f8917faa986c1a744e65d762ef6d8be9d75677af2ca"}, - {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:5841dd1f284bd1b3d8a6eca3a7f062b06f1eec09b184397e1d1d43447e89a7ae"}, - {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8caee47e970b92b3dd948371230fcceb80d3f2277b3bf7fbd7c0564e7d39068e"}, - {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73819689c169417a4f978e562d24f2def2be75739c4bed1992435d007819da1b"}, - {file = "grpcio-1.64.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6503b64c8b2dfad299749cad1b595c650c91e5b2c8a1b775380fcf8d2cbba1e9"}, - {file = "grpcio-1.64.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1de403fc1305fd96cfa75e83be3dee8538f2413a6b1685b8452301c7ba33c294"}, - {file = "grpcio-1.64.1-cp311-cp311-win32.whl", hash = "sha256:d4d29cc612e1332237877dfa7fe687157973aab1d63bd0f84cf06692f04c0367"}, - {file = "grpcio-1.64.1-cp311-cp311-win_amd64.whl", hash = "sha256:5e56462b05a6f860b72f0fa50dca06d5b26543a4e88d0396259a07dc30f4e5aa"}, - {file = "grpcio-1.64.1-cp312-cp312-linux_armv7l.whl", hash = "sha256:4657d24c8063e6095f850b68f2d1ba3b39f2b287a38242dcabc166453e950c59"}, - {file = "grpcio-1.64.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:62b4e6eb7bf901719fce0ca83e3ed474ae5022bb3827b0a501e056458c51c0a1"}, - {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:ee73a2f5ca4ba44fa33b4d7d2c71e2c8a9e9f78d53f6507ad68e7d2ad5f64a22"}, - {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:198908f9b22e2672a998870355e226a725aeab327ac4e6ff3a1399792ece4762"}, - {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39b9d0acaa8d835a6566c640f48b50054f422d03e77e49716d4c4e8e279665a1"}, - {file = "grpcio-1.64.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:5e42634a989c3aa6049f132266faf6b949ec2a6f7d302dbb5c15395b77d757eb"}, - {file = "grpcio-1.64.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b1a82e0b9b3022799c336e1fc0f6210adc019ae84efb7321d668129d28ee1efb"}, - {file = "grpcio-1.64.1-cp312-cp312-win32.whl", hash = "sha256:55260032b95c49bee69a423c2f5365baa9369d2f7d233e933564d8a47b893027"}, - {file = "grpcio-1.64.1-cp312-cp312-win_amd64.whl", hash = "sha256:c1a786ac592b47573a5bb7e35665c08064a5d77ab88a076eec11f8ae86b3e3f6"}, - {file = "grpcio-1.64.1-cp38-cp38-linux_armv7l.whl", hash = "sha256:a011ac6c03cfe162ff2b727bcb530567826cec85eb8d4ad2bfb4bd023287a52d"}, - {file = "grpcio-1.64.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:4d6dab6124225496010bd22690f2d9bd35c7cbb267b3f14e7a3eb05c911325d4"}, - {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:a5e771d0252e871ce194d0fdcafd13971f1aae0ddacc5f25615030d5df55c3a2"}, - {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2c3c1b90ab93fed424e454e93c0ed0b9d552bdf1b0929712b094f5ecfe7a23ad"}, - {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20405cb8b13fd779135df23fabadc53b86522d0f1cba8cca0e87968587f50650"}, - {file = "grpcio-1.64.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0cc79c982ccb2feec8aad0e8fb0d168bcbca85bc77b080d0d3c5f2f15c24ea8f"}, - {file = "grpcio-1.64.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a3a035c37ce7565b8f4f35ff683a4db34d24e53dc487e47438e434eb3f701b2a"}, - {file = "grpcio-1.64.1-cp38-cp38-win32.whl", hash = "sha256:1257b76748612aca0f89beec7fa0615727fd6f2a1ad580a9638816a4b2eb18fd"}, - {file = "grpcio-1.64.1-cp38-cp38-win_amd64.whl", hash = "sha256:0a12ddb1678ebc6a84ec6b0487feac020ee2b1659cbe69b80f06dbffdb249122"}, - {file = "grpcio-1.64.1-cp39-cp39-linux_armv7l.whl", hash = "sha256:75dbbf415026d2862192fe1b28d71f209e2fd87079d98470db90bebe57b33179"}, - {file = "grpcio-1.64.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e3d9f8d1221baa0ced7ec7322a981e28deb23749c76eeeb3d33e18b72935ab62"}, - {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:5f8b75f64d5d324c565b263c67dbe4f0af595635bbdd93bb1a88189fc62ed2e5"}, - {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c84ad903d0d94311a2b7eea608da163dace97c5fe9412ea311e72c3684925602"}, - {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:940e3ec884520155f68a3b712d045e077d61c520a195d1a5932c531f11883489"}, - {file = "grpcio-1.64.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f10193c69fc9d3d726e83bbf0f3d316f1847c3071c8c93d8090cf5f326b14309"}, - {file = "grpcio-1.64.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ac15b6c2c80a4d1338b04d42a02d376a53395ddf0ec9ab157cbaf44191f3ffdd"}, - {file = "grpcio-1.64.1-cp39-cp39-win32.whl", hash = "sha256:03b43d0ccf99c557ec671c7dede64f023c7da9bb632ac65dbc57f166e4970040"}, - {file = "grpcio-1.64.1-cp39-cp39-win_amd64.whl", hash = "sha256:ed6091fa0adcc7e4ff944090cf203a52da35c37a130efa564ded02b7aff63bcd"}, - {file = "grpcio-1.64.1.tar.gz", hash = "sha256:8d51dd1c59d5fa0f34266b80a3805ec29a1f26425c2a54736133f6d87fc4968a"}, + {file = "grpcio-1.65.4-cp310-cp310-linux_armv7l.whl", hash = "sha256:0e85c8766cf7f004ab01aff6a0393935a30d84388fa3c58d77849fcf27f3e98c"}, + {file = "grpcio-1.65.4-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:e4a795c02405c7dfa8affd98c14d980f4acea16ea3b539e7404c645329460e5a"}, + {file = "grpcio-1.65.4-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:d7b984a8dd975d949c2042b9b5ebcf297d6d5af57dcd47f946849ee15d3c2fb8"}, + {file = "grpcio-1.65.4-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:644a783ce604a7d7c91412bd51cf9418b942cf71896344b6dc8d55713c71ce82"}, + {file = "grpcio-1.65.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5764237d751d3031a36fafd57eb7d36fd2c10c658d2b4057c516ccf114849a3e"}, + {file = "grpcio-1.65.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ee40d058cf20e1dd4cacec9c39e9bce13fedd38ce32f9ba00f639464fcb757de"}, + {file = "grpcio-1.65.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4482a44ce7cf577a1f8082e807a5b909236bce35b3e3897f839f2fbd9ae6982d"}, + {file = "grpcio-1.65.4-cp310-cp310-win32.whl", hash = "sha256:66bb051881c84aa82e4f22d8ebc9d1704b2e35d7867757f0740c6ef7b902f9b1"}, + {file = "grpcio-1.65.4-cp310-cp310-win_amd64.whl", hash = "sha256:870370524eff3144304da4d1bbe901d39bdd24f858ce849b7197e530c8c8f2ec"}, + {file = "grpcio-1.65.4-cp311-cp311-linux_armv7l.whl", hash = "sha256:85e9c69378af02e483bc626fc19a218451b24a402bdf44c7531e4c9253fb49ef"}, + {file = "grpcio-1.65.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:2bd672e005afab8bf0d6aad5ad659e72a06dd713020554182a66d7c0c8f47e18"}, + {file = "grpcio-1.65.4-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:abccc5d73f5988e8f512eb29341ed9ced923b586bb72e785f265131c160231d8"}, + {file = "grpcio-1.65.4-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:886b45b29f3793b0c2576201947258782d7e54a218fe15d4a0468d9a6e00ce17"}, + {file = "grpcio-1.65.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be952436571dacc93ccc7796db06b7daf37b3b56bb97e3420e6503dccfe2f1b4"}, + {file = "grpcio-1.65.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:8dc9ddc4603ec43f6238a5c95400c9a901b6d079feb824e890623da7194ff11e"}, + {file = "grpcio-1.65.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ade1256c98cba5a333ef54636095f2c09e6882c35f76acb04412f3b1aa3c29a5"}, + {file = "grpcio-1.65.4-cp311-cp311-win32.whl", hash = "sha256:280e93356fba6058cbbfc6f91a18e958062ef1bdaf5b1caf46c615ba1ae71b5b"}, + {file = "grpcio-1.65.4-cp311-cp311-win_amd64.whl", hash = "sha256:d2b819f9ee27ed4e3e737a4f3920e337e00bc53f9e254377dd26fc7027c4d558"}, + {file = "grpcio-1.65.4-cp312-cp312-linux_armv7l.whl", hash = "sha256:926a0750a5e6fb002542e80f7fa6cab8b1a2ce5513a1c24641da33e088ca4c56"}, + {file = "grpcio-1.65.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:2a1d4c84d9e657f72bfbab8bedf31bdfc6bfc4a1efb10b8f2d28241efabfaaf2"}, + {file = "grpcio-1.65.4-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:17de4fda50967679677712eec0a5c13e8904b76ec90ac845d83386b65da0ae1e"}, + {file = "grpcio-1.65.4-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3dee50c1b69754a4228e933696408ea87f7e896e8d9797a3ed2aeed8dbd04b74"}, + {file = "grpcio-1.65.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74c34fc7562bdd169b77966068434a93040bfca990e235f7a67cdf26e1bd5c63"}, + {file = "grpcio-1.65.4-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:24a2246e80a059b9eb981e4c2a6d8111b1b5e03a44421adbf2736cc1d4988a8a"}, + {file = "grpcio-1.65.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18c10f0d054d2dce34dd15855fcca7cc44ec3b811139437543226776730c0f28"}, + {file = "grpcio-1.65.4-cp312-cp312-win32.whl", hash = "sha256:d72962788b6c22ddbcdb70b10c11fbb37d60ae598c51eb47ec019db66ccfdff0"}, + {file = "grpcio-1.65.4-cp312-cp312-win_amd64.whl", hash = "sha256:7656376821fed8c89e68206a522522317787a3d9ed66fb5110b1dff736a5e416"}, + {file = "grpcio-1.65.4-cp38-cp38-linux_armv7l.whl", hash = "sha256:4934077b33aa6fe0b451de8b71dabde96bf2d9b4cb2b3187be86e5adebcba021"}, + {file = "grpcio-1.65.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0cef8c919a3359847c357cb4314e50ed1f0cca070f828ee8f878d362fd744d52"}, + {file = "grpcio-1.65.4-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:a925446e6aa12ca37114840d8550f308e29026cdc423a73da3043fd1603a6385"}, + {file = "grpcio-1.65.4-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf53e6247f1e2af93657e62e240e4f12e11ee0b9cef4ddcb37eab03d501ca864"}, + {file = "grpcio-1.65.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdb34278e4ceb224c89704cd23db0d902e5e3c1c9687ec9d7c5bb4c150f86816"}, + {file = "grpcio-1.65.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e6cbdd107e56bde55c565da5fd16f08e1b4e9b0674851d7749e7f32d8645f524"}, + {file = "grpcio-1.65.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:626319a156b1f19513156a3b0dbfe977f5f93db63ca673a0703238ebd40670d7"}, + {file = "grpcio-1.65.4-cp38-cp38-win32.whl", hash = "sha256:3d1bbf7e1dd1096378bd83c83f554d3b93819b91161deaf63e03b7022a85224a"}, + {file = "grpcio-1.65.4-cp38-cp38-win_amd64.whl", hash = "sha256:a99e6dffefd3027b438116f33ed1261c8d360f0dd4f943cb44541a2782eba72f"}, + {file = "grpcio-1.65.4-cp39-cp39-linux_armv7l.whl", hash = "sha256:874acd010e60a2ec1e30d5e505b0651ab12eb968157cd244f852b27c6dbed733"}, + {file = "grpcio-1.65.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b07f36faf01fca5427d4aa23645e2d492157d56c91fab7e06fe5697d7e171ad4"}, + {file = "grpcio-1.65.4-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:b81711bf4ec08a3710b534e8054c7dcf90f2edc22bebe11c1775a23f145595fe"}, + {file = "grpcio-1.65.4-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88fcabc332a4aef8bcefadc34a02e9ab9407ab975d2c7d981a8e12c1aed92aa1"}, + {file = "grpcio-1.65.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9ba3e63108a8749994f02c7c0e156afb39ba5bdf755337de8e75eb685be244b"}, + {file = "grpcio-1.65.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:8eb485801957a486bf5de15f2c792d9f9c897a86f2f18db8f3f6795a094b4bb2"}, + {file = "grpcio-1.65.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:075f3903bc1749ace93f2b0664f72964ee5f2da5c15d4b47e0ab68e4f442c257"}, + {file = "grpcio-1.65.4-cp39-cp39-win32.whl", hash = "sha256:0a0720299bdb2cc7306737295d56e41ce8827d5669d4a3cd870af832e3b17c4d"}, + {file = "grpcio-1.65.4-cp39-cp39-win_amd64.whl", hash = "sha256:a146bc40fa78769f22e1e9ff4f110ef36ad271b79707577bf2a31e3e931141b9"}, + {file = "grpcio-1.65.4.tar.gz", hash = "sha256:2a4f476209acffec056360d3e647ae0e14ae13dcf3dfb130c227ae1c594cbe39"}, ] [package.extras] -protobuf = ["grpcio-tools (>=1.64.1)"] +protobuf = ["grpcio-tools (>=1.65.4)"] [[package]] name = "grpcio-tools" @@ -1642,13 +1642,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "v4-proto" -version = "4.1.4" +version = "5.2.1" description = "Protos for dYdX Chain protocol" optional = false python-versions = ">=3.8" files = [ - {file = "v4-proto-4.1.4.tar.gz", hash = "sha256:264d29a3f666a8686586789bb9bbec8a6d58ff16ffcece53a18fbb6ff97451c9"}, - {file = "v4_proto-4.1.4-py3-none-any.whl", hash = "sha256:9ee85862a0d9c3005ade4d4479332337d4b074d25e09bc4ca99d181b75de313c"}, + {file = "v4-proto-5.2.1.tar.gz", hash = "sha256:7de9f84cc13adcdae7ab920b0c615d8a878bb4006e11ef501188685fc9b5a9ec"}, + {file = "v4_proto-5.2.1-py3-none-any.whl", hash = "sha256:8b4c802c14fb5d2662191e329129218c26547d296e4f5e745e8217338355b66c"}, ] [package.dependencies] @@ -1710,4 +1710,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "08f167d695bb0327aa94b6bb9bd4ca0671fa89a1e443b6235a1d7f4cfba04f75" +content-hash = "8554d8aff1f50abaeb0ef9f86af09f79ab7835f9f93434cbbae4da906408b253" diff --git a/v4-client-py-v2/pyproject.toml b/v4-client-py-v2/pyproject.toml index 6e4d5e55..ff6db3d0 100644 --- a/v4-client-py-v2/pyproject.toml +++ b/v4-client-py-v2/pyproject.toml @@ -1,13 +1,16 @@ [tool.poetry] name = "dydx-v4-client" -version = "1.0.0" +version = "1.1.3" description = "" -authors = ["Piotr Piwoński "] +authors = [ + "Saul Martin ", + "Piotr Piwoński ", +] readme = "README.md" [tool.poetry.dependencies] python = "^3.9" -v4-proto = "^4.0.1" +v4-proto = "5.2.1" httpx = "^0.27.0" websocket-client = "^1.7.0" bip-utils = "^2.9.3" @@ -15,6 +18,7 @@ ecdsa = "^0.19.0" typing-extensions = "^4.12.2" bech32 = "^1.2.0" pycryptodome = "^3.20.0" +grpcio = "1.65.4" [tool.poetry.group.dev.dependencies] diff --git a/v4-client-py-v2/tests/conftest.py b/v4-client-py-v2/tests/conftest.py index aa13161f..1a597d66 100644 --- a/v4-client-py-v2/tests/conftest.py +++ b/v4-client-py-v2/tests/conftest.py @@ -6,11 +6,12 @@ import httpx import pytest -from dydx_v4_client import FaucetClient, NodeClient +from dydx_v4_client.faucet_client import FaucetClient from dydx_v4_client.indexer.rest.indexer_client import IndexerClient from dydx_v4_client.indexer.rest.noble_client import NobleClient from dydx_v4_client.indexer.socket.websocket import IndexerSocket from dydx_v4_client.network import TESTNET, TESTNET_FAUCET, TESTNET_NOBLE +from dydx_v4_client.node.client import NodeClient from dydx_v4_client.node.message import order, order_id from dydx_v4_client.wallet import Wallet, from_mnemonic diff --git a/v4-client-py-v2/tests/test_v4_proto.py b/v4-client-py-v2/tests/test_v4_proto.py index 362378a0..4113bbaa 100644 --- a/v4-client-py-v2/tests/test_v4_proto.py +++ b/v4-client-py-v2/tests/test_v4_proto.py @@ -13,7 +13,7 @@ ) from tests.conftest import TEST_ADDRESS -SERIALIZED_PLACE_ORDER = b"\nF\n1\n-\n+dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\x18@\x10\x01\x18\x80\xad\xe2\x04 \x80\xa0\xbe\x81\x95\x015\t\x9cYf" +SERIALIZED_PLACE_ORDER = b"\nH\n1\n-\n+dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\x18@\x10\x01\x18\x80\xad\xe2\x04 \x80\xa0\xbe\x81\x95\x015\t\x9cYfH\x02" SERIALIZED_CANCEL_ORDER = ( b"\n1\n-\n+dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\x18@\x1d\t\x9cYf" ) diff --git a/v4-client-rs/.gitignore b/v4-client-rs/.gitignore new file mode 100644 index 00000000..a9d37c56 --- /dev/null +++ b/v4-client-rs/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/v4-client-rs/CHANGELOG.md b/v4-client-rs/CHANGELOG.md new file mode 100644 index 00000000..7f2fb776 --- /dev/null +++ b/v4-client-rs/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2024-12-02 + +### 🚀 Features + +- Add Vaults REST API (#291) +- Add Validator/`NodeClient` MegaVault methods (#300) + +### ⚙️ Miscellaneous Tasks + +- Fix Rust client Cargo.toml README path (#281) +- Fix Rust client Cargo.toml repository link (#284) +- Allow the `Unicode-3.0` license (#292) +- Update dependencies (#295) + +## [0.1.0] - 2024-10-28 + +### 🚀 Features + +- Rust client implementation (#268) diff --git a/v4-client-rs/Cargo.toml b/v4-client-rs/Cargo.toml new file mode 100644 index 00000000..cb98e61c --- /dev/null +++ b/v4-client-rs/Cargo.toml @@ -0,0 +1,20 @@ +[workspace] +resolver = "2" +members = [ + "client", +] + +[workspace.package] +version = "0.1.1" +edition = "2021" +license = "LicenseRef-dYdX-Custom" + +[workspace.dependencies] +anyhow = "1" +async-trait = "0.1" +bigdecimal = { version = "0.4", features = ["serde"] } +derive_more = { version = "1", features = ["full"] } +log = "0.4" +thiserror = "2" +tokio = { version = "1.41", features = ["fs", "rt-multi-thread"] } +dydx-proto = "0.2.0" diff --git a/v4-client-rs/LICENSE b/v4-client-rs/LICENSE new file mode 100644 index 00000000..22304f63 --- /dev/null +++ b/v4-client-rs/LICENSE @@ -0,0 +1,802 @@ +Copyright (C) 2023 dYdX Trading Inc. + +Subject to your compliance with applicable law and the v4 Terms of Use, available at dydx.exchange/legal, you are granted the right to use the Program or Licensed Work (defined below) under the terms of the GNU Affero General Public License as set forth below; provided, however, that if you violate any such applicable law in your use of the Program or Licensed Work, all of your rights and licenses to use (including any rights to reproduce, distribute, install or modify) the Program or Licensed Work will automatically and immediately terminate. + + +The “Program” or “Licensed Work” shall mean any of the following: dydxprotocol/cosmos-sdk, dydxprotocol/cometbft, dydxprotocol/v4-chain, dydxprotocol/v4-clients, dydxprotocol/v4-web, dydxprotocol/v4-abacus, dydxprotocol/v4-localization, dydxprotocol/v4-documentation, and any dYdX or dYdX Trading Inc. repository reflecting a copy of, or link to, this license. + + +The GNU Affero General Public License +Version 3, 19 November 2007 + + +Copyright (C) 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + + Preamble + + + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + + The precise terms and conditions for copying, distribution and +modification follow. + + + + TERMS AND CONDITIONS + + + 0. Definitions. + + + "This License" refers to version 3 of the GNU Affero General Public License. + + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + + A "covered work" means either the unmodified Program or a work based +on the Program. + + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + + + 1. Source Code. + + + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + + + The Corresponding Source for a work in source code form is that +same work. + + + 2. Basic Permissions. + + + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; Section 10 +makes it unnecessary. + + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + + + 4. Conveying Verbatim Copies. + + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with Section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + + 5. Conveying Modified Source Versions. + + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of Section 4, provided that you also meet all of these conditions: + + + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under Section + 7. This requirement modifies the requirement in Section 4 to + "keep intact all notices". + + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable Section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + + + 6. Conveying Non-Source Forms. + + + + You may convey a covered work in object code form under the terms +of Sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with Subsection 6b. + + + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under Subsection 6d. + + + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + + + 7. Additional Terms. + + + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + + + a) Disclaiming warranty or limiting liability differently from the + terms of Sections 15 and 16 of this License; or + + + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of Section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + + + 8. Termination. + + + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of Section 11). + + + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under Section 10. + + + + 9. Acceptance Not Required for Having Copies. + + + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + + + 10. Automatic Licensing of Downstream Recipients. + + + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + + + 11. Patents. + + + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + + + 12. No Surrender of Others' Freedom. + + + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + + + 13. Remote Network Interaction; Use with the GNU General Public License. + + + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + + + 14. Revised Versions of this License. + + + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + + + 15. Disclaimer of Warranty. + + + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + + + 16. Limitation of Liability. + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + 17. Interpretation of Sections 15 and 16. + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + +For more information about this software, see https://dydx.exchange. + Copyright (C) 2023 dYdX Trading Inc. diff --git a/v4-client-rs/README.md b/v4-client-rs/README.md new file mode 100644 index 00000000..679253d5 --- /dev/null +++ b/v4-client-rs/README.md @@ -0,0 +1,64 @@ +# Rust client for dYdX v4 + +The crate implements interaction with the dYdX API. + +The following features are implemented: +- `NodeClient`, `IndexerClient` + WebSockets, `FaucetClient`, `NobleClient` +- Fully asynchronous implementation +- Telemetry +- Convenient builder for constructing requests +- Automatic WS connection support + +## Install + +To add the crate to your project, use the command: + +```sh +cargo add dydx +``` + +## Development + +Workspace consists of a single crate: +* `client` - to provide connection management with dYdX, common types and utils + +### Prerequisites + +* [Rust](https://www.rust-lang.org/tools/install) +* [cargo deny](https://github.com/EmbarkStudios/cargo-deny) +* [protoc](https://grpc.io/docs/protoc-installation/) for dev dependencies (`metrics-exporter-tcp`) + + +### Examples + +To run the example, you need to use the `cargo` command as follows: + +```sh +cargo run --example bot_basic_adder +``` + +You can find the full set of examples in the [examples](client/examples) folder. + +### Code quality assurance + +Before publishing make sure to run (and fix all warnings and errors) + +```sh +cargo fmt +cargo clippy +cargo deny check licenses advisories sources +``` + +### Documentation + +To generate the documentation, use the command + +```sh +cargo doc -p dydx +``` + +## Acknowledgements + +Built by Nethermind: [@v0-e](https://github.com/v0-e), [@therustmonk](https://github.com/therustmonk), [@maksimryndin](https://github.com/maksimryndin) + +For more details about the grant see [link](https://www.dydxgrants.com/grants/rust-trading-client). diff --git a/v4-client-rs/client/Cargo.toml b/v4-client-rs/client/Cargo.toml new file mode 100644 index 00000000..ae318d17 --- /dev/null +++ b/v4-client-rs/client/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "dydx" +version.workspace = true +edition.workspace = true +license.workspace = true +readme.workspace = true +description = "dYdX v4 asynchronous client." +repository = "https://github.com/dydxprotocol/v4-clients/tree/main/v4-client-rs" + +# https://crates.io/categories +categories = ["api-bindings", "asynchronous", "finance"] +keywords = ["trading", "dex"] + +[features] +default = ["faucet", "noble", "telemetry"] +faucet = [] +noble = [ + "dep:ibc-proto" +] +telemetry = [ + "dep:metrics", +] + +[dependencies] +anyhow.workspace = true +async-trait.workspace = true +bigdecimal.workspace = true +bip32 = { version = "0.5", default-features = false, features = ["bip39", "alloc", "secp256k1"] } +cosmrs = "0.21" +chrono = { version = "0.4", features = ["serde"] } +derive_more.workspace = true +futures-util = "0.3" +governor = { version = "0.7", default-features = false, features = ["std"] } +ibc-proto = { version = "0.51", optional = true } +log.workspace = true +rand = "0.8" +reqwest = { version = "0.12", features = ["json"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +serde_with = "3.11" +strum = { version = "0.26", features = ["derive"] } +thiserror.workspace = true +tonic = { version = "0.12", features = ["tls-native-roots"] } +tokio.workspace = true +tokio-tungstenite = { version = "0.24", features = ["native-tls"] } +toml = "0.8" +tower = { version = "0.5", features = ["timeout"] } +dydx-proto.workspace = true + +# Telemetry +metrics = { version = "0.24", optional = true } + +[dev-dependencies] +metrics-exporter-tcp = "0.11.0" +serial_test = "3.2.0" +tracing = "0.1" +tracing-subscriber = "0.3" diff --git a/v4-client-rs/client/examples/account_endpoint.rs b/v4-client-rs/client/examples/account_endpoint.rs new file mode 100644 index 00000000..cafc80e5 --- /dev/null +++ b/v4-client-rs/client/examples/account_endpoint.rs @@ -0,0 +1,205 @@ +mod support; + +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::{ + GetAggregationsOpts, GetFillsOpts, GetHistoricalPnlOpts, GetTradingRewardsOpts, + GetTransfersOpts, IndexerClient, ListOrdersOpts, ListPositionsOpts, MarketType, OrderSide, + PerpetualPositionStatus, Ticker, TradingRewardAggregationPeriod, +}; +use dydx::node::Wallet; +use support::constants::TEST_MNEMONIC; + +pub struct Rester { + indexer: IndexerClient, + wallet: Wallet, +} + +impl Rester { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { indexer, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let rester = Rester::connect().await?; + let account = rester.wallet.account_offline(0)?; + let indexer = rester.indexer; + + // Test values + let address = account.address(); + let subaccount = account.subaccount(0)?; + let parent_subaccount = subaccount.parent(); + + let subaccounts = indexer.accounts().get_subaccounts(address).await?; + tracing::info!("Subaccounts response: {:?}", subaccounts); + + let subaccount_resp = indexer.accounts().get_subaccount(&subaccount).await?; + tracing::info!("Subaccount response: {:?}", subaccount_resp); + + let asset_positions = indexer.accounts().get_asset_positions(&subaccount).await?; + tracing::info!("Asset positions response: {:?}", asset_positions); + + let pos_opts = ListPositionsOpts { + status: PerpetualPositionStatus::Closed.into(), + limit: Some(3), + ..Default::default() + }; + let positions = indexer + .accounts() + .list_positions(&subaccount, Some(pos_opts)) + .await?; + tracing::info!("Perpetual positions response: {:?}", positions); + + let trf_opts = GetTransfersOpts { + limit: Some(3), + ..Default::default() + }; + let transfers = indexer + .accounts() + .get_transfers(&subaccount, Some(trf_opts)) + .await?; + tracing::info!("Transfers response: {:?}", transfers); + + let ord_opts = ListOrdersOpts { + ticker: Some(Ticker::from("ETH-USD")), + limit: Some(3), + side: OrderSide::Buy.into(), + ..Default::default() + }; + let orders = indexer + .accounts() + .list_orders(&subaccount, Some(ord_opts)) + .await?; + tracing::info!("Orders response: {:?}", orders); + + let fill_opts = GetFillsOpts { + limit: Some(3), + market: Some(Ticker::from("ETH-USD")), + market_type: Some(MarketType::Perpetual), + ..Default::default() + }; + let fills = indexer + .accounts() + .get_fills(&subaccount, Some(fill_opts)) + .await?; + tracing::info!("Fills response: {:?}", fills); + + let pnl_opts = GetHistoricalPnlOpts { + limit: Some(3), + ..Default::default() + }; + let pnls = indexer + .accounts() + .get_historical_pnl(&subaccount, Some(pnl_opts)) + .await?; + tracing::info!("Historical PnLs response: {:?}", pnls); + + let rwds_opts = GetTradingRewardsOpts { + limit: Some(3), + ..Default::default() + }; + let rewards = indexer + .accounts() + .get_rewards(account.address(), Some(rwds_opts)) + .await?; + tracing::info!("Trading rewards response: {:?}", rewards); + + let aggr_opts = GetAggregationsOpts { + limit: Some(3), + ..Default::default() + }; + let aggregated = indexer + .accounts() + .get_rewards_aggregated( + address, + TradingRewardAggregationPeriod::Daily, + Some(aggr_opts), + ) + .await?; + tracing::info!("Trading rewards aggregated response: {:?}", aggregated); + + // Parent subaccount + let subaccount_resp = indexer + .accounts() + .get_parent_subaccount(&parent_subaccount) + .await?; + tracing::info!( + "Subaccount response (parent subaccount): {:?}", + subaccount_resp + ); + + let asset_positions = indexer + .accounts() + .get_parent_asset_positions(&parent_subaccount) + .await?; + tracing::info!( + "Asset positions response (parent subaccount): {:?}", + asset_positions + ); + + let pos_opts = ListPositionsOpts { + status: PerpetualPositionStatus::Closed.into(), + limit: Some(3), + ..Default::default() + }; + let positions = indexer + .accounts() + .list_parent_positions(&parent_subaccount, Some(pos_opts)) + .await?; + tracing::info!( + "Perpetual positions response (parent subaccount): {:?}", + positions + ); + + let trf_opts = GetTransfersOpts { + limit: Some(3), + ..Default::default() + }; + let transfers = indexer + .accounts() + .get_parent_transfers(&parent_subaccount, Some(trf_opts)) + .await?; + tracing::info!("Transfers response (parent subaccount): {:?}", transfers); + + let ord_opts = ListOrdersOpts { + ticker: Some(Ticker::from("ETH-USD")), + limit: Some(3), + side: OrderSide::Buy.into(), + ..Default::default() + }; + let orders = indexer + .accounts() + .list_parent_orders(&parent_subaccount, Some(ord_opts)) + .await?; + tracing::info!("Orders response (parent subaccount): {:?}", orders); + + let fill_opts = GetFillsOpts { + limit: Some(3), + market: Some(Ticker::from("ETH-USD")), + market_type: Some(MarketType::Perpetual), + ..Default::default() + }; + let fills = indexer + .accounts() + .get_parent_fills(&parent_subaccount, Some(fill_opts)) + .await?; + tracing::info!("Fills response (parent subaccount): {:?}", fills); + + let pnl_opts = GetHistoricalPnlOpts { + limit: Some(3), + ..Default::default() + }; + let pnls = indexer + .accounts() + .get_parent_historical_pnl(&parent_subaccount, Some(pnl_opts)) + .await?; + tracing::info!("Historical PnLs response (parent subaccount): {:?}", pnls); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/batch_cancel_orders.rs b/v4-client-rs/client/examples/batch_cancel_orders.rs new file mode 100644 index 00000000..568f4e4a --- /dev/null +++ b/v4-client-rs/client/examples/batch_cancel_orders.rs @@ -0,0 +1,95 @@ +mod support; +use anyhow::{Error, Result}; +use bigdecimal::BigDecimal; +use dydx::config::ClientConfig; +use dydx::indexer::{ClientId, IndexerClient}; +use dydx::node::{NodeClient, OrderBuilder, OrderSide, Wallet, SHORT_TERM_ORDER_MAXIMUM_LIFETIME}; +use dydx_proto::dydxprotocol::clob::{order::TimeInForce, OrderBatch}; +use rand::thread_rng; +use std::str::FromStr; +use support::constants::TEST_MNEMONIC; +use tokio::time::{sleep, Duration}; + +const N_ORDERS: usize = 6; + +const ETH_USD_TICKER: &str = "ETH-USD"; + +pub struct OrderPlacer { + client: NodeClient, + indexer: IndexerClient, + wallet: Wallet, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { + client, + indexer, + wallet, + }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + let mut account = placer.wallet.account(0, &mut placer.client).await?; + + let subaccount = account.subaccount(0)?; + + let market = placer + .indexer + .markets() + .get_perpetual_market(Ð_USD_TICKER.into()) + .await?; + + let builder = OrderBuilder::new(market.clone(), subaccount.clone()) + .market(OrderSide::Buy, BigDecimal::from_str("0.001")?) + .price(100) + .reduce_only(false) + .time_in_force(TimeInForce::Unspecified); + + let mut client_ids = Vec::new(); + // Push some orders + for _id in 0..N_ORDERS { + // Short term orders have a maximum validity of 20 blocks + let height = placer.client.get_latest_block_height().await?; + let order_builder = builder.clone().until(height.ahead(10)); + + let (order_id, order) = + order_builder.build(ClientId::random_with_rng(&mut thread_rng()))?; + let client_id = order_id.client_id; + client_ids.push(client_id); + let tx_hash = placer.client.place_order(&mut account, order).await?; + tracing::info!("Broadcast order ({client_id}) transaction hash: {tx_hash:?}"); + sleep(Duration::from_secs(2)).await; + } + + // Batch cancel + let batch = OrderBatch { + clob_pair_id: market.clob_pair_id.0, + client_ids, + }; + let til_height = placer + .client + .get_latest_block_height() + .await? + .ahead(SHORT_TERM_ORDER_MAXIMUM_LIFETIME); + let tx_hash = placer + .client + .batch_cancel_orders(&mut account, subaccount, vec![batch], til_height) + .await?; + tracing::info!( + "Broadcast cancel orders batch transaction hash: {:?}", + tx_hash + ); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/bot_basic_adder.rs b/v4-client-rs/client/examples/bot_basic_adder.rs new file mode 100644 index 00000000..83aa893a --- /dev/null +++ b/v4-client-rs/client/examples/bot_basic_adder.rs @@ -0,0 +1,271 @@ +mod support; + +use anyhow::{anyhow as err, Error, Result}; +use bigdecimal::{BigDecimal, One, Signed}; +use dydx::config::ClientConfig; +use dydx::indexer::{ + AnyId, Feed, IndexerClient, ListPerpetualMarketsOpts, PerpetualMarket, Price, Quantity, + SubaccountsMessage, Ticker, TradesMessage, +}; +use dydx::node::{Account, NodeClient, OrderBuilder, OrderId, OrderSide, Wallet}; +use std::str::FromStr; +use support::constants::TEST_MNEMONIC; +use support::order_book::LiveOrderBook; +use tokio::select; + +pub struct Parameters { + ticker: Ticker, + depth: BigDecimal, + allowed_deviation: BigDecimal, + max_position: Quantity, +} + +pub struct Variables { + position: Quantity, + state: State, +} + +enum State { + Resting { price: Price, oid: OrderId }, + InFlightOrder, + Cancelled, +} + +pub struct BasicAdder { + client: NodeClient, + #[allow(dead_code)] // TODO remove after completion + indexer: IndexerClient, + #[allow(dead_code)] // TODO remove after completion + wallet: Wallet, + account: Account, + #[allow(dead_code)] // TODO remove after completion + market: PerpetualMarket, + generator: OrderBuilder, + trades_feed: Feed, + subaccounts_feed: Feed, + order_book: LiveOrderBook, + parameters: Parameters, + variables: Variables, +} + +impl BasicAdder { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let mut client = NodeClient::connect(config.node).await?; + let mut indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + let account = wallet.account(0, &mut client).await?; + let subaccount = account.subaccount(0)?; + + let ticker = Ticker::from("ETH-USD"); + let market = indexer + .markets() + .list_perpetual_markets(Some(ListPerpetualMarketsOpts { + ticker: Some(ticker.clone()), + limit: None, + })) + .await? + .remove(&ticker) + .ok_or_else(|| err!("{ticker} not found in markets query response"))?; + let generator = OrderBuilder::new(market.clone(), subaccount.clone()); + + let trades_feed = indexer.feed().trades(&ticker, false).await?; + let orders_feed = indexer.feed().orders(&ticker, false).await?; + let subaccounts_feed = indexer.feed().subaccounts(subaccount, false).await?; + let order_book = LiveOrderBook::new(orders_feed); + let depth: BigDecimal = BigDecimal::from_str("0.001")?; + let allowed_deviation: BigDecimal = BigDecimal::from_str("0.2")?; + let max_position: Quantity = "1.0".parse()?; + let parameters = Parameters { + ticker, + depth, + allowed_deviation, + max_position, + }; + let variables = Variables { + position: 0.into(), + state: State::Cancelled, + }; + Ok(Self { + client, + indexer, + wallet, + account, + market, + generator, + trades_feed, + subaccounts_feed, + order_book, + parameters, + variables, + }) + } + + async fn entrypoint(mut self) { + loop { + if let Err(err) = self.step().await { + tracing::error!("Bot update failed: {err}"); + } + } + } + + async fn step(&mut self) -> Result<()> { + select! { + msg = self.trades_feed.recv() => { + if let Some(msg) = msg { + self.handle_trades_message(msg).await?; + } + } + msg = self.subaccounts_feed.recv() => { + if let Some(msg) = msg { + self.handle_subaccounts_message(msg).await?; + } + } + _ = self.order_book.changed() => { + self.handle_order_book().await?; + } + } + Ok(()) + } + + async fn handle_trades_message(&mut self, msg: TradesMessage) -> Result<()> { + match msg { + TradesMessage::Initial(_upd) => {} + TradesMessage::Update(_upd) => {} + } + Ok(()) + } + + async fn handle_subaccounts_message(&mut self, msg: SubaccountsMessage) -> Result<()> { + match msg { + SubaccountsMessage::Initial(upd) => { + let positions = upd.contents.subaccount.open_perpetual_positions; + if let Some(position) = positions.get(&self.parameters.ticker) { + self.variables.position = position.size.clone(); + tracing::info!("Position: {}", self.variables.position); + } + } + SubaccountsMessage::Update(upd) => { + if let Some(ref positions) = upd + .contents + .first() + .ok_or_else(|| err!("Subaccount message does not have data!"))? + .perpetual_positions + { + let size = positions + .iter() + .find(|p| (p.market == self.parameters.ticker)) + .map(|p| p.size.clone()); + if let Some(size) = size { + self.variables.position = size; + tracing::info!("Position: {}", self.variables.position); + } + } + } + } + Ok(()) + } + + async fn handle_order_book(&mut self) -> Result<()> { + let spread = self + .order_book + .borrow() + .spread() + .map(|spread| (spread.bid.price.clone(), spread.ask.price.clone())); + + if let Some((bid, ask)) = spread { + let side = if self.variables.position.is_negative() { + OrderSide::Buy + } else { + OrderSide::Sell + }; + + let one = ::one(); + let (book_price, ideal_price) = match side { + OrderSide::Buy => (&bid, bid.clone() * (one + &self.parameters.depth)), + OrderSide::Sell => (&ask, ask.clone() * (one - &self.parameters.depth)), + other => panic!("Unhandled side {other:?}!"), + }; + let ideal_distance = &book_price.0 * &self.parameters.depth; + + match &self.variables.state { + State::Resting { price, oid } => { + let distance = (ideal_price.clone() - price.clone()).abs(); + if distance > &self.parameters.allowed_deviation * ideal_distance { + tracing::info!( + "Cancelling order due to deviation: ID:{} side:{:?} ideal_price:{} price:{}", + oid.client_id, side, ideal_price, price + ); + self.cancel_order(oid.clone()).await?; + self.variables.state = State::Cancelled; + } + } + State::InFlightOrder => { + tracing::info!("Not placing an order because in flight"); + } + State::Cancelled => { + let size = &self.parameters.max_position.0 - self.variables.position.abs(); + if &size * &ideal_price.0 < BigDecimal::from_str("3.0")? { + tracing::info!("Not placing an order because at position limit: size:{size} ideal_price:{ideal_price}"); + return Ok(()); + } + self.variables.state = State::InFlightOrder; + if let Ok(oid) = self + .place_limit_order(side, ideal_price.clone(), size) + .await + { + self.variables.state = State::Resting { + price: ideal_price, + oid, + }; + } else { + self.variables.state = State::Cancelled; + } + } + } + } + Ok(()) + } + + async fn place_limit_order( + &mut self, + side: OrderSide, + price: Price, + size: BigDecimal, + ) -> Result { + let current_block = self.client.get_latest_block_height().await?; + let (id, order) = self + .generator + .clone() + .limit(side, price, size) + .until(current_block.ahead(10)) + .build(AnyId)?; + let hash = self.client.place_order(&mut self.account, order).await?; + tracing::info!("Placing {side:?} order: {hash} (ID: {})", id.client_id); + + Ok(id) + } + + async fn cancel_order(&mut self, id: OrderId) -> Result<()> { + let current_block = self.client.get_latest_block_height().await?; + let until = current_block.ahead(10); + let c_id = id.client_id; + let hash = self + .client + .cancel_order(&mut self.account, id, until) + .await?; + tracing::info!("Cancelling order: {hash} (ID: {c_id})"); + + Ok(()) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let adder = BasicAdder::connect().await?; + adder.entrypoint().await; + Ok(()) +} diff --git a/v4-client-rs/client/examples/bot_trend_follower.rs b/v4-client-rs/client/examples/bot_trend_follower.rs new file mode 100644 index 00000000..e024faed --- /dev/null +++ b/v4-client-rs/client/examples/bot_trend_follower.rs @@ -0,0 +1,388 @@ +mod support; + +use anyhow::{anyhow as err, Error, Result}; +use chrono::{TimeDelta, Utc}; +use dydx::config::ClientConfig; +use dydx::indexer::{ + CandleResolution, ClientId, Feed, GetCandlesOpts, IndexerClient, ListPerpetualMarketsOpts, + PerpetualMarket, Price, Quantity, Subaccount, SubaccountsMessage, Ticker, TradesMessage, +}; +use dydx::node::{ + Account, NodeClient, OrderBuilder, OrderId, OrderSide, Wallet, + SHORT_TERM_ORDER_MAXIMUM_LIFETIME, +}; +use std::fmt; +use support::constants::TEST_MNEMONIC; +use support::order_book::LiveOrderBook; +use tokio::{ + select, + sync::mpsc, + time::{sleep, Duration}, +}; + +pub struct Parameters { + ticker: Ticker, + position_size: Quantity, + shorter_span: TimeDelta, + longer_span: TimeDelta, +} + +pub struct Variables { + position: Quantity, + shorter_channel: Channel, + longer_channel: Channel, + state: State, +} + +enum State { + Waiting, + InTrend(OrderSide), +} + +pub struct Channel { + high: Price, + low: Price, +} + +impl fmt::Display for Channel { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "[{}, {}]", self.low, self.high)?; + Ok(()) + } +} + +pub struct TrendFollower { + client: NodeClient, + indexer: IndexerClient, + #[allow(dead_code)] // TODO remove after completion + wallet: Wallet, + account: Account, + subaccount: Subaccount, + market: PerpetualMarket, + generator: OrderBuilder, + trades_feed: Feed, + subaccounts_feed: Feed, + order_book: LiveOrderBook, + channel_rx: mpsc::UnboundedReceiver, + parameters: Parameters, + variables: Variables, +} + +impl TrendFollower { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let mut client = NodeClient::connect(config.node).await?; + let mut indexer = IndexerClient::new(config.indexer.clone()); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + let mut account = wallet.account(0, &mut client).await?; + let subaccount = account.subaccount(0)?; + + let ticker = Ticker::from("ETH-USD"); + let market = indexer + .markets() + .list_perpetual_markets(Some(ListPerpetualMarketsOpts { + ticker: Some(ticker.clone()), + limit: None, + })) + .await? + .remove(&ticker) + .ok_or_else(|| err!("{ticker} not found in markets query response"))?; + let generator = OrderBuilder::new(market.clone(), subaccount.clone()); + + // Close position + client + .close_position( + &mut account, + subaccount.clone(), + market.clone(), + None, + ClientId::random(), + ) + .await?; + + let trades_feed = indexer.feed().trades(&ticker, false).await?; + let orders_feed = indexer.feed().orders(&ticker, false).await?; + let subaccounts_feed = indexer + .feed() + .subaccounts(subaccount.clone(), false) + .await?; + let order_book = LiveOrderBook::new(orders_feed); + let position_size: Quantity = "0.001".parse()?; + let shorter_span = TimeDelta::minutes(10); + let longer_span = TimeDelta::minutes(30); + + let shorter_channel = calculate_channel(&indexer, &ticker, shorter_span).await?; + let longer_channel = calculate_channel(&indexer, &ticker, longer_span).await?; + + tracing::info!("Watching channel: {longer_channel}"); + + let (tx, channel_rx) = mpsc::unbounded_channel(); + tokio::spawn(Self::channel_fetcher( + tx, + IndexerClient::new(config.indexer), + ticker.clone(), + shorter_span, + )); + + let parameters = Parameters { + ticker, + position_size, + shorter_span, + longer_span, + }; + let variables = Variables { + position: 0.into(), + shorter_channel, + longer_channel, + state: State::Waiting, + }; + Ok(Self { + client, + indexer, + wallet, + account, + subaccount, + market, + generator, + trades_feed, + subaccounts_feed, + order_book, + channel_rx, + parameters, + variables, + }) + } + + async fn entrypoint(mut self) { + loop { + if let Err(err) = self.step().await { + tracing::error!("Bot update failed: {err}"); + } + } + } + + async fn step(&mut self) -> Result<()> { + select! { + msg = self.trades_feed.recv() => { + if let Some(msg) = msg { + self.handle_trades_message(msg).await?; + } + } + msg = self.subaccounts_feed.recv() => { + if let Some(msg) = msg { + self.handle_subaccounts_message(msg).await?; + } + } + channel = self.channel_rx.recv() => { + if let Some(channel) = channel { + self.variables.shorter_channel = channel; + } + } + _ = self.order_book.changed() => { + self.handle_order_book().await?; + } + } + Ok(()) + } + + async fn handle_trades_message(&mut self, msg: TradesMessage) -> Result<()> { + match msg { + TradesMessage::Initial(_upd) => {} + TradesMessage::Update(_upd) => {} + } + Ok(()) + } + + async fn handle_subaccounts_message(&mut self, msg: SubaccountsMessage) -> Result<()> { + match msg { + SubaccountsMessage::Initial(upd) => { + let positions = upd.contents.subaccount.open_perpetual_positions; + if let Some(position) = positions.get(&self.parameters.ticker) { + self.variables.position = position.size.clone(); + tracing::info!("Position: {}", self.variables.position); + } + } + SubaccountsMessage::Update(upd) => { + if let Some(ref positions) = upd + .contents + .first() + .ok_or_else(|| err!("Subaccount message does not have data!"))? + .perpetual_positions + { + let size = positions + .iter() + .find(|p| (p.market == self.parameters.ticker)) + .map(|p| p.size.clone()); + if let Some(size) = size { + self.variables.position = size; + tracing::info!("Position: {}", self.variables.position); + } + } + } + } + Ok(()) + } + + async fn handle_order_book(&mut self) -> Result<()> { + let spread = self + .order_book + .borrow() + .spread() + .map(|spread| (spread.bid.price.clone(), spread.ask.price.clone())); + + if let Some((bid, ask)) = spread { + let price = Price((bid.0 + ask.0) / 2); + match self.variables.state { + State::Waiting => { + if price > self.variables.longer_channel.high { + tracing::info!("Channel broken at {price}. Placing buy order."); + self.place_limit_order(OrderSide::Buy, price).await?; + self.variables.state = State::InTrend(OrderSide::Buy); + self.variables.shorter_channel = + self.get_channel(self.parameters.shorter_span).await?; + tracing::info!("In-trend channel: {}", self.variables.shorter_channel); + } else if price < self.variables.longer_channel.low { + tracing::info!("Channel broken at {price}. Placing sell order."); + self.place_limit_order(OrderSide::Sell, price).await?; + self.variables.state = State::InTrend(OrderSide::Sell); + self.variables.shorter_channel = + self.get_channel(self.parameters.shorter_span).await?; + tracing::info!("In-trend channel: {}", self.variables.shorter_channel); + } + } + State::InTrend(side) => { + let break_price = match side { + OrderSide::Buy => { + if price < self.variables.shorter_channel.low { + Some(price) + } else { + None + } + } + OrderSide::Sell => { + if price > self.variables.shorter_channel.high { + Some(price) + } else { + None + } + } + _ => None, + }; + if let Some(price) = break_price { + tracing::info!( + "Leaving trend at {price}, channel: {}. Closing position.", + self.variables.shorter_channel + ); + self.close_position().await?; + self.variables.state = State::Waiting; + self.variables.longer_channel = + self.get_channel(self.parameters.longer_span).await?; + tracing::info!("Watching channel {}.", self.variables.longer_channel); + } + } + } + } + Ok(()) + } + + async fn place_limit_order(&mut self, side: OrderSide, price: Price) -> Result { + let current_block = self.client.get_latest_block_height().await?; + let (id, order) = self + .generator + .clone() + .limit(side, price, self.parameters.position_size.clone()) + .until(current_block.ahead(SHORT_TERM_ORDER_MAXIMUM_LIFETIME)) + .build(ClientId::random())?; + let hash = self.client.place_order(&mut self.account, order).await?; + tracing::info!("Placing {side:?} order: {hash} (ID: {})", id.client_id); + + Ok(id) + } + + async fn _cancel_order(&mut self, id: OrderId) -> Result<()> { + let current_block = self.client.get_latest_block_height().await?; + let until = current_block.ahead(10); + let c_id = id.client_id; + let hash = self + .client + .cancel_order(&mut self.account, id, until) + .await?; + tracing::info!("Cancelling order: {hash} (ID: {c_id})"); + + Ok(()) + } + + async fn close_position(&mut self) -> Result<()> { + self.client + .close_position( + &mut self.account, + self.subaccount.clone(), + self.market.clone(), + None, + ClientId::random(), + ) + .await + .map(|_| ()) + .map_err(|e| err!("Failed closing position: {e}")) + } + + async fn get_channel(&self, span: TimeDelta) -> Result { + calculate_channel(&self.indexer, &self.parameters.ticker, span).await + } + + async fn channel_fetcher( + tx: mpsc::UnboundedSender, + indexer: IndexerClient, + ticker: Ticker, + span: TimeDelta, + ) -> Result { + loop { + sleep(Duration::from_secs(30)).await; + let result = calculate_channel(&indexer, &ticker, span).await?; + tx.send(result)?; + } + } +} + +async fn calculate_channel( + indexer: &IndexerClient, + ticker: &Ticker, + span: TimeDelta, +) -> Result { + let now = Utc::now(); + let opts = GetCandlesOpts { + from_iso: Some(now - span), + to_iso: Some(now), + limit: None, + }; + let candles = indexer + .markets() + .get_candles(ticker, CandleResolution::M1, Some(opts)) + .await?; + if candles.is_empty() { + return Err(err!("Candles response is empty")); + } + let high = candles + .iter() + .max_by_key(|c| c.high.clone()) + .unwrap() + .high + .clone(); + let low = candles + .iter() + .min_by_key(|c| c.low.clone()) + .unwrap() + .low + .clone(); + Ok(Channel { low, high }) +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let follower = TrendFollower::connect().await?; + follower.entrypoint().await; + Ok(()) +} diff --git a/v4-client-rs/client/examples/cancel_order.rs b/v4-client-rs/client/examples/cancel_order.rs new file mode 100644 index 00000000..94f6fb10 --- /dev/null +++ b/v4-client-rs/client/examples/cancel_order.rs @@ -0,0 +1,71 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::{AnyId, IndexerClient, Ticker}; +use dydx::node::{NodeClient, OrderBuilder, OrderSide, Wallet}; +use dydx_proto::dydxprotocol::clob::order::TimeInForce; +use support::constants::TEST_MNEMONIC; +use tokio::time::{sleep, Duration}; + +const ETH_USD_TICKER: &str = "ETH-USD"; + +pub struct OrderPlacer { + client: NodeClient, + indexer: IndexerClient, + wallet: Wallet, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { + client, + indexer, + wallet, + }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + let mut account = placer.wallet.account(0, &mut placer.client).await?; + let subaccount = account.subaccount(0)?; + + let ticker = Ticker(ETH_USD_TICKER.into()); + let market = placer + .indexer + .markets() + .get_perpetual_market(&ticker) + .await?; + + let current_block_height = placer.client.get_latest_block_height().await?; + let good_until = current_block_height.ahead(10); + + let (order_id, order) = OrderBuilder::new(market, subaccount) + .limit(OrderSide::Buy, 100, 3) + .reduce_only(false) + .time_in_force(TimeInForce::Unspecified) + .until(good_until.clone()) + .build(AnyId)?; + + let place_tx_hash = placer.client.place_order(&mut account, order).await?; + tracing::info!("Place order transaction hash: {:?}", place_tx_hash); + + sleep(Duration::from_secs(5)).await; + + // Cancel order + let cancel_tx_hash = placer + .client + .cancel_order(&mut account, order_id, good_until) + .await?; + tracing::info!("Cancel order transaction hash: {:?}", cancel_tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/close_all_positions.rs b/v4-client-rs/client/examples/close_all_positions.rs new file mode 100644 index 00000000..a43a62e4 --- /dev/null +++ b/v4-client-rs/client/examples/close_all_positions.rs @@ -0,0 +1,90 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::{ + ClientId, IndexerClient, ListPositionsOpts, + PerpetualPositionResponseObject as PerpetualPosition, PerpetualPositionStatus, Subaccount, +}; +use dydx::node::{NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; + +pub struct OrderPlacer { + client: NodeClient, + indexer: IndexerClient, + wallet: Wallet, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { + client, + indexer, + wallet, + }) + } +} + +async fn get_open_positions( + indexer: &IndexerClient, + subaccount: &Subaccount, +) -> Result> { + indexer + .accounts() + .list_positions( + subaccount, + Some(ListPositionsOpts { + status: Some(PerpetualPositionStatus::Open), + ..Default::default() + }), + ) + .await +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + let mut account = placer.wallet.account(0, &mut placer.client).await?; + + let subaccount = account.subaccount(0)?; + + let open_positions = get_open_positions(&placer.indexer, &subaccount).await?; + tracing::info!("Number of open positions: {}", open_positions.len()); + + for position in open_positions { + let market = placer + .indexer + .markets() + .get_perpetual_market(&position.market) + .await?; + let ticker = market.ticker.clone(); + + // Fully close the position, if open, matching best current market prices + let tx_hash = placer + .client + .close_position( + &mut account, + subaccount.clone(), + market, + None, + ClientId::random(), + ) + .await?; + tracing::info!("{ticker} position close transaction hash: {:?}", tx_hash); + } + + tracing::info!( + "Number of open positions: {}", + get_open_positions(&placer.indexer, &subaccount) + .await? + .len() + ); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/close_position.rs b/v4-client-rs/client/examples/close_position.rs new file mode 100644 index 00000000..7e10486d --- /dev/null +++ b/v4-client-rs/client/examples/close_position.rs @@ -0,0 +1,121 @@ +mod support; +use anyhow::{Error, Result}; +use bigdecimal::BigDecimal; +use dydx::config::ClientConfig; +use dydx::indexer::{ + ClientId, IndexerClient, ListPositionsOpts, + PerpetualPositionResponseObject as PerpetualPosition, PerpetualPositionStatus, Subaccount, + Ticker, +}; +use dydx::node::{NodeClient, Wallet}; +use std::str::FromStr; +use support::constants::TEST_MNEMONIC; +use tokio::time::{sleep, Duration}; + +const ETH_USD_TICKER: &str = "ETH-USD"; + +pub struct OrderPlacer { + client: NodeClient, + indexer: IndexerClient, + wallet: Wallet, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { + client, + indexer, + wallet, + }) + } +} + +async fn get_open_position( + indexer: &IndexerClient, + subaccount: &Subaccount, + ticker: &Ticker, +) -> Option { + indexer + .accounts() + .list_positions( + subaccount, + Some(ListPositionsOpts { + status: Some(PerpetualPositionStatus::Open), + ..Default::default() + }), + ) + .await + .ok() + .and_then(|positions| positions.into_iter().find(|pos| pos.market == *ticker)) +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + let mut account = placer.wallet.account(0, &mut placer.client).await?; + + let subaccount = account.subaccount(0)?; + let ticker = Ticker(ETH_USD_TICKER.into()); + + let market = placer + .indexer + .markets() + .get_perpetual_market(Ð_USD_TICKER.into()) + .await?; + + println!( + "Current open position: {:?}", + get_open_position(&placer.indexer, &subaccount, &ticker).await + ); + + // Reduce position by an amount, if open, matching best current market prices + let reduce_by = BigDecimal::from_str("0.0001")?; + let tx_hash = placer + .client + .close_position( + &mut account, + subaccount.clone(), + market.clone(), + Some(reduce_by), + ClientId::random(), + ) + .await?; + tracing::info!( + "Partial position close broadcast transaction hash: {:?}", + tx_hash + ); + + sleep(Duration::from_secs(3)).await; + + // Fully close the position, if open, matching best current market prices + let tx_hash = placer + .client + .close_position( + &mut account, + subaccount.clone(), + market, + None, + ClientId::random(), + ) + .await?; + tracing::info!( + "Fully position close broadcast transaction hash: {:?}", + tx_hash + ); + + sleep(Duration::from_secs(3)).await; + + println!( + "Current open position: {:?}", + get_open_position(&placer.indexer, &subaccount, &ticker).await + ); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/deposit.rs b/v4-client-rs/client/examples/deposit.rs new file mode 100644 index 00000000..a2781e07 --- /dev/null +++ b/v4-client-rs/client/examples/deposit.rs @@ -0,0 +1,39 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::node::{NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; + +pub struct Transferor { + client: NodeClient, + wallet: Wallet, +} + +impl Transferor { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut transferor = Transferor::connect().await?; + let mut account = transferor.wallet.account(0, &mut transferor.client).await?; + + let sender = account.address().clone(); + let recipient = account.subaccount(0)?; + + let tx_hash = transferor + .client + .deposit(&mut account, sender, recipient, 1) + .await?; + tracing::info!("Deposit transaction hash: {:?}", tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/faucet_endpoint.rs b/v4-client-rs/client/examples/faucet_endpoint.rs new file mode 100644 index 00000000..ac9f4ff2 --- /dev/null +++ b/v4-client-rs/client/examples/faucet_endpoint.rs @@ -0,0 +1,56 @@ +mod support; + +#[cfg(feature = "faucet")] +use anyhow::Result; + +#[cfg(feature = "faucet")] +mod faucet_endpoint_example { + use super::support::constants::TEST_MNEMONIC; + use anyhow::{anyhow as err, Error, Result}; + use dydx::config::ClientConfig; + use dydx::faucet::FaucetClient; + use dydx::indexer::Usdc; + use dydx::node::Wallet; + pub struct FaucetRequester { + faucet: FaucetClient, + wallet: Wallet, + } + + impl FaucetRequester { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let faucet = FaucetClient::new( + config + .faucet + .ok_or_else(|| err!("Config file must contain a [faucet] config!"))?, + ); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { faucet, wallet }) + } + } + + pub async fn run() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let requester = FaucetRequester::connect().await?; + let subaccount = requester.wallet.account_offline(0)?.subaccount(0)?; + + requester + .faucet + .fill(&subaccount, &Usdc::from(1000)) + .await?; + + Ok(()) + } +} + +#[cfg(feature = "faucet")] +#[tokio::main] +async fn main() -> Result<()> { + faucet_endpoint_example::run().await?; + Ok(()) +} + +#[cfg(not(feature = "faucet"))] +fn main() { + eprintln!("Feature 'faucet' must be enabled to run this example!") +} diff --git a/v4-client-rs/client/examples/live_price.rs b/v4-client-rs/client/examples/live_price.rs new file mode 100644 index 00000000..2c6ea76a --- /dev/null +++ b/v4-client-rs/client/examples/live_price.rs @@ -0,0 +1,83 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::{Feed, IndexerClient, MarketsMessage, Ticker}; +use dydx::node::{OrderBuilder, Wallet}; +use support::constants::TEST_MNEMONIC; + +pub struct Feeder { + ticker: Ticker, + markets_feed: Feed, + ordergen: OrderBuilder, +} + +impl Feeder { + pub async fn connect() -> Result { + tracing_subscriber::fmt() + .with_max_level(tracing::Level::DEBUG) + .try_init() + .map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let mut indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + let ticker = "ETH-USD".into(); + + let account = wallet.account_offline(0)?; + let subaccount = account.subaccount(0)?; + let market = indexer.markets().get_perpetual_market(&ticker).await?; + let ordergen = OrderBuilder::new(market, subaccount); + let markets_feed = indexer.feed().markets(false).await?; + + Ok(Self { + ticker, + markets_feed, + ordergen, + }) + } + + async fn entrypoint(mut self) { + loop { + self.step().await; + } + } + + async fn step(&mut self) { + if let Some(msg) = self.markets_feed.recv().await { + self.handle_markets_msg(msg).await; + } + } + + async fn handle_markets_msg(&mut self, msg: MarketsMessage) { + let price_opt = match msg { + MarketsMessage::Initial(mut init) => init + .contents + .markets + .remove(&self.ticker) + .and_then(|market| market.oracle_price), + MarketsMessage::Update(mut upd) => upd + .contents + .first_mut() + .and_then(|contents| { + contents + .oracle_prices + .as_mut() + .and_then(|prices| prices.remove(&self.ticker)) + }) + .map(|opm| opm.oracle_price), + }; + if let Some(price) = price_opt { + tracing::info!("Oracle price updated: {price:?}"); + // Since `OrderBuilder` uses the oracle price for slippage protection in Market orders, + // it is recommended to be updated if the same instance is re-used for different orders. + self.ordergen.update_market_price(price); + } + } +} +#[tokio::main] +async fn main() -> Result<()> { + let feeder = Feeder::connect().await?; + feeder.entrypoint().await; + Ok(()) +} diff --git a/v4-client-rs/client/examples/market_endpoint.rs b/v4-client-rs/client/examples/market_endpoint.rs new file mode 100644 index 00000000..b1b79b83 --- /dev/null +++ b/v4-client-rs/client/examples/market_endpoint.rs @@ -0,0 +1,100 @@ +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::{ + CandleResolution, GetCandlesOpts, GetHistoricalFundingOpts, GetTradesOpts, IndexerClient, + ListPerpetualMarketsOpts, SparklineTimePeriod, Ticker, +}; + +const ETH_USD_TICKER: &str = "ETH-USD"; + +pub struct Rester { + indexer: IndexerClient, +} + +impl Rester { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let indexer = IndexerClient::new(config.indexer); + Ok(Self { indexer }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let rester = Rester::connect().await?; + let indexer = rester.indexer; + + // Test value + let ticker = Ticker::from(ETH_USD_TICKER); + + let markets_options = ListPerpetualMarketsOpts { + limit: Some(5), + ..Default::default() + }; + let markets = indexer + .markets() + .list_perpetual_markets(Some(markets_options)) + .await?; + tracing::info!("Markets response: {:?}", markets); + + let markets_options = ListPerpetualMarketsOpts { + ticker: Some(ticker.clone()), + ..Default::default() + }; + let market = indexer + .markets() + .list_perpetual_markets(Some(markets_options)) + .await?; + tracing::info!("Market ({ETH_USD_TICKER}) response: {:?}", market); + + let sparklines = indexer + .markets() + .get_sparklines(SparklineTimePeriod::SevenDays) + .await?; + tracing::info!( + "Sparklines ({ETH_USD_TICKER}) response: {:?}", + sparklines.get(&ticker) + ); + + let trades_opts = GetTradesOpts { + limit: Some(5), + ..Default::default() + }; + let trades = indexer + .markets() + .get_trades(&ticker, Some(trades_opts)) + .await?; + tracing::info!("Trades ({ETH_USD_TICKER}) response: {:?}", trades); + + let orderbook = indexer + .markets() + .get_perpetual_market_orderbook(&ticker) + .await?; + tracing::info!("Orderbook ({ETH_USD_TICKER}) response: {:?}", orderbook); + + let candles_opts = GetCandlesOpts { + limit: Some(3), + ..Default::default() + }; + let candles = indexer + .markets() + .get_candles(&ticker, CandleResolution::M1, Some(candles_opts)) + .await?; + tracing::info!("Candles ({ETH_USD_TICKER}) response: {:?}", candles); + + let fund_opts = GetHistoricalFundingOpts { + limit: Some(3), + ..Default::default() + }; + let funding = indexer + .markets() + .get_historical_funding(&ticker, Some(fund_opts)) + .await?; + tracing::info!( + "Historical funding ({ETH_USD_TICKER}) response: {:?}", + funding + ); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/noble_transfer.rs b/v4-client-rs/client/examples/noble_transfer.rs new file mode 100644 index 00000000..b379f3ed --- /dev/null +++ b/v4-client-rs/client/examples/noble_transfer.rs @@ -0,0 +1,117 @@ +#[cfg(feature = "noble")] +use anyhow::Result; + +#[cfg(feature = "noble")] +mod noble_transfer_example { + use super::*; + use anyhow::{anyhow as err, Error}; + use dydx::config::ClientConfig; + use dydx::indexer::Token; + use dydx::noble::{NobleClient, NobleUsdc}; + use dydx::node::{NodeClient, Wallet}; + use tokio::time::{sleep, Duration}; + + const TEST_MNEMONIC: &str = "mirror actor skill push coach wait confirm orchard lunch mobile athlete gossip awake miracle matter bus reopen team ladder lazy list timber render wait"; + const DYDX_SOURCE_CHANNEL: &str = "channel-0"; + const NOBLE_SOURCE_CHANNEL: &str = "channel-33"; + + pub struct Bridger { + wallet: Wallet, + noble: NobleClient, + node: NodeClient, + } + + impl Bridger { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let noble = NobleClient::connect( + config + .noble + .ok_or_else(|| err!("Config file must contain a [noble] config!"))?, + ) + .await?; + let node = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { + noble, + wallet, + node, + }) + } + } + + #[tokio::main] + pub async fn run() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let mut bridger = Bridger::connect().await?; + + let mut account_dydx = bridger.wallet.account_offline(0)?; + let mut account_noble = bridger.wallet.noble().account_offline(0)?; + + let address_dydx = account_dydx.address().clone(); + let address_noble = account_noble.address().clone(); + + tracing::info!( + "Before transfer balance: {:?}", + bridger + .noble + .get_account_balances(address_noble.clone()) + .await? + ); + let tx_hash = bridger + .node + .send_token_ibc( + &mut account_dydx, + address_dydx.clone(), + address_noble.clone(), + Token::Usdc(1.into()), + DYDX_SOURCE_CHANNEL.into(), + ) + .await?; + tracing::info!("dYdX -> Noble Tx hash: {tx_hash}"); + + sleep(Duration::from_secs(30)).await; + + tracing::info!( + "After transfer balance: {:?}", + bridger + .noble + .get_account_balances(address_noble.clone()) + .await? + ); + + let tx_hash = bridger + .noble + .send_token_ibc( + &mut account_noble, + address_noble.clone(), + address_dydx, + NobleUsdc::from(1), + NOBLE_SOURCE_CHANNEL.into(), + ) + .await?; + tracing::info!("Noble -> dYdX Tx hash: {tx_hash}"); + + sleep(Duration::from_secs(30)).await; + + tracing::info!( + "Undo transfer balance: {:?}", + bridger + .noble + .get_account_balances(address_noble.clone()) + .await? + ); + + Ok(()) + } +} + +#[cfg(feature = "noble")] +fn main() -> Result<()> { + noble_transfer_example::run() +} + +#[cfg(not(feature = "noble"))] +fn main() { + eprintln!("Feature 'noble' must be enabled to run this example!") +} diff --git a/v4-client-rs/client/examples/place_order_long_term.rs b/v4-client-rs/client/examples/place_order_long_term.rs new file mode 100644 index 00000000..e2e1fbf4 --- /dev/null +++ b/v4-client-rs/client/examples/place_order_long_term.rs @@ -0,0 +1,65 @@ +mod support; +use anyhow::{Error, Result}; +use bigdecimal::BigDecimal; +use chrono::{TimeDelta, Utc}; +use dydx::config::ClientConfig; +use dydx::indexer::{ClientId, IndexerClient, Ticker}; +use dydx::node::{NodeClient, OrderBuilder, OrderSide, Wallet}; +use dydx_proto::dydxprotocol::clob::order::TimeInForce; +use support::constants::TEST_MNEMONIC; + +const ETH_USD_TICKER: &str = "ETH-USD"; + +pub struct OrderPlacer { + client: NodeClient, + indexer: IndexerClient, + wallet: Wallet, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { + client, + indexer, + wallet, + }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + let mut account = placer.wallet.account(0, &mut placer.client).await?; + + // Test values + let subaccount = account.subaccount(0)?; + let client_id = ClientId::random(); + let ticker = Ticker(ETH_USD_TICKER.into()); + let market = placer + .indexer + .markets() + .get_perpetual_market(&ticker) + .await?; + + let now = Utc::now(); + let time_in_force_seconds = now + TimeDelta::seconds(60); + + let (_id, order) = OrderBuilder::new(market, subaccount) + .limit(OrderSide::Buy, 123, BigDecimal::new(2.into(), 2)) + .time_in_force(TimeInForce::Unspecified) + .until(time_in_force_seconds) + .long_term() + .build(client_id)?; + + let tx_hash = placer.client.place_order(&mut account, order).await?; + tracing::info!("Broadcast transaction hash: {:?}", tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/place_order_short_term.rs b/v4-client-rs/client/examples/place_order_short_term.rs new file mode 100644 index 00000000..7d9a8764 --- /dev/null +++ b/v4-client-rs/client/examples/place_order_short_term.rs @@ -0,0 +1,63 @@ +mod support; +use anyhow::{Error, Result}; +use bigdecimal::BigDecimal; +use dydx::config::ClientConfig; +use dydx::indexer::IndexerClient; +use dydx::node::{NodeClient, OrderBuilder, OrderSide, Wallet}; +use dydx_proto::dydxprotocol::clob::order::TimeInForce; +use std::str::FromStr; +use support::constants::TEST_MNEMONIC; + +const ETH_USD_TICKER: &str = "ETH-USD"; + +pub struct OrderPlacer { + client: NodeClient, + indexer: IndexerClient, + wallet: Wallet, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { + client, + indexer, + wallet, + }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + let mut account = placer.wallet.account(0, &mut placer.client).await?; + let subaccount = account.subaccount(0)?; + + let market = placer + .indexer + .markets() + .get_perpetual_market(Ð_USD_TICKER.into()) + .await?; + + let current_block_height = placer.client.get_latest_block_height().await?; + + let size = BigDecimal::from_str("0.02")?; + let (_id, order) = OrderBuilder::new(market, subaccount) + .market(OrderSide::Buy, size) + .reduce_only(false) + .price(100) // market-order slippage protection price + .time_in_force(TimeInForce::Unspecified) + .until(current_block_height.ahead(10)) + .build(123456)?; + + let tx_hash = placer.client.place_order(&mut account, order).await?; + tracing::info!("Broadcast transaction hash: {:?}", tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/send_token.rs b/v4-client-rs/client/examples/send_token.rs new file mode 100644 index 00000000..306ed8ff --- /dev/null +++ b/v4-client-rs/client/examples/send_token.rs @@ -0,0 +1,40 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::Token; +use dydx::node::{NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; + +pub struct Transferor { + client: NodeClient, + wallet: Wallet, +} + +impl Transferor { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let mut transferor = Transferor::connect().await?; + + let mut account0 = transferor.wallet.account(0, &mut transferor.client).await?; + let sender = account0.address().clone(); + + let account1 = transferor.wallet.account(1, &mut transferor.client).await?; + let recipient = account1.address().clone(); + + let tx_hash = transferor + .client + .send_token(&mut account0, sender, recipient, Token::DydxTnt(1.into())) + .await?; + tracing::info!("Send token transaction hash: {:?}", tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/sequencer.rs b/v4-client-rs/client/examples/sequencer.rs new file mode 100644 index 00000000..8b2874ae --- /dev/null +++ b/v4-client-rs/client/examples/sequencer.rs @@ -0,0 +1,160 @@ +mod support; +use anyhow::{Error, Result}; +use async_trait::async_trait; +use bigdecimal::BigDecimal; +use chrono::{TimeDelta, Utc}; +use dydx::config::ClientConfig; +use dydx::indexer::{Address, ClientId, IndexerClient, PerpetualMarket, Subaccount, Ticker}; +use dydx::node::{sequencer::*, Account, NodeClient, OrderBuilder, OrderSide, Wallet}; +use dydx_proto::dydxprotocol::clob::order::TimeInForce; +use std::sync::Arc; +use support::constants::TEST_MNEMONIC; +use tokio::sync::Mutex; +use tokio::time::{sleep, Duration}; + +const ETH_USD_TICKER: &str = "ETH-USD"; + +pub struct OrderPlacer { + client: NodeClient, + market: PerpetualMarket, + account: Account, + subaccount: Subaccount, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let mut client = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + let ticker = Ticker(ETH_USD_TICKER.into()); + let market = indexer.markets().get_perpetual_market(&ticker).await?; + let account = wallet.account(0, &mut client).await?; + let subaccount = account.subaccount(0)?; + Ok(Self { + client, + market, + account, + subaccount, + }) + } + + pub async fn place_order(&mut self) -> Result<()> { + let (_, order) = OrderBuilder::new(self.market.clone(), self.subaccount.clone()) + .limit(OrderSide::Buy, 123, BigDecimal::new(2.into(), 2)) + .time_in_force(TimeInForce::Unspecified) + .until(Utc::now() + TimeDelta::seconds(60)) + .long_term() + .build(ClientId::random())?; + + self.client + .place_order(&mut self.account, order) + .await + .map(drop) + .map_err(Error::msg) + } + + pub async fn fetch_sequence_number(&mut self) -> Result { + let (_, sequence_number) = self.client.query_address(self.account.address()).await?; + Ok(sequence_number) + } +} + +#[derive(Clone)] +pub struct CustomSequencer { + counter: Arc>, + // Or use an Atomic in this case +} + +impl CustomSequencer { + pub fn new(start_at: u64) -> Self { + Self { + counter: Arc::new(Mutex::new(start_at)), + } + } +} + +#[async_trait] +impl Sequencer for CustomSequencer { + async fn next_nonce(&mut self, _: &Address) -> Result { + let mut counter = self.counter.lock().await; + *counter += 1; + Ok(Nonce::Sequence(*counter - 1)) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + + // In Cosmos-based blockchains, like dYdX, an account sequence number is used as a nonce to + // prevent replay attacks. This affects only relevant requests: non-short term orders and transfer methods. + // This crate provides three different mechanisms to set the account number: + // + // - QueryingSequencer: a request is made to the network to fetch the correct sequence number + // to be used in the next transaction. This request is made for every relevant request + // previously to the transaction broadcast. + // - IncrementalSequencer: for each relevant request, a simple counter is increased. The + // starting value counter must be set manually, using for example the value returned by + // NodeClient::query_address(). + // - TimestamperSequencer: for each relevant request, the current timestamp (milliseconds) is + // used. + // + // The Sequencer trait can be used to provide custom sequencers to the NodeClient. + + // By default, NodeClient uses the QueryingSequencer. + placer.place_order().await?; + sleep(Duration::from_secs(4)).await; + tracing::info!( + "(After QueryingSequencer) Sequence number: {}", + placer.fetch_sequence_number().await? + ); + + // To use the incremental sequencer, create one with the to-be used addresses and initial + // counters. + let incremental_sequencer = IncrementalSequencer::new(&[( + placer.account.address().clone(), + placer.fetch_sequence_number().await?, + )]); + placer.client.with_sequencer(incremental_sequencer); + + placer.place_order().await?; + sleep(Duration::from_secs(4)).await; + tracing::info!( + "(After IncrementalSequencer) Sequence number: {}", + placer.fetch_sequence_number().await? + ); + + // And the timestamper sequencer, + let timestamper_sequencer = TimestamperSequencer; + placer.client.with_sequencer(timestamper_sequencer); + + placer.place_order().await?; + sleep(Duration::from_secs(4)).await; + tracing::info!( + "(After TimestamperSequencer) Sequence number: {}", + placer.fetch_sequence_number().await? + ); + + // To tackle other specific scenarios, a Sequencer can also be provided. + // Here we try to tackle a concurrent scenario where different trading bots running in the same + // process are utilizing the same account to issue long-term orders. + // Note: here, orders may reach the network out-of-order, resulting in a sequencing error. + let custom_sequencer = CustomSequencer::new(placer.fetch_sequence_number().await?); + let mut placer1 = OrderPlacer::connect().await?; + let mut placer2 = OrderPlacer::connect().await?; + placer1.client.with_sequencer(custom_sequencer.clone()); + placer2.client.with_sequencer(custom_sequencer.clone()); + + tokio::try_join!(placer1.place_order(), placer2.place_order())?; + sleep(Duration::from_secs(4)).await; + tracing::info!( + "(After CustomSequencer, two orders) Sequence number: {}", + placer.fetch_sequence_number().await? + ); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/support/constants.rs b/v4-client-rs/client/examples/support/constants.rs new file mode 100644 index 00000000..db260dca --- /dev/null +++ b/v4-client-rs/client/examples/support/constants.rs @@ -0,0 +1,2 @@ +#[allow(dead_code)] +pub const TEST_MNEMONIC: &str = "mirror actor skill push coach wait confirm orchard lunch mobile athlete gossip awake miracle matter bus reopen team ladder lazy list timber render wait"; diff --git a/v4-client-rs/client/examples/support/mod.rs b/v4-client-rs/client/examples/support/mod.rs new file mode 100644 index 00000000..a59bb337 --- /dev/null +++ b/v4-client-rs/client/examples/support/mod.rs @@ -0,0 +1,6 @@ +pub mod constants; +#[allow(dead_code)] +pub mod order_book; +#[allow(dead_code)] +#[cfg(feature = "telemetry")] +pub mod telemetry; diff --git a/v4-client-rs/client/examples/support/order_book.rs b/v4-client-rs/client/examples/support/order_book.rs new file mode 100644 index 00000000..f325b416 --- /dev/null +++ b/v4-client-rs/client/examples/support/order_book.rs @@ -0,0 +1,149 @@ +use bigdecimal::Zero; +use derive_more::{Deref, DerefMut}; +use dydx::indexer::{ + Feed, OrderBookResponseObject, OrderbookResponsePriceLevel, OrdersMessage, Price, Quantity, +}; +use std::collections::BTreeMap; +use std::fmt; +use tokio::sync::watch; +use tokio::task::JoinHandle; + +#[derive(Deref, DerefMut)] +pub struct LiveOrderBook { + handle: JoinHandle<()>, + #[deref] + #[deref_mut] + rx: watch::Receiver, +} + +impl LiveOrderBook { + pub fn new(feed: Feed) -> Self { + let (tx, rx) = watch::channel(OrderBook::default()); + let task = LiveOrderBookTask { feed, tx }; + let handle = tokio::spawn(task.entrypoint()); + Self { handle, rx } + } +} + +impl Drop for LiveOrderBook { + fn drop(&mut self) { + self.handle.abort(); + } +} + +struct LiveOrderBookTask { + feed: Feed, + tx: watch::Sender, +} + +impl LiveOrderBookTask { + async fn entrypoint(mut self) { + while let Some(msg) = self.feed.recv().await { + match msg { + OrdersMessage::Initial(upd) => { + self.tx.send_modify(move |order_book| { + order_book.update_bids(upd.contents.bids); + order_book.update_asks(upd.contents.asks); + }); + } + OrdersMessage::Update(upd) => { + self.tx.send_modify(move |order_book| { + if let Some(bids) = upd.contents.bids { + order_book.update_bids(bids); + } + if let Some(asks) = upd.contents.asks { + order_book.update_asks(asks); + } + }); + } + } + } + } +} + +pub struct Quote<'a> { + pub price: &'a Price, + pub quantity: &'a Quantity, +} + +impl<'a> From<(&'a Price, &'a Quantity)> for Quote<'a> { + fn from((price, quantity): (&'a Price, &'a Quantity)) -> Self { + Self { price, quantity } + } +} + +pub struct Spread<'a> { + pub bid: Quote<'a>, + pub ask: Quote<'a>, +} + +#[derive(Default, Debug)] +pub struct OrderBook { + /// Prices you can sell + pub bids: BTreeMap, + /// Prices you can buy (how much the seller asks) + pub asks: BTreeMap, +} + +impl OrderBook { + pub fn bids(&self) -> impl Iterator { + self.bids.iter().map(Quote::from).rev() + } + + pub fn asks(&self) -> impl Iterator { + self.asks.iter().map(Quote::from) + } + + pub fn spread(&self) -> Option { + let bid = self.bids().next()?; + let ask = self.asks().next()?; + Some(Spread { bid, ask }) + } + + fn update(map: &mut BTreeMap, levels: Vec) { + for level in levels { + if level.size.is_zero() { + map.remove(&level.price); + } else { + map.insert(level.price, level.size); + } + } + } + + pub fn update_bids(&mut self, bids: Vec) { + Self::update(&mut self.bids, bids); + } + + pub fn update_asks(&mut self, asks: Vec) { + Self::update(&mut self.asks, asks); + } + + pub fn table(&self) -> OrderBookTable { + OrderBookTable { inner: self } + } +} + +impl From for OrderBook { + fn from(response: OrderBookResponseObject) -> Self { + let mut order_book = OrderBook::default(); + order_book.update_bids(response.bids); + order_book.update_asks(response.asks); + order_book + } +} + +pub struct OrderBookTable<'a> { + inner: &'a OrderBook, +} + +impl<'a> fmt::Display for OrderBookTable<'a> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + for (price, size) in &self.inner.bids { + writeln!(f, "BID: {} - {}", price, size)?; + } + for (price, size) in &self.inner.asks { + writeln!(f, "ASK: {} - {}", price, size)?; + } + Ok(()) + } +} diff --git a/v4-client-rs/client/examples/support/telemetry.rs b/v4-client-rs/client/examples/support/telemetry.rs new file mode 100644 index 00000000..5c6c2513 --- /dev/null +++ b/v4-client-rs/client/examples/support/telemetry.rs @@ -0,0 +1,37 @@ +use anyhow::{anyhow as err, Result}; +use metrics_exporter_tcp::Error; +use std::io::ErrorKind; + +/// Setup telemetry +pub async fn metrics_dashboard() -> Result<()> { + let default_port = 5000; + let alt_port = 5049; + // Try server on default port (5000) else try listen on 5049 + let port = match setup_server(default_port) { + Ok(()) => default_port, + Err(e) => match e { + Error::Io(e) => { + if matches!(e.kind(), ErrorKind::AddrInUse) { + setup_server(alt_port) + .map_err(|e| err!("Unable to setup telemetry server on port {default_port} or {alt_port}: {e}"))?; + alt_port + } else { + return Err(e.into()); + } + } + _ => return Err(e.into()), + }, + }; + + tracing::info!("== THIS EXAMPLE USES `https://github.com/metrics-rs/metrics/tree/main/metrics-observer` AS A METRICS EXPORTER (on TCP port {port}) =="); + + Ok(()) +} + +fn setup_server(port: u16) -> Result<(), Error> { + let addr: std::net::SocketAddr = format!("0.0.0.0:{port}") + .parse() + .expect("Failed parsing SocketAddr"); + let builder = metrics_exporter_tcp::TcpBuilder::new().listen_address(addr); + builder.install() +} diff --git a/v4-client-rs/client/examples/transfer.rs b/v4-client-rs/client/examples/transfer.rs new file mode 100644 index 00000000..eb188b0e --- /dev/null +++ b/v4-client-rs/client/examples/transfer.rs @@ -0,0 +1,37 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::node::{NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; + +pub struct Transferor { + client: NodeClient, + wallet: Wallet, +} + +impl Transferor { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let mut transferor = Transferor::connect().await?; + let mut account = transferor.wallet.account(0, &mut transferor.client).await?; + + let sender = account.subaccount(0)?; + let recipient = account.subaccount(1)?; + + let tx_hash = transferor + .client + .transfer(&mut account, sender, recipient, 1) + .await?; + tracing::info!("Transfer transaction hash: {:?}", tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/utility_endpoint.rs b/v4-client-rs/client/examples/utility_endpoint.rs new file mode 100644 index 00000000..b5104e37 --- /dev/null +++ b/v4-client-rs/client/examples/utility_endpoint.rs @@ -0,0 +1,42 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::IndexerClient; +use dydx::node::Wallet; +use support::constants::TEST_MNEMONIC; + +pub struct Rester { + indexer: IndexerClient, + wallet: Wallet, +} + +impl Rester { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { indexer, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let rester = Rester::connect().await?; + let account = rester.wallet.account_offline(0)?; + let indexer = rester.indexer; + + // Test values + let address = account.address(); + + let time = indexer.utility().get_time().await?; + tracing::info!("Time: {time:?}"); + + let height = indexer.utility().get_height().await?; + tracing::info!("Height: {height:?}"); + + let screen = indexer.utility().get_screen(address).await?; + tracing::info!("Screen for address {address}: {screen:?}"); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/validator_get.rs b/v4-client-rs/client/examples/validator_get.rs new file mode 100644 index 00000000..c5741ba8 --- /dev/null +++ b/v4-client-rs/client/examples/validator_get.rs @@ -0,0 +1,120 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::node::{NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; + +const ETH_USD_PAIR_ID: u32 = 1; + +pub struct Getter { + client: NodeClient, + wallet: Wallet, +} + +impl Getter { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let mut getter = Getter::connect().await?; + // Test values + let account = getter.wallet.account_offline(0)?; + let address = account.address().clone(); + let subaccount = account.subaccount(0)?; + + let account = getter.client.get_account(&address).await?; + tracing::info!("Get account: {account:?}"); + + let balances = getter.client.get_account_balances(&address).await?; + tracing::info!("Get account balances: {balances:?}"); + + let balance = getter + .client + .get_account_balance(&address, &"adv4tnt".parse()?) + .await?; + tracing::info!("Get account balance: {balance:?}"); + + let node_info = getter.client.get_node_info().await?; + let version = node_info + .application_version + .map(|v| format!("{} v{} @{}", v.name, v.version, &v.git_commit[0..7])); + tracing::info!( + "Get node info (node version): {}", + version.unwrap_or("unknown".into()) + ); + + let block = getter.client.get_latest_block().await?; + tracing::info!("Get latest block: {block:?}"); + + let height = getter.client.get_latest_block_height().await?; + tracing::info!("Get latest block height: {height:?}"); + + let stats = getter.client.get_user_stats(&address).await?; + tracing::info!("Get user stats: {stats:?}"); + + let validators = getter.client.get_all_validators(None).await?; + tracing::info!("Get all validators: {validators:?}"); + + let subaccount = getter.client.get_subaccount(&subaccount).await?; + tracing::info!("Get subaccount: {subaccount:?}"); + + let subaccounts = getter.client.get_subaccounts().await?; + tracing::info!("Get subaccounts: {subaccounts:?}"); + + let clob_pair = getter.client.get_clob_pair(ETH_USD_PAIR_ID).await?; + tracing::info!("Get clob pair: {clob_pair:?}"); + + let clob_pairs = getter.client.get_clob_pairs(None).await?; + tracing::info!("Get clob pairs: {clob_pairs:?}"); + + let price = getter.client.get_price(ETH_USD_PAIR_ID).await?; + tracing::info!("Get price: {price:?}"); + + let prices = getter.client.get_prices(None).await?; + tracing::info!("Get prices: {prices:?}"); + + let perpetual = getter.client.get_perpetual(ETH_USD_PAIR_ID).await?; + tracing::info!("Get perpetual: {perpetual:?}"); + + let perpetuals = getter.client.get_perpetuals(None).await?; + tracing::info!("Get perpetuals: {perpetuals:?}"); + + let equity_tier_limit = getter.client.get_equity_tier_limit_config().await?; + tracing::info!("Get equity tier limit config: {equity_tier_limit:?}"); + + let delegations = getter + .client + .get_delegator_delegations(address.clone(), None) + .await?; + tracing::info!("Get delegator delegations: {delegations:?}"); + + let unbonding_delegations = getter + .client + .get_delegator_unbonding_delegations(address.clone(), None) + .await?; + tracing::info!("Get delegator unbonding delegations: {unbonding_delegations:?}"); + + let bridge_messages = getter + .client + .get_delayed_complete_bridge_messages(address.clone()) + .await?; + tracing::info!("Get delayed complete bridge messages: {bridge_messages:?}"); + + let fee_tiers = getter.client.get_fee_tiers().await?; + tracing::info!("Get fee tiers: {fee_tiers:?}"); + + let user_fee_tier = getter.client.get_user_fee_tier(address.clone()).await?; + tracing::info!("Get user fee tier: {user_fee_tier:?}"); + + let reward_params = getter.client.get_rewards_params().await?; + tracing::info!("Get reward params: {reward_params:?}"); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/validator_megavault.rs b/v4-client-rs/client/examples/validator_megavault.rs new file mode 100644 index 00000000..3368bc46 --- /dev/null +++ b/v4-client-rs/client/examples/validator_megavault.rs @@ -0,0 +1,76 @@ +mod support; +use anyhow::{Error, Result}; +use bigdecimal::num_bigint::BigInt; +use dydx::config::ClientConfig; +use dydx::node::{BigIntExt, NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; +use tokio::time::{sleep, Duration}; + +pub struct MegaVaulter { + client: NodeClient, + wallet: Wallet, +} + +impl MegaVaulter { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + + let mut vaulter = MegaVaulter::connect().await?; + let mut account = vaulter.wallet.account(0, &mut vaulter.client).await?; + let address = account.address().clone(); + let subaccount = account.subaccount(0)?; + + // Deposit 1 USDC into the MegaVault + let tx_hash = vaulter + .client + .megavault() + .deposit(&mut account, subaccount.clone(), 1) + .await?; + tracing::info!("Deposit transaction hash: {:?}", tx_hash); + + sleep(Duration::from_secs(2)).await; + + // Withdraw 1 share from the MegaVault + let number_of_shares: BigInt = 1.into(); + let tx_hash = vaulter + .client + .megavault() + .withdraw(&mut account, subaccount, 0, Some(&number_of_shares)) + .await?; + tracing::info!("Withdraw transaction hash: {:?}", tx_hash); + + // Query methods + + let owner_shares = vaulter + .client + .megavault() + .get_owner_shares(&address) + .await?; + tracing::info!("Get owner shares: {owner_shares:?}"); + + // Convert serialized integer into an integer (`BigIntExt` trait) + if let Some(shares) = owner_shares.shares { + let nshares = BigInt::from_serializable_int(&shares.num_shares)?; + tracing::info!("Number of owned shares: {}", nshares); + } + + let withdrawal_info = vaulter + .client + .megavault() + .get_withdrawal_info(&number_of_shares) + .await?; + tracing::info!("Get withdrawal info: {withdrawal_info:?}"); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/validator_post.rs b/v4-client-rs/client/examples/validator_post.rs new file mode 100644 index 00000000..a6831839 --- /dev/null +++ b/v4-client-rs/client/examples/validator_post.rs @@ -0,0 +1,82 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::node::{NodeClient, Wallet}; +use dydx_proto::dydxprotocol::clob::{ + order::{ConditionType, GoodTilOneof, Side, TimeInForce}, + Order, OrderId, +}; +use dydx_proto::dydxprotocol::subaccounts::SubaccountId; +use rand::{thread_rng, Rng}; +use support::constants::TEST_MNEMONIC; +use tokio::time::{sleep, Duration}; + +const ETH_USD_PAIR_ID: u32 = 1; +const ETH_USD_QUANTUMS: u64 = 10_000_000; // calculated based on market +const SUBTICKS: u64 = 40_000_000_000; // calculated based on market and price +const ORDER_FLAGS_SHORT_TERM: u32 = 0; // for short term order is 0 +const N_ORDERS: usize = 6; + +pub struct OrderPlacer { + client: NodeClient, + wallet: Wallet, +} + +impl OrderPlacer { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let mut placer = OrderPlacer::connect().await?; + let mut account = placer.wallet.account(0, &mut placer.client).await?; + + let subaccount = SubaccountId { + owner: account.address().to_string(), + number: 0, + }; + let order_ids = (0..N_ORDERS) + .map(|_| OrderId { + subaccount_id: Some(subaccount.clone()), + client_id: thread_rng().gen_range(0..100_000_000), + order_flags: ORDER_FLAGS_SHORT_TERM, + clob_pair_id: ETH_USD_PAIR_ID, + }) + .collect::>(); + + // Push some orders + for id in &order_ids { + // Short term orders have a maximum validity of 20 blocks + let til_height = placer.client.get_latest_block_height().await?.ahead(10).0; + let order = Order { + order_id: Some(id.clone()), + side: Side::Sell.into(), + quantums: ETH_USD_QUANTUMS, + subticks: SUBTICKS, + time_in_force: TimeInForce::Unspecified.into(), + reduce_only: false, + client_metadata: 0u32, + condition_type: ConditionType::Unspecified.into(), + conditional_order_trigger_subticks: 0u64, + good_til_oneof: Some(GoodTilOneof::GoodTilBlock(til_height)), + }; + + let tx_hash = placer.client.place_order(&mut account, order).await?; + tracing::info!( + "Broadcast order ({}) transaction hash: {:?}", + id.client_id, + tx_hash + ); + sleep(Duration::from_secs(2)).await; + } + + Ok(()) +} diff --git a/v4-client-rs/client/examples/vault_endpoint.rs b/v4-client-rs/client/examples/vault_endpoint.rs new file mode 100644 index 00000000..110b3afb --- /dev/null +++ b/v4-client-rs/client/examples/vault_endpoint.rs @@ -0,0 +1,43 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::{IndexerClient, PnlTickInterval}; + +pub struct Rester { + indexer: IndexerClient, +} + +impl Rester { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let indexer = IndexerClient::new(config.indexer); + Ok(Self { indexer }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let rester = Rester::connect().await?; + let indexer = rester.indexer; + + // Test values + let resolution = PnlTickInterval::Hour; + + let pnls = indexer + .vaults() + .get_megavault_historical_pnl(resolution) + .await?; + tracing::info!("MegaVault historical PnLs: {pnls:?}"); + + let vaults_pnls = indexer + .vaults() + .get_vaults_historical_pnl(resolution) + .await?; + tracing::info!("Vaults historical PnLs: {vaults_pnls:?}"); + + let positions = indexer.vaults().get_megavault_positions().await?; + tracing::info!("MegaVault positions: {positions:?}"); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/wallet.rs b/v4-client-rs/client/examples/wallet.rs new file mode 100644 index 00000000..520c4aee --- /dev/null +++ b/v4-client-rs/client/examples/wallet.rs @@ -0,0 +1,102 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +#[cfg(feature = "noble")] +use dydx::noble::NobleClient; +use dydx::node::{NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + + // Create a `Wallet` from a mnemonic + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + + // A `Wallet` is used to derive an `Account` used to sign transactions + let account0 = wallet.account_offline(0)?; + + // Multiple accounts can be derived from your mnemonic/master private key + let account1 = wallet.account_offline(1)?; + + // Some online attributes like an up-to-date sequence number are required for some + // order/transfer methods in `NodeClient`'s operations. + // This is usually not required if `NodeClient` is allowed to `manage_sequencing = true`. + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let mut client = NodeClient::connect(config.node).await?; + let account_upd = wallet.account(0, &mut client).await?; + + // An `Account` is mostly identified by its `Address` + let address = account0.address(); + tracing::info!( + "Account '0' address: {address} | sequence-number: {} | account-number (online ID): {}", + account0.sequence_number(), + account0.account_number() + ); + tracing::info!( + "Account '0' (synced-values) address: {} | sequence-number: {} | account-number (online ID): {}", + account_upd.address(), account_upd.sequence_number(), account_upd.account_number() + ); + tracing::info!("Account '1' address: {}", account1.address()); + + // dYdX uses the concept of "subaccounts" to help isolate funds and manage risk + let subaccount00 = account0.subaccount(0)?; + let subaccount01 = account0.subaccount(1)?; + + // Different subaccounts under the same account have the same address, being differentiated by + // their subaccount number + tracing::info!( + "Account '0' subaccount '0': address {} | number {}", + subaccount00.address, + subaccount00.number + ); + tracing::info!( + "Account '0' subaccount '1': address {} | number {}", + subaccount01.address, + subaccount01.number + ); + + // Subaccounts 0..=127 are parent subaccounts. These subaccounts can have multiple positions + // opened and all positions are cross-margined. + // Subaccounts 128..=128000 are child subaccounts. These subaccounts can only have one position + // open. + tracing::info!( + "Is subaccount '0' a parent subaccount? {:?}", + subaccount00.is_parent() + ); + tracing::info!( + "The parent subaccount of the subaccount '256' is: {:?}", + account0.subaccount(256)?.parent() + ); + tracing::info!( + "Is the parent of subaccount '256' equal to subaccount '0'? {:?}", + account0.subaccount(256)?.parent() == subaccount00 + ); + + #[cfg(feature = "noble")] + { + // To derive a Noble account (used to transfer USDC in and out of dYdX through Cosmos IBC) + // the same wallet instance as before can be used + let noble_account0 = wallet.noble().account_offline(0)?; + tracing::info!( + "Account '0' (Noble) address: {} | sequence-number: {}", + noble_account0.address(), + noble_account0.sequence_number() + ); + + // Noble accounts also use sequence numbers + if let Some(noble_config) = config.noble { + let mut noble = NobleClient::connect(noble_config).await?; + let noble_account_upd = wallet.noble().account(0, &mut noble).await?; + tracing::info!( + "Account '0' (Noble, synced-values) address: {} | sequence-number: {}", + noble_account_upd.address(), + noble_account_upd.sequence_number() + ); + } else { + tracing::warn!("A [noble] configuration is required for some parts of this example."); + } + } + + Ok(()) +} diff --git a/v4-client-rs/client/examples/websockets.rs b/v4-client-rs/client/examples/websockets.rs new file mode 100644 index 00000000..fe060f1e --- /dev/null +++ b/v4-client-rs/client/examples/websockets.rs @@ -0,0 +1,89 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::indexer::{ + BlockHeightMessage, CandleResolution, CandlesMessage, Feed, IndexerClient, MarketsMessage, + OrdersMessage, ParentSubaccountsMessage, SubaccountsMessage, Ticker, TradesMessage, +}; +use dydx::node::Wallet; +use support::constants::TEST_MNEMONIC; +use tokio::select; + +pub struct Feeder { + trades_feed: Feed, + orders_feed: Feed, + markets_feed: Feed, + subaccounts_feed: Feed, + parent_subaccounts_feed: Feed, + candles_feed: Feed, + height_feed: Feed, +} + +impl Feeder { + pub async fn connect() -> Result { + tracing_subscriber::fmt() + .with_max_level(tracing::Level::DEBUG) + .try_init() + .map_err(Error::msg)?; + #[cfg(feature = "telemetry")] + support::telemetry::metrics_dashboard().await?; + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let mut indexer = IndexerClient::new(config.indexer); + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + + let account = wallet.account_offline(0)?; + let subaccount = account.subaccount(127)?; + + let ticker = Ticker::from("ETH-USD"); + let markets_feed = indexer.feed().markets(false).await?; + let trades_feed = indexer.feed().trades(&ticker, false).await?; + let orders_feed = indexer.feed().orders(&ticker, false).await?; + let candles_feed = indexer + .feed() + .candles(&ticker, CandleResolution::M1, false) + .await?; + let subaccounts_feed = indexer + .feed() + .subaccounts(subaccount.clone(), false) + .await?; + let parent_subaccounts_feed = indexer + .feed() + .parent_subaccounts(subaccount.parent(), false) + .await?; + let height_feed = indexer.feed().block_height(false).await?; + + Ok(Self { + trades_feed, + markets_feed, + orders_feed, + candles_feed, + subaccounts_feed, + parent_subaccounts_feed, + height_feed, + }) + } + + async fn step(&mut self) { + select! { + msg = self.trades_feed.recv() => if let Some(msg) = msg { tracing::info!("Received trades message: {msg:?}") }, + msg = self.orders_feed.recv() => if let Some(msg) = msg { tracing::info!("Received orders message: {msg:?}") }, + msg = self.markets_feed.recv() => if let Some(msg) = msg { tracing::info!("Received markets message: {msg:?}") }, + msg = self.subaccounts_feed.recv() => if let Some(msg) = msg { tracing::info!("Received subaccounts message: {msg:?}") }, + msg = self.parent_subaccounts_feed.recv() => if let Some(msg) = msg { tracing::info!("Received parent subaccounts message: {msg:?}") }, + msg = self.candles_feed.recv() => if let Some(msg) = msg { tracing::info!("Received candles message: {msg:?}") }, + msg = self.height_feed.recv() => if let Some(msg) = msg { tracing::info!("Received block height message: {msg:?}") }, + } + } + + async fn entrypoint(mut self) { + loop { + self.step().await; + } + } +} +#[tokio::main] +async fn main() -> Result<()> { + let feeder = Feeder::connect().await?; + feeder.entrypoint().await; + Ok(()) +} diff --git a/v4-client-rs/client/examples/withdraw.rs b/v4-client-rs/client/examples/withdraw.rs new file mode 100644 index 00000000..afab0d29 --- /dev/null +++ b/v4-client-rs/client/examples/withdraw.rs @@ -0,0 +1,37 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::node::{NodeClient, Wallet}; +use support::constants::TEST_MNEMONIC; + +pub struct Transferor { + client: NodeClient, + wallet: Wallet, +} + +impl Transferor { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let mut transferor = Transferor::connect().await?; + let mut account = transferor.wallet.account(0, &mut transferor.client).await?; + + let recipient = account.address().clone(); + let sender = account.subaccount(0)?; + + let tx_hash = transferor + .client + .withdraw(&mut account, sender, recipient, 1) + .await?; + tracing::info!("Withdraw transaction hash: {:?}", tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/examples/withdraw_other.rs b/v4-client-rs/client/examples/withdraw_other.rs new file mode 100644 index 00000000..6d54a763 --- /dev/null +++ b/v4-client-rs/client/examples/withdraw_other.rs @@ -0,0 +1,75 @@ +mod support; +use anyhow::{Error, Result}; +use dydx::config::ClientConfig; +use dydx::node::{NodeClient, Wallet}; +use dydx_proto::{ + dydxprotocol::{sending::MsgWithdrawFromSubaccount, subaccounts::SubaccountId}, + ToAny, +}; +use std::iter::once; +use support::constants::TEST_MNEMONIC; + +pub struct Transferor { + client: NodeClient, + wallet: Wallet, +} + +impl Transferor { + pub async fn connect() -> Result { + let config = ClientConfig::from_file("client/tests/testnet.toml").await?; + let client = NodeClient::connect(config.node).await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + Ok(Self { client, wallet }) + } +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt().try_init().map_err(Error::msg)?; + let mut transferor = Transferor::connect().await?; + let account = transferor.wallet.account(0, &mut transferor.client).await?; + let mut client = transferor.client; + + let amount = 1_u64; + + let recipient = account.address().clone(); + let sender = SubaccountId { + owner: recipient.to_string(), + number: 0, + }; + + // Simulate transaction + let msg = MsgWithdrawFromSubaccount { + sender: Some(sender.clone()), + recipient: recipient.to_string(), + asset_id: 0, + quantums: amount, + } + .to_any(); + let simulated_tx = client + .builder + .build_transaction(&account, once(msg), None)?; + let simulation = client.simulate(&simulated_tx).await?; + tracing::info!("Simulation: {:?}", simulation); + + let fee = client.builder.calculate_fee(Some(simulation.gas_used))?; + tracing::info!("Total fee: {:?}", fee); + + let fee_amount: u64 = fee.amount[0].amount.try_into()?; + + // Issue transaction + let final_msg = MsgWithdrawFromSubaccount { + sender: Some(sender), + recipient: recipient.into(), + asset_id: 0, + quantums: amount - fee_amount, + } + .to_any(); + let final_tx = client + .builder + .build_transaction(&account, once(final_msg), Some(fee))?; + let tx_hash = client.broadcast_transaction(final_tx).await?; + tracing::info!("Withdraw transaction hash: {:?}", tx_hash); + + Ok(()) +} diff --git a/v4-client-rs/client/src/config.rs b/v4-client-rs/client/src/config.rs new file mode 100644 index 00000000..5ed33acf --- /dev/null +++ b/v4-client-rs/client/src/config.rs @@ -0,0 +1,33 @@ +#[cfg(feature = "faucet")] +use super::faucet::FaucetConfig; +#[cfg(feature = "noble")] +use super::noble::NobleConfig; +use super::{indexer::IndexerConfig, node::NodeConfig}; +use anyhow::Error; +use serde::Deserialize; +use std::path::Path; +use tokio::fs; + +/// Serves as a configuration wrapper over configurations for specific clients. +#[derive(Debug, Deserialize)] +pub struct ClientConfig { + /// Configuration for [`IndexerClient`](crate::indexer::IndexerClient) + pub indexer: IndexerConfig, + /// Configuration for [`NodeClient`](crate::node::NodeClient) + pub node: NodeConfig, + /// Configuration for [`FaucetClient`](crate::faucet::FaucetClient) + #[cfg(feature = "faucet")] + pub faucet: Option, + /// Configuration for [`NobleClient`](crate::noble::NobleClient) + #[cfg(feature = "noble")] + pub noble: Option, +} + +impl ClientConfig { + /// Creates a new `ClientConfig` instance from a TOML file at the given path + pub async fn from_file(path: impl AsRef) -> Result { + let toml_str = fs::read_to_string(path).await?; + let config = toml::from_str(&toml_str)?; + Ok(config) + } +} diff --git a/v4-client-rs/client/src/faucet.rs b/v4-client-rs/client/src/faucet.rs new file mode 100644 index 00000000..d75032f1 --- /dev/null +++ b/v4-client-rs/client/src/faucet.rs @@ -0,0 +1,84 @@ +pub use crate::indexer::{Address, Subaccount, SubaccountNumber, Usdc}; +use anyhow::{anyhow as err, Error}; +use bigdecimal::num_traits::ToPrimitive; +use reqwest::Client; +use serde::{Deserialize, Serialize}; + +/// Configuration for the Faucet client. +#[derive(Debug, Deserialize)] +pub struct FaucetConfig { + /// The base url of the faucet service. + pub endpoint: String, +} + +/// [Faucet](https://docs.dydx.exchange/infrastructure_providers-network/faucet) +/// serves as a source of funds for test purposes. +/// +/// See also [What is a Crypto Faucet?](https://dydx.exchange/crypto-learning/crypto-faucet). +/// +/// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/faucet_endpoint.rs). +#[derive(Debug)] +pub struct FaucetClient { + config: FaucetConfig, + client: Client, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct FillReq<'t> { + address: &'t Address, + subaccount_number: &'t SubaccountNumber, + amount: u64, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct FillNativeReq<'t> { + address: &'t Address, +} + +impl FaucetClient { + /// Creates a new `FaucetClient` + pub fn new(config: FaucetConfig) -> Self { + Self { + config, + client: Client::default(), + } + } + + /// add USDC to a subaccount + pub async fn fill(&self, subaccount: &Subaccount, amount: &Usdc) -> Result<(), Error> { + const URI: &str = "/faucet/tokens"; + let url = format!("{}{URI}", self.config.endpoint); + let body = FillReq { + address: &subaccount.address, + subaccount_number: &subaccount.number, + amount: amount + .to_u64() + .ok_or_else(|| err!("Failed converting USDC amount to u64"))?, + }; + let _resp = self + .client + .post(url) + .json(&body) + .send() + .await? + .error_for_status()?; + Ok(()) + } + + /// add native dYdX testnet token to an address + pub async fn fill_native(&self, address: &Address) -> Result<(), Error> { + const URI: &str = "/faucet/native-token"; + let url = format!("{}{URI}", self.config.endpoint); + let body = FillNativeReq { address }; + let _resp = self + .client + .post(url) + .json(&body) + .send() + .await? + .error_for_status()?; + Ok(()) + } +} diff --git a/v4-client-rs/client/src/indexer/config.rs b/v4-client-rs/client/src/indexer/config.rs new file mode 100644 index 00000000..64248ac6 --- /dev/null +++ b/v4-client-rs/client/src/indexer/config.rs @@ -0,0 +1,13 @@ +pub use crate::indexer::{rest::RestConfig, sock::SockConfig}; +use serde::Deserialize; + +/// Indexer client configuration. +#[derive(Clone, Debug, Deserialize)] +pub struct IndexerConfig { + /// Indexer REST client configuration. + #[serde(alias = "http")] + pub rest: RestConfig, + /// Indexer Websocket client configuration. + #[serde(alias = "ws")] + pub sock: SockConfig, +} diff --git a/v4-client-rs/client/src/indexer/mod.rs b/v4-client-rs/client/src/indexer/mod.rs new file mode 100644 index 00000000..ec649395 --- /dev/null +++ b/v4-client-rs/client/src/indexer/mod.rs @@ -0,0 +1,56 @@ +/// Indexer client configuration. +pub mod config; +mod rest; +mod sock; +/// Tokens. +pub mod tokens; +/// Types for Indexer data. +pub mod types; + +pub use config::IndexerConfig; +pub use rest::*; +pub use sock::*; +pub use tokens::*; +pub use types::*; + +/// Indexer client. +#[derive(Debug)] +pub struct IndexerClient { + rest: RestClient, + sock: SockClient, +} + +impl IndexerClient { + /// Create a new Indexer client. + pub fn new(config: IndexerConfig) -> Self { + Self { + rest: RestClient::new(config.rest), + sock: SockClient::new(config.sock), + } + } + + /// Get accounts query dispatcher. + pub fn accounts(&self) -> rest::Accounts { + self.rest.accounts() + } + + /// Get markets query dispatcher. + pub fn markets(&self) -> rest::Markets { + self.rest.markets() + } + + /// Get utility query dispatcher. + pub fn utility(&self) -> rest::Utility { + self.rest.utility() + } + + /// Get vaults query dispatcher. + pub fn vaults(&self) -> rest::Vaults { + self.rest.vaults() + } + + /// Get feeds dispatcher. + pub fn feed(&mut self) -> Feeds<'_> { + Feeds::new(&mut self.sock) + } +} diff --git a/v4-client-rs/client/src/indexer/rest/client/accounts.rs b/v4-client-rs/client/src/indexer/rest/client/accounts.rs new file mode 100644 index 00000000..5da56641 --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/client/accounts.rs @@ -0,0 +1,520 @@ +use super::*; +use anyhow::Error; + +/// Accounts dispatcher. +/// +/// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/account_endpoint.rs). +pub struct Accounts<'a> { + rest: &'a RestClient, +} + +impl<'a> Accounts<'a> { + /// Create a new accounts dispatcher. + pub(crate) fn new(rest: &'a RestClient) -> Self { + Self { rest } + } + + /// Query for all subaccounts infos. + /// + /// Compare with [`Self::get_subaccount`]. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getaddress). + pub async fn get_subaccounts(&self, address: &Address) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/addresses"; + let url = format!("{}{URI}/{address}", rest.config.endpoint); + let resp = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(resp) + } + + /// Query for the subaccount, its current perpetual and asset positions, margin and collateral. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getsubaccount). + pub async fn get_subaccount( + &self, + subaccount: &Subaccount, + ) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/addresses"; + let address = &subaccount.address; + let number = &subaccount.number; + let url = format!( + "{}{URI}/{address}/subaccountNumber/{number}", + rest.config.endpoint + ); + let subaccount = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json::() + .await? + .subaccount; + Ok(subaccount) + } + + /// Query for the parent subaccount, its child subaccounts, equity, collateral and margin. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getparentsubaccount). + pub async fn get_parent_subaccount( + &self, + subaccount: &ParentSubaccount, + ) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/addresses"; + let address = &subaccount.address; + let number = &subaccount.number; + let url = format!( + "{}{URI}/{address}/parentSubaccountNumber/{number}", + rest.config.endpoint + ); + let subaccount = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json::() + .await? + .subaccount; + Ok(subaccount) + } + + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/close_all_positions.rs). + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#listpositions). + pub async fn list_positions( + &self, + subaccount: &Subaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/perpetualPositions"; + let url = format!("{}{URI}", rest.config.endpoint); + let query = Query { + address: &subaccount.address, + subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let positions = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .positions; + Ok(positions) + } + + /// List all positions of a parent subaccount. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#listpositionsforparentsubaccount). + pub async fn list_parent_positions( + &self, + subaccount: &ParentSubaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/perpetualPositions"; + let url = format!("{}{URI}/parentSubaccountNumber", rest.config.endpoint); + let query = QueryParent { + address: &subaccount.address, + parent_subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let positions = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .positions; + Ok(positions) + } + + /// Query for asset positions (size, buy/sell etc). + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getassetpositions). + pub async fn get_asset_positions( + &self, + subaccount: &Subaccount, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/assetPositions"; + let url = format!("{}{URI}", rest.config.endpoint); + let query = Query { + address: &subaccount.address, + subaccount_number: &subaccount.number, + }; + let positions = rest + .client + .get(url) + .query(&query) + .send() + .await? + .error_for_status()? + .json::() + .await? + .positions; + Ok(positions) + } + + /// Query for asset positions (size, buy/sell etc) for a parent subaccount. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getassetpositionsforparentsubaccount). + pub async fn get_parent_asset_positions( + &self, + subaccount: &ParentSubaccount, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/assetPositions"; + let url = format!("{}{URI}/parentSubaccountNumber", rest.config.endpoint); + let query = QueryParent { + address: &subaccount.address, + parent_subaccount_number: &subaccount.number, + }; + let positions = rest + .client + .get(url) + .query(&query) + .send() + .await? + .error_for_status()? + .json::() + .await? + .positions; + Ok(positions) + } + + /// Query for transfers between subaccounts. + /// + /// See also [`crate::node::NodeClient::transfer`]. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gettransfers). + pub async fn get_transfers( + &self, + subaccount: &Subaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/transfers"; + let url = format!("{}{URI}", rest.config.endpoint); + let query = Query { + address: &subaccount.address, + subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let transfers = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .transfers; + Ok(transfers) + } + + /// Query for transfers between subaccounts associated with a parent subaccount. + /// + /// See also [`crate::node::NodeClient::transfer`]. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gettransfersforparentsubaccount). + pub async fn get_parent_transfers( + &self, + subaccount: &ParentSubaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/transfers"; + let url = format!("{}{URI}/parentSubaccountNumber", rest.config.endpoint); + let query = QueryParent { + address: &subaccount.address, + parent_subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let transfers = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .transfers; + Ok(transfers) + } + + /// Query for orders filtered by order params. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#listorders). + pub async fn list_orders( + &self, + subaccount: &Subaccount, + opts: Option, + ) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/orders"; + let url = format!("{}{URI}", rest.config.endpoint); + let query = Query { + address: &subaccount.address, + subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let orders = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(orders) + } + + /// Query for orders filtered by order params of a parent subaccount. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#listordersforparentsubaccount). + pub async fn list_parent_orders( + &self, + subaccount: &ParentSubaccount, + opts: Option, + ) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/orders"; + let url = format!("{}{URI}/parentSubaccountNumber", rest.config.endpoint); + let query = QueryParent { + address: &subaccount.address, + parent_subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let orders = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(orders) + } + + /// Query for the order. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getorder). + pub async fn get_order(&self, order_id: &OrderId) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/orders"; + let url = format!("{}{URI}/{order_id}", rest.config.endpoint); + let order = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(order) + } + + /// Query for fills (i.e. filled orders data). + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getfills). + pub async fn get_fills( + &self, + subaccount: &Subaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/fills"; + let url = format!("{}{URI}", rest.config.endpoint); + let query = Query { + address: &subaccount.address, + subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let fills = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .fills; + Ok(fills) + } + + /// Query for fills (i.e. filled orders data) for a parent subaccount. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getfillsforparentsubaccount). + pub async fn get_parent_fills( + &self, + subaccount: &ParentSubaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/fills"; + let url = format!("{}{URI}/parentSubaccountNumber", rest.config.endpoint); + let query = QueryParent { + address: &subaccount.address, + parent_subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let fills = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .fills; + Ok(fills) + } + + /// Query for profit and loss report for the specified time/block range. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gethistoricalpnl). + pub async fn get_historical_pnl( + &self, + subaccount: &Subaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/historical-pnl"; + let url = format!("{}{URI}", rest.config.endpoint); + let query = Query { + address: &subaccount.address, + subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let pnls = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .historical_pnl; + Ok(pnls) + } + + /// Query for profit and loss report for the specified time/block range of a parent subaccount. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gethistoricalpnlforparentsubaccount). + pub async fn get_parent_historical_pnl( + &self, + subaccount: &ParentSubaccount, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/historical-pnl"; + let url = format!("{}{URI}/parentSubaccountNumber", rest.config.endpoint); + let query = QueryParent { + address: &subaccount.address, + parent_subaccount_number: &subaccount.number, + }; + let options = opts.unwrap_or_default(); + let pnls = rest + .client + .get(url) + .query(&query) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .historical_pnl; + Ok(pnls) + } + + /// Get trader's rewards. + /// + /// See also [Trading Rewards](https://docs.dydx.exchange/concepts-trading/rewards_fees_and_parameters#trading-rewards). + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gettradingrewards). + pub async fn get_rewards( + &self, + address: &Address, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/historicalBlockTradingRewards"; + let url = format!("{}{URI}/{address}", rest.config.endpoint); + let options = opts.unwrap_or_default(); + let rewards = rest + .client + .get(url) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .rewards; + Ok(rewards) + } + + /// Get trader's rewards aggregation. + /// + /// See also [`Self::get_rewards`]. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getaggregations). + pub async fn get_rewards_aggregated( + &self, + address: &Address, + period: TradingRewardAggregationPeriod, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/historicalTradingRewardAggregations"; + let url = format!("{}{URI}/{address}", rest.config.endpoint); + let options = opts.unwrap_or_default(); + let aggregated = rest + .client + .get(url) + .query(&[("period", &period)]) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .rewards; + Ok(aggregated) + } +} diff --git a/v4-client-rs/client/src/indexer/rest/client/markets.rs b/v4-client-rs/client/src/indexer/rest/client/markets.rs new file mode 100644 index 00000000..eb45f526 --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/client/markets.rs @@ -0,0 +1,174 @@ +use super::*; +use anyhow::{anyhow as err, Error}; +use std::collections::HashMap; + +/// Markets dispatcher. +/// +/// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/market_endpoint.rs). +pub struct Markets<'a> { + rest: &'a RestClient, +} + +impl<'a> Markets<'a> { + /// Create a new markets dispatcher. + pub(crate) fn new(rest: &'a RestClient) -> Self { + Self { rest } + } + + /// Query for perpetual markets data. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#listperpetualmarkets). + pub async fn list_perpetual_markets( + &self, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/perpetualMarkets"; + let url = format!("{}{URI}", rest.config.endpoint); + let options = opts.unwrap_or_default(); + let markets = rest + .client + .get(url) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .markets; + Ok(markets) + } + + /// Query for the perpetual market. + pub async fn get_perpetual_market(&self, ticker: &Ticker) -> Result { + let mut markets = self + .list_perpetual_markets(Some(ListPerpetualMarketsOpts { + limit: Some(1), + ticker: Some(ticker.clone()), + })) + .await?; + markets + .remove(ticker) + .ok_or_else(|| err!("Market ticker not found in list Markets response")) + } + + /// Query for bids-asks for the perpetual market. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getperpetualmarket). + pub async fn get_perpetual_market_orderbook( + &self, + ticker: &Ticker, + ) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/orderbooks/perpetualMarket"; + let url = format!("{}{URI}/{ticker}", rest.config.endpoint); + let orderbook = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(orderbook) + } + + /// Query for trades. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gettrades). + pub async fn get_trades( + &self, + ticker: &Ticker, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/trades/perpetualMarket"; + let url = format!("{}{URI}/{ticker}", rest.config.endpoint); + let options = opts.unwrap_or_default(); + let trades = rest + .client + .get(url) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .trades; + Ok(trades) + } + + /// Query for [candles](https://dydx.exchange/crypto-learning/candlestick-patterns). + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getcandles). + pub async fn get_candles( + &self, + ticker: &Ticker, + res: CandleResolution, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/candles/perpetualMarkets"; + let url = format!("{}{URI}/{ticker}", rest.config.endpoint); + let options = opts.unwrap_or_default(); + let candles = rest + .client + .get(url) + .query(&[("resolution", &res)]) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .candles; + Ok(candles) + } + + /// Query for funding till time/block specified. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gethistoricalfunding). + pub async fn get_historical_funding( + &self, + ticker: &Ticker, + opts: Option, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/historicalFunding"; + let url = format!("{}{URI}/{ticker}", rest.config.endpoint); + let options = opts.unwrap_or_default(); + let funding = rest + .client + .get(url) + .query(&options) + .send() + .await? + .error_for_status()? + .json::() + .await? + .historical_funding; + Ok(funding) + } + + /// Query for [sparklines](https://en.wikipedia.org/wiki/Sparkline). + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#get). + pub async fn get_sparklines( + &self, + period: SparklineTimePeriod, + ) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/sparklines"; + let url = format!("{}{URI}", rest.config.endpoint); + let sparklines = rest + .client + .get(url) + .query(&[("timePeriod", &period)]) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(sparklines) + } +} diff --git a/v4-client-rs/client/src/indexer/rest/client/mod.rs b/v4-client-rs/client/src/indexer/rest/client/mod.rs new file mode 100644 index 00000000..295dcc88 --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/client/mod.rs @@ -0,0 +1,65 @@ +pub mod accounts; +pub mod markets; +pub mod utility; +pub mod vaults; + +use super::config::RestConfig; +use super::options::*; +use crate::indexer::{rest::types::*, types::*}; +use accounts::Accounts; +use markets::Markets; +use reqwest::Client; +use serde::Serialize; +use utility::Utility; +use vaults::Vaults; + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct Query<'t> { + address: &'t Address, + subaccount_number: &'t SubaccountNumber, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct QueryParent<'t> { + address: &'t Address, + parent_subaccount_number: &'t ParentSubaccountNumber, +} + +/// REST client to Indexer. +#[derive(Debug)] +pub(crate) struct RestClient { + config: RestConfig, + client: Client, +} + +impl RestClient { + /// Create a new Indexer REST client. + pub(crate) fn new(config: RestConfig) -> Self { + Self { + config, + client: Client::default(), + } + } + + /// Get accounts query dispatcher. + pub(crate) fn accounts(&self) -> Accounts<'_> { + Accounts::new(self) + } + + /// Get markets query dispatcher. + pub(crate) fn markets(&self) -> Markets<'_> { + Markets::new(self) + } + + /// Get utility query dispatcher. + pub(crate) fn utility(&self) -> Utility<'_> { + Utility::new(self) + } + + /// Get vaults query dispatcher. + pub(crate) fn vaults(&self) -> Vaults<'_> { + Vaults::new(self) + } +} diff --git a/v4-client-rs/client/src/indexer/rest/client/utility.rs b/v4-client-rs/client/src/indexer/rest/client/utility.rs new file mode 100644 index 00000000..28a51e18 --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/client/utility.rs @@ -0,0 +1,71 @@ +use super::*; +use anyhow::Error; + +/// Other data dispatcher. +/// +/// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/utility_endpoint.rs). +pub struct Utility<'a> { + rest: &'a RestClient, +} + +impl<'a> Utility<'a> { + /// Create a new utility dispatcher. + pub(crate) fn new(rest: &'a RestClient) -> Self { + Self { rest } + } + + /// Current server time (UTC) of Indexer. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#gettime). + pub async fn get_time(&self) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/time"; + let url = format!("{}{URI}", rest.config.endpoint); + let resp = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(resp) + } + + /// Current block height and block time (UTC) parsed by Indexer. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#getheight). + pub async fn get_height(&self) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/height"; + let url = format!("{}{URI}", rest.config.endpoint); + let resp = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(resp) + } + + /// Query for screening results (compliance) of the address. + /// + /// [Reference](https://docs.dydx.exchange/api_integration-indexer/indexer_api#screen). + pub async fn get_screen(&self, query: &Address) -> Result { + let rest = &self.rest; + const URI: &str = "/v4/screen"; + let url = format!("{}{URI}", rest.config.endpoint); + let resp = rest + .client + .get(url) + .query(&[("address", query)]) + .send() + .await? + .error_for_status()? + .json() + .await?; + Ok(resp) + } +} diff --git a/v4-client-rs/client/src/indexer/rest/client/vaults.rs b/v4-client-rs/client/src/indexer/rest/client/vaults.rs new file mode 100644 index 00000000..e0fa63bb --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/client/vaults.rs @@ -0,0 +1,75 @@ +use super::*; +use anyhow::Error; + +/// Vaults dispatcher. +/// +/// Check [the example](https://github.com/NethermindEth/dydx-v4-rust/blob/trunk/client/examples/vaults_endpoint.rs). +pub struct Vaults<'a> { + rest: &'a RestClient, +} + +impl<'a> Vaults<'a> { + /// Create a new vaults dispatcher. + pub(crate) fn new(rest: &'a RestClient) -> Self { + Self { rest } + } + + /// MegaVault historical PnL. + pub async fn get_megavault_historical_pnl( + &self, + resolution: PnlTickInterval, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/vault/v1/megavault/historicalPnl"; + let url = format!("{}{URI}", rest.config.endpoint); + let resp = rest + .client + .get(url) + .query(&[("resolution", resolution)]) + .send() + .await? + .error_for_status()? + .json::() + .await? + .megavault_pnl; + Ok(resp) + } + + /// Vaults historical PnL. + pub async fn get_vaults_historical_pnl( + &self, + resolution: PnlTickInterval, + ) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/vault/v1/vaults/historicalPnl"; + let url = format!("{}{URI}", rest.config.endpoint); + let resp = rest + .client + .get(url) + .query(&[("resolution", resolution)]) + .send() + .await? + .error_for_status()? + .json::() + .await? + .vaults_pnl; + Ok(resp) + } + + /// MegaVault positions. + pub async fn get_megavault_positions(&self) -> Result, Error> { + let rest = &self.rest; + const URI: &str = "/v4/vault/v1/megavault/positions"; + let url = format!("{}{URI}", rest.config.endpoint); + let resp = rest + .client + .get(url) + .send() + .await? + .error_for_status()? + .json::() + .await? + .positions; + Ok(resp) + } +} diff --git a/v4-client-rs/client/src/indexer/rest/config.rs b/v4-client-rs/client/src/indexer/rest/config.rs new file mode 100644 index 00000000..7d7d7e88 --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/config.rs @@ -0,0 +1,10 @@ +use serde::Deserialize; + +/// REST Indexer client configuration. +#[derive(Clone, Debug, Deserialize)] +pub struct RestConfig { + /// REST endpoint. + /// + /// You can select REST endpoints from [the list](https://docs.dydx.exchange/infrastructure_providers-network/resources#indexer-endpoints). + pub endpoint: String, +} diff --git a/v4-client-rs/client/src/indexer/rest/mod.rs b/v4-client-rs/client/src/indexer/rest/mod.rs new file mode 100644 index 00000000..5d943a4e --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/mod.rs @@ -0,0 +1,14 @@ +mod client; +mod config; +mod options; +mod types; + +pub(crate) use client::RestClient; +pub use config::RestConfig; +pub use options::*; +pub use types::*; + +pub use client::accounts::Accounts; +pub use client::markets::Markets; +pub use client::utility::Utility; +pub use client::vaults::Vaults; diff --git a/v4-client-rs/client/src/indexer/rest/options.rs b/v4-client-rs/client/src/indexer/rest/options.rs new file mode 100644 index 00000000..a9decada --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/options.rs @@ -0,0 +1,157 @@ +use crate::indexer::types::*; +use chrono::{DateTime, Utc}; +use serde::Serialize; + +/// Filter options for perpetual markets. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct ListPerpetualMarketsOpts { + /// Limit. + pub limit: Option, + /// Ticker. + pub ticker: Option, +} + +/// Filter options for trades. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetTradesOpts { + /// Limit. + pub limit: Option, + /// Block height. + pub created_before_or_at_height: Option, + /// Time. + pub created_before_or_at: Option>, +} + +/// Filter options for candles. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetCandlesOpts { + /// Limit. + pub limit: Option, + /// Time. + #[serde(rename = "fromISO")] + pub from_iso: Option>, + /// Time. + #[serde(rename = "toISO")] + pub to_iso: Option>, +} + +/// Filter options for fundings. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetHistoricalFundingOpts { + /// Limit. + pub limit: Option, + /// Block height. + pub effective_before_or_at_height: Option, + /// Time. + pub effective_before_or_at: Option>, +} + +/// Filter options for positions. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct ListPositionsOpts { + /// Perpetual postion status. + pub status: Option, + /// Limit. + pub limit: Option, + /// Block height. + pub created_before_or_at_height: Option, + /// Time. + pub created_before_or_at: Option>, +} + +/// Filter options for transfers. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetTransfersOpts { + /// Limit. + pub limit: Option, + /// Block height. + pub created_before_or_at_height: Option, + /// Time. + pub created_before_or_at: Option>, +} + +/// Filter options for orders. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct ListOrdersOpts { + /// Limit. + pub limit: Option, + /// Ticker. + pub ticker: Option, + /// Side (buy/sell). + pub side: Option, + // TODO: Arrays is supported + /// Order status. + pub status: Option, + /// Order type. + #[serde(rename = "type")] + pub order_type: Option, + /// Block height. + pub good_til_block_before_or_at: Option, + /// Time. + pub good_til_block_time_before_or_at: Option>, + /// Whether to return the latest orders. + pub return_latest_orders: Option, +} + +/// Filter options for fills. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetFillsOpts { + /// Limit. + pub limit: Option, + /// Block height. + pub created_before_or_at_height: Option, + /// Time. + pub created_before_or_at: Option>, + /// Ticker. + pub market: Option, + /// Market type. + pub market_type: Option, +} + +/// Filter options for profit and loss. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetHistoricalPnlOpts { + /// Limit. + pub limit: Option, + /// Block height. + pub created_before_or_at_height: Option, + /// Time. + pub created_before_or_at: Option>, + /// Block height. + pub created_on_or_after_height: Option, + /// Time. + pub created_on_or_after: Option>, +} + +/// Filter options for rewards. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetTradingRewardsOpts { + /// Limit. + pub limit: Option, + /// Block height. + pub starting_before_or_at_height: Option, + /// Time. + pub starting_before_or_at: Option>, +} + +/// Filter options for aggregated rewards. +#[derive(Serialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct GetAggregationsOpts { + /// Limit. + pub limit: Option, + /// Block height. + pub starting_before_or_at_height: Option, + /// Time. + pub starting_before_or_at: Option>, +} diff --git a/v4-client-rs/client/src/indexer/rest/types.rs b/v4-client-rs/client/src/indexer/rest/types.rs new file mode 100644 index 00000000..649b1cb9 --- /dev/null +++ b/v4-client-rs/client/src/indexer/rest/types.rs @@ -0,0 +1,363 @@ +use bigdecimal::BigDecimal; +use chrono::{DateTime, Utc}; +use derive_more::{Display, From}; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +use crate::indexer::types::*; + +/// REST Indexer response error. +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ResponseError { + /// Errors. + pub errors: Vec, +} + +/// REST Indexer error message. +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ErrorMsg { + /// Message. + pub msg: String, + /// Parameter. + pub param: String, + /// Location. + pub location: String, +} + +/// Profit and loss tick id. +#[derive(Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct PnlTickId(pub String); + +/// PnL tick resolution. +#[derive( + Deserialize, Serialize, Debug, Clone, Copy, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +#[serde(rename_all = "lowercase")] +pub enum PnlTickInterval { + /// Hour. + Hour, + /// Day. + Day, +} + +/// Transfer id. +#[derive( + Serialize, Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +pub struct TransferId(pub String); + +/// Period to aggregate rewards over. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum TradingRewardAggregationPeriod { + /// Day. + Daily, + /// Week. + Weekly, + /// Month. + Monthly, +} + +/// Sparkline time period. +#[derive(Serialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum SparklineTimePeriod { + /// 1 day. + OneDay, + /// 7 days. + SevenDays, +} + +/// Fundings response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HistoricalFundingResponse { + /// List of fundings + pub historical_funding: Vec, +} + +/// Funding response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HistoricalFundingResponseObject { + /// Market ticker. + pub ticker: Ticker, + /// Time. + pub effective_at: DateTime, + /// Block height. + pub effective_at_height: Height, + /// Price. + pub price: Price, + /// Funding rate. + pub rate: BigDecimal, +} + +/// Sparkline response. +pub type SparklineResponseObject = HashMap>; + +/// Indexer server time. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TimeResponse { + /// Time (UTC). + pub iso: DateTime, + /// Unix epoch. + pub epoch: f64, +} + +/// Compliance response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ComplianceResponse { + /// Whether the address is restricted. + pub restricted: bool, + /// Reason. + pub reason: Option, +} + +/// Address response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct AddressResponse { + /// List of all subaccounts. + pub subaccounts: Vec, + /// Total rewards. + pub total_trading_rewards: BigDecimal, +} + +/// Subaccount response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct SubaccountResponse { + /// Subaccount. + pub subaccount: SubaccountResponseObject, +} + +/// Parent subaccount response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ParentSubaccountResponse { + /// Subaccount. + pub subaccount: ParentSubaccountResponseObject, +} + +/// Asset positions response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct AssetPositionResponse { + /// Asset positions. + pub positions: Vec, +} + +/// Perpetual positions response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PerpetualPositionResponse { + /// Perpetual positions. + pub positions: Vec, +} + +/// Transfers response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TransferResponse { + /// List of transfers. + pub transfers: Vec, +} + +/// Transfer response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TransferResponseObject { + /// Transfer id. + pub id: TransferId, + /// Time (UTC). + pub created_at: DateTime, + /// Block height. + pub created_at_height: Height, + /// Sender of transfer. + pub sender: Account, + /// Recipient of transfer. + pub recipient: Account, + /// Size of transfer. + pub size: BigDecimal, + /// Token symbol. + pub symbol: Symbol, + /// Transfer transaction hash. + pub transaction_hash: String, + /// Transfer type. + #[serde(rename = "type")] + pub transfer_type: TransferType, +} + +/// Orders list response. +pub type ListOrdersResponse = Vec; + +/// Fills response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct FillResponse { + /// List of fills. + pub fills: Vec, +} + +/// Fill response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct FillResponseObject { + /// Fill id. + pub id: FillId, + /// Side (buy/sell). + pub side: OrderSide, + /// Size. + pub size: BigDecimal, + /// Fee. + pub fee: BigDecimal, + /// Fill type. + #[serde(rename = "type")] + pub fill_type: FillType, + /// Liquidity. + pub liquidity: Liquidity, + /// Market ticker. + pub market: Ticker, + /// Market type. + pub market_type: MarketType, + /// Price. + pub price: Price, + /// Subaccount number. + pub subaccount_number: SubaccountNumber, + /// Block height. + pub created_at_height: Height, + /// Time (UTC). + pub created_at: DateTime, + /// Client metadata. + pub client_metadata: Option, + /// Order id. + pub order_id: Option, +} + +/// Profit and loss reports. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HistoricalPnlResponse { + /// List of PnL reports. + pub historical_pnl: Vec, +} + +/// Profit and loss report. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PnlTicksResponseObject { + /// Report id. + pub id: PnlTickId, + /// Subaccount id. + pub subaccount_id: SubaccountId, + /// Block height. + pub block_height: Height, + /// Time (UTC). + pub block_time: DateTime, + /// Time (UTC). + pub created_at: DateTime, + /// Equity. + pub equity: BigDecimal, + /// Total PnL. + pub total_pnl: BigDecimal, + /// Net transfers. + pub net_transfers: BigDecimal, +} + +/// Trading rewards reports. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HistoricalBlockTradingRewardsResponse { + /// List of reports. + pub rewards: Vec, +} + +/// Trading rewards report. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HistoricalBlockTradingReward { + /// Trading reward amount. + pub trading_reward: BigDecimal, + /// Block height. + pub created_at_height: Height, + /// Time (UTC). + pub created_at: DateTime, +} + +/// Trading rewards aggregation reports. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HistoricalTradingRewardAggregationsResponse { + /// List of reports. + pub rewards: Vec, +} + +/// Trading rewards aggregation report. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HistoricalTradingRewardAggregation { + /// Trading reward amount. + pub trading_reward: BigDecimal, + /// Block height. + pub started_at_height: Height, + /// Time (UTC). + pub started_at: DateTime, + /// Block height. + pub ended_at_height: Option, + /// Time (UTC). + pub ended_at: Option>, + /// Aggregation period. + pub period: TradingRewardAggregationPeriod, +} + +/// MegaVault Profit and loss reports. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct MegaVaultHistoricalPnlResponse { + /// List of PnL reports. + pub megavault_pnl: Vec, +} + +/// MegaVault Profit and loss reports. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct MegaVaultPositionResponse { + /// List MegaVault positions. + pub positions: Vec, +} + +/// Vaults profit and loss reports. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct VaultsHistoricalPnLResponse { + /// List of PnL reports. + pub vaults_pnl: Vec, +} + +/// Vault Profit and loss reports. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct VaultHistoricalPnl { + /// Associated ticker. + pub ticker: String, + /// List of PnL reports. + pub historical_pnl: Vec, +} + +/// Vault position. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct VaultPosition { + /// Associated ticker. + pub ticker: String, + /// Asset position. + pub asset_position: Option, + /// Perpetual position. + pub perpetual_position: Option, + /// Equity. + pub equity: BigDecimal, +} diff --git a/v4-client-rs/client/src/indexer/sock/config.rs b/v4-client-rs/client/src/indexer/sock/config.rs new file mode 100644 index 00000000..d1afa635 --- /dev/null +++ b/v4-client-rs/client/src/indexer/sock/config.rs @@ -0,0 +1,27 @@ +use serde::Deserialize; +use std::num::NonZeroU32; + +/// Websocket Indexer client configuration. +#[derive(Clone, Debug, Deserialize)] +pub struct SockConfig { + /// Websocket endpoint. + /// + /// You can select Websocket endpoints from [the list](https://docs.dydx.exchange/infrastructure_providers-network/resources#indexer-endpoints). + pub endpoint: String, + /// Reconnect interval. + #[serde(default = "default_timeout")] + pub timeout: u64, + /// Rate limit. + /// + /// See also [Rate Limiting](https://docs.dydx.exchange/api_integration-indexer/indexer_websocket#rate-limiting). + #[serde(default = "default_rate_limit")] + pub rate_limit: NonZeroU32, +} + +fn default_timeout() -> u64 { + 1_000 +} + +fn default_rate_limit() -> NonZeroU32 { + NonZeroU32::new(2).unwrap() +} diff --git a/v4-client-rs/client/src/indexer/sock/connector.rs b/v4-client-rs/client/src/indexer/sock/connector.rs new file mode 100644 index 00000000..117694a7 --- /dev/null +++ b/v4-client-rs/client/src/indexer/sock/connector.rs @@ -0,0 +1,316 @@ +use super::{config::SockConfig, messages::*}; +use anyhow::{anyhow as err, Error}; +use futures_util::{SinkExt, StreamExt}; +use governor::{DefaultDirectRateLimiter, Quota, RateLimiter}; +use std::collections::{hash_map::Entry, HashMap}; +use tokio::{ + net::TcpStream, + sync::mpsc, + time::{sleep, Duration}, +}; +use tokio_tungstenite::{ + connect_async, + tungstenite::{self, protocol::Message}, + MaybeTlsStream, WebSocketStream, +}; + +#[cfg(feature = "telemetry")] +use crate::telemetry::{ + LatencyMetric, TELEMETRY_DESC_WS_RECEIVED, TELEMETRY_DESC_WS_RECONNECTS, + TELEMETRY_DESC_WS_SENT, TELEMETRY_DESC_WS_SENT_DURATION, TELEMETRY_WS_RECEIVED, + TELEMETRY_WS_RECONNECTS, TELEMETRY_WS_SENT, TELEMETRY_WS_SENT_DURATION, +}; + +#[derive(Debug)] +pub enum ControlMsg { + Subscribe(Subscription, bool, ChannelSender), + Unsubscribe(Subscription), + #[allow(dead_code)] // TODO remove after completion. + Terminate, +} + +type WsStream = WebSocketStream>; + +#[derive(Debug)] +pub enum ChannelSender { + Subaccounts(mpsc::UnboundedSender>), + ParentSubaccounts(mpsc::UnboundedSender>), + Trades(mpsc::UnboundedSender>), + Orders(mpsc::UnboundedSender>), + Markets(mpsc::UnboundedSender>), + Candles(mpsc::UnboundedSender>), + BlockHeight(mpsc::UnboundedSender>), +} + +impl ChannelSender { + pub(crate) fn status(&self, msg: ConnectorStatusMessage) -> Result<(), Error> { + match self { + Self::Subaccounts(tx) => tx.send(ConnectorMessage::Status(msg))?, + Self::ParentSubaccounts(tx) => tx.send(ConnectorMessage::Status(msg))?, + Self::Trades(tx) => tx.send(ConnectorMessage::Status(msg))?, + Self::Orders(tx) => tx.send(ConnectorMessage::Status(msg))?, + Self::Markets(tx) => tx.send(ConnectorMessage::Status(msg))?, + Self::Candles(tx) => tx.send(ConnectorMessage::Status(msg))?, + Self::BlockHeight(tx) => tx.send(ConnectorMessage::Status(msg))?, + } + Ok(()) + } + + pub(crate) fn send(&self, msg: FeedMessage) -> Result<(), Error> { + match (self, msg) { + (Self::Subaccounts(tx), FeedMessage::Subaccounts(m)) => { + tx.send(ConnectorMessage::Feed(m))? + } + (Self::ParentSubaccounts(tx), FeedMessage::ParentSubaccounts(m)) => { + tx.send(ConnectorMessage::Feed(m))? + } + (Self::Trades(tx), FeedMessage::Trades(m)) => tx.send(ConnectorMessage::Feed(m))?, + (Self::Orders(tx), FeedMessage::Orders(m)) => tx.send(ConnectorMessage::Feed(m))?, + (Self::Markets(tx), FeedMessage::Markets(m)) => tx.send(ConnectorMessage::Feed(m))?, + (Self::Candles(tx), FeedMessage::Candles(m)) => tx.send(ConnectorMessage::Feed(m))?, + (Self::BlockHeight(tx), FeedMessage::BlockHeight(m)) => { + tx.send(ConnectorMessage::Feed(m))? + } + _ => return Err(err!("Mismatched ChannelSender and FeedMessage types")), + } + Ok(()) + } +} + +/// Connector to Client message +#[derive(Debug)] +pub enum ConnectorMessage> { + Status(ConnectorStatusMessage), + Feed(T), +} + +#[derive(Debug)] +pub enum ConnectorStatusMessage { + Connected, + Disconnected, + Resubscription, +} + +/// WebSockets connection manager, message router +pub(crate) struct Connector { + client_handle: bool, + timeout: Duration, + url: String, + rx: mpsc::UnboundedReceiver, + subscriptions: HashMap, + rate_limiter: DefaultDirectRateLimiter, +} + +impl Connector { + pub(crate) fn new(config: SockConfig, rx: mpsc::UnboundedReceiver) -> Self { + #[cfg(feature = "telemetry")] + { + metrics::describe_counter!( + TELEMETRY_WS_RECONNECTS, + metrics::Unit::Count, + TELEMETRY_DESC_WS_RECONNECTS + ); + metrics::describe_counter!( + TELEMETRY_WS_RECEIVED, + metrics::Unit::Count, + TELEMETRY_DESC_WS_RECEIVED + ); + metrics::describe_counter!( + TELEMETRY_WS_SENT, + metrics::Unit::Count, + TELEMETRY_DESC_WS_SENT + ); + + metrics::describe_histogram!( + TELEMETRY_WS_SENT_DURATION, + metrics::Unit::Milliseconds, + TELEMETRY_DESC_WS_SENT_DURATION + ); + } + Connector { + client_handle: true, + url: config.endpoint, + timeout: Duration::from_millis(config.timeout), + rx, + subscriptions: Default::default(), + rate_limiter: RateLimiter::direct(Quota::per_second(config.rate_limit)), + } + } + + pub(crate) async fn entrypoint(mut self) { + if let Err(err) = self.connection_loop().await { + log::error!("Connection failed: {err}"); + } + } + + async fn connection_loop(&mut self) -> Result<(), Error> { + let (mut wss, _) = connect_async(&self.url).await?; + while self.is_active() { + if let Err(err) = self.step(&mut wss).await { + match err { + SockError::Tungstenite(e) => { + log::error!( + "WebSocket interaction failed: {e}. Attempting reconnection..." + ); + sleep(self.timeout).await; + + #[cfg(feature = "telemetry")] + metrics::counter!(TELEMETRY_WS_RECONNECTS).increment(1); + + wss = self.reconnect().await?; + } + SockError::Protocol(e) => log::error!("WebSocket protocol failure: {e}"), + } + } + } + log::debug!("Stopping connector."); + self.unsubscribe_all(&mut wss).await?; + Ok(()) + } + + async fn step(&mut self, wss: &mut WsStream) -> Result<(), SockError> { + tokio::select! { + // Client -> Indexer + Some(msg) = self.rx.recv() => { + + if let Some(msg) = self.process_ctrl_msg(msg).await { + #[cfg(feature = "telemetry")] + LatencyMetric::new(TELEMETRY_WS_SENT_DURATION); + + self.send(wss, msg).await?; + + #[cfg(feature = "telemetry")] + metrics::counter!(TELEMETRY_WS_SENT).increment(1); + } + } + // Indexer -> Client + Some(msg) = wss.next() => { + self.process_wss_msg(msg?).await?; + + #[cfg(feature = "telemetry")] + metrics::counter!(TELEMETRY_WS_RECEIVED).increment(1); + } + } + Ok(()) + } + + async fn process_ctrl_msg(&mut self, ctrl_msg: ControlMsg) -> Option { + match ctrl_msg { + ControlMsg::Subscribe(sub, batched, tx) => { + let msg = sub.sub_message(batched); + match self.subscriptions.entry(sub) { + Entry::Vacant(entry) => { + tx.status(ConnectorStatusMessage::Connected).ok()?; + entry.insert(tx); + Some(RatedMessage::RateLimited(msg)) + } + Entry::Occupied(_) => { + tx.status(ConnectorStatusMessage::Resubscription).ok()?; + None + } + } + } + ControlMsg::Unsubscribe(sub) => { + let msg = sub.unsub_message(); + self.subscriptions.remove(&sub); + Some(RatedMessage::Free(msg)) + } + ControlMsg::Terminate => { + self.client_handle = false; + None + } + } + } + + async fn process_wss_msg(&mut self, wss_msg: Message) -> Result<(), Error> { + match wss_msg { + Message::Text(text) => { + let json: WsMessage = + serde_json::from_str(&text).map_err(|e| err!("{e} for message: {text}"))?; + match json { + WsMessage::Setup(setup) => { + log::debug!( + "Connected to WebSocket stream with ID: {}", + setup.connection_id + ); + Ok(()) + } + WsMessage::Error(error) => { + Err(err!("Server sent error message: {}", error.message)) + } + WsMessage::Data(data) => { + let sub = data.subscription().ok_or_else(|| { + err!("Could not match received FeedMessage with a subscription!") + })?; + let tx = self + .subscriptions + .get(&sub) + .ok_or_else(|| err!("Subscription {sub:?} is not found!"))?; + tx.send(data)?; + Ok(()) + } + WsMessage::Unsub(unsub) => { + log::debug!( + "Received unsubscribed message for: {} {}", + unsub.channel, + unsub.id.unwrap_or("".into()) + ); + Ok(()) + } + } + } + Message::Ping(_) | Message::Pong(_) => Ok(()), + evt => Err(err!("Unsupported WebSocket event: {evt:?}")), + } + } + + async fn reconnect(&mut self) -> Result { + let (mut wss, _) = connect_async(&self.url).await?; + // Resubscribe to all + for sub in &self.subscriptions { + let msg = sub.0.sub_message(false); + self.send(&mut wss, RatedMessage::RateLimited(msg)).await?; + } + Ok(wss) + } + + async fn unsubscribe_all(&mut self, wss: &mut WsStream) -> Result<(), Error> { + for sub in &self.subscriptions { + let msg = sub.0.unsub_message(); + self.send(wss, RatedMessage::Free(msg)).await?; + } + Ok(()) + } + + /// Run while `SockClient` wasn't dropped or there are any live subscriptions + fn is_active(&self) -> bool { + self.client_handle || !self.subscriptions.is_empty() + } + + /// Rate-limiting socket send + async fn send(&self, wss: &mut WsStream, msg: RatedMessage) -> Result<(), Error> { + let wmsg = match msg { + RatedMessage::RateLimited(wmsg) => { + self.rate_limiter.until_ready().await; + wmsg + } + RatedMessage::Free(wmsg) => wmsg, + }; + wss.send(wmsg).await?; + Ok(()) + } +} + +#[derive(Debug)] +enum RatedMessage { + RateLimited(Message), + Free(Message), +} + +#[derive(Debug, thiserror::Error)] +enum SockError { + #[error("Stream error: {0}")] + Tungstenite(#[from] tungstenite::Error), + #[error("Protocol error: {0}")] + Protocol(#[from] anyhow::Error), +} diff --git a/v4-client-rs/client/src/indexer/sock/feed.rs b/v4-client-rs/client/src/indexer/sock/feed.rs new file mode 100644 index 00000000..bf744c7a --- /dev/null +++ b/v4-client-rs/client/src/indexer/sock/feed.rs @@ -0,0 +1,101 @@ +use anyhow::anyhow as err; +use derive_more::Debug; +use std::ops::{Deref, DerefMut}; +use thiserror::Error; +use tokio::sync::mpsc; + +use super::connector::{ConnectorMessage, ConnectorStatusMessage}; +use super::{ControlMsg, FeedMessage, Subscription}; + +/// Realtime feed. +/// +/// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/websockets.rs). +pub struct Feed> { + feed: mpsc::UnboundedReceiver>, + sub: Subscription, + ctrl: mpsc::UnboundedSender, +} + +impl Feed +where + T: TryFrom + Debug, +{ + pub(crate) async fn setup( + mut feed: mpsc::UnboundedReceiver>, + sub: Subscription, + ctrl: mpsc::UnboundedSender, + ) -> Result { + if let Some(msg) = feed.recv().await { + match msg { + ConnectorMessage::Status(ConnectorStatusMessage::Connected) => { + Ok(Self { feed, sub, ctrl }) + } + ConnectorMessage::Status(status) => Err(status.into()), + other => Err(err!("Connector sent {:?}. Expected Connected status.", other).into()), + } + } else { + Err(FeedError::Disconnected) + } + } + + // Can be made return Result + /// Receive feed update. + pub async fn recv(&mut self) -> Option { + match self.feed.recv().await { + Some(ConnectorMessage::Feed(feed)) => Some(feed), + _ => None, + } + } +} + +impl> Drop for Feed { + fn drop(&mut self) { + if let Err(err) = self.ctrl.send(ControlMsg::Unsubscribe(self.sub.clone())) { + log::error!("Sending of Unsubscribe control message to connector failed: {err}"); + } + } +} + +impl> Deref for Feed { + type Target = mpsc::UnboundedReceiver>; + + fn deref(&self) -> &Self::Target { + &self.feed + } +} + +impl> DerefMut for Feed { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.feed + } +} + +/// Feed error. +#[derive(Debug, Error)] +pub enum FeedError { + /// Channel is disconnected. + #[error("Channel disconnected")] + Disconnected, + /// Resubscription is detected. + #[error("Resubscription detected")] + Resubscription, + /// Other error. + #[error("Other error: {0}")] + Other(#[from] anyhow::Error), +} + +impl From for FeedError { + fn from(status: ConnectorStatusMessage) -> Self { + match status { + ConnectorStatusMessage::Disconnected => FeedError::Disconnected, + ConnectorStatusMessage::Resubscription => FeedError::Resubscription, + _ => FeedError::Other(err!("Unexpected ConnectorStatusMessage {:?}", status)), + } + } +} + +impl From> for FeedError { + fn from(_err: mpsc::error::SendError) -> Self { + FeedError::Disconnected + } +} diff --git a/v4-client-rs/client/src/indexer/sock/messages.rs b/v4-client-rs/client/src/indexer/sock/messages.rs new file mode 100644 index 00000000..219e6ec9 --- /dev/null +++ b/v4-client-rs/client/src/indexer/sock/messages.rs @@ -0,0 +1,1106 @@ +use crate::indexer::types::{ + CandleResponse as CandlesInitialMessageContents, CandleResponseObject as Candle, + HeightResponse as BlockHeightInitialMessageContents, + OrderBookResponseObject as OrdersInitialMessageContents, + OrderResponseObject as OrderMessageObject, + ParentSubaccountResponseObject as ParentSubaccountMessageObject, + PerpetualMarketResponse as MarketsInitialMessageContents, + SubaccountResponseObject as SubaccountMessageObject, + TradeResponse as TradesInitialMessageContents, *, +}; +use bigdecimal::BigDecimal; +use chrono::{DateTime, Utc}; +use serde::Deserialize; +use serde_json::{json, Value}; +use std::collections::HashMap; +use tokio_tungstenite::tungstenite::protocol::Message; + +/// Feed subscription options +/// Respective ticker is required for `Orders`, `Trades`, `Candles` +#[derive(Debug, Clone, Hash, Eq, PartialEq)] +pub enum Subscription { + /// Subaccounts. + Subaccounts(Subaccount), + /// Orders. + Orders(Ticker), + /// Trades. + Trades(Ticker), + /// Markets. + Markets, + /// Candles. + Candles(Ticker, CandleResolution), + /// Parent subaccounts. + ParentSubaccounts(ParentSubaccount), + /// Block height. + BlockHeight, +} + +impl Subscription { + pub(crate) fn sub_message(&self, batched: bool) -> Message { + match self { + Self::Subaccounts(ref subacc) => subaccounts::sub_message(subacc, batched), + Self::Markets => markets::sub_message(batched), + Self::Orders(ref ticker) => orders::sub_message(ticker, batched), + Self::Trades(ref ticker) => trades::sub_message(ticker, batched), + Self::Candles(ref ticker, ref res) => candles::sub_message(ticker, res, batched), + Self::ParentSubaccounts(ref subacc) => parent_subaccounts::sub_message(subacc, batched), + Self::BlockHeight => block_height::sub_message(batched), + } + } + + pub(crate) fn unsub_message(&self) -> Message { + match self { + Self::Subaccounts(ref subacc) => subaccounts::unsub_message(subacc), + Self::Markets => markets::unsub_message(), + Self::Orders(ref ticker) => orders::unsub_message(ticker), + Self::Trades(ref ticker) => trades::unsub_message(ticker), + Self::Candles(ref ticker, ref res) => candles::unsub_message(ticker, res), + Self::ParentSubaccounts(ref subacc) => parent_subaccounts::unsub_message(subacc), + Self::BlockHeight => block_height::unsub_message(), + } + } +} + +struct MessageFormatter {} + +impl MessageFormatter { + pub(crate) fn sub_message(channel: &str, fields: Value) -> Message { + let message = json!({ + "type": "subscribe", + "channel": channel, + }); + Self::message(fields, message) + } + + pub(crate) fn unsub_message(channel: &str, fields: Value) -> Message { + let message = json!({ + "type": "unsubscribe", + "channel": channel, + }); + Self::message(fields, message) + } + + fn message(mut message: Value, fields: Value) -> Message { + if let Value::Object(ref mut map) = message { + if let Value::Object(fields) = fields { + map.extend(fields); + } + } + Message::Text(message.to_string()) + } +} + +pub(crate) mod subaccounts { + use super::{json, Message, MessageFormatter, Subaccount}; + pub(crate) const CHANNEL: &str = "v4_subaccounts"; + + pub(crate) fn sub_message(subacc: &Subaccount, batched: bool) -> Message { + let address = &subacc.address; + let number = &subacc.number; + MessageFormatter::sub_message( + CHANNEL, + json!({"id": format!("{address}/{number}"), "batched": batched}), + ) + } + + pub(crate) fn unsub_message(subacc: &Subaccount) -> Message { + let address = &subacc.address; + let number = &subacc.number; + MessageFormatter::unsub_message(CHANNEL, json!({"id": format!("{address}/{number}")})) + } +} + +pub(crate) mod parent_subaccounts { + use super::{json, Message, MessageFormatter, ParentSubaccount}; + pub(crate) const CHANNEL: &str = "v4_parent_subaccounts"; + + pub(crate) fn sub_message(subacc: &ParentSubaccount, batched: bool) -> Message { + let address = &subacc.address; + let number = &subacc.number; + MessageFormatter::sub_message( + CHANNEL, + json!({"id": format!("{address}/{number}"), "batched": batched}), + ) + } + + pub(crate) fn unsub_message(subacc: &ParentSubaccount) -> Message { + let address = &subacc.address; + let number = &subacc.number; + MessageFormatter::unsub_message(CHANNEL, json!({"id": format!("{address}/{number}")})) + } +} + +pub(crate) mod orders { + use super::{json, Message, MessageFormatter, Ticker}; + pub(crate) const CHANNEL: &str = "v4_orderbook"; + + pub(crate) fn sub_message(id: &Ticker, batched: bool) -> Message { + MessageFormatter::sub_message(CHANNEL, json!({"id": id, "batched": batched})) + } + + pub(crate) fn unsub_message(id: &Ticker) -> Message { + MessageFormatter::unsub_message(CHANNEL, json!({"id": id})) + } +} + +pub(crate) mod trades { + use super::{json, Message, MessageFormatter, Ticker}; + pub(crate) const CHANNEL: &str = "v4_trades"; + + pub(crate) fn sub_message(id: &Ticker, batched: bool) -> Message { + MessageFormatter::sub_message(CHANNEL, json!({"id": id, "batched": batched})) + } + + pub(crate) fn unsub_message(id: &Ticker) -> Message { + MessageFormatter::unsub_message(CHANNEL, json!({"id": id})) + } +} + +pub(crate) mod markets { + use super::{json, Message, MessageFormatter}; + pub const CHANNEL: &str = "v4_markets"; + + pub(crate) fn sub_message(batched: bool) -> Message { + MessageFormatter::sub_message(CHANNEL, json!({"batched": batched})) + } + + pub(crate) fn unsub_message() -> Message { + MessageFormatter::unsub_message(CHANNEL, json!({})) + } +} + +pub(crate) mod candles { + use super::{json, CandleResolution, Message, MessageFormatter, Ticker}; + pub(crate) const CHANNEL: &str = "v4_candles"; + + pub(crate) fn sub_message( + id: &Ticker, + resolution: &CandleResolution, + batched: bool, + ) -> Message { + let resolution_str = serde_json::to_string(resolution).unwrap_or_default(); + let resolution_str = resolution_str.trim_matches('"'); + MessageFormatter::sub_message( + CHANNEL, + json!({"id": format!("{id}/{resolution_str}"), "batched": batched}), + ) + } + + pub(crate) fn unsub_message(id: &Ticker, resolution: &CandleResolution) -> Message { + let resolution_str = serde_json::to_string(resolution).unwrap_or_default(); + let resolution_str = resolution_str.trim_matches('"'); + MessageFormatter::unsub_message(CHANNEL, json!({"id": format!("{id}/{resolution_str}")})) + } +} + +pub(crate) mod block_height { + use super::{json, Message, MessageFormatter}; + pub const CHANNEL: &str = "v4_block_height"; + + pub(crate) fn sub_message(batched: bool) -> Message { + MessageFormatter::sub_message(CHANNEL, json!({"batched": batched})) + } + + pub(crate) fn unsub_message() -> Message { + MessageFormatter::unsub_message(CHANNEL, json!({})) + } +} + +/* Main WS type */ +#[allow(clippy::large_enum_variant)] +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub(crate) enum WsMessage { + #[serde(rename = "connected")] + Setup(StatusConnectedMessage), + #[serde(rename = "error")] + Error(StatusErrorMessage), + #[serde(rename = "unsubscribed")] + Unsub(StatusUnsubMessage), + #[serde(untagged)] + Data(FeedMessage), +} + +#[derive(Debug, Deserialize)] +pub(crate) struct StatusConnectedMessage { + pub(crate) connection_id: String, + #[allow(dead_code)] // TODO remove after completion. + pub(crate) message_id: u64, +} + +#[derive(Debug, Deserialize)] +pub(crate) struct StatusErrorMessage { + pub(crate) message: String, + #[allow(dead_code)] // TODO remove after completion. + pub(crate) connection_id: String, + #[allow(dead_code)] // TODO remove after completion. + pub(crate) message_id: u64, +} + +#[derive(Debug, Deserialize)] +pub(crate) struct StatusUnsubMessage { + #[allow(dead_code)] // TODO remove after completion. + pub(crate) connection_id: String, + #[allow(dead_code)] // TODO remove after completion. + pub(crate) message_id: u64, + pub(crate) channel: String, + pub(crate) id: Option, +} + +/// Feed Types +#[derive(Debug, Deserialize)] +#[serde(tag = "channel")] +pub enum FeedMessage { + /// Subaccounts. + #[serde(rename = "v4_subaccounts")] + Subaccounts(SubaccountsMessage), + /// Orders. + #[serde(rename = "v4_orderbook")] + Orders(OrdersMessage), + /// Trades. + #[serde(rename = "v4_trades")] + Trades(TradesMessage), + /// Markets. + #[serde(rename = "v4_markets")] + Markets(MarketsMessage), + /// Candles. + #[serde(rename = "v4_candles")] + Candles(CandlesMessage), + /// Parent subaccounts. + #[serde(rename = "v4_parent_subaccounts")] + ParentSubaccounts(ParentSubaccountsMessage), + /// Block height. + #[serde(rename = "v4_block_height")] + BlockHeight(BlockHeightMessage), +} + +macro_rules! impl_feed_message_try_from { + ($target_type:ty, $variant:ident) => { + impl TryFrom for $target_type { + type Error = (); + fn try_from(value: FeedMessage) -> Result { + match value { + FeedMessage::$variant(a) => Ok(a), + _ => Err(()), + } + } + } + }; +} + +/// Subaccounts message. +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub enum SubaccountsMessage { + /// Initial. + #[serde(rename = "subscribed")] + Initial(SubaccountsInitialMessage), + /// Update. + #[serde(untagged)] + Update(SubaccountsUpdateMessage), +} +impl_feed_message_try_from!(SubaccountsMessage, Subaccounts); + +/// Subaccounts message. +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub enum ParentSubaccountsMessage { + /// Initial. + #[serde(rename = "subscribed")] + Initial(ParentSubaccountsInitialMessage), + /// Update. + #[serde(untagged)] + Update(ParentSubaccountsUpdateMessage), +} +impl_feed_message_try_from!(ParentSubaccountsMessage, ParentSubaccounts); + +/// Trades message. +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub enum TradesMessage { + /// Initial. + #[serde(rename = "subscribed")] + Initial(TradesInitialMessage), + /// Update. + #[serde(untagged)] + Update(TradesUpdateMessage), +} +impl_feed_message_try_from!(TradesMessage, Trades); + +/// Orders message. +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub enum OrdersMessage { + /// Initial. + #[serde(rename = "subscribed")] + Initial(OrdersInitialMessage), + /// Update. + #[serde(untagged)] + Update(OrdersUpdateMessage), +} +impl_feed_message_try_from!(OrdersMessage, Orders); + +/// Markets message. +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub enum MarketsMessage { + /// Initial. + #[serde(rename = "subscribed")] + Initial(MarketsInitialMessage), + /// Update. + #[serde(untagged)] + Update(MarketsUpdateMessage), +} +impl_feed_message_try_from!(MarketsMessage, Markets); + +/// Candles message. +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub enum CandlesMessage { + /// Initial. + #[serde(rename = "subscribed")] + Initial(CandlesInitialMessage), + /// Update. + #[serde(untagged)] + Update(CandlesUpdateMessage), +} +impl_feed_message_try_from!(CandlesMessage, Candles); + +/// Block height message. +#[derive(Debug, Deserialize)] +#[serde(tag = "type")] +pub enum BlockHeightMessage { + /// Initial. + #[serde(rename = "subscribed")] + Initial(BlockHeightInitialMessage), + /// Update. + #[serde(untagged)] + Update(BlockHeightUpdateMessage), +} +impl_feed_message_try_from!(BlockHeightMessage, BlockHeight); + +impl FeedMessage { + pub(crate) fn subscription(&self) -> Option { + let parse_subacc_id = |id: &str| -> Option { + // Parse "id": "Address/Number" + let mut id_split = id.split('/'); + let address = id_split.next()?.parse().ok()?; + let number_str = id_split.next()?; + let number = serde_json::from_str::(number_str).ok()?; + Some(Subaccount::new(address, number)) + }; + let parse_psubacc_id = |id: &str| -> Option { + // Parse "id": "Address/Number" + let mut id_split = id.split('/'); + let address = id_split.next()?.parse().ok()?; + let number_str = id_split.next()?; + let number = serde_json::from_str::(number_str).ok()?; + Some(ParentSubaccount::new(address, number)) + }; + let parse_candles_id = |id: &str| -> Option<(Ticker, CandleResolution)> { + // Parse "id": "TICKER/RESOLUTION" + let mut id_split = id.split('/'); + let ticker = Ticker(id_split.next()?.into()); + let resolution_str = format!("\"{}\"", id_split.next()?); + let resolution = serde_json::from_str(&resolution_str).ok()?; + Some((ticker, resolution)) + }; + + match self { + Self::Subaccounts(SubaccountsMessage::Initial(msg)) => { + let subacc = parse_subacc_id(&msg.id)?; + Some(Subscription::Subaccounts(subacc)) + } + Self::Subaccounts(SubaccountsMessage::Update(msg)) => { + let subacc = parse_subacc_id(&msg.id)?; + Some(Subscription::Subaccounts(subacc)) + } + + Self::ParentSubaccounts(ParentSubaccountsMessage::Initial(msg)) => { + let subacc = parse_psubacc_id(&msg.id)?; + Some(Subscription::ParentSubaccounts(subacc)) + } + Self::ParentSubaccounts(ParentSubaccountsMessage::Update(msg)) => { + let subacc = parse_psubacc_id(&msg.id)?; + Some(Subscription::ParentSubaccounts(subacc)) + } + + Self::Orders(OrdersMessage::Initial(msg)) => { + Some(Subscription::Orders(Ticker(msg.id.clone()))) + } + Self::Orders(OrdersMessage::Update(msg)) => { + Some(Subscription::Orders(Ticker(msg.id.clone()))) + } + + Self::Trades(TradesMessage::Initial(msg)) => { + Some(Subscription::Trades(Ticker(msg.id.clone()))) + } + Self::Trades(TradesMessage::Update(msg)) => { + Some(Subscription::Trades(Ticker(msg.id.clone()))) + } + + Self::Markets(MarketsMessage::Update(_)) => Some(Subscription::Markets), + Self::Markets(MarketsMessage::Initial(_)) => Some(Subscription::Markets), + + Self::Candles(CandlesMessage::Initial(msg)) => { + let (ticker, resolution) = parse_candles_id(&msg.id)?; + Some(Subscription::Candles(ticker, resolution)) + } + Self::Candles(CandlesMessage::Update(msg)) => { + let (ticker, resolution) = parse_candles_id(&msg.id)?; + Some(Subscription::Candles(ticker, resolution)) + } + + Self::BlockHeight(BlockHeightMessage::Initial(_)) => Some(Subscription::BlockHeight), + Self::BlockHeight(BlockHeightMessage::Update(_)) => Some(Subscription::BlockHeight), + } + } +} + +/// Subaccount initial. +#[derive(Debug, Deserialize)] +pub struct SubaccountsInitialMessage { + /// Connection id. + pub connection_id: String, + /// Subaccount. + pub contents: SubaccountsInitialMessageContents, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, +} + +/// Subaccount. +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SubaccountsInitialMessageContents { + /// Subaccount. + pub subaccount: SubaccountMessageObject, + /// Orders. + pub orders: Vec, + /// Block height. + pub block_height: Height, +} + +/// Parent subaccount initial. +#[derive(Debug, Deserialize)] +pub struct ParentSubaccountsInitialMessage { + /// Connection id. + pub connection_id: String, + /// Subaccount. + pub contents: ParentSubaccountsInitialMessageContents, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, +} + +/// Parent subaccount. +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ParentSubaccountsInitialMessageContents { + /// Subaccount. + pub subaccount: ParentSubaccountMessageObject, + /// Orders. + pub orders: Vec, + /// Block height. + pub block_height: Height, +} + +/// Orders initial message. +#[derive(Debug, Deserialize)] +pub struct OrdersInitialMessage { + /// Connection id. + pub connection_id: String, + /// Orders. + pub contents: OrdersInitialMessageContents, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, +} + +/// Trades initial message. +#[derive(Debug, Deserialize)] +pub struct TradesInitialMessage { + /// Connection id. + pub connection_id: String, + /// Trades. + pub contents: TradesInitialMessageContents, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, +} + +/// Markets initial message. +#[derive(Debug, Deserialize)] +pub struct MarketsInitialMessage { + /// Connection id. + pub connection_id: String, + /// Market. + pub contents: MarketsInitialMessageContents, + /// Message id. + pub message_id: u64, +} + +/// Candles initial message. +#[derive(Debug, Deserialize)] +pub struct CandlesInitialMessage { + /// Connection id. + pub connection_id: String, + /// Candles. + pub contents: CandlesInitialMessageContents, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, +} + +/// Block height initial message. +#[derive(Debug, Deserialize)] +pub struct BlockHeightInitialMessage { + /// Connection id. + pub connection_id: String, + /// Block height contents. + pub contents: BlockHeightInitialMessageContents, + /// Message id. + pub message_id: u64, +} + +// Updates +macro_rules! generate_contents_deserialize_function { + ($fn_name:ident, $result_type:ty) => { + fn $fn_name<'de, D>(deserializer: D) -> Result, D::Error> + where + D: serde::Deserializer<'de>, + { + let value = Value::deserialize(deserializer)?; + + match value { + // Batched + Value::Array(arr) => arr + .into_iter() + .map(|v| serde_json::from_value(v)) + .collect::, _>>() + .map_err(serde::de::Error::custom), + // Streamed + Value::Object(obj) => { + let item = serde_json::from_value::<$result_type>(Value::Object(obj.clone())) + .map_err(serde::de::Error::custom)?; + Ok(vec![item]) + } + _ => Err(serde::de::Error::custom("Expected array or object")), + } + } + }; +} + +/// Subaccount update. +#[derive(Debug, Deserialize)] +pub struct SubaccountsUpdateMessage { + /// Connection id. + pub connection_id: String, + /// Update. + #[serde(deserialize_with = "deserialize_subaccounts_contents")] + pub contents: Vec, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, + /// Version. + pub version: String, +} +generate_contents_deserialize_function!( + deserialize_subaccounts_contents, + SubaccountUpdateMessageContents +); + +/// Subaccount update contents. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SubaccountUpdateMessageContents { + /// Perpetual position updates on the subaccount. + pub perpetual_positions: Option>, + /// Asset position updates on the subaccount. + pub asset_positions: Option>, + /// Order updates on the subaccount. + pub orders: Option>, + /// Fills that occur on the subaccount. + pub fills: Option>, + /// Transfers that occur on the subaccount. + pub transfers: Option, + /// Rewards that occur on the subaccount. + pub trading_reward: Option, + /// Block height. + pub block_height: Option, +} + +/// Perpetual position on subaccount. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PerpetualPositionSubaccountMessageContents { + /// Address. + pub address: Address, + /// Subaccount number. + pub subaccount_number: SubaccountNumber, + /// Position id. + pub position_id: String, + /// Market ticker. + pub market: Ticker, + /// Side (buy/sell). + pub side: PositionSide, + /// Position status. + pub status: PerpetualPositionStatus, + /// Size. + pub size: Quantity, + /// Maximum size. + pub max_size: Quantity, + /// Net funding. + pub net_funding: BigDecimal, + /// Entry price. + pub entry_price: Price, + /// Exit price. + pub exit_price: Option, + /// Sum at open. + pub sum_open: BigDecimal, + /// Sum at close. + pub sum_close: BigDecimal, + /// Actual PnL. + pub realized_pnl: Option, + /// Potential PnL. + pub unrealized_pnl: Option, +} + +/// Asset position per subaccount. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AssetPositionSubaccountMessageContents { + /// Address. + pub address: Address, + /// Subaccount number. + pub subaccount_number: SubaccountNumber, + /// Position id. + pub position_id: String, + /// Asset id. + pub asset_id: AssetId, + /// Token symbol. + pub symbol: Symbol, + /// Side (buy/sell). + pub side: PositionSide, + /// Size. + pub size: Quantity, +} + +/// Order per subaccount. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct OrderSubaccountMessageContents { + /// Id. + pub id: String, + /// Subaccount id. + pub subaccount_id: SubaccountId, + /// Client id. + pub client_id: ClientId, + /// Clob pair id. + pub clob_pair_id: Option, + /// Side (buy/sell). + pub side: Option, + /// Size. + pub size: Option, + /// Market ticker. + pub ticker: Option, + /// Price. + pub price: Option, + #[serde(rename = "type")] + /// Order type. + pub order_type: Option, + /// Time-in-force. + pub time_in_force: Option, + /// Post-only. + pub post_only: Option, + /// Reduce-only. + pub reduce_only: Option, + /// Order status. + pub status: ApiOrderStatus, + /// Order flags. + pub order_flags: OrderFlags, + /// Total filled. + pub total_filled: Option, + /// Total optimistic filled. + pub total_optimistic_filled: Option, + /// Block height. + pub good_til_block: Option, + /// Time(UTC). + pub good_til_block_time: Option>, + /// Trigger price. + pub trigger_price: Option, + /// Time(UTC). + pub updated_at: Option>, + /// Block height. + pub updated_at_height: Option, + /// Removal reason. + pub removal_reason: Option, + /// Block height. + pub created_at_height: Option, + /// Client metadata. + pub client_metadata: Option, +} + +/// Fill per subaccount. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FillSubaccountMessageContents { + /// Fill id. + pub id: FillId, + /// Subaccount id. + pub subaccount_id: SubaccountId, + /// Order side. + pub side: OrderSide, + /// Liquidity. + pub liquidity: Liquidity, + /// Fill type. + #[serde(rename = "type")] + pub fill_type: FillType, + /// Clob pair id. + pub clob_pair_id: ClobPairId, + /// Size. + pub size: Quantity, + /// Price. + pub price: Price, + /// Quote amount. + pub quote_amount: String, + /// Event id. + pub event_id: String, + /// Transaction hash. + pub transaction_hash: String, + /// Time(UTC). + pub created_at: DateTime, + /// Block height. + pub created_at_height: Height, + /// Market ticker. + pub ticker: Ticker, + /// Order id. + pub order_id: Option, + /// Client metadata. + pub client_metadata: Option, +} + +/// Transfer per subaccount. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TransferSubaccountMessageContents { + /// Sender. + pub sender: Account, + /// Recipient. + pub recipient: Account, + /// Token symbol. + pub symbol: Symbol, + /// Size. + pub size: Quantity, + /// Transfer type. + #[serde(rename = "type")] + pub transfer_type: TransferType, + /// Transaction hash. + pub transaction_hash: String, + /// Time(UTC). + pub created_at: DateTime, + /// Block height. + pub created_at_height: Height, +} + +/// Trading reward. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TradingRewardSubaccountMessageContents { + /// Trading reward. + pub trading_reward: BigDecimal, + /// Time(UTC). + pub created_at: DateTime, + /// Block height. + pub created_at_height: Height, +} + +/// Subaccount update. +#[derive(Debug, Deserialize)] +pub struct ParentSubaccountsUpdateMessage { + /// Connection id. + pub connection_id: String, + /// Update. + #[serde(deserialize_with = "deserialize_subaccounts_contents")] + pub contents: Vec, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, + /// Version. + pub version: String, +} + +/// Subaccount update contents. +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ParentSubaccountUpdateMessageContents { + /// Perpetual position updates on the subaccount. + pub perpetual_positions: Option>, + /// Asset position updates on the subaccount. + pub asset_positions: Option>, + /// Order updates on the subaccount. + pub orders: Option>, + /// Fills that occur on the subaccount. + pub fills: Option>, + /// Transfers that occur on the subaccount. + pub transfers: Option, + /// Rewards that occur on the subaccount. + pub trading_reward: Option, + /// Block height. + pub block_height: Option, +} + +/// Order update message. +#[derive(Debug, Deserialize)] +pub struct OrdersUpdateMessage { + /// Connection id. + pub connection_id: String, + /// Update. + #[serde(deserialize_with = "deserialize_orders_contents")] + pub contents: OrdersUpdateMessageContents, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, + /// Version. + pub version: String, +} + +fn deserialize_orders_contents<'de, D>( + deserializer: D, +) -> Result +where + D: serde::Deserializer<'de>, +{ + let value = Value::deserialize(deserializer)?; + + match value { + // Batched + Value::Array(arr) => { + let mut bids = Vec::new(); + let mut asks = Vec::new(); + + for v in arr { + let item: OrdersUpdateMessageContents = + serde_json::from_value(v).map_err(serde::de::Error::custom)?; + + if let Some(item_bids) = item.bids { + bids.extend(item_bids); + } + if let Some(item_asks) = item.asks { + asks.extend(item_asks); + } + } + + Ok(OrdersUpdateMessageContents { + bids: if bids.is_empty() { None } else { Some(bids) }, + asks: if asks.is_empty() { None } else { Some(asks) }, + }) + } + // Streamed + Value::Object(obj) => { + let item = + serde_json::from_value::(Value::Object(obj.clone())) + .map_err(serde::de::Error::custom)?; + Ok(item) + } + _ => Err(serde::de::Error::custom("Expected array or object")), + } +} + +/// Orderbook update. +#[derive(Deserialize, Debug, Clone)] +pub struct OrdersUpdateMessageContents { + /// Bids. + pub bids: Option>, + /// Asks. + pub asks: Option>, +} + +/// Trades update. +#[derive(Deserialize, Debug, Clone)] +pub struct TradesUpdateMessage { + /// Connection id. + pub connection_id: String, + /// Update. + #[serde(deserialize_with = "deserialize_trades_contents")] + pub contents: Vec, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, + /// Version. + pub version: String, +} +generate_contents_deserialize_function!(deserialize_trades_contents, TradesUpdateMessageContents); + +/// Trades updates. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TradesUpdateMessageContents { + /// Updates. + pub trades: Vec, +} + +/// Trade update. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TradeUpdate { + /// Unique id of the trade, which is the taker fill id. + pub id: TradeId, + /// Time(UTC). + pub created_at: DateTime, + /// Side (buy/sell). + pub side: OrderSide, + /// Price. + pub price: Price, + /// Size. + pub size: Quantity, + /// Trade type. + #[serde(rename = "type")] + pub trade_type: TradeType, +} + +/// Markets update message. +#[derive(Debug, Deserialize)] +pub struct MarketsUpdateMessage { + /// Connection id. + pub connection_id: String, + /// Updates. + #[serde(deserialize_with = "deserialize_markets_contents")] + pub contents: Vec, + /// Message id. + pub message_id: u64, + /// Version. + pub version: String, +} +generate_contents_deserialize_function!(deserialize_markets_contents, MarketsUpdateMessageContents); + +/// Markets update. +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct MarketsUpdateMessageContents { + /// Trading. + pub trading: Option>, + /// Oracle prices. + pub oracle_prices: Option>, +} + +/// Perpetual market info. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TradingPerpetualMarket { + /// Atomic resolution + pub atomic_resolution: Option, + /// Base asset. + pub base_asset: Option, + /// Base open interest. + pub base_open_interest: Option, + /// Base position size. + pub base_position_size: Option, + /// Clob pair id. + pub clob_pair_id: Option, + /// Id. + pub id: Option, + /// Market id. + pub market_id: Option, + /// Incremental position size. + pub incremental_position_size: Option, + /// Initial margin fraction. + pub initial_margin_fraction: Option, + /// Maintenance margin fraction. + pub maintenance_margin_fraction: Option, + /// Max position size. + pub max_position_size: Option, + /// Open interest. + pub open_interest: Option, + /// Quantum conversion exponent. + pub quantum_conversion_exponent: Option, + /// Quote asset. + pub quote_asset: Option, + /// Market status + pub status: Option, + /// Step base quantums. + pub step_base_quantums: Option, + /// Subticks per tick. + pub subticks_per_tick: Option, + /// Market ticker. + pub ticker: Option, + /// 24-h price change. + #[serde(rename = "priceChange24H")] + pub price_change_24h: Option, + /// 24-h number of trades. + #[serde(rename = "trades24H")] + pub trades_24h: Option, + /// 24-h volume. + #[serde(rename = "volume24H")] + pub volume_24h: Option, + /// Next funding rate. + pub next_funding_rate: Option, +} + +/// Oracle price for market. +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct OraclePriceMarket { + /// Oracle price. + pub oracle_price: Price, + /// Time(UTC). + pub effective_at: DateTime, + /// Block height. + pub effective_at_height: Height, + /// Market id. + pub market_id: u64, +} + +/// Candles update. +#[derive(Debug, Deserialize)] +pub struct CandlesUpdateMessage { + /// Connection id. + pub connection_id: String, + /// Candle. + #[serde(deserialize_with = "deserialize_candles_contents")] + pub contents: Vec, + /// Id. + pub id: String, + /// Message id. + pub message_id: u64, + /// Version. + pub version: String, +} +generate_contents_deserialize_function!(deserialize_candles_contents, Candle); + +/// Block height update message. +#[derive(Debug, Deserialize)] +pub struct BlockHeightUpdateMessage { + /// Connection id. + pub connection_id: String, + /// Updates. + #[serde(deserialize_with = "deserialize_block_height_contents")] + pub contents: Vec, + /// Message id. + pub message_id: u64, + /// Version. + pub version: String, +} +generate_contents_deserialize_function!( + deserialize_block_height_contents, + BlockHeightUpdateMessageContents +); + +/// Block height update message contents. +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BlockHeightUpdateMessageContents { + /// Block height. + pub block_height: Height, + /// Time of block. + pub time: DateTime, +} diff --git a/v4-client-rs/client/src/indexer/sock/mod.rs b/v4-client-rs/client/src/indexer/sock/mod.rs new file mode 100644 index 00000000..448ffdbd --- /dev/null +++ b/v4-client-rs/client/src/indexer/sock/mod.rs @@ -0,0 +1,176 @@ +mod config; +mod connector; +/// Realtime feeds. +pub mod feed; +mod messages; + +use anyhow::Result; +use connector::{ChannelSender, Connector, ControlMsg}; +use tokio::sync::mpsc; + +pub use config::SockConfig; + +use crate::indexer::{CandleResolution, ParentSubaccount, Subaccount, Ticker}; +pub use feed::*; +pub use messages::*; + +#[derive(Debug)] +pub(crate) struct SockClient { + conn_tx: mpsc::UnboundedSender, +} + +macro_rules! impl_subscribe { + ($method_name:ident, $message_type:ty, $channel_sender_variant:ident) => { + pub(crate) async fn $method_name( + &mut self, + sub: Subscription, + batched: bool, + ) -> Result, FeedError> { + let (tx, rx) = mpsc::unbounded_channel(); + self.conn_tx.send(ControlMsg::Subscribe( + sub.clone(), + batched, + ChannelSender::$channel_sender_variant(tx), + ))?; + Feed::setup(rx, sub, self.conn_tx.clone()).await + } + }; +} + +impl SockClient { + pub(crate) fn new(config: SockConfig) -> Self { + let (conn_tx, conn_rx) = mpsc::unbounded_channel(); + + let connector = Connector::new(config, conn_rx); + tokio::spawn(connector.entrypoint()); + + Self { conn_tx } + } + + impl_subscribe!(subaccounts, SubaccountsMessage, Subaccounts); + impl_subscribe!( + parent_subaccounts, + ParentSubaccountsMessage, + ParentSubaccounts + ); + impl_subscribe!(trades, TradesMessage, Trades); + impl_subscribe!(orders, OrdersMessage, Orders); + impl_subscribe!(markets, MarketsMessage, Markets); + impl_subscribe!(candles, CandlesMessage, Candles); + impl_subscribe!(block_height, BlockHeightMessage, BlockHeight); +} + +impl Drop for SockClient { + fn drop(&mut self) { + if let Err(e) = self.conn_tx.send(ControlMsg::Terminate) { + log::error!("Failed sending control Terminate to WebSocket connector: {e}"); + } + } +} + +/// Feeds dispatcher. +#[derive(Debug)] +pub struct Feeds<'a> { + sock: &'a mut SockClient, +} + +impl<'a> Feeds<'a> { + pub(crate) fn new(sock: &'a mut SockClient) -> Self { + Self { sock } + } + + /// This channel provides realtime information about orders, fills, transfers, perpetual positions, and perpetual assets for a subaccount. + /// + /// Initial message returns information on the subaccount like [`get_subaccount`](crate::indexer::Accounts::get_subaccount). + /// + /// Subsequent responses will contain any update to open orders, changes in account, changes in open positions, and/or transfers in a single message. + pub async fn subaccounts( + &mut self, + subaccount: Subaccount, + batched: bool, + ) -> Result, FeedError> { + self.sock + .subaccounts(Subscription::Subaccounts(subaccount), batched) + .await + } + + /// This channel provides realtime information about markets. + /// + /// Initial message returns information on markets like [`list_perpetual_markets`](crate::indexer::Markets::list_perpetual_markets). + /// + /// Subsequent responses will contain any update to markets. + pub async fn markets(&mut self, batched: bool) -> Result, FeedError> { + self.sock.markets(Subscription::Markets, batched).await + } + + /// This channel provides realtime information about trades for the market. + /// + /// Initial message returns information on trades like [`get_trades`](crate::indexer::Markets::get_trades). + /// + /// Subsequent responses will contain any update to trades for the market. + pub async fn trades( + &mut self, + ticker: &Ticker, + batched: bool, + ) -> Result, FeedError> { + self.sock + .trades(Subscription::Trades(ticker.clone()), batched) + .await + } + + /// This channel provides realtime information about the orderbook for the market. + /// + /// Initial message returns information on orderbook like [`get_perpetual_market_orderbook`](crate::indexer::Markets::get_perpetual_market_orderbook). + /// + /// Subsequent responses will contain any update to the orderbook for the market. + pub async fn orders( + &mut self, + ticker: &Ticker, + batched: bool, + ) -> Result, FeedError> { + self.sock + .orders(Subscription::Orders(ticker.clone()), batched) + .await + } + + /// This channel provides realtime information about the candles for the market. + /// + /// Initial message returns information on candles like [`get_candles`](crate::indexer::Markets::get_candles). + /// + /// Subsequent responses will contain any update to the candles for the market. + pub async fn candles( + &mut self, + ticker: &Ticker, + resolution: CandleResolution, + batched: bool, + ) -> Result, FeedError> { + self.sock + .candles(Subscription::Candles(ticker.clone(), resolution), batched) + .await + } + + /// This channel provides realtime information about orders, fills, transfers, perpetual positions, and perpetual assets for a parent subaccount and its children. + pub async fn parent_subaccounts( + &mut self, + subaccount: ParentSubaccount, + batched: bool, + ) -> Result, FeedError> { + self.sock + .parent_subaccounts(Subscription::ParentSubaccounts(subaccount), batched) + .await + } + + /// This channel provides realtime information about the chain's block height. + /// + /// Initial message returns information like [`get_height`](crate::indexer::Utility::get_height). + /// + /// Subsequent responses will contain following created blocks. + pub async fn block_height( + &mut self, + batched: bool, + ) -> Result, FeedError> { + self.sock + .block_height(Subscription::BlockHeight, batched) + .await + } +} diff --git a/v4-client-rs/client/src/indexer/tokens.rs b/v4-client-rs/client/src/indexer/tokens.rs new file mode 100644 index 00000000..1b7a3532 --- /dev/null +++ b/v4-client-rs/client/src/indexer/tokens.rs @@ -0,0 +1,116 @@ +use crate::indexer::Denom; +use anyhow::{anyhow as err, Error}; +use bigdecimal::{num_traits::ToPrimitive, BigDecimal, One}; +use derive_more::{Deref, DerefMut, From}; +use dydx_proto::cosmos_sdk_proto::cosmos::base::v1beta1::Coin as ProtoCoin; + +/// USDC token. +#[derive(Debug, Deref, DerefMut, Clone, PartialEq, Eq, PartialOrd, Ord)] +pub struct Usdc(pub BigDecimal); + +impl Usdc { + const QUANTUMS_ATOMIC_RESOLUTION: i64 = -6; + + /// Create a micro USDC (1e-6) token from an integer. + pub fn from_quantums(quantums: impl Into) -> Self { + Self(quantums.into() / BigDecimal::new(One::one(), Self::QUANTUMS_ATOMIC_RESOLUTION)) + } + + /// Express a USDC token as an integer. + pub fn quantize(self) -> BigDecimal { + self.0 * BigDecimal::new(One::one(), Self::QUANTUMS_ATOMIC_RESOLUTION) + } + + /// Express a USDC token as a u64. + pub fn quantize_as_u64(self) -> Result { + self.quantize() + .to_u64() + .ok_or_else(|| err!("Failed converting USDC value to u64")) + } +} + +impl From for Usdc +where + T: Into, +{ + fn from(value: T) -> Self { + Usdc(value.into()) + } +} + +/// Token. +pub enum Token { + /// USDC. + Usdc(Usdc), + /// dYdX native token. + Dydx(BigDecimal), + /// dYdX testnet native token. + DydxTnt(BigDecimal), +} + +/// An entity which can be operated as a token. +pub trait Tokenized { + /// Gets Token [`Denom`]. + fn denom(&self) -> Denom; + + /// Convert to Cosmos [`Coin`](ProtoCoin). + fn coin(&self) -> Result; +} + +impl Tokenized for Token { + fn denom(&self) -> Denom { + match self { + Self::Usdc(_) => Denom::Usdc, + Self::Dydx(_) => Denom::Dydx, + Self::DydxTnt(_) => Denom::DydxTnt, + } + } + + fn coin(&self) -> Result { + let amount_res = match self { + Self::Usdc(usdc) => usdc.clone().quantize().to_u128(), + Self::Dydx(d) => d.to_u128(), + Self::DydxTnt(d) => d.to_u128(), + }; + Ok(ProtoCoin { + amount: amount_res + .ok_or_else(|| err!("Failed converting dYdX testnet token value into amount"))? + .to_string(), + denom: self.denom().to_string(), + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::str::FromStr; + + fn bigdecimal(val: &str) -> BigDecimal { + BigDecimal::from_str(val).expect("Failed converting str into BigDecimal") + } + + #[test] + fn token_quantums_to_usdc() { + let quantums = bigdecimal("20_000_000"); + let usdc = Usdc::from_quantums(quantums); + let expected = bigdecimal("20"); + assert_eq!(usdc.0, expected); + } + + #[test] + fn token_usdc_to_quantums() { + let usdc = bigdecimal("20"); + let quantums = Usdc::from(usdc).quantize(); + let expected = bigdecimal("20_000_000"); + assert_eq!(quantums, expected); + } + + #[test] + fn token_denom_parse() { + // Test if hardcoded denominations are parsed correctly + let _usdc = Token::Usdc(0.into()).denom(); + let _dydx = Token::Dydx(0.into()).denom(); + let _dydx_tnt = Token::DydxTnt(0.into()).denom(); + } +} diff --git a/v4-client-rs/client/src/indexer/types.rs b/v4-client-rs/client/src/indexer/types.rs new file mode 100644 index 00000000..82bc989c --- /dev/null +++ b/v4-client-rs/client/src/indexer/types.rs @@ -0,0 +1,1057 @@ +use crate::node::OrderMarketParams; +use anyhow::{anyhow as err, Error}; +use bigdecimal::BigDecimal; +use chrono::{DateTime, Utc}; +use cosmrs::{AccountId, Denom as CosmosDenom}; +use derive_more::{Add, Deref, DerefMut, Display, Div, From, Mul, Sub}; +use dydx_proto::dydxprotocol::subaccounts::SubaccountId as ProtoSubaccountId; +use rand::{thread_rng, Rng}; +use serde::{Deserialize, Serialize}; +use serde_with::{serde_as, DisplayFromStr}; +use std::collections::HashMap; +use std::convert::TryFrom; +use std::{fmt, str::FromStr}; + +// Shared types used by REST API, WS + +/// A trader's account. +#[derive(Deserialize, Debug, Clone, Eq, Hash, PartialOrd, Ord, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct Account { + /// Address. + pub address: Address, +} + +/// [Address](https://dydx.exchange/crypto-learning/what-is-a-wallet-address). +#[derive( + Serialize, Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +pub struct Address(String); + +impl FromStr for Address { + type Err = Error; + fn from_str(value: &str) -> Result { + Ok(Self( + value.parse::().map_err(Error::msg)?.to_string(), + )) + } +} + +impl AsRef for Address { + fn as_ref(&self) -> &str { + &self.0 + } +} + +impl From
for String { + fn from(address: Address) -> Self { + address.0 + } +} + +/// Order status. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase", untagged)] +pub enum ApiOrderStatus { + /// Order status. + OrderStatus(OrderStatus), + /// Best effort. + BestEffort(BestEffortOpenedStatus), +} + +/// [Time-in-Force](https://docs.dydx.exchange/api_integration-trading/order_types#time-in-force). +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum ApiTimeInForce { + /// GTT represents Good-Til-Time, where an order will first match with existing orders on the book + /// and any remaining size will be added to the book as a maker order, which will expire at a + /// given expiry time. + Gtt, + /// FOK represents Fill-Or-KILl where it's enforced that an order will either be filled + /// completely and immediately by maker orders on the book or canceled if the entire amount can't + /// be filled. + Fok, + /// IOC represents Immediate-Or-Cancel, where it's enforced that an order only be matched with + /// maker orders on the book. If the order has remaining size after matching with existing orders + /// on the book, the remaining size is not placed on the book. + Ioc, +} + +/// Asset id. +#[derive( + Serialize, Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +pub struct AssetId(pub String); + +/// Best-effort opened status. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum BestEffortOpenedStatus { + /// Best-effort opened. + BestEffortOpened, +} + +/// Candle resolution. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub enum CandleResolution { + /// 1-minute. + #[serde(rename = "1MIN")] + M1, + /// 5-minutes. + #[serde(rename = "5MINS")] + M5, + /// 15-minutes. + #[serde(rename = "15MINS")] + M15, + /// 30-minutes. + #[serde(rename = "30MINS")] + M30, + /// 1-hour. + #[serde(rename = "1HOUR")] + H1, + /// 4-hours. + #[serde(rename = "4HOURS")] + H4, + /// 1-day. + #[serde(rename = "1DAY")] + D1, +} + +/// Representatio of an arbitrary ID. +#[derive(Clone, Debug)] +pub struct AnyId; + +/// Client ID defined by the user to identify orders. +/// +/// This value should be different for different orders. +/// To update a specific previously submitted order, the new [`Order`](dydx_proto::dydxprotocol::clob::Order) must have the same client ID, and the same [`OrderId`]. +/// See also: [How can I replace an order?](https://docs.dydx.exchange/introduction-onboarding_faqs). +#[serde_as] +#[derive(Deserialize, Debug, Clone, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct ClientId(#[serde_as(as = "DisplayFromStr")] pub u32); + +impl ClientId { + /// Creates a new `ClientId` from a provided `u32`. + pub fn new(id: u32) -> Self { + ClientId(id) + } + + /// Creates a random `ClientId` using the default rand::thread_rng. + pub fn random() -> Self { + ClientId(thread_rng().gen()) + } + + /// Creates a random `ClientId` using a user-provided RNG. + pub fn random_with_rng(rng: &mut R) -> Self { + ClientId(rng.gen()) + } +} + +impl From for ClientId { + fn from(value: u32) -> Self { + Self(value) + } +} + +impl From for ClientId { + fn from(_: AnyId) -> Self { + Self::random() + } +} + +/// Clob pair id. +#[serde_as] +#[derive(Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct ClobPairId(#[serde_as(as = "DisplayFromStr")] pub u32); + +impl From for ClobPairId { + fn from(value: u32) -> Self { + Self(value) + } +} + +/// Client metadata. +#[serde_as] +#[derive(Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct ClientMetadata(#[serde_as(as = "DisplayFromStr")] pub u32); + +impl From for ClientMetadata { + fn from(value: u32) -> Self { + Self(value) + } +} + +/// Fill id. +#[derive(Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct FillId(pub String); + +/// Fill type. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum FillType { + /// LIMIT is the fill type for a fill with a limit taker order. + Limit, + /// LIQUIDATED is for the taker side of the fill where the subaccount was liquidated. + /// + /// The subaccountId associated with this fill is the liquidated subaccount. + Liquidated, + /// LIQUIDATION is for the maker side of the fill, never used for orders. + Liquidation, + /// DELEVERAGED is for the subaccount that was deleveraged in a deleveraging event. + /// + /// The fill type will be set to taker. + Deleveraged, + /// OFFSETTING is for the offsetting subaccount in a deleveraging event. + /// + /// The fill type will be set to maker. + Offsetting, +} + +/// Block height. +#[serde_as] +#[derive( + Serialize, Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +pub struct Height(#[serde_as(as = "DisplayFromStr")] pub u32); + +impl Height { + /// Get the block which is n blocks ahead. + pub fn ahead(&self, n: u32) -> Height { + Height(self.0 + n) + } +} + +/// Liquidity position. +/// +/// See also [Market Makers vs Market Takers](https://dydx.exchange/crypto-learning/market-makers-vs-market-takers). +#[derive(Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum Liquidity { + /// [Taker](https://dydx.exchange/crypto-learning/glossary?#taker). + Taker, + /// [Maker](https://dydx.exchange/crypto-learning/glossary?#maker). + Maker, +} + +/// Perpetual market status +#[derive(Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum PerpetualMarketStatus { + /// Active. + Active, + /// Paused. + Paused, + /// Cancel-only. + CancelOnly, + /// Post-only. + PostOnly, + /// Initializing. + Initializing, + /// Final settlement. + FinalSettlement, +} + +/// Perpetual position status. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum PerpetualPositionStatus { + /// Open. + Open, + /// Closed. + Closed, + /// Liquidated. + Liquidated, +} + +/// Position. +/// +/// See also [How to Short Crypto: A Beginner’s Guide](https://dydx.exchange/crypto-learning/how-to-short-crypto). +#[derive(Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum PositionSide { + /// Long. + Long, + /// Short. + Short, +} + +/// Market type. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum MarketType { + /// [Perpetuals](https://dydx.exchange/crypto-learning/perpetuals-crypto). + Perpetual, + /// [Spot](https://dydx.exchange/crypto-learning/what-is-spot-trading). + Spot, +} + +/// Perpetual market type. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum PerpetualMarketType { + /// Cross. + Cross, + /// [Isolated](https://docs.dydx.exchange/api_integration-trading/isolated_markets). + Isolated, +} + +/// Order id. +#[derive(Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct OrderId(pub String); + +/// Order status. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum OrderStatus { + /// Opened. + Open, + /// Filled. + Filled, + /// Canceled. + Canceled, + /// Short term cancellations are handled best-effort, meaning they are only gossiped. + BestEffortCanceled, + /// Untriggered. + Untriggered, +} + +/// When the order enters the execution phase +/// +/// See also [Time in force](https://docs.dydx.exchange/api_integration-indexer/indexer_api#apitimeinforce). +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum OrderExecution { + /// Leaving order execution as unspecified/empty represents the default behavior + /// where an order will first match with existing orders on the book, and any remaining size + /// will be added to the book as a maker order. + Default, + /// IOC represents Immediate-Or-Cancel, where it's enforced that an order only be matched with + /// maker orders on the book. If the order has remaining size after matching with existing orders + /// on the book, the remaining size is not placed on the book. + Ioc, + /// FOK represents Fill-Or-KILl where it's enforced that an order will either be filled + /// completely and immediately by maker orders on the book or canceled if the entire amount can't + /// be filled. + Fok, + /// Post only enforces that an order only be placed on the book as a maker order. + /// Note this means that validators will cancel any newly-placed post only orders that would cross with other maker orders. + PostOnly, +} + +/// Order flags. +#[derive(Clone, Debug, Deserialize)] +pub enum OrderFlags { + /// Short-term order. + #[serde(rename = "0")] + ShortTerm = 0, + /// Conditional order. + #[serde(rename = "32")] + Conditional = 32, + /// Long-term (stateful) order. + #[serde(rename = "64")] + LongTerm = 64, +} + +// TODO: Consider using 12-bytes array, and deserialize from hex +/// Trade id. +#[derive( + Serialize, Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +pub struct TradeId(pub String); + +/// Order side. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum OrderSide { + /// Buy. + Buy, + /// Sell. + Sell, +} + +/// Order types. +/// +/// See also [OrderType](https://docs.dydx.exchange/api_integration-indexer/indexer_api#ordertype). +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum OrderType { + /// Limit. + Limit, + /// Market. + Market, + /// Stop-limit. + StopLimit, + /// Stop-market. + StopMarket, + /// Trailing-stop. + TrailingStop, + /// Take-profit. + TakeProfit, + /// Take-profit-market. + TakeProfitMarket, + /// Hard-trade. + HardTrade, + /// Failed-hard-trade. + FailedHardTrade, + /// Transfer-placeholder. + TransferPlaceholder, +} + +/// Subaccount. +#[derive(Deserialize, Debug, Clone, Eq, Hash, PartialOrd, Ord, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct Subaccount { + /// Address. + pub address: Address, + /// Subaccount number. + pub number: SubaccountNumber, +} + +impl Subaccount { + /// Create a new Subaccount. + pub fn new(address: Address, number: SubaccountNumber) -> Self { + Self { address, number } + } + + /// Get the parent of this Subaccount. + pub fn parent(&self) -> ParentSubaccount { + let number = ParentSubaccountNumber(self.number.0 % 128); + ParentSubaccount::new(self.address.clone(), number) + } + + /// Check if this Subaccount is a parent? + pub fn is_parent(&self) -> bool { + self.number.0 < 128 + } +} + +impl From for ProtoSubaccountId { + fn from(subacc: Subaccount) -> Self { + ProtoSubaccountId { + owner: subacc.address.0, + number: subacc.number.0, + } + } +} + +/// Subaccount number. +#[derive(Serialize, Deserialize, Debug, Clone, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct SubaccountNumber(pub(crate) u32); + +impl SubaccountNumber { + /// Get the subaccount number value. + pub fn value(&self) -> u32 { + self.0 + } +} + +impl TryFrom for SubaccountNumber { + type Error = Error; + fn try_from(number: u32) -> Result { + match number { + 0..=128_000 => Ok(SubaccountNumber(number)), + _ => Err(err!("Subaccount number must be [0, 128_000]")), + } + } +} + +impl From for SubaccountNumber { + fn from(parent: ParentSubaccountNumber) -> Self { + Self(parent.value()) + } +} + +/// Parent subaccount. +/// +/// A parent subaccount can have multiple positions opened and all posititions are cross-margined. +/// See also [how isolated positions are handled in dYdX](https://docs.dydx.exchange/api_integration-guides/how_to_isolated#mapping-of-isolated-positions-to-subaccounts). +#[derive(Deserialize, Debug, Clone, Eq, Hash, PartialOrd, Ord, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct ParentSubaccount { + /// Address. + pub address: Address, + /// Parent subaccount number. + pub number: ParentSubaccountNumber, +} + +impl ParentSubaccount { + /// Create a new Subaccount. + pub fn new(address: Address, number: ParentSubaccountNumber) -> Self { + Self { address, number } + } +} + +impl std::cmp::PartialEq for ParentSubaccount { + fn eq(&self, other: &Subaccount) -> bool { + self.address == other.address && self.number == other.number + } +} + +/// Subaccount number. +#[derive(Serialize, Deserialize, Debug, Clone, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct ParentSubaccountNumber(u32); + +impl ParentSubaccountNumber { + /// Get parent subaccount number value. + pub fn value(&self) -> u32 { + self.0 + } +} + +impl TryFrom for ParentSubaccountNumber { + type Error = Error; + fn try_from(number: u32) -> Result { + match number { + 0..=127 => Ok(ParentSubaccountNumber(number)), + _ => Err(err!("Parent subaccount number must be [0, 127]")), + } + } +} + +impl std::cmp::PartialEq for ParentSubaccountNumber { + fn eq(&self, other: &SubaccountNumber) -> bool { + self.0 == other.value() + } +} + +/// Subaccount id. +#[derive(Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct SubaccountId(pub String); + +/// Token symbol. +#[derive( + Serialize, Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +pub struct Symbol(pub String); + +/// Trade type. +#[derive(Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum TradeType { + /// LIMIT is the trade type for a fill with a limit taker order. + Limit, + /// LIQUIDATED is the trade type for a fill with a liquidated taker order. + Liquidated, + /// DELEVERAGED is the trade type for a fill with a deleveraged taker order. + Deleveraged, +} + +/// Transfer type. +#[derive(Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum TransferType { + /// Transfer-in. + TransferIn, + /// Transfer-out. + TransferOut, + /// Deposit. + Deposit, + /// Withdrawal. + Withdrawal, +} + +/// Ticker. +#[derive( + Serialize, Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, +)] +pub struct Ticker(pub String); + +impl<'a> From<&'a str> for Ticker { + fn from(value: &'a str) -> Self { + Self(value.into()) + } +} + +const USDC_DENOM: &str = "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5"; +const DYDX_DENOM: &str = "adydx"; +const DYDX_TNT_DENOM: &str = "adv4tnt"; +#[cfg(feature = "noble")] +const NOBLE_USDC_DENOM: &str = "uusdc"; + +/// Denom. +/// +/// A more convenient type for Cosmos' [`Denom`](CosmosDenom). +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +pub enum Denom { + /// USDC IBC token. + #[serde(rename = "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5")] + Usdc, + /// dYdX native mainnet token. + #[serde(rename = "adydx")] + Dydx, + /// dYdX native testnet token. + #[serde(rename = "adv4tnt")] + DydxTnt, + /// Noble USDC token. + #[cfg(feature = "noble")] + #[serde(rename = "uusdc")] + NobleUsdc, + /// Custom denom representation. + #[serde(untagged)] + Custom(CosmosDenom), +} + +impl Denom { + /// Gas price per atomic unit. + /// This price is only available for `Denom`s which can be used to cover transactions gas fees. + pub fn gas_price(&self) -> Option { + match self { + // Defined dYdX micro USDC per Gas unit. + // As defined in [1](https://docs.dydx.exchange/infrastructure_providers-validators/required_node_configs#base-configuration) and [2](https://github.com/dydxprotocol/v4-chain/blob/ba731b00e3163f7c3ff553b4300d564c11eaa81f/protocol/cmd/dydxprotocold/cmd/config.go#L15). + Self::Usdc => Some(BigDecimal::new(25.into(), 3)), + // Defined dYdX native tokens per Gas unit. Recommended to be roughly the same in value as 0.025 micro USDC. + // As defined in [1](https://github.com/dydxprotocol/v4-chain/blob/ba731b00e3163f7c3ff553b4300d564c11eaa81f/protocol/cmd/dydxprotocold/cmd/config.go#L21). + Self::Dydx | Self::DydxTnt => Some(BigDecimal::new(25_000_000_000u64.into(), 0)), + #[cfg(feature = "noble")] + Self::NobleUsdc => Some(BigDecimal::new(1.into(), 1)), + _ => None, + } + } +} + +impl FromStr for Denom { + type Err = Error; + fn from_str(value: &str) -> Result { + match value { + USDC_DENOM => Ok(Self::Usdc), + DYDX_DENOM => Ok(Self::Dydx), + DYDX_TNT_DENOM => Ok(Self::DydxTnt), + _ => Ok(Self::Custom( + value.parse::().map_err(Error::msg)?, + )), + } + } +} + +impl AsRef for Denom { + fn as_ref(&self) -> &str { + match self { + Self::Usdc => USDC_DENOM, + Self::Dydx => DYDX_DENOM, + Self::DydxTnt => DYDX_TNT_DENOM, + #[cfg(feature = "noble")] + Self::NobleUsdc => NOBLE_USDC_DENOM, + Self::Custom(denom) => denom.as_ref(), + } + } +} + +impl fmt::Display for Denom { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.as_ref()) + } +} + +impl TryFrom for CosmosDenom { + type Error = Error; + fn try_from(value: Denom) -> Result { + value.as_ref().parse().map_err(Self::Error::msg) + } +} + +/// Parent subaccount response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ParentSubaccountResponseObject { + /// Address. + pub address: Address, + /// Subaccount number. + pub parent_subaccount_number: SubaccountNumber, + /// Equity. + pub equity: BigDecimal, + /// Free collateral. + pub free_collateral: BigDecimal, + /// Is margin enabled? + pub margin_enabled: Option, + /// Associated child subaccounts. + pub child_subaccounts: Vec, +} + +/// Subaccount response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct SubaccountResponseObject { + /// Address. + pub address: Address, + /// Subaccount number. + pub subaccount_number: SubaccountNumber, + /// Equity. + pub equity: BigDecimal, + /// Free collateral. + pub free_collateral: BigDecimal, + /// Is margin enabled? + pub margin_enabled: Option, + /// Asset positions. + pub asset_positions: AssetPositionsMap, + /// Opened perpetual positions. + pub open_perpetual_positions: PerpetualPositionsMap, +} + +/// Asset position response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct AssetPositionResponseObject { + /// Token symbol. + pub symbol: Symbol, + /// Position. + pub side: PositionSide, + /// Size. + pub size: Quantity, + /// Subaccount number. + pub subaccount_number: SubaccountNumber, + /// Asset id. + pub asset_id: AssetId, +} + +/// Perpetual position response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PerpetualPositionResponseObject { + /// Market ticker. + pub market: Ticker, + /// Position status. + pub status: PerpetualPositionStatus, + /// Position. + pub side: PositionSide, + /// Size. + pub size: Quantity, + /// Maximum size. + pub max_size: Quantity, + /// Entry price. + pub entry_price: Price, + /// Actual PnL. + pub realized_pnl: BigDecimal, + /// Time(UTC). + pub created_at: DateTime, + /// Block height. + pub created_at_height: Height, + /// Sum at open. + pub sum_open: BigDecimal, + /// Sum at close. + pub sum_close: BigDecimal, + /// Net funding. + pub net_funding: BigDecimal, + /// Potential PnL. + pub unrealized_pnl: BigDecimal, + /// Time(UTC). + pub closed_at: Option>, + /// Exit price. + pub exit_price: Option, + /// Subaccount number. + pub subaccount_number: SubaccountNumber, +} + +/// Asset positions. +pub type AssetPositionsMap = HashMap; + +/// Perpetual positions. +pub type PerpetualPositionsMap = HashMap; + +/// Price. +#[derive( + Add, + Deserialize, + Debug, + Clone, + Div, + Display, + Deref, + DerefMut, + PartialEq, + Eq, + Mul, + PartialOrd, + Ord, + Hash, + Sub, +)] +#[serde(transparent)] +pub struct Price(pub BigDecimal); + +impl From for Price +where + T: Into, +{ + fn from(value: T) -> Self { + Self(value.into()) + } +} + +impl FromStr for Price { + type Err = bigdecimal::ParseBigDecimalError; + fn from_str(s: &str) -> Result { + s.parse().map(Self) + } +} + +/// Quantity. +#[derive( + Add, + Deserialize, + Debug, + Clone, + Div, + Display, + Deref, + DerefMut, + PartialEq, + Eq, + Mul, + PartialOrd, + Ord, + Hash, + Sub, +)] +#[serde(transparent)] +pub struct Quantity(pub BigDecimal); + +impl From for Quantity +where + T: Into, +{ + fn from(value: T) -> Self { + Self(value.into()) + } +} + +impl FromStr for Quantity { + type Err = bigdecimal::ParseBigDecimalError; + fn from_str(s: &str) -> Result { + s.parse().map(Self) + } +} + +/// Orderbook price level. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct OrderbookResponsePriceLevel { + /// Price. + pub price: Price, + /// Size. + pub size: Quantity, +} + +/// Orderbook response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct OrderBookResponseObject { + /// Bids. + pub bids: Vec, + /// Asks. + pub asks: Vec, +} + +/// Order response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct OrderResponseObject { + /// Client id. + pub client_id: ClientId, + /// Client metadata. + pub client_metadata: ClientMetadata, + /// Clob pair id. + pub clob_pair_id: ClobPairId, + /// Block height. + pub created_at_height: Option, + /// Block height. + pub good_til_block: Option, + /// Time(UTC). + pub good_til_block_time: Option>, + /// Id. + pub id: OrderId, + /// Order flags. + pub order_flags: OrderFlags, + /// Post-only. + pub post_only: bool, + /// Price. + pub price: Price, + /// Reduce-only. + pub reduce_only: bool, + /// Side (buy/sell). + pub side: OrderSide, + /// Size. + pub size: Quantity, + /// Order status. + pub status: ApiOrderStatus, + /// Subaccount id. + pub subaccount_id: SubaccountId, + /// Subaccount number. + pub subaccount_number: SubaccountNumber, + /// Market ticker. + pub ticker: Ticker, + /// Time-in-force. + pub time_in_force: ApiTimeInForce, + /// Total filled. + pub total_filled: BigDecimal, + /// Order type. + #[serde(rename = "type")] + pub order_type: OrderType, + /// Time(UTC). + pub updated_at: Option>, + /// Block height. + pub updated_at_height: Option, +} + +/// Trade response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TradeResponse { + /// Trades. + pub trades: Vec, +} + +/// Trade. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TradeResponseObject { + /// Trade id. + pub id: TradeId, + /// Block height. + pub created_at_height: Height, + /// Time(UTC). + pub created_at: DateTime, + /// Side (buy/sell). + pub side: OrderSide, + /// Price. + pub price: Price, + /// Size. + pub size: Quantity, + /// Trade type. + #[serde(rename = "type")] + pub trade_type: TradeType, +} + +/// Perpetual markets. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PerpetualMarketResponse { + /// Perpetual markets. + pub markets: HashMap, +} + +/// Perpetual market. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PerpetualMarket { + /// Atomic resolution + pub atomic_resolution: i32, + /// Base open interest. + pub base_open_interest: BigDecimal, + /// Clob pair id. + pub clob_pair_id: ClobPairId, + /// Initial margin fraction. + pub initial_margin_fraction: BigDecimal, + /// Maintenance margin fraction. + pub maintenance_margin_fraction: BigDecimal, + /// Market type. + pub market_type: PerpetualMarketType, + /// Next funding rate. + pub next_funding_rate: BigDecimal, + /// Open interest. + pub open_interest: BigDecimal, + /// Open interest lower capitalization. + pub open_interest_lower_cap: Option, + /// Open interest upper capitalization. + pub open_interest_upper_cap: Option, + /// Oracle price. + pub oracle_price: Option, + /// 24-h price change. + #[serde(rename = "priceChange24H")] + pub price_change_24h: BigDecimal, + /// Quantum conversion exponent. + pub quantum_conversion_exponent: i32, + /// Market status + pub status: PerpetualMarketStatus, + /// Step base quantums. + pub step_base_quantums: u64, + /// Step size. + pub step_size: BigDecimal, + /// Subticks per tick. + pub subticks_per_tick: u32, + /// Tick size. + pub tick_size: BigDecimal, + /// Market ticker. + pub ticker: Ticker, + /// 24-h number of trades. + #[serde(rename = "trades24H")] + pub trades_24h: u64, + /// 24-h volume. + #[serde(rename = "volume24H")] + pub volume_24h: Quantity, +} + +impl PerpetualMarket { + /// Creates a [`OrderMarketParams`], capable of performing price and size quantizations and other + /// operations based on market data. + /// These quantizations are required for `Order` placement. + pub fn order_params(&self) -> OrderMarketParams { + OrderMarketParams { + atomic_resolution: self.atomic_resolution, + clob_pair_id: self.clob_pair_id.clone(), + oracle_price: self.oracle_price.clone(), + quantum_conversion_exponent: self.quantum_conversion_exponent, + step_base_quantums: self.step_base_quantums, + subticks_per_tick: self.subticks_per_tick, + } + } +} + +/// Candle response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CandleResponse { + /// List of candles. + pub candles: Vec, +} + +/// Candle response. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CandleResponseObject { + /// Market ticker. + pub ticker: Ticker, + /// Number of trades. + pub trades: u64, + /// Time(UTC). + pub started_at: DateTime, + /// Base token volume. + pub base_token_volume: Quantity, + /// Token price at open. + pub open: Price, + /// Low price volume. + pub low: Price, + /// High price volume. + pub high: Price, + /// Token price at close. + pub close: Price, + /// Candle resolution. + pub resolution: CandleResolution, + /// USD volume. + pub usd_volume: Quantity, + /// Starting open interest. + pub starting_open_interest: BigDecimal, +} + +/// Block height parsed by Indexer. +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct HeightResponse { + /// Block height. + pub height: Height, + /// Time (UTC). + pub time: DateTime, +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn denom_parse() { + // Test if hardcoded denom is parsed correctly + let _usdc = Denom::Usdc.to_string().parse::().unwrap(); + let _dydx = Denom::Dydx.to_string().parse::().unwrap(); + let _dydx_tnt = Denom::DydxTnt.to_string().parse::().unwrap(); + let _custom: Denom = "uusdc".parse().unwrap(); + } +} diff --git a/v4-client-rs/client/src/lib.rs b/v4-client-rs/client/src/lib.rs new file mode 100644 index 00000000..f7648f92 --- /dev/null +++ b/v4-client-rs/client/src/lib.rs @@ -0,0 +1,49 @@ +//! [dYdX](https://dydx.trade/) v4 asynchronous client. +//! +//! [dYdX v4 architecture](https://docs.dydx.exchange/concepts-architecture/architectural_overview) +//! introduces nodes and the indexer for read-write and read-only operations accordingly. +//! Multiple entrypoints to the system are reflected in the client interface to allow for a highly customized use. +//! +//! The client allows: +//! * manage orders and funds (via [`NodeClient`](crate::node::NodeClient)) +//! * query the dYdX network (via [`NodeClient`](crate::node::NodeClient) and [`IndexerClient`](crate::indexer::IndexerClient)) +//! * get testnet token funds (via [`FaucetClient`](crate::faucet::FaucetClient), gated by feature `faucet`, turned on by default) +//! * transfer funds between Noble and dYdX (via [`NobleClient`](crate::noble::NobleClient), gated by feature `noble`, turned on by default) +//! +//! ### Telemetry +//! +//! The feature `telemetry` is turned on by default and provides [`metrics`](https://github.com/metrics-rs/metrics/tree/main/metrics) collection in a vendor-agnostic way. +//! This allows to use any compatible [metrics exporter](https://github.com/metrics-rs/metrics?tab=readme-ov-file#project-layout). +//! To see what metrics are collected check the public constants of the module [`telemetry`]. +//! Many provided examples (see below) use [`metrics-observer`](https://github.com/metrics-rs/metrics/tree/main/metrics-observer) as an example metrics exporter +//! allowing to track them in a separate terminal. +//! +//! ### Examples +//! +//! Explore many elaborated examples in [the +//! repository](https://github.com/dydxprotocol/v4-clients/tree/main/v4-client-rs/client/examples). +//! Note - to run examples you need [`protoc`](https://grpc.io/docs/protoc-installation/) as `metrics-exporter-tcp` uses it during the build. + +#![deny(missing_docs)] + +/// Client configuration. +pub mod config; +/// Testnet tokens. +/// +/// Note that faucet is available under the compilation feature `faucet` (turned on by default). +#[cfg(feature = "faucet")] +pub mod faucet; +/// Indexer client. +pub mod indexer; +/// Noble client. +/// +/// Note that Noble client is available under the compilation feature `noble` (turned on by default). +#[cfg(feature = "noble")] +pub mod noble; +/// Node client. +pub mod node; +/// Telemetry. +/// +/// Note that telemetry is available under the compilation feature `telemetry` (turned on by default). +#[cfg(feature = "telemetry")] +pub mod telemetry; diff --git a/v4-client-rs/client/src/noble/config.rs b/v4-client-rs/client/src/noble/config.rs new file mode 100644 index 00000000..16053481 --- /dev/null +++ b/v4-client-rs/client/src/noble/config.rs @@ -0,0 +1,31 @@ +use crate::indexer::Denom; +use cosmrs::tendermint::chain::Id as ChainId; +use serde::Deserialize; + +/// Configuration for [`NobleClient`](crate::noble::NobleClient) +#[derive(Debug, Deserialize)] +pub struct NobleConfig { + /// Node endpoint. + pub endpoint: String, + /// Timeout in milliseconds + #[serde(default = "default_timeout")] + pub timeout: u64, + /// [`ChainId`] to specify the chain. + pub chain_id: ChainId, + /// Fee [`Denom`]. + pub fee_denom: Denom, + /// The sequence is a value that represents the number of transactions sent from an account. + /// Either the client manages it automatically via quering the network for the next + /// sequence number or it is a responsibility of a user. + /// It is a [replay prevention](https://docs.cosmos.network/v0.47/learn/beginner/tx-lifecycle). + #[serde(default = "default_manage_sequencing")] + pub manage_sequencing: bool, +} + +fn default_timeout() -> u64 { + 1_000 +} + +fn default_manage_sequencing() -> bool { + true +} diff --git a/v4-client-rs/client/src/noble/mod.rs b/v4-client-rs/client/src/noble/mod.rs new file mode 100644 index 00000000..67abe3d8 --- /dev/null +++ b/v4-client-rs/client/src/noble/mod.rs @@ -0,0 +1,243 @@ +mod config; +mod tokens; +use crate::{ + indexer::{Address, Denom, Tokenized}, + node::{Account, TxBuilder, TxHash}, +}; +use anyhow::{anyhow as err, Error}; +use chrono::{TimeDelta, Utc}; +pub use config::NobleConfig; +use cosmrs::tx::{self, Tx}; +use dydx_proto::{ + cosmos_sdk_proto::cosmos::{ + auth::v1beta1::{ + query_client::QueryClient as AuthClient, BaseAccount, QueryAccountRequest, + }, + bank::v1beta1::{ + query_client::QueryClient as BankClient, QueryAllBalancesRequest, QueryBalanceRequest, + }, + base::{abci::v1beta1::GasInfo, v1beta1::Coin}, + tx::v1beta1::{ + service_client::ServiceClient as TxClient, BroadcastMode, BroadcastTxRequest, + SimulateRequest, + }, + }, + ToAny, +}; +use ibc_proto::{ + cosmos::base::v1beta1::Coin as IbcProtoCoin, ibc::applications::transfer::v1::MsgTransfer, +}; +pub use tokens::NobleUsdc; +use tokio::time::Duration; +use tonic::transport::{Channel, ClientTlsConfig}; +use tower::timeout::Timeout; + +/// Wrapper over standard [Cosmos modules](https://github.com/cosmos/cosmos-sdk/tree/main/x) clients. +pub struct Routes { + /// Authentication of accounts and transactions for Cosmos SDK applications. + pub auth: AuthClient>, + /// Token transfer functionalities. + pub bank: BankClient>, + /// Tx utilities for the Cosmos SDK. + pub tx: TxClient>, +} + +impl Routes { + /// Creates new modules clients wrapper. + pub fn new(channel: Timeout) -> Self { + Self { + auth: AuthClient::new(channel.clone()), + bank: BankClient::new(channel.clone()), + tx: TxClient::new(channel), + } + } +} + +/// Noble client. +pub struct NobleClient { + builder: TxBuilder, + #[allow(dead_code)] + config: NobleConfig, + routes: Routes, +} + +impl NobleClient { + /// Connect to the node. + pub async fn connect(config: NobleConfig) -> Result { + let tls = ClientTlsConfig::new().with_native_roots(); + let endpoint = config.endpoint.clone(); + let channel = Channel::from_shared(endpoint)? + .tls_config(tls)? + .connect() + .await?; + let timeout = Duration::from_millis(config.timeout); + let timeout_channel = Timeout::new(channel, timeout); + let builder = TxBuilder::new(config.chain_id.clone(), config.fee_denom.clone()); + + Ok(Self { + builder, + config, + routes: Routes::new(timeout_channel), + }) + } + + /// Query all balances of an account/address. + pub async fn get_account_balances(&mut self, address: Address) -> Result, Error> { + let req = QueryAllBalancesRequest { + address: address.to_string(), + resolve_denom: false, + pagination: None, + }; + let balances = self + .routes + .bank + .all_balances(req) + .await? + .into_inner() + .balances; + Ok(balances) + } + + /// Query token balance of an account/address. + pub async fn get_account_balance( + &mut self, + address: Address, + denom: &Denom, + ) -> Result { + let req = QueryBalanceRequest { + address: address.into(), + denom: denom.to_string(), + }; + let balance = self + .routes + .bank + .balance(req) + .await? + .into_inner() + .balance + .ok_or_else(|| err!("Balance query response does not contain balance"))?; + Ok(balance) + } + + /// Query for [an account](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth#account-1) + /// by it's address. + pub async fn get_account(&mut self, address: &Address) -> Result { + let req = QueryAccountRequest { + address: address.to_string(), + }; + let resp = self + .routes + .auth + .account(req) + .await? + .into_inner() + .account + .ok_or_else(|| err!("Query account request failure, account should exist."))? + .to_msg()?; + Ok(resp) + } + + async fn simulate(&mut self, tx_raw: &tx::Raw) -> Result { + let request = SimulateRequest { + tx_bytes: tx_raw + .to_bytes() + .map_err(|e| err!("Raw Tx to bytes failed: {}", e))?, + ..Default::default() + }; + + let gas = self + .routes + .tx + .simulate(request) + .await? + .into_inner() + .gas_info + .ok_or_else(|| err!("Tx simulation request failed, gas info should exist."))?; + Ok(gas) + } + + /// Fetch account's number and sequence number from the network. + pub async fn query_address(&mut self, address: &Address) -> Result<(u64, u64), Error> { + self.get_account(address) + .await + .map(|res| (res.account_number, res.sequence)) + } + + /// Transfer a token asset between Cosmos blockchain networks. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/noble_transfer.rs). + pub async fn send_token_ibc( + &mut self, + account: &mut Account, + sender: Address, + recipient: Address, + token: impl Tokenized, + source_channel: String, + ) -> Result { + let coin = token.coin()?; + let timeout = (Utc::now() + TimeDelta::seconds(60)) + .timestamp_nanos_opt() + .ok_or_else(|| err!("Failed calculating timeout ns timestamp"))? + .try_into()?; + + let msg = MsgTransfer { + receiver: recipient.to_string(), + sender: sender.to_string(), + source_port: "transfer".to_string(), + source_channel, + timeout_timestamp: timeout, + token: Some(IbcProtoCoin { + amount: coin.amount, + denom: coin.denom, + }), + timeout_height: None, + memo: Default::default(), + }; + + if self.config.manage_sequencing { + let (_, sequence_number) = self.query_address(account.address()).await?; + account.set_sequence_number(sequence_number); + } + + let tx_raw = + self.builder + .build_transaction(account, std::iter::once(msg.to_any()), None)?; + + let simulated = self.simulate(&tx_raw).await?; + let gas = simulated.gas_used; + let fee = self.builder.calculate_fee(Some(gas))?; + + let tx_bytes = tx_raw + .to_bytes() + .map_err(|e| err!("Raw Tx to bytes failed: {e}"))?; + let tx = Tx::from_bytes(&tx_bytes).map_err(|e| err!("Failed to decode Tx bytes: {e}"))?; + self.builder + .build_transaction(account, tx.body.messages, Some(fee))?; + + let request = BroadcastTxRequest { + tx_bytes: tx_raw + .to_bytes() + .map_err(|e| err!("Raw Tx to bytes failed: {}", e))?, + mode: BroadcastMode::Sync.into(), + }; + + let response = self + .routes + .tx + .broadcast_tx(request) + .await? + .into_inner() + .tx_response + .ok_or_else(|| err!("Tx not present in broadcast response"))?; + + if response.code == 0 { + Ok(response.txhash) + } else { + Err(err!( + "Tx broadcast failed with error {}: {}", + response.code, + response.raw_log, + )) + } + } +} diff --git a/v4-client-rs/client/src/noble/tokens.rs b/v4-client-rs/client/src/noble/tokens.rs new file mode 100644 index 00000000..9633107b --- /dev/null +++ b/v4-client-rs/client/src/noble/tokens.rs @@ -0,0 +1,43 @@ +use crate::indexer::{Denom, Tokenized}; +use anyhow::{anyhow as err, Error}; +use bigdecimal::{num_traits::ToPrimitive, BigDecimal}; +use dydx_proto::cosmos_sdk_proto::cosmos::base::v1beta1::Coin as ProtoCoin; + +/// USDC Noble token. +pub struct NobleUsdc(pub BigDecimal); + +impl From for NobleUsdc +where + T: Into, +{ + fn from(value: T) -> Self { + NobleUsdc(value.into()) + } +} + +impl Tokenized for NobleUsdc { + fn denom(&self) -> Denom { + Denom::NobleUsdc + } + + fn coin(&self) -> Result { + Ok(ProtoCoin { + amount: self + .0 + .to_u128() + .ok_or_else(|| err!("Failed converting Noble USDC value into amount"))? + .to_string(), + denom: self.denom().to_string(), + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn noble_token_parse() { + let _usdc = NobleUsdc(0.into()).denom(); + } +} diff --git a/v4-client-rs/client/src/node/builder.rs b/v4-client-rs/client/src/node/builder.rs new file mode 100644 index 00000000..a799d7e9 --- /dev/null +++ b/v4-client-rs/client/src/node/builder.rs @@ -0,0 +1,68 @@ +use super::sequencer::Nonce; +use super::{fee, Account}; +use crate::indexer::Denom; +use anyhow::{anyhow as err, Error, Result}; +pub use cosmrs::tendermint::chain::Id; +use cosmrs::{ + tx::{self, Fee, SignDoc, SignerInfo}, + Any, +}; + +/// Transaction builder. +pub struct TxBuilder { + chain_id: Id, + fee_denom: Denom, +} + +impl TxBuilder { + /// Create a new transaction builder. + pub fn new(chain_id: Id, fee_denom: Denom) -> Self { + Self { + chain_id, + fee_denom, + } + } + + /// Estimate a transaction fee. + /// + /// See also [What Are Crypto Gas Fees?](https://dydx.exchange/crypto-learning/what-are-crypto-gas-fees). + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/withdraw_other.rs). + pub fn calculate_fee(&self, gas_used: Option) -> Result { + if let Some(gas) = gas_used { + fee::calculate(gas, &self.fee_denom) + } else { + Ok(fee::default()) + } + } + + /// Build a transaction for given messages. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/withdraw_other.rs). + pub fn build_transaction( + &self, + account: &Account, + msgs: impl IntoIterator, + fee: Option, + ) -> Result { + let tx_body = tx::BodyBuilder::new().msgs(msgs).memo("").finish(); + + let fee = fee.unwrap_or(self.calculate_fee(None)?); + + let nonce = match account.next_nonce() { + Some(Nonce::Sequence(number) | Nonce::Timestamp(number)) => *number, + None => return Err(err!("Account's next nonce not set")), + }; + let auth_info = SignerInfo::single_direct(Some(account.public_key()), nonce).auth_info(fee); + + let sign_doc = SignDoc::new( + &tx_body, + &auth_info, + &self.chain_id, + account.account_number(), + ) + .map_err(|e| err!("cannot create sign doc: {e}"))?; + + account.sign(sign_doc) + } +} diff --git a/v4-client-rs/client/src/node/client/error.rs b/v4-client-rs/client/src/node/client/error.rs new file mode 100644 index 00000000..a47fb93c --- /dev/null +++ b/v4-client-rs/client/src/node/client/error.rs @@ -0,0 +1,57 @@ +use thiserror::Error; +use tonic::Status; + +/// Node error. +#[derive(Error, Debug)] +pub enum NodeError { + /// General error. + #[error("General error: {0}")] + General(#[from] anyhow::Error), + /// Broadcast error. + #[error("Broadcast error: {0}")] + Broadcast(#[from] BroadcastError), +} + +/// Broadcast error. +#[derive(Error, Debug)] +#[error("Broadcast error {code:?} with log: {message}")] +pub struct BroadcastError { + /// Code. + /// + /// [Codes](https://github.com/dydxprotocol/v4-chain/blob/main/protocol/x/clob/types/errors.go). + pub code: Option, + /// Message. + pub message: String, +} + +impl From for BroadcastError { + fn from(error: Status) -> Self { + BroadcastError { + code: None, + message: error.message().to_string(), + } + } +} + +impl BroadcastError { + pub(crate) fn get_collateral_reason(&self) -> Option<&str> { + match self { + // A code is sent in BroadcastTxResponse + BroadcastError { + code: Some(3007), .. + } => { + Some("Broadcast error 3007 received (under collaterization), ignoring") + } + // Tonic::Status is unknown with a message string with the error + BroadcastError { + code: None, + message, + } if message.contains("StillUndercollateralized") + || message.contains("NewlyUndercollateralized") => + { + Some("Broadcast error 'StillUndercollateralized' / 'NewlyUndercollateralized', ignoring") + } + _ => None, + } + } +} diff --git a/v4-client-rs/client/src/node/client/megavault.rs b/v4-client-rs/client/src/node/client/megavault.rs new file mode 100644 index 00000000..6836700f --- /dev/null +++ b/v4-client-rs/client/src/node/client/megavault.rs @@ -0,0 +1,139 @@ +use super::*; +use crate::node::utils::BigIntExt; + +use anyhow::{anyhow as err, Error}; +use dydx_proto::dydxprotocol::{ + subaccounts::SubaccountId, + vault::{ + MsgDepositToMegavault, MsgWithdrawFromMegavault, NumShares, + QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponse, + QueryMegavaultWithdrawalInfoRequest, QueryMegavaultWithdrawalInfoResponse, + }, +}; + +use bigdecimal::num_bigint::ToBigInt; + +/// [`NodeClient`] MegaVault requests dispatcher +pub struct MegaVault<'a> { + client: &'a mut NodeClient, +} + +impl<'a> MegaVault<'a> { + /// Create a new MegaVault requests dispatcher + pub(crate) fn new(client: &'a mut NodeClient) -> Self { + Self { client } + } + + /// Deposit USDC into the MegaVault. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_megavault.rs). + pub async fn deposit( + &mut self, + account: &mut Account, + subaccount: Subaccount, + amount: impl Into, + ) -> Result { + let client = &mut self.client; + + let subaccount_id = SubaccountId { + owner: subaccount.address.to_string(), + number: subaccount.number.0, + }; + let quantums = amount + .into() + .quantize() + .to_bigint() + .ok_or_else(|| err!("Failed converting USDC quantums to BigInt"))? + .to_serializable_vec()?; + + let msg = MsgDepositToMegavault { + subaccount_id: Some(subaccount_id), + quote_quantums: quantums, + }; + + let tx_raw = client.create_transaction(account, msg).await?; + + client.broadcast_transaction(tx_raw).await + } + + /// Withdraw shares from the MegaVault. + /// The number of shares must be equal or greater to some specified minimum amount (in + /// USDC-equivalent value). + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_megavault.rs). + pub async fn withdraw( + &mut self, + account: &mut Account, + subaccount: Subaccount, + min_amount: impl Into, + shares: Option<&BigInt>, + ) -> Result { + let client = &mut self.client; + + let subaccount_id = SubaccountId { + owner: subaccount.address.to_string(), + number: subaccount.number.0, + }; + let quantums = min_amount + .into() + .quantize() + .to_bigint() + .ok_or_else(|| err!("Failed converting USDC quantums to BigInt"))? + .to_serializable_vec()?; + let num_shares = shares + .map(|x| x.to_serializable_vec()) + .transpose()? + .map(|vec| NumShares { num_shares: vec }); + + let msg = MsgWithdrawFromMegavault { + subaccount_id: Some(subaccount_id), + min_quote_quantums: quantums, + shares: num_shares, + }; + + let tx_raw = client.create_transaction(account, msg).await?; + + client.broadcast_transaction(tx_raw).await + } + + /// Query the shares associated with an [`Address`]. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_megavault.rs). + pub async fn get_owner_shares( + &mut self, + address: &Address, + ) -> Result { + let client = &mut self.client; + let req = QueryMegavaultOwnerSharesRequest { + address: address.to_string(), + }; + + let response = client.vault.megavault_owner_shares(req).await?.into_inner(); + + Ok(response) + } + + /// Query the withdrawal information for a specified number of shares. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_megavault.rs). + pub async fn get_withdrawal_info( + &mut self, + shares: &BigInt, + ) -> Result { + let client = &mut self.client; + let num_shares = NumShares { + num_shares: shares.to_serializable_vec()?, + }; + let req = QueryMegavaultWithdrawalInfoRequest { + shares_to_withdraw: Some(num_shares), + }; + + let response = client + .vault + .megavault_withdrawal_info(req) + .await? + .into_inner(); + + Ok(response) + } +} diff --git a/v4-client-rs/client/src/node/client/methods.rs b/v4-client-rs/client/src/node/client/methods.rs new file mode 100644 index 00000000..58c81fbf --- /dev/null +++ b/v4-client-rs/client/src/node/client/methods.rs @@ -0,0 +1,424 @@ +use super::{Address, NodeClient}; +use crate::indexer::{Denom, Height, Subaccount}; +use anyhow::{anyhow as err, Error}; +use dydx_proto::{ + cosmos::base::query::v1beta1::PageRequest as V4PageRequest, + cosmos_sdk_proto::cosmos::{ + auth::v1beta1::{BaseAccount, QueryAccountRequest}, + bank::v1beta1::{QueryAllBalancesRequest, QueryBalanceRequest}, + base::{ + query::v1beta1::PageRequest as CosmosPageRequest, + tendermint::v1beta1::{ + Block, GetLatestBlockRequest, GetNodeInfoRequest, GetNodeInfoResponse, + }, + v1beta1::Coin, + }, + staking::v1beta1::{ + DelegationResponse, QueryDelegatorDelegationsRequest, + QueryDelegatorUnbondingDelegationsRequest, QueryValidatorsRequest, UnbondingDelegation, + Validator, + }, + }, + dydxprotocol::{ + bridge::{DelayedCompleteBridgeMessage, QueryDelayedCompleteBridgeMessagesRequest}, + clob::{ + ClobPair, EquityTierLimitConfiguration, QueryAllClobPairRequest, + QueryEquityTierLimitConfigurationRequest, QueryGetClobPairRequest, + }, + feetiers::{PerpetualFeeTier, QueryPerpetualFeeParamsRequest, QueryUserFeeTierRequest}, + perpetuals::{Perpetual, QueryAllPerpetualsRequest, QueryPerpetualRequest}, + prices::{MarketPrice, QueryAllMarketPricesRequest, QueryMarketPriceRequest}, + rewards, + stats::{QueryUserStatsRequest, UserStats}, + subaccounts::{ + QueryAllSubaccountRequest, QueryGetSubaccountRequest, Subaccount as SubaccountInfo, + }, + }, +}; + +impl NodeClient { + /// Query for [account balances](https://github.com/cosmos/cosmos-sdk/tree/main/x/bank#allbalances) + /// by address for all denominations. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_account_balances(&mut self, address: &Address) -> Result, Error> { + let req = QueryAllBalancesRequest { + address: address.to_string(), + resolve_denom: false, + pagination: None, + }; + let balances = self.bank.all_balances(req).await?.into_inner().balances; + Ok(balances) + } + + /// Query for account [balance](https://github.com/cosmos/cosmos-sdk/tree/main/x/bank#balance) + /// by address for a given denomination. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_account_balance( + &mut self, + address: &Address, + denom: &Denom, + ) -> Result { + let req = QueryBalanceRequest { + address: address.to_string(), + denom: denom.to_string(), + }; + let balance = self + .bank + .balance(req) + .await? + .into_inner() + .balance + .ok_or_else(|| err!("Balance query response does not contain balance"))?; + Ok(balance) + } + + /// Query for [an account](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth#account-1) + /// by it's address. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_account(&mut self, address: &Address) -> Result { + let req = QueryAccountRequest { + address: address.to_string(), + }; + let resp = self + .auth + .account(req) + .await? + .into_inner() + .account + .ok_or_else(|| err!("Query account request failure, account should exist."))? + .to_msg()?; + Ok(resp) + } + + /// Query for node info. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_node_info(&mut self) -> Result { + let req = GetNodeInfoRequest {}; + let info = self.base.get_node_info(req).await?.into_inner(); + Ok(info) + } + + /// Query for the latest block. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_latest_block(&mut self) -> Result { + let req = GetLatestBlockRequest::default(); + let latest_block = self + .base + .get_latest_block(req) + .await? + .into_inner() + .sdk_block + .ok_or_else(|| err!("The latest block is empty"))?; + Ok(latest_block) + } + + /// Query for the latest block height. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_latest_block_height(&mut self) -> Result { + let latest_block = self.get_latest_block().await?; + let header = latest_block + .header + .ok_or_else(|| err!("The block doesn't contain a header"))?; + let height = Height(header.height.try_into()?); + Ok(height) + } + + /// Query for user stats (Maker and Taker positions). + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_user_stats(&mut self, address: &Address) -> Result { + let req = QueryUserStatsRequest { + user: address.to_string(), + }; + let stats = self + .stats + .user_stats(req) + .await? + .into_inner() + .stats + .ok_or_else(|| err!("User stats query response does not contain stats"))?; + Ok(stats) + } + + /// Query for [all validators](https://github.com/cosmos/cosmos-sdk/tree/main/x/staking#validators-2) + /// that match the given status. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_all_validators( + &mut self, + status: Option, + ) -> Result, Error> { + let req = QueryValidatorsRequest { + status: status.unwrap_or_default(), + pagination: None, + }; + let validators = self.staking.validators(req).await?.into_inner().validators; + Ok(validators) + } + + /// Query for all subacccounts. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_subaccounts(&mut self) -> Result, Error> { + let req = QueryAllSubaccountRequest { pagination: None }; + let subaccounts = self + .subaccounts + .subaccount_all(req) + .await? + .into_inner() + .subaccount; + Ok(subaccounts) + } + + /// Query for the subacccount. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_subaccount( + &mut self, + subaccount: &Subaccount, + ) -> Result { + let req = QueryGetSubaccountRequest { + owner: subaccount.address.to_string(), + number: subaccount.number.0, + }; + let subaccount = self + .subaccounts + .subaccount(req) + .await? + .into_inner() + .subaccount + .ok_or_else(|| err!("Subaccount query response does not contain subaccount info"))?; + Ok(subaccount) + } + + /// Query for the orderbook pair by its id. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_clob_pair(&mut self, pair_id: u32) -> Result { + let req = QueryGetClobPairRequest { id: pair_id }; + let clob_pair = self + .clob + .clob_pair(req) + .await? + .into_inner() + .clob_pair + .ok_or_else(|| err!("Clob pair {pair_id} query response does not contain clob pair"))?; + Ok(clob_pair) + } + + /// Query for all orderbook pairs. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_clob_pairs( + &mut self, + pagination: Option, + ) -> Result, Error> { + let req = QueryAllClobPairRequest { pagination }; + let clob_pairs = self.clob.clob_pair_all(req).await?.into_inner().clob_pair; + Ok(clob_pairs) + } + + /// Query for the market price. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_price(&mut self, market_id: u32) -> Result { + let req = QueryMarketPriceRequest { id: market_id }; + let price = self + .prices + .market_price(req) + .await? + .into_inner() + .market_price + .ok_or_else(|| { + err!("Market {market_id} price query response does not contain price") + })?; + Ok(price) + } + + /// Query for all markets prices. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_prices( + &mut self, + pagination: Option, + ) -> Result, Error> { + let req = QueryAllMarketPricesRequest { pagination }; + let prices = self + .prices + .all_market_prices(req) + .await? + .into_inner() + .market_prices; + Ok(prices) + } + + /// Query for the perpetual. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_perpetual(&mut self, perpetual_id: u32) -> Result { + let req = QueryPerpetualRequest { id: perpetual_id }; + let perpetual = self + .perpetuals + .perpetual(req) + .await? + .into_inner() + .perpetual + .ok_or_else(|| { + err!("Perpetual {perpetual_id} query response does not contain perpetual") + })?; + Ok(perpetual) + } + + /// Query for all perpetuals. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_perpetuals( + &mut self, + pagination: Option, + ) -> Result, Error> { + let req = QueryAllPerpetualsRequest { pagination }; + let perpetuals = self + .perpetuals + .all_perpetuals(req) + .await? + .into_inner() + .perpetual; + Ok(perpetuals) + } + + /// Query for [`EquityTierLimitConfiguration`]. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_equity_tier_limit_config( + &mut self, + ) -> Result { + let req = QueryEquityTierLimitConfigurationRequest {}; + let etlc = self + .clob + .equity_tier_limit_configuration(req) + .await? + .into_inner() + .equity_tier_limit_config + .ok_or_else(|| { + err!("Equity tier limit config query response does not contain config") + })?; + Ok(etlc) + } + + /// Query for [all delegations](https://github.com/cosmos/cosmos-sdk/tree/main/x/staking#delegatordelegations) + /// of a given delegator address. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_delegator_delegations( + &mut self, + delegator_address: Address, + pagination: Option, + ) -> Result, Error> { + let req = QueryDelegatorDelegationsRequest { + delegator_addr: delegator_address.to_string(), + pagination, + }; + let delegations = self + .staking + .delegator_delegations(req) + .await? + .into_inner() + .delegation_responses; + Ok(delegations) + } + + /// Query for [all unbonding delegations](https://github.com/cosmos/cosmos-sdk/tree/main/x/staking#delegatorunbondingdelegations) + /// of a given delegator address. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_delegator_unbonding_delegations( + &mut self, + delegator_address: Address, + pagination: Option, + ) -> Result, Error> { + let req = QueryDelegatorUnbondingDelegationsRequest { + delegator_addr: delegator_address.to_string(), + pagination, + }; + let responses = self + .staking + .delegator_unbonding_delegations(req) + .await? + .into_inner() + .unbonding_responses; + Ok(responses) + } + + /// Query for delayed bridge messages for the address. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_delayed_complete_bridge_messages( + &mut self, + address: Address, + ) -> Result, Error> { + let req = QueryDelayedCompleteBridgeMessagesRequest { + address: address.to_string(), + }; + let messages = self + .bridge + .delayed_complete_bridge_messages(req) + .await? + .into_inner() + .messages; + Ok(messages) + } + + /// Query for fee tiers for perpetuals. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_fee_tiers(&mut self) -> Result, Error> { + let req = QueryPerpetualFeeParamsRequest {}; + let tiers = self + .feetiers + .perpetual_fee_params(req) + .await? + .into_inner() + .params + .ok_or_else(|| err!("Fee tiers query response does not contain params"))? + .tiers; + Ok(tiers) + } + + /// Query for perpetual fee tier for the address. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_user_fee_tier(&mut self, address: Address) -> Result { + let req = QueryUserFeeTierRequest { + user: address.to_string(), + }; + let tier = self + .feetiers + .user_fee_tier(req) + .await? + .into_inner() + .tier + .ok_or_else(|| err!("User fee tier query response does not contain tier"))?; + Ok(tier) + } + + /// Query for rewards params. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/validator_get.rs). + pub async fn get_rewards_params(&mut self) -> Result { + let req = rewards::QueryParamsRequest {}; + let params = self + .rewards + .params(req) + .await? + .into_inner() + .params + .ok_or_else(|| err!("Rewards query response does not contain params"))?; + Ok(params) + } +} diff --git a/v4-client-rs/client/src/node/client/mod.rs b/v4-client-rs/client/src/node/client/mod.rs new file mode 100644 index 00000000..10410c23 --- /dev/null +++ b/v4-client-rs/client/src/node/client/mod.rs @@ -0,0 +1,683 @@ +pub mod error; +mod megavault; +mod methods; + +use super::{ + builder::TxBuilder, config::NodeConfig, order::*, sequencer::*, utils::*, wallet::Account, +}; +use megavault::MegaVault; + +pub use crate::indexer::{ + Address, ClientId, Height, OrderFlags, Subaccount, Ticker, Tokenized, Usdc, +}; +use anyhow::{anyhow as err, Error, Result}; +use bigdecimal::{ + num_bigint::{BigInt, Sign}, + BigDecimal, Signed, +}; +#[cfg(feature = "noble")] +use chrono::{TimeDelta, Utc}; +use cosmrs::tx::{self, Tx}; +use derive_more::{Deref, DerefMut}; +use dydx_proto::{ + cosmos_sdk_proto::cosmos::{ + auth::v1beta1::query_client::QueryClient as AuthClient, + bank::v1beta1::{query_client::QueryClient as BankClient, MsgSend}, + base::{ + abci::v1beta1::GasInfo, + tendermint::v1beta1::service_client::ServiceClient as BaseClient, + }, + staking::v1beta1::query_client::QueryClient as StakingClient, + tx::v1beta1::{ + service_client::ServiceClient as TxClient, BroadcastMode, BroadcastTxRequest, + GetTxRequest, SimulateRequest, + }, + }, + dydxprotocol::{ + bridge::query_client::QueryClient as BridgeClient, + clob::{ + query_client::QueryClient as ClobClient, MsgBatchCancel, MsgCancelOrder, MsgPlaceOrder, + Order, OrderBatch, + }, + feetiers::query_client::QueryClient as FeeTiersClient, + listing::MsgCreateMarketPermissionless, + perpetuals::query_client::QueryClient as PerpetualsClient, + prices::query_client::QueryClient as PricesClient, + rewards::query_client::QueryClient as RewardsClient, + sending::{MsgCreateTransfer, MsgDepositToSubaccount, MsgWithdrawFromSubaccount, Transfer}, + stats::query_client::QueryClient as StatsClient, + subaccounts::{query_client::QueryClient as SubaccountsClient, SubaccountId}, + vault::query_client::QueryClient as VaultClient, + }, + ToAny, +}; +pub use error::*; +#[cfg(feature = "noble")] +use ibc_proto::{ + cosmos::base::v1beta1::Coin as IbcProtoCoin, + ibc::applications::transfer::v1::MsgTransfer as IbcMsgTransfer, +}; +use std::iter; +use tokio::time::{sleep, Duration}; +use tonic::{ + transport::{Channel, ClientTlsConfig}, + Code, +}; +use tower::timeout::Timeout; + +#[cfg(feature = "telemetry")] +use crate::telemetry::{ + LatencyMetric, TELEMETRY_BATCH_CANCEL_ORDER_DURATION, TELEMETRY_CANCEL_ORDER_DURATION, + TELEMETRY_DESC_BATCH_CANCEL_ORDER_DURATION, TELEMETRY_DESC_CANCEL_ORDER_DURATION, + TELEMETRY_DESC_ORDERS_CANCELLED, TELEMETRY_DESC_ORDERS_PLACED, + TELEMETRY_DESC_PLACE_ORDER_DURATION, TELEMETRY_DESC_QUERY_TX_DURATION, TELEMETRY_LABEL_ADDRESS, + TELEMETRY_ORDERS_CANCELLED, TELEMETRY_ORDERS_PLACED, TELEMETRY_PLACE_ORDER_DURATION, + TELEMETRY_QUERY_TX_DURATION, +}; + +const DEFAULT_QUERY_TIMEOUT_SECS: u64 = 15; +const DEFAULT_QUERY_INTERVAL_SECS: u64 = 2; + +/// Transaction hash. +/// +/// internally Cosmos uses tendermint::Hash +pub type TxHash = String; + +/// Wrapper over standard [Cosmos modules](https://github.com/cosmos/cosmos-sdk/tree/main/x) clients +/// and [dYdX modules](https://github.com/dydxprotocol/v4-chain/tree/main/protocol/x) clients. +pub struct Routes { + /// Authentication of accounts and transactions for Cosmos SDK applications. + pub auth: AuthClient>, + /// Token transfer functionalities. + pub bank: BankClient>, + /// Basic network information. + pub base: BaseClient>, + /// dYdX bridge to Ethereum + pub bridge: BridgeClient>, + /// dYdX orderbook + pub clob: ClobClient>, + /// dYdX fees + pub feetiers: FeeTiersClient>, + /// dYdX perpetuals + pub perpetuals: PerpetualsClient>, + /// dYdX prices + pub prices: PricesClient>, + /// dYdX rewards + pub rewards: RewardsClient>, + /// Proof-of-Stake layer for public blockchains. + pub staking: StakingClient>, + /// dYdX stats + pub stats: StatsClient>, + /// dYdX subaccounts + pub subaccounts: SubaccountsClient>, + /// Tx utilities for the Cosmos SDK. + pub tx: TxClient>, + /// Vaults + pub vault: VaultClient>, +} + +impl Routes { + /// Creates new modules clients wrapper. + pub fn new(channel: Timeout) -> Self { + Self { + auth: AuthClient::new(channel.clone()), + bank: BankClient::new(channel.clone()), + base: BaseClient::new(channel.clone()), + bridge: BridgeClient::new(channel.clone()), + clob: ClobClient::new(channel.clone()), + feetiers: FeeTiersClient::new(channel.clone()), + perpetuals: PerpetualsClient::new(channel.clone()), + prices: PricesClient::new(channel.clone()), + rewards: RewardsClient::new(channel.clone()), + staking: StakingClient::new(channel.clone()), + stats: StatsClient::new(channel.clone()), + subaccounts: SubaccountsClient::new(channel.clone()), + tx: TxClient::new(channel.clone()), + vault: VaultClient::new(channel), + } + } +} + +/// Node (validator) client. +/// +/// Serves to manage [orders](OrderBuilder) and funds, query transactions. +#[derive(Deref, DerefMut)] +pub struct NodeClient { + config: NodeConfig, + /// Transactions builder. + pub builder: TxBuilder, + #[deref] + #[deref_mut] + routes: Routes, + sequencer: Box, +} + +impl NodeClient { + /// Connect to the node. + pub async fn connect(config: NodeConfig) -> Result { + let tls = ClientTlsConfig::new().with_native_roots(); + let endpoint = config.endpoint.clone(); + let channel = Channel::from_shared(endpoint)? + .tls_config(tls)? + .connect() + .await?; + let timeout = Duration::from_millis(config.timeout); + let timeout_channel = Timeout::new(channel, timeout); + let chain_id = config.chain_id.clone().try_into()?; + let builder = TxBuilder::new(chain_id, config.fee_denom.clone()); + let sequencer = Box::new(QueryingSequencer::new(timeout_channel.clone())); + + #[cfg(feature = "telemetry")] + { + metrics::describe_counter!( + TELEMETRY_ORDERS_PLACED, + metrics::Unit::Count, + TELEMETRY_DESC_ORDERS_PLACED + ); + metrics::describe_counter!( + TELEMETRY_ORDERS_CANCELLED, + metrics::Unit::Count, + TELEMETRY_DESC_ORDERS_CANCELLED + ); + metrics::describe_histogram!( + TELEMETRY_PLACE_ORDER_DURATION, + metrics::Unit::Milliseconds, + TELEMETRY_DESC_PLACE_ORDER_DURATION + ); + metrics::describe_histogram!( + TELEMETRY_CANCEL_ORDER_DURATION, + metrics::Unit::Milliseconds, + TELEMETRY_DESC_CANCEL_ORDER_DURATION + ); + metrics::describe_histogram!( + TELEMETRY_BATCH_CANCEL_ORDER_DURATION, + metrics::Unit::Milliseconds, + TELEMETRY_DESC_BATCH_CANCEL_ORDER_DURATION + ); + metrics::describe_histogram!( + TELEMETRY_QUERY_TX_DURATION, + metrics::Unit::Milliseconds, + TELEMETRY_DESC_QUERY_TX_DURATION + ); + } + + Ok(Self { + config, + builder, + routes: Routes::new(timeout_channel), + sequencer, + }) + } + + /// Set `NodeClient`'s account sequence number mechanism + pub fn with_sequencer(&mut self, sequencer: impl Sequencer) { + self.sequencer = Box::new(sequencer); + } + + /// Place [`Order`]. + /// + /// Check [the short-order example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/place_order_short_term.rs) + /// and [the long-term order example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/place_order_long_term.rs). + pub async fn place_order( + &mut self, + account: &mut Account, + order: Order, + ) -> Result { + #[cfg(feature = "telemetry")] + LatencyMetric::new(TELEMETRY_PLACE_ORDER_DURATION); + let is_short_term = order + .order_id + .as_ref() + .is_some_and(|id| id.order_flags == OrderFlags::ShortTerm as u32); + + let msg = MsgPlaceOrder { order: Some(order) }; + + let tx_raw = self + .create_base_transaction(account, msg, !is_short_term) + .await?; + + let tx_hash = self.broadcast_transaction(tx_raw).await?; + + #[cfg(feature = "telemetry")] + { + let address = account.address(); + metrics::counter!( + TELEMETRY_ORDERS_PLACED, + &[(TELEMETRY_LABEL_ADDRESS, address.to_string())] + ) + .increment(1); + } + + Ok(tx_hash) + } + + /// Cancel [`Order`]. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/cancel_order.rs). + pub async fn cancel_order( + &mut self, + account: &mut Account, + order_id: OrderId, + until: impl Into, + ) -> Result { + #[cfg(feature = "telemetry")] + LatencyMetric::new(TELEMETRY_CANCEL_ORDER_DURATION); + + let until = until.into(); + let msg = MsgCancelOrder { + order_id: Some(order_id), + good_til_oneof: Some(until.try_into()?), + }; + + let tx_raw = self.create_base_transaction(account, msg, true).await?; + + let tx_hash = self.broadcast_transaction(tx_raw).await?; + + #[cfg(feature = "telemetry")] + { + let address = account.address(); + metrics::counter!( + TELEMETRY_ORDERS_CANCELLED, + &[(TELEMETRY_LABEL_ADDRESS, address.to_string())] + ) + .increment(1); + } + + Ok(tx_hash) + } + + /// Cancel a batch of short-terms [`Order`]s. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/batch_cancel_orders.rs). + pub async fn batch_cancel_orders( + &mut self, + account: &mut Account, + subaccount: Subaccount, + short_term_cancels: Vec, + until_block: Height, + ) -> Result { + #[cfg(feature = "telemetry")] + LatencyMetric::new(TELEMETRY_BATCH_CANCEL_ORDER_DURATION); + + #[cfg(feature = "telemetry")] + let count: u64 = short_term_cancels + .iter() + .map(|batch| batch.client_ids.len() as u64) + .sum(); + + let msg = MsgBatchCancel { + subaccount_id: Some(subaccount.into()), + short_term_cancels, + good_til_block: until_block.0, + }; + + let tx_raw = self.create_base_transaction(account, msg, true).await?; + + let tx_hash = self.broadcast_transaction(tx_raw).await?; + + #[cfg(feature = "telemetry")] + { + let address = account.address(); + metrics::counter!( + TELEMETRY_ORDERS_CANCELLED, + &[(TELEMETRY_LABEL_ADDRESS, address.to_string())] + ) + .increment(count); + } + + Ok(tx_hash) + } + + /// Deposit funds (USDC) from the address to the subaccount. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/deposit.rs). + pub async fn deposit( + &mut self, + account: &mut Account, + sender: Address, + recipient: Subaccount, + amount: impl Into, + ) -> Result { + let msg = MsgDepositToSubaccount { + sender: sender.to_string(), + recipient: Some(recipient.into()), + asset_id: 0, + quantums: amount.into().quantize_as_u64()?, + }; + + let tx_raw = self.create_transaction(account, msg).await?; + + self.broadcast_transaction(tx_raw).await + } + + /// Withdraw funds (USDC) from the subaccount to the address. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/withdraw.rs). + pub async fn withdraw( + &mut self, + account: &mut Account, + sender: Subaccount, + recipient: Address, + amount: impl Into, + ) -> Result { + let msg = MsgWithdrawFromSubaccount { + sender: Some(sender.into()), + recipient: recipient.to_string(), + asset_id: 0, + quantums: amount.into().quantize_as_u64()?, + }; + + let tx_raw = self.create_transaction(account, msg).await?; + + self.broadcast_transaction(tx_raw).await + } + + /// Transfer funds (USDC) between subaccounts. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/transfer.rs). + pub async fn transfer( + &mut self, + account: &mut Account, + sender: Subaccount, + recipient: Subaccount, + amount: impl Into, + ) -> Result { + let transfer = Transfer { + sender: Some(sender.into()), + recipient: Some(recipient.into()), + asset_id: 0, + amount: amount.into().quantize_as_u64()?, + }; + let msg = MsgCreateTransfer { + transfer: Some(transfer), + }; + + let tx_raw = self.create_transaction(account, msg).await?; + + self.broadcast_transaction(tx_raw).await + } + + /// Transfer a token asset from one address to another one. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/send_token.rs). + pub async fn send_token( + &mut self, + account: &mut Account, + sender: Address, + recipient: Address, + token: impl Tokenized, + ) -> Result { + let msg = MsgSend { + from_address: sender.to_string(), + to_address: recipient.to_string(), + amount: vec![token.coin()?], + }; + + let tx_raw = self.create_transaction(account, msg).await?; + + self.broadcast_transaction(tx_raw).await + } + + /// Transfer a token asset between blockchain networks. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/noble_transfer.rs). + #[cfg(feature = "noble")] + pub async fn send_token_ibc( + &mut self, + account: &mut Account, + sender: Address, + recipient: Address, + token: impl Tokenized, + source_channel: String, + ) -> Result { + let coin = token.coin()?; + let timeout = (Utc::now() + TimeDelta::seconds(60)) + .timestamp_nanos_opt() + .ok_or_else(|| err!("Failed calculating timeout ns timestamp"))? + .try_into() + .map_err(|e| err!("Failed converting timestamp into u64: {e}"))?; + + let msg = IbcMsgTransfer { + receiver: recipient.to_string(), + sender: sender.to_string(), + source_port: "transfer".to_string(), + source_channel, + timeout_timestamp: timeout, + token: Some(IbcProtoCoin { + amount: coin.amount, + denom: coin.denom, + }), + timeout_height: None, + memo: Default::default(), + }; + + let tx_raw = self.create_transaction(account, msg).await?; + + self.broadcast_transaction(tx_raw).await + } + + /// Close position for a given market. + /// + /// Opposite short-term market orders are used. + /// If provided, the position is only reduced by a size of `reduce_by`. + /// Note that at the moment dYdX [doesn't support](https://dydx.exchange/faq) spot trading. + /// + /// Check [the first example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/close_position.rs) + /// and [the second example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/close_all_positions.rs). + pub async fn close_position( + &mut self, + account: &mut Account, + subaccount: Subaccount, + market_params: impl Into, + reduce_by: Option, + client_id: impl Into, + ) -> Result, NodeError> { + let subaccount_info = self.get_subaccount(&subaccount).await?; + let market_params = market_params.into(); + let quantums_opt = subaccount_info + .perpetual_positions + .into_iter() + .find(|pos| pos.perpetual_id == market_params.clob_pair_id.0) + .map(|pos| BigInt::from_serializable_int(&pos.quantums)) + .transpose()?; + + let (side, size) = if let Some(quantums) = quantums_opt { + let side = match quantums.sign() { + Sign::Plus => OrderSide::Sell, + Sign::Minus => OrderSide::Buy, + _ => return Ok(None), + }; + let mut size = market_params.dequantize_quantums(quantums.abs()); + if let Some(reduce_by) = reduce_by { + // The quantity to reduce by should not be larger than the + // current position + size = size.min(reduce_by); + } + (side, size) + } else { + return Ok(None); + }; + + let height = self.get_latest_block_height().await?; + + let (_, order) = OrderBuilder::new(market_params, subaccount.clone()) + .market(side, size) + .until(height.ahead(SHORT_TERM_ORDER_MAXIMUM_LIFETIME)) + .build(client_id.into())?; + let tx_hash = self.place_order(account, order).await?; + + Ok(Some(tx_hash)) + } + + /// Access the vaults requests dispatcher + pub fn megavault(&mut self) -> MegaVault { + MegaVault::new(self) + } + + /// Create a market permissionless + pub async fn create_market_permissionless( + &mut self, + account: &mut Account, + ticker: &Ticker, + subaccount: &Subaccount, + ) -> Result { + let subaccount_id = SubaccountId { + owner: subaccount.address.to_string(), + number: subaccount.number.0, + }; + let msg = MsgCreateMarketPermissionless { + ticker: ticker.to_string(), + subaccount_id: Some(subaccount_id), + }; + + let tx_raw = self.create_transaction(account, msg).await?; + + self.broadcast_transaction(tx_raw).await + } + + /// Simulate a transaction. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/withdraw_other.rs). + pub async fn simulate(&mut self, tx_raw: &tx::Raw) -> Result { + let request = SimulateRequest { + tx_bytes: tx_raw + .to_bytes() + .map_err(|e| err!("Raw Tx to bytes failed: {}", e))?, + ..Default::default() + }; + + // Move to client/methods.rs + self.tx + .simulate(request) + .await + .map_err(BroadcastError::from)? + .into_inner() + .gas_info + .ok_or_else(|| err!("Tx simulation request failed, gas info should exist.").into()) + } + + /// Fetch account's number and sequence number from the network. + pub async fn query_address(&mut self, address: &Address) -> Result<(u64, u64), Error> { + self.get_account(address) + .await + .map(|res| (res.account_number, res.sequence)) + } + + /// Create a transaction. + pub async fn create_transaction( + &mut self, + account: &mut Account, + msg: impl ToAny, + ) -> Result { + let tx_raw = self.create_base_transaction(account, msg, true).await?; + let tx_bytes = tx_raw + .to_bytes() + .map_err(|e| err!("Raw Tx to bytes failed: {e}"))?; + let tx = Tx::from_bytes(&tx_bytes) + .map_err(|e| err!("Failed to decode received Tx bytes: {e}"))?; + + let simulated = self.simulate(&tx_raw).await?; + let gas = simulated.gas_used; + let fee = self.builder.calculate_fee(Some(gas))?; + self.builder + .build_transaction(account, tx.body.messages, Some(fee)) + .map_err(|e| e.into()) + } + + async fn create_base_transaction( + &mut self, + account: &mut Account, + msg: impl ToAny, + seqnum_required: bool, + ) -> Result { + if seqnum_required && self.config.manage_sequencing { + let nonce = self.sequencer.next_nonce(account.address()).await?; + account.set_next_nonce(nonce); + } else if !seqnum_required { + account.set_next_nonce(Nonce::Sequence(account.sequence_number())) + } + + self.builder + .build_transaction(account, iter::once(msg.to_any()), None) + } + + /// Broadcast a transaction + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/withdraw_other.rs). + pub async fn broadcast_transaction(&mut self, tx_raw: tx::Raw) -> Result { + let request = BroadcastTxRequest { + tx_bytes: tx_raw + .to_bytes() + .map_err(|e| err!("Raw Tx to bytes failed: {}", e))?, + mode: BroadcastMode::Sync.into(), + }; + + let response = self + .tx + .broadcast_tx(request) + .await + .map_err(BroadcastError::from)? + .into_inner() + .tx_response + .ok_or_else(|| err!("Tx not present in broadcast response"))?; + + if response.code == 0 { + Ok(response.txhash) + } else { + Err(NodeError::Broadcast(BroadcastError { + code: Some(response.code), + message: response.raw_log, + })) + } + } + + /// Query the network for a transaction + pub async fn query_transaction(&mut self, tx_hash: &TxHash) -> Result { + #[cfg(feature = "telemetry")] + LatencyMetric::new(TELEMETRY_QUERY_TX_DURATION); + + let attempts = DEFAULT_QUERY_TIMEOUT_SECS / DEFAULT_QUERY_INTERVAL_SECS; + for _ in 0..attempts { + match self + .tx + .get_tx(GetTxRequest { + hash: tx_hash.clone(), + }) + .await + { + Ok(r) => { + let response = r + .into_inner() + .tx_response + .ok_or_else(|| err!("Tx not present in broadcast response"))?; + let tx_bytes = response + .tx + .ok_or_else(|| err!("TxResponse does not contain Tx bytes!"))? + .value; + let tx = Tx::from_bytes(&tx_bytes) + .map_err(|e| err!("Failed to decode received Tx bytes: {e}"))?; + return Ok(tx); + } + Err(status) if status.code() == Code::NotFound => { + sleep(Duration::from_secs(DEFAULT_QUERY_INTERVAL_SECS)).await; + } + Err(status) => { + return Err(err!("Error querying Tx {tx_hash}: {status}")); + } + } + } + Err(err!("Tx {tx_hash} not found after timeout")) + } + + /// Query the network for a transaction result + pub async fn query_transaction_result( + &mut self, + tx_hash: Result, + ) -> Result, Error> { + match tx_hash { + Ok(tx_hash) => self.query_transaction(&tx_hash).await.map(Some), + Err(NodeError::Broadcast(err)) if err.get_collateral_reason().is_some() => Ok(None), + Err(err) => Err(err.into()), + } + } +} diff --git a/v4-client-rs/client/src/node/config.rs b/v4-client-rs/client/src/node/config.rs new file mode 100644 index 00000000..4461adad --- /dev/null +++ b/v4-client-rs/client/src/node/config.rs @@ -0,0 +1,37 @@ +use crate::indexer::Denom; +use crate::node::ChainId; +use serde::Deserialize; + +/// Configuration for [`NodeClient`](crate::node::NodeClient) +#[derive(Clone, Debug, Deserialize)] +pub struct NodeConfig { + /// Node endpoint. + /// + /// You can select other gRPC endpoints from [the list](https://docs.dydx.exchange/infrastructure_providers-network/resources#full-node-endpoints). + pub endpoint: String, + /// [`Timeout`](tower::timeout::Timeout) applied to requests, in milliseconds. + #[serde(default = "default_timeout")] + pub timeout: u64, + /// [`ChainId`] to specify the chain. + pub chain_id: ChainId, + /// Fee [`Denom`]. + /// + /// See also [Understand IBC Denoms](https://tutorials.cosmos.network/tutorials/6-ibc-dev/). + pub fee_denom: Denom, + /// Have NodeClient manage transaction sequence numbering. + /// + /// Long-term (stateful) orders require managing a sequence number for an account. + /// Either the client manages it automatically via quering the network for the next + /// sequence number or it is a responsibility of a user. + /// It is a [replay prevention](https://docs.dydx.exchange/api_integration-trading/short_term_vs_stateful). + #[serde(default = "default_manage_sequencing")] + pub manage_sequencing: bool, +} + +fn default_timeout() -> u64 { + 1_000 +} + +fn default_manage_sequencing() -> bool { + true +} diff --git a/v4-client-rs/client/src/node/fee.rs b/v4-client-rs/client/src/node/fee.rs new file mode 100644 index 00000000..df89a367 --- /dev/null +++ b/v4-client-rs/client/src/node/fee.rs @@ -0,0 +1,43 @@ +use crate::indexer::Denom; +use anyhow::{anyhow as err, Result}; +use bigdecimal::{ + num_traits::{FromPrimitive, ToPrimitive}, + rounding::RoundingMode, + BigDecimal, +}; +use cosmrs::{tx::Fee, Coin}; + +/// Gas ajdustement value to avoid rejected transactions caused by gas understimation. +const GAS_MULTIPLIER: f64 = 1.4; + +pub(crate) fn default() -> Fee { + Fee { + amount: vec![], + gas_limit: 0, + payer: None, + granter: None, + } +} + +pub(crate) fn calculate(gas_used: u64, denom: &Denom) -> Result { + if let Some(gas_price) = denom.gas_price() { + let gas_multiplier = BigDecimal::from_f64(GAS_MULTIPLIER) + .ok_or_else(|| err!("Failed converting gas multiplier to BigDecimal"))?; + let gas_limit = gas_used * gas_multiplier; + // Ceil to avoid underestimation + let amount = (gas_price * &gas_limit).with_scale_round(0, RoundingMode::Up); + Ok(Fee::from_amount_and_gas( + Coin { + amount: amount + .to_u128() + .ok_or_else(|| err!("Failed converting gas cost to u128"))?, + denom: denom.clone().try_into()?, + }, + gas_limit + .to_u64() + .ok_or_else(|| err!("Failed converting gas limit to u64"))?, + )) + } else { + Err(err!("{denom:?} cannot be used to cover gas fees")) + } +} diff --git a/v4-client-rs/client/src/node/mod.rs b/v4-client-rs/client/src/node/mod.rs new file mode 100644 index 00000000..cc5f2429 --- /dev/null +++ b/v4-client-rs/client/src/node/mod.rs @@ -0,0 +1,18 @@ +mod builder; +mod client; +mod config; +mod fee; +mod order; +/// Account number sequencing mechanisms +pub mod sequencer; +mod types; +mod utils; +mod wallet; + +pub use builder::TxBuilder; +pub use client::{error::*, Address, NodeClient, Subaccount, TxHash}; +pub use config::NodeConfig; +pub use order::*; +pub use types::ChainId; +pub use utils::BigIntExt; +pub use wallet::{Account, Wallet}; diff --git a/v4-client-rs/client/src/node/order.rs b/v4-client-rs/client/src/node/order.rs new file mode 100644 index 00000000..b9f8acda --- /dev/null +++ b/v4-client-rs/client/src/node/order.rs @@ -0,0 +1,616 @@ +use crate::indexer::{ + ClientId, ClobPairId, Height, OrderExecution, OrderFlags, OrderType, PerpetualMarket, Price, + Quantity, Subaccount, +}; +use anyhow::{anyhow as err, Error}; +use bigdecimal::{num_traits::cast::ToPrimitive, BigDecimal, One}; +use chrono::{DateTime, Utc}; +use derive_more::From; +pub use dydx_proto::dydxprotocol::clob::{ + order::{Side as OrderSide, TimeInForce as OrderTimeInForce}, + OrderId, +}; +use dydx_proto::dydxprotocol::{ + clob::{ + msg_cancel_order, + order::{self, ConditionType}, + Order, + }, + subaccounts::SubaccountId, +}; + +/// Maximum short-term orders lifetime. +/// +/// See also [short-term vs long-term orders](https://help.dydx.trade/en/articles/166985-short-term-vs-long-term-order-types). +pub const SHORT_TERM_ORDER_MAXIMUM_LIFETIME: u32 = 20; + +/// Value used to identify the Rust client. +pub const DEFAULT_RUST_CLIENT_METADATA: u32 = 4; + +/// Order [expirations](https://docs.dydx.exchange/api_integration-trading/short_term_vs_stateful). +#[derive(From, Clone, Debug)] +pub enum OrderGoodUntil { + /// Block expiratin is used for short-term orders. + Block(Height), + /// Time expiratin is used for long-term orders. + Time(DateTime), +} + +impl TryFrom for order::GoodTilOneof { + type Error = Error; + fn try_from(until: OrderGoodUntil) -> Result { + match until { + OrderGoodUntil::Block(height) => Ok(Self::GoodTilBlock(height.0)), + OrderGoodUntil::Time(time) => Ok(Self::GoodTilBlockTime(time.timestamp().try_into()?)), + } + } +} + +impl TryFrom for msg_cancel_order::GoodTilOneof { + type Error = Error; + fn try_from(until: OrderGoodUntil) -> Result { + match until { + OrderGoodUntil::Block(height) => Ok(Self::GoodTilBlock(height.0)), + OrderGoodUntil::Time(time) => Ok(Self::GoodTilBlockTime(time.timestamp().try_into()?)), + } + } +} + +/// Market parameters required to perform price and size quantizations. +/// These quantizations are required for `Order` placement. +/// +/// See also [how to interpret block data for trades](https://docs.dydx.exchange/api_integration-guides/how_to_interpret_block_data_for_trades). +#[derive(Clone, Debug)] +pub struct OrderMarketParams { + /// Atomic resolution + pub atomic_resolution: i32, + /// Clob pair id. + pub clob_pair_id: ClobPairId, + /// Oracle price. + pub oracle_price: Option, + /// Quantum conversion exponent. + pub quantum_conversion_exponent: i32, + /// Step base quantums. + pub step_base_quantums: u64, + /// Subticks per tick. + pub subticks_per_tick: u32, +} + +impl OrderMarketParams { + /// Convert price into subticks. + pub fn quantize_price(&self, price: impl Into) -> BigDecimal { + const QUOTE_QUANTUMS_ATOMIC_RESOLUTION: i32 = -6; + let scale = -(self.atomic_resolution + - self.quantum_conversion_exponent + - QUOTE_QUANTUMS_ATOMIC_RESOLUTION); + let factor = BigDecimal::new(One::one(), scale.into()); + let raw_subticks = price.into().0 * factor; + let subticks_per_tick = BigDecimal::from(self.subticks_per_tick); + let quantums = quantize(&raw_subticks, &subticks_per_tick); + quantums.max(subticks_per_tick) + } + + /// Convert decimal into quantums. + pub fn quantize_quantity(&self, quantity: impl Into) -> BigDecimal { + let factor = BigDecimal::new(One::one(), self.atomic_resolution.into()); + let raw_quantums = quantity.into().0 * factor; + let step_base_quantums = BigDecimal::from(self.step_base_quantums); + let quantums = quantize(&raw_quantums, &step_base_quantums); + quantums.max(step_base_quantums) + } + + /// Convert subticks into decimal. + pub fn dequantize_subticks(&self, subticks: impl Into) -> BigDecimal { + const QUOTE_QUANTUMS_ATOMIC_RESOLUTION: i32 = -6; + let scale = -(self.atomic_resolution + - self.quantum_conversion_exponent + - QUOTE_QUANTUMS_ATOMIC_RESOLUTION); + let factor = BigDecimal::new(One::one(), scale.into()); + subticks.into() / factor + } + + /// Convert quantums into decimal. + pub fn dequantize_quantums(&self, quantums: impl Into) -> BigDecimal { + let factor = BigDecimal::new(One::one(), self.atomic_resolution.into()); + quantums.into() / factor + } + + /// Get orderbook pair id. + pub fn clob_pair_id(&self) -> &ClobPairId { + &self.clob_pair_id + } +} + +/// A `round`-line function that quantize a `value` to the `fraction`. +fn quantize(value: &BigDecimal, fraction: &BigDecimal) -> BigDecimal { + (value / fraction).round(0) * fraction +} + +impl From for OrderMarketParams { + fn from(market: PerpetualMarket) -> Self { + Self { + atomic_resolution: market.atomic_resolution, + clob_pair_id: market.clob_pair_id, + oracle_price: market.oracle_price, + quantum_conversion_exponent: market.quantum_conversion_exponent, + step_base_quantums: market.step_base_quantums, + subticks_per_tick: market.subticks_per_tick, + } + } +} + +/// [`Order`] builder. +/// +/// Note that the price input to the `OrderBuilder` is in the "common" units of the perpetual/currency, not the quantized/atomic value. +/// +/// Two main classes of orders in dYdX from persistence perspective are +/// [short-term and long-term (stateful) orders](https://docs.dydx.exchange/api_integration-trading/short_term_vs_stateful). +/// +/// For different types of orders +/// see also [Stop-Limit Versus Stop-Loss](https://dydx.exchange/crypto-learning/stop-limit-versus-stop-loss) and +/// [Perpetual order types on dYdX Chain](https://help.dydx.trade/en/articles/166981-perpetual-order-types-on-dydx-chain). +#[derive(Clone, Debug)] +pub struct OrderBuilder { + market_params: OrderMarketParams, + #[allow(dead_code)] // TODO remove after completion + subaccount_id: SubaccountId, + flags: OrderFlags, + side: Option, + ty: Option, + size: Option, + price: Option, + time_in_force: Option, + reduce_only: Option, + until: Option, + post_only: Option, + execution: Option, + trigger_price: Option, + slippage: BigDecimal, +} + +impl OrderBuilder { + /// Create a new [`Order`] builder. + pub fn new(market_for: impl Into, subaccount: Subaccount) -> Self { + Self { + market_params: market_for.into(), + subaccount_id: subaccount.into(), + flags: OrderFlags::ShortTerm, + side: Some(OrderSide::Buy), + ty: Some(OrderType::Market), + size: None, + price: None, + time_in_force: None, + reduce_only: None, + until: None, + post_only: None, + execution: None, + trigger_price: None, + slippage: BigDecimal::new(5.into(), 2), + } + } + + /// Set as Market order. + /// + /// An instruction to immediately buy or sell an asset at the best available price when the order is placed. + pub fn market(mut self, side: impl Into, size: impl Into) -> Self { + self.ty = Some(OrderType::Market); + self.side = Some(side.into()); + self.size = Some(size.into()); + self + } + + /// Set as Limit order. + /// + /// With a limit order, a trader specifies the price at which they’re willing to buy or sell an asset. + /// Unlike market orders, limit orders don’t go into effect until the market price hits a trader’s “limit price.” + pub fn limit( + mut self, + side: impl Into, + price: impl Into, + size: impl Into, + ) -> Self { + self.ty = Some(OrderType::Limit); + self.price = Some(price.into()); + self.side = Some(side.into()); + self.size = Some(size.into()); + self + } + + /// Set as Stop Limit order + /// + /// Stop-limit orders use a stop `trigger_price` and a limit `price` to give investors greater control over their trades. + /// When setting up a stop-limit order, traders set a `trigger_price` when their order enters the market + /// and a limit `price` when they want the order to execute. + pub fn stop_limit( + mut self, + side: impl Into, + price: impl Into, + trigger_price: impl Into, + size: impl Into, + ) -> Self { + self.ty = Some(OrderType::StopLimit); + self.price = Some(price.into()); + self.trigger_price = Some(trigger_price.into()); + self.side = Some(side.into()); + self.size = Some(size.into()); + self.conditional() + } + + /// Set as Stop Market order. + /// + /// When using a stop order, the trader sets a `trigger_price` to trigger a buy or sell order on their exchange. + /// The moment that condition is met, it triggers a market order executed at the current market price. + /// This means that, unlike limit orders, the execution price of a stop order may be different from the price set by the trader. + pub fn stop_market( + mut self, + side: impl Into, + trigger_price: impl Into, + size: impl Into, + ) -> Self { + self.ty = Some(OrderType::StopMarket); + self.trigger_price = Some(trigger_price.into()); + self.side = Some(side.into()); + self.size = Some(size.into()); + self.conditional() + } + + /// Set as Take Profit Limit order. + /// + /// The order enters in force if the price reaches `trigger_price` and is executed at `price` after that. + pub fn take_profit_limit( + mut self, + side: impl Into, + price: impl Into, + trigger_price: impl Into, + size: impl Into, + ) -> Self { + self.ty = Some(OrderType::TakeProfit); + self.price = Some(price.into()); + self.trigger_price = Some(trigger_price.into()); + self.side = Some(side.into()); + self.size = Some(size.into()); + self.conditional() + } + + /// Set as Take Profit Market order. + /// + /// The order enters in force if the price reaches `trigger_price` and converst to an ordinary market order, + /// i.e. it is executed at the best available market price. + pub fn take_profit_market( + mut self, + side: impl Into, + trigger_price: impl Into, + size: impl Into, + ) -> Self { + self.ty = Some(OrderType::TakeProfitMarket); + self.trigger_price = Some(trigger_price.into()); + self.side = Some(side.into()); + self.size = Some(size.into()); + self.conditional() + } + + /// Set order as a long-term. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/place_order_long_term.rs). + pub fn long_term(mut self) -> Self { + self.flags = OrderFlags::LongTerm; + self + } + + /// Set order as a short-term. + /// + /// Check [the example](https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-rs/client/examples/place_order_short_term.rs). + pub fn short_term(mut self) -> Self { + self.flags = OrderFlags::ShortTerm; + self + } + + /// Set order as a conditional, triggered using `trigger_price`. + pub fn conditional(mut self) -> Self { + self.flags = OrderFlags::Conditional; + self + } + + /* Single setters */ + /// Set the limit price for Limit orders (and related types), + /// or the up-to allowed price for Market orders (and related types). + pub fn price(mut self, price: impl Into) -> Self { + self.price = Some(price.into()); + self + } + + /// [Position size](https://dydx.exchange/crypto-learning/glossary?#total-order-size). + pub fn size(mut self, size: impl Into) -> Self { + self.size = Some(size.into()); + self + } + + /// Set [time execution options](https://docs.dydx.exchange/api_integration-trading/order_types#time-in-force). + /// + /// Basically, it places of the order in the range between being + /// a Taker order and a Maker order. + /// + /// `IOC` (Taker) <---> `Unspecified` (Taker/Maker) <---> `Post` (Maker). + /// + /// See also [Market Makers vs Market Takers](https://dydx.exchange/crypto-learning/market-makers-vs-market-takers). + pub fn time_in_force(mut self, tif: impl Into) -> Self { + self.time_in_force = Some(tif.into()); + self + } + + /// Set an order as [reduce-only](https://docs.dydx.exchange/api_integration-trading/order_types#reduce-only-order-ro). + pub fn reduce_only(mut self, reduce: impl Into) -> Self { + self.reduce_only = Some(reduce.into()); + self + } + + /// Set order's expiration. + pub fn until(mut self, gtof: impl Into) -> Self { + self.until = Some(gtof.into()); + self + } + + /// Time execution pattern. + /// + /// See also [`OrderBuilder::time_in_force`]. + pub fn execution(mut self, execution: impl Into) -> Self { + self.execution = Some(execution.into()); + self + } + + /// Allowed slippage (%) for long term and conditional Market orders. + /// + /// Allowed price slippage is calculated based on the provided PerpetualMarket oracle price, + /// or, a user-provided `price()` taking precedence. + /// + /// See also [What is Slippage in Crypto?](https://dydx.exchange/crypto-learning/what-is-slippage-in-crypto). + pub fn allowed_slippage(mut self, slippage_percent: impl Into) -> Self { + self.slippage = slippage_percent.into() / 100.0; + self + } + + /// Update the generator's market. + /// + /// Note that at the moment dYdX [doesn't support](https://dydx.exchange/faq) spot trading. + pub fn update_market(&mut self, market_for: impl Into) { + self.market_params = market_for.into(); + } + + /// Update the generator's market oracle price. + pub fn update_market_price(&mut self, price: impl Into) { + self.market_params.oracle_price = Some(price.into()); + } + + /* Builder */ + /// Build an [`Order`] and a corresponding [`OrderId`]. + /// + /// `client_id` [impacts](https://docs.dydx.exchange/api_integration-clients/validator_client#replacing-an-order) an order id. + /// So it is important to provide its uniqueness as otherwise some orders may overwrite others. + pub fn build(self, client_id: impl Into) -> Result<(OrderId, Order), Error> { + let side = self + .side + .ok_or_else(|| err!("Missing Order side (Buy/Sell)"))?; + let size = self + .size + .as_ref() + .ok_or_else(|| err!("Missing Order size"))?; + let ty = self.ty.as_ref().ok_or_else(|| err!("Missing Order type"))?; + let post_only = self.post_only.as_ref().unwrap_or(&false); + let execution = self.execution.as_ref().unwrap_or(&OrderExecution::Default); + let time_in_force = ty.time_in_force( + &self.time_in_force.unwrap_or(OrderTimeInForce::Unspecified), + *post_only, + execution, + )?; + let reduce_only = *self.reduce_only.as_ref().unwrap_or(&false); + let until = self + .until + .as_ref() + .ok_or_else(|| err!("Missing Order until (good-til-oneof)"))?; + let quantums = self + .market_params + .quantize_quantity(size.clone()) + .to_u64() + .ok_or_else(|| err!("Failed converting BigDecimal size into u64"))?; + let conditional_order_trigger_subticks = match ty { + OrderType::StopLimit + | OrderType::StopMarket + | OrderType::TakeProfit + | OrderType::TakeProfitMarket => self + .market_params + .quantize_price( + self.trigger_price + .clone() + .ok_or_else(|| err!("Missing Order trigger price"))?, + ) + .to_u64() + .ok_or_else(|| err!("Failed converting BigDecimal trigger-price into u64"))?, + _ => 0, + }; + + let clob_pair_id = self.market_params.clob_pair_id().0; + + let order_id = OrderId { + subaccount_id: Some(self.subaccount_id.clone()), + client_id: client_id.into().0, + order_flags: self.flags.clone() as u32, + clob_pair_id, + }; + + let order = Order { + order_id: Some(order_id.clone()), + side: side.into(), + quantums, + subticks: self.calculate_subticks()?, + time_in_force: time_in_force.into(), + reduce_only, + client_metadata: DEFAULT_RUST_CLIENT_METADATA, + condition_type: ty.condition_type()?.into(), + conditional_order_trigger_subticks, + good_til_oneof: Some(until.clone().try_into()?), + }; + + Ok((order_id, order)) + } + + /* Helpers */ + fn calculate_subticks(&self) -> Result { + let ty = self.ty.as_ref().ok_or_else(|| err!("Missing Order type"))?; + let price = match ty { + OrderType::Market | OrderType::StopMarket | OrderType::TakeProfitMarket => { + // Use user-provided slippage price + if let Some(price) = self.price.clone() { + price + // Calculate slippage price based on oracle price + } else if let Some(oracle_price) = self.market_params.oracle_price.clone() { + let side = self + .side + .as_ref() + .ok_or_else(|| err!("Missing Order side"))?; + let one = ::one(); + match side { + OrderSide::Buy => oracle_price * (one + &self.slippage), + OrderSide::Sell => oracle_price * (one - &self.slippage), + _ => return Err(err!("Order side {side:?} not supported")), + } + } else { + return Err(err!("Failed to calculate Market order slippage price")); + } + } + _ => self + .price + .clone() + .ok_or_else(|| err!("Missing Order price"))?, + }; + + self.market_params + .quantize_price(price) + .to_u64() + .ok_or_else(|| err!("Failed converting BigDecimal price into u64")) + } +} + +impl OrderType { + /// Validate time execution options. + /// + /// See also [`OrderBuilder::time_in_force`]. + pub fn time_in_force( + &self, + time_in_force: &OrderTimeInForce, + post_only: bool, + execution: &OrderExecution, + ) -> Result { + match self { + OrderType::Market => Ok(OrderTimeInForce::Ioc), + OrderType::Limit => { + if post_only { + Ok(OrderTimeInForce::PostOnly) + } else { + Ok(*time_in_force) + } + } + OrderType::StopLimit | OrderType::TakeProfit => match execution { + OrderExecution::Default => Ok(OrderTimeInForce::Unspecified), + OrderExecution::PostOnly => Ok(OrderTimeInForce::PostOnly), + OrderExecution::Fok => Ok(OrderTimeInForce::FillOrKill), + OrderExecution::Ioc => Ok(OrderTimeInForce::Ioc), + }, + OrderType::StopMarket | OrderType::TakeProfitMarket => match execution { + OrderExecution::Default | OrderExecution::PostOnly => Err(err!( + "Execution value {execution:?} not supported for order type {self:?}" + )), + OrderExecution::Fok => Ok(OrderTimeInForce::FillOrKill), + OrderExecution::Ioc => Ok(OrderTimeInForce::Ioc), + }, + _ => Err(err!( + "Invalid combination of order type, time in force, and execution" + )), + } + } + + /// Get [the condition type](https://docs.dydx.exchange/api_integration-trading/order_types#condition-types) for the order. + pub fn condition_type(&self) -> Result { + match self { + OrderType::Limit | OrderType::Market => Ok(ConditionType::Unspecified), + OrderType::StopLimit | OrderType::StopMarket => Ok(ConditionType::StopLoss), + OrderType::TakeProfit | OrderType::TakeProfitMarket => Ok(ConditionType::TakeProfit), + _ => Err(err!("Order type unsupported for condition type")), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::indexer::{ClobPairId, PerpetualMarketStatus, PerpetualMarketType, Ticker}; + use std::str::FromStr; + + fn sample_market_params() -> OrderMarketParams { + PerpetualMarket { + ticker: Ticker::from("BTC-USD"), + + atomic_resolution: -10, + clob_pair_id: ClobPairId(0), + market_type: PerpetualMarketType::Cross, + quantum_conversion_exponent: -9, + step_base_quantums: 1_000_000, + subticks_per_tick: 100_000, + + base_open_interest: Default::default(), + initial_margin_fraction: Default::default(), + maintenance_margin_fraction: Default::default(), + next_funding_rate: Default::default(), + open_interest: Default::default(), + open_interest_lower_cap: None, + open_interest_upper_cap: None, + oracle_price: Default::default(), + price_change_24h: Default::default(), + status: PerpetualMarketStatus::Active, + step_size: Default::default(), + tick_size: Default::default(), + trades_24h: 0, + volume_24h: Quantity(0.into()), + } + .into() + } + + fn bigdecimal(val: &str) -> BigDecimal { + BigDecimal::from_str(val).expect("Failed converting str into BigDecimal") + } + + #[test] + fn market_size_to_quantums() { + let market = sample_market_params(); + let size = bigdecimal("0.01"); + let quantums = market.quantize_quantity(size); + let expected = bigdecimal("100_000_000"); + assert_eq!(quantums, expected); + } + + #[test] + fn market_price_to_subticks() { + let market = sample_market_params(); + let price = bigdecimal("50_000"); + let subticks = market.quantize_price(price); + let expected = bigdecimal("5_000_000_000"); + assert_eq!(subticks, expected); + } + + #[test] + fn market_quantums_to_size() { + let market = sample_market_params(); + let quantums = bigdecimal("100_000_000"); + let size = market.dequantize_quantums(quantums); + let expected = bigdecimal("0.01"); + assert_eq!(size, expected); + } + + #[test] + fn market_subticks_to_price() { + let market = sample_market_params(); + let subticks = bigdecimal("5_000_000_000"); + let price = market.dequantize_subticks(subticks); + let expected = bigdecimal("50_000"); + assert_eq!(price, expected); + } +} diff --git a/v4-client-rs/client/src/node/sequencer.rs b/v4-client-rs/client/src/node/sequencer.rs new file mode 100644 index 00000000..3ec5d8ab --- /dev/null +++ b/v4-client-rs/client/src/node/sequencer.rs @@ -0,0 +1,130 @@ +use anyhow::{anyhow as err, Error, Result}; +use async_trait::async_trait; +#[allow(unused_imports)] +use chrono::{DateTime, Utc}; + +use super::Address; +use dydx_proto::cosmos_sdk_proto::{ + cosmos::auth::v1beta1::{ + query_client::QueryClient as QueryGrpcClient, BaseAccount, QueryAccountRequest, + }, + traits::Message, +}; +use std::collections::HashMap; +use tonic::{transport::Channel, Request}; +use tower::timeout::Timeout; + +/// Transaction sequence number validation value used to enable protection against replay attacks. +#[derive(Clone, Debug)] +pub enum Nonce { + /// A sequence number is incremental, associated with the number of transactions (short-term + /// orders excluded) issued by an [`Account`](super::wallet::Account). + Sequence(u64), + /// A valid timestamp nonce folows the rules: + /// 1. now - 30s ≤ timestamp ≤ now + 30s; + /// 2. timestamp is strictly larger than any of the largest 20 timestamp nonces previously submitted in the account’s lifetime; + /// 3. timestamp has never been used before. + Timestamp(u64), +} + +impl Nonce { + /// Create a new timestamp `Nonce` using the current timestamp + pub fn now() -> Self { + Self::Timestamp(Utc::now().timestamp_millis() as u64) + } +} + +/// A trait to produce [`Nonce`]s for [`Account`](super::Account). +#[async_trait] +pub trait Sequencer: Send + 'static { + /// Returns the next nonce. + async fn next_nonce(&mut self, address: &Address) -> Result; +} + +/// A simple incremental sequencer. +/// An internal counter is increased in every `next_nonce()` call. +#[allow(dead_code)] // TODO remove after completion +#[derive(Clone, Debug)] +pub struct IncrementalSequencer { + counters: HashMap, +} + +impl IncrementalSequencer { + /// Add relevant `Address`es and respective starting counter values + #[allow(dead_code)] // TODO remove after completion + pub fn new(addresses: &[(Address, u64)]) -> Self { + Self { + counters: addresses.iter().cloned().collect(), + } + } + + /// Adds an `Address` with a starting counter value to the sequencer + #[allow(dead_code)] // TODO remove after completion + pub fn add_address(&mut self, address: Address, start_at: u64) -> Option { + self.counters.insert(address, start_at) + } +} + +#[async_trait] +impl Sequencer for IncrementalSequencer { + async fn next_nonce(&mut self, address: &Address) -> Result { + let counter = self + .counters + .get_mut(address) + .ok_or_else(|| err!("Address {address} not found in sequencer"))?; + *counter += 1; + Ok(Nonce::Sequence(*counter - 1)) + } +} + +/// A sequencer which fetches the next sequence number from the network. +#[allow(dead_code)] // TODO remove after completion +#[derive(Clone, Debug)] +pub struct QueryingSequencer { + querier: QueryGrpcClient>, +} + +impl QueryingSequencer { + /// Creates a new `QueryingSequencer` using a gRPC [`Channel`]. + #[allow(dead_code)] // TODO remove after completion + pub fn new(channel: Timeout) -> Self { + Self { + querier: QueryGrpcClient::new(channel), + } + } +} + +#[async_trait] +impl Sequencer for QueryingSequencer { + async fn next_nonce(&mut self, address: &Address) -> Result { + let response = self + .querier + .account(Request::new(QueryAccountRequest { + address: address.to_string(), + })) + .await? + .into_inner(); + let sequence = BaseAccount::decode( + &response + .account + .ok_or_else(|| err!("Query account request failure, account should exist."))? + .value[..], + ) + .map(|res| res.sequence) + .map_err(|e| err!("Query account request decode failure: {e}"))?; + + Ok(Nonce::Sequence(sequence)) + } +} + +/// A sequencer which uses a current timestamp as a sequence number. +#[allow(dead_code)] // TODO remove after completion +#[derive(Clone, Debug)] +pub struct TimestamperSequencer; + +#[async_trait] +impl Sequencer for TimestamperSequencer { + async fn next_nonce(&mut self, _: &Address) -> Result { + Ok(Nonce::now()) + } +} diff --git a/v4-client-rs/client/src/node/types.rs b/v4-client-rs/client/src/node/types.rs new file mode 100644 index 00000000..8267081b --- /dev/null +++ b/v4-client-rs/client/src/node/types.rs @@ -0,0 +1,27 @@ +use cosmrs::tendermint::{chain::Id, error::Error}; +use serde::Deserialize; +use strum::{AsRefStr, Display}; + +/// [Chain ID](https://docs.dydx.exchange/infrastructure_providers-network/network_constants#chain-id) +/// serves as a unique chain identificator to prevent replay attacks. +/// +/// See also [Cosmos ecosystem](https://cosmos.directory/). +#[derive(Debug, Eq, PartialEq, Clone, Display, AsRefStr, Deserialize)] +pub enum ChainId { + /// Testnet. + #[strum(serialize = "dydx-testnet-4")] + #[serde(rename = "dydx-testnet-4")] + Testnet4, + /// Mainnet. + #[strum(serialize = "dydx-mainnet-1")] + #[serde(rename = "dydx-mainnet-1")] + Mainnet1, +} + +impl TryFrom for Id { + type Error = Error; + + fn try_from(chain_id: ChainId) -> Result { + chain_id.as_ref().parse() + } +} diff --git a/v4-client-rs/client/src/node/utils.rs b/v4-client-rs/client/src/node/utils.rs new file mode 100644 index 00000000..747133ce --- /dev/null +++ b/v4-client-rs/client/src/node/utils.rs @@ -0,0 +1,177 @@ +use anyhow::{anyhow as err, Error}; +use bigdecimal::num_bigint::{BigInt, Sign}; + +/// An extension trait for [`BigInt`]. +pub trait BigIntExt { + /// Initialize a [`BigInt`] from a bytes slice. + fn from_serializable_int(bytes: &[u8]) -> Result; + /// Creates a bytes vector from a [`BigInt`]. + fn to_serializable_vec(&self) -> Result, Error>; +} + +impl BigIntExt for BigInt { + fn from_serializable_int(bytes: &[u8]) -> Result { + if bytes.is_empty() { + return Ok(BigInt::from(0)); + } + + let sign = match bytes[0] { + 2 => Sign::Plus, + 3 => Sign::Minus, + _ => return Err(err!("Invalid sign byte, must be 2 or 3.")), + }; + + Ok(BigInt::from_bytes_be(sign, &bytes[1..])) + } + + fn to_serializable_vec(&self) -> Result, Error> { + if self.sign() == Sign::NoSign { + return Ok(vec![0x02]); + } + + let (sign, bytes) = self.to_bytes_be(); + let mut vec = vec![0; 1 + bytes.len()]; + + vec[0] = match sign { + Sign::Plus | Sign::NoSign => 2, + Sign::Minus => 3, + }; + vec[1..].copy_from_slice(&bytes); + + Ok(vec) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::str::FromStr; + + #[test] + fn node_utils_serializable_to_bigint() -> Result<(), Error> { + assert_eq!( + BigInt::from_str("0")?, + BigInt::from_serializable_int(&[0x02])? + ); + assert_eq!( + BigInt::from_str("-0")?, + BigInt::from_serializable_int(&[0x02])? + ); + assert_eq!( + BigInt::from_str("1")?, + BigInt::from_serializable_int(&[0x02, 0x01])? + ); + assert_eq!( + BigInt::from_str("-1")?, + BigInt::from_serializable_int(&[0x03, 0x01])? + ); + assert_eq!( + BigInt::from_str("255")?, + BigInt::from_serializable_int(&[0x02, 0xFF])? + ); + assert_eq!( + BigInt::from_str("-255")?, + BigInt::from_serializable_int(&[0x03, 0xFF])? + ); + assert_eq!( + BigInt::from_str("256")?, + BigInt::from_serializable_int(&[0x02, 0x01, 0x00])? + ); + assert_eq!( + BigInt::from_str("-256")?, + BigInt::from_serializable_int(&[0x03, 0x01, 0x00])? + ); + assert_eq!( + BigInt::from_str("123456789")?, + BigInt::from_serializable_int(&[0x02, 0x07, 0x5b, 0xcd, 0x15])? + ); + assert_eq!( + BigInt::from_str("-123456789")?, + BigInt::from_serializable_int(&[0x03, 0x07, 0x5b, 0xcd, 0x15])? + ); + assert_eq!( + BigInt::from_str("123456789123456789")?, + BigInt::from_serializable_int(&[0x02, 0x01, 0xb6, 0x9b, 0x4b, 0xac, 0xd0, 0x5f, 0x15])? + ); + assert_eq!( + BigInt::from_str("-123456789123456789")?, + BigInt::from_serializable_int(&[0x03, 0x01, 0xb6, 0x9b, 0x4b, 0xac, 0xd0, 0x5f, 0x15])? + ); + assert_eq!( + BigInt::from_str("123456789123456789123456789")?, + BigInt::from_serializable_int(&[ + 0x02, 0x66, 0x1e, 0xfd, 0xf2, 0xe3, 0xb1, 0x9f, 0x7c, 0x04, 0x5f, 0x15 + ])? + ); + assert_eq!( + BigInt::from_str("-123456789123456789123456789")?, + BigInt::from_serializable_int(&[ + 0x03, 0x66, 0x1e, 0xfd, 0xf2, 0xe3, 0xb1, 0x9f, 0x7c, 0x04, 0x5f, 0x15 + ])? + ); + + Ok(()) + } + + #[test] + fn node_utils_serializable_from_bigint() -> Result<(), Error> { + assert_eq!( + [0x02].to_vec(), + BigInt::from_str("0")?.to_serializable_vec()?, + ); + assert_eq!( + [0x02].to_vec(), + BigInt::from_str("-0")?.to_serializable_vec()?, + ); + assert_eq!( + [0x02, 0x01].to_vec(), + BigInt::from_str("1")?.to_serializable_vec()?, + ); + assert_eq!( + [0x03, 0x01].to_vec(), + BigInt::from_str("-1")?.to_serializable_vec()?, + ); + assert_eq!( + [0x02, 0xFF].to_vec(), + BigInt::from_str("255")?.to_serializable_vec()?, + ); + assert_eq!( + [0x03, 0xFF].to_vec(), + BigInt::from_str("-255")?.to_serializable_vec()?, + ); + assert_eq!( + [0x02, 0x01, 0x00].to_vec(), + BigInt::from_str("256")?.to_serializable_vec()?, + ); + assert_eq!( + [0x03, 0x01, 0x00].to_vec(), + BigInt::from_str("-256")?.to_serializable_vec()?, + ); + assert_eq!( + [0x02, 0x07, 0x5b, 0xcd, 0x15].to_vec(), + BigInt::from_str("123456789")?.to_serializable_vec()?, + ); + assert_eq!( + [0x03, 0x07, 0x5b, 0xcd, 0x15].to_vec(), + BigInt::from_str("-123456789")?.to_serializable_vec()?, + ); + assert_eq!( + [0x02, 0x01, 0xb6, 0x9b, 0x4b, 0xac, 0xd0, 0x5f, 0x15].to_vec(), + BigInt::from_str("123456789123456789")?.to_serializable_vec()?, + ); + assert_eq!( + [0x03, 0x01, 0xb6, 0x9b, 0x4b, 0xac, 0xd0, 0x5f, 0x15].to_vec(), + BigInt::from_str("-123456789123456789")?.to_serializable_vec()?, + ); + assert_eq!( + [0x02, 0x66, 0x1e, 0xfd, 0xf2, 0xe3, 0xb1, 0x9f, 0x7c, 0x04, 0x5f, 0x15].to_vec(), + BigInt::from_str("123456789123456789123456789")?.to_serializable_vec()?, + ); + assert_eq!( + [0x03, 0x66, 0x1e, 0xfd, 0xf2, 0xe3, 0xb1, 0x9f, 0x7c, 0x04, 0x5f, 0x15].to_vec(), + BigInt::from_str("-123456789123456789123456789")?.to_serializable_vec()?, + ); + + Ok(()) + } +} diff --git a/v4-client-rs/client/src/node/wallet.rs b/v4-client-rs/client/src/node/wallet.rs new file mode 100644 index 00000000..9ea4ab06 --- /dev/null +++ b/v4-client-rs/client/src/node/wallet.rs @@ -0,0 +1,180 @@ +use super::client::NodeClient; +use super::sequencer::Nonce; +use crate::indexer::{Address, Subaccount}; +use anyhow::{anyhow as err, Error}; +use bip32::{DerivationPath, Language, Mnemonic, Seed}; +use cosmrs::{ + crypto::{secp256k1::SigningKey, PublicKey}, + tx, AccountId, +}; +use std::str::FromStr; + +/// account prefix https://docs.cosmos.network/main/learn/beginner/accounts +const BECH32_PREFIX_DYDX: &str = "dydx"; + +/// Hierarchical Deterministic (HD) [wallet](https://dydx.exchange/crypto-learning/glossary?#wallet) +/// which allows to have multiple addresses and signing keys from one master seed. +/// +/// [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) introduced a wallet standard to derive multiple accounts +/// for different chains from a single seed (which allows to recover the whole tree of keys). +/// This `Wallet` hardcodes Cosmos ATOM token so it can derive multiple addresses from their corresponding indices. +/// +/// See also [Mastering Bitcoin](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05_wallets.adoc). +pub struct Wallet { + seed: Seed, +} + +impl Wallet { + /// Derive a seed from a 24-words English mnemonic phrase. + pub fn from_mnemonic(mnemonic: &str) -> Result { + let seed = Mnemonic::new(mnemonic, Language::English)?.to_seed(""); + Ok(Self { seed }) + } + + /// Derive a dYdX account with updated account and sequence numbers. + pub async fn account(&self, index: u32, client: &mut NodeClient) -> Result { + let mut account = self.account_offline(index)?; + (account.account_number, account.sequence_number) = + client.query_address(account.address()).await?; + Ok(account) + } + + /// Derive a dYdX account with zero'ed account and sequence numbers. + pub fn account_offline(&self, index: u32) -> Result { + self.derive_account(index, BECH32_PREFIX_DYDX) + } + + #[cfg(feature = "noble")] + /// Noble-specific `Wallet` operations. + pub fn noble(&self) -> noble::WalletOps<'_> { + noble::WalletOps::new(self) + } + + fn derive_account(&self, index: u32, prefix: &str) -> Result { + // https://github.com/satoshilabs/slips/blob/master/slip-0044.md + let derivation_str = format!("m/44'/118'/0'/0/{index}"); + let derivation_path = DerivationPath::from_str(&derivation_str)?; + let private_key = SigningKey::derive_from_path(&self.seed, &derivation_path)?; + let public_key = private_key.public_key(); + let account_id = public_key.account_id(prefix).map_err(Error::msg)?; + let address = account_id.to_string().parse()?; + Ok(Account { + index, + account_id, + address, + key: private_key, + account_number: 0, + sequence_number: 0, + next_nonce: None, + }) + } +} + +/// Represents a derived account. +/// +/// See also [`Wallet`]. +pub struct Account { + index: u32, + #[allow(dead_code)] // TODO remove after completion + account_id: AccountId, + // The `String` representation of the `AccountId` + address: Address, + key: SigningKey, + // Online attributes + account_number: u64, + sequence_number: u64, + next_nonce: Option, +} + +impl Account { + /// An address of the account. + pub fn address(&self) -> &Address { + &self.address + } + + /// A public key associated with the account. + pub fn public_key(&self) -> PublicKey { + self.key.public_key() + } + + /// An index of the derived account. + pub fn index(&self) -> &u32 { + &self.index + } + + /// A subaccount from a corresponding index. + pub fn subaccount(&self, number: u32) -> Result { + Ok(Subaccount::new(self.address.clone(), number.try_into()?)) + } + + /// Sign [`SignDoc`](tx::SignDoc) with a corresponding private key. + pub fn sign(&self, doc: tx::SignDoc) -> Result { + doc.sign(&self.key) + .map_err(|e| err!("Failure to sign doc: {e}")) + } + + /// The account number. + pub fn account_number(&self) -> u64 { + self.account_number + } + + /// The account sequence number. + pub fn sequence_number(&self) -> u64 { + self.sequence_number + } + + /// Set a new sequence number. + pub fn set_sequence_number(&mut self, sequence_number: u64) { + self.sequence_number = sequence_number; + } + + /// Gets the [`Nonce`] to be used in the next transaction. + pub fn next_nonce(&self) -> Option<&Nonce> { + self.next_nonce.as_ref() + } + + /// Set the [`Nonce`] to be used in the next transaction. + pub fn set_next_nonce(&mut self, nonce: Nonce) { + if let Nonce::Sequence(number) = nonce { + self.sequence_number = number + } + self.next_nonce = Some(nonce); + } +} + +#[cfg(feature = "noble")] +mod noble { + use super::*; + use crate::noble::NobleClient; + + const BECH32_PREFIX_NOBLE: &str = "noble"; + + /// Noble-specific wallet operations + pub struct WalletOps<'w> { + wallet: &'w Wallet, + } + + impl<'w> WalletOps<'w> { + /// Create a new Noble-specific wallet operations dispatcher. + pub fn new(wallet: &'w Wallet) -> Self { + Self { wallet } + } + + /// Derive a Noble account with updated account and sequence numbers. + pub async fn account( + &self, + index: u32, + client: &mut NobleClient, + ) -> Result { + let mut account = self.account_offline(index)?; + (account.account_number, account.sequence_number) = + client.query_address(account.address()).await?; + Ok(account) + } + + /// Derive a Noble account with zero'ed account and sequence numbers. + pub fn account_offline(&self, index: u32) -> Result { + self.wallet.derive_account(index, BECH32_PREFIX_NOBLE) + } + } +} diff --git a/v4-client-rs/client/src/telemetry.rs b/v4-client-rs/client/src/telemetry.rs new file mode 100644 index 00000000..243f70e3 --- /dev/null +++ b/v4-client-rs/client/src/telemetry.rs @@ -0,0 +1,72 @@ +use std::time::Instant; + +// Metrics +/// Counter for orders opened with [`place_order`](crate::node::NodeClient::place_order). +pub const TELEMETRY_ORDERS_PLACED: &str = "orders.placed"; +/// Counter for orders cancelled with [`cancel_order`](crate::node::NodeClient::cancel_order). +pub const TELEMETRY_ORDERS_CANCELLED: &str = "orders.cancelled"; +/// Histogram for [`place_order`](crate::node::NodeClient::place_order) duration in milliseconds. +pub const TELEMETRY_PLACE_ORDER_DURATION: &str = "place_order.duration"; +/// Histogram for [`cancel_order`](crate::node::NodeClient::cancel_order) duration in milliseconds. +pub const TELEMETRY_CANCEL_ORDER_DURATION: &str = "cancel_order.duration"; +/// Histogram for [`batch_cancel_orders`](crate::node::NodeClient::batch_cancel_orders) duration in milliseconds. +pub const TELEMETRY_BATCH_CANCEL_ORDER_DURATION: &str = "batch_cancel_orders.duration"; +/// Histogram for [`query_transaction`](crate::node::NodeClient::query_transaction) duration in milliseconds +pub const TELEMETRY_QUERY_TX_DURATION: &str = "query_transaction.duration"; +/// Counter for reconnection attempts for Indexer Websocket feed +pub const TELEMETRY_WS_RECONNECTS: &str = "ws.reconnects"; +/// Counter for messages received by Indexer Websocket feed. +pub const TELEMETRY_WS_RECEIVED: &str = "ws.received"; +/// Counter for messages sent by Indexer Websocket feed. +pub const TELEMETRY_WS_SENT: &str = "ws.sent"; +/// Histogram for sending duration in milliseconds, Indexer Websocket feed messages. +pub const TELEMETRY_WS_SENT_DURATION: &str = "ws.sent.duration"; +// Descriptions +/// Description for [`TELEMETRY_ORDERS_PLACED`]. +pub const TELEMETRY_DESC_ORDERS_PLACED: &str = "Orders opened with `place_order`"; +/// Description for [`TELEMETRY_ORDERS_CANCELLED`]. +pub const TELEMETRY_DESC_ORDERS_CANCELLED: &str = "Orders cancelled with `cancel_order`"; +/// Description for [`TELEMETRY_PLACE_ORDER_DURATION`]. +pub const TELEMETRY_DESC_PLACE_ORDER_DURATION: &str = "`place_order` duration in milliseconds"; +/// Description for [`TELEMETRY_CANCEL_ORDER_DURATION`]. +pub const TELEMETRY_DESC_CANCEL_ORDER_DURATION: &str = "`cancel_order` duration in milliseconds"; +/// Description for [`TELEMETRY_BATCH_CANCEL_ORDER_DURATION`]. +pub const TELEMETRY_DESC_BATCH_CANCEL_ORDER_DURATION: &str = + "`batch_cancel_orders` duration in milliseconds"; +/// Description for [`TELEMETRY_QUERY_TX_DURATION`]. +pub const TELEMETRY_DESC_QUERY_TX_DURATION: &str = "`query_transaction` duration in milliseconds"; +/// Description for [`TELEMETRY_WS_RECONNECTS`]. +pub const TELEMETRY_DESC_WS_RECONNECTS: &str = "Reconnection attempts for Indexer Websocket feed"; +/// Description for [`TELEMETRY_WS_RECEIVED`]. +pub const TELEMETRY_DESC_WS_RECEIVED: &str = "Messages received by Indexer Websocket feed"; +/// Description for [`TELEMETRY_WS_SENT`]. +pub const TELEMETRY_DESC_WS_SENT: &str = "Messages sent by Indexer Websocket feed"; +/// Description for [`TELEMETRY_WS_SENT_DURATION`]. +pub const TELEMETRY_DESC_WS_SENT_DURATION: &str = + "Indexer Websocket feed messages, sending duration in milliseconds"; +// Labels +/// Label for address. +pub const TELEMETRY_LABEL_ADDRESS: &str = "address"; + +pub(crate) struct LatencyMetric { + name: &'static str, + start: Instant, +} + +impl LatencyMetric { + pub(crate) fn new(name: &'static str) -> Self { + let start = Instant::now(); + Self { name, start } + } +} + +impl Drop for LatencyMetric { + fn drop(&mut self) { + // TODO replace with https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_millis_f64 + // when stable + let duration = self.start.elapsed(); + let latency = (duration.as_secs() as f64) * (1_000_f64) + + (duration.subsec_nanos() as f64) / (1_000_000_f64); + metrics::histogram!(self.name).record(latency); + } +} diff --git a/v4-client-rs/client/tests/env.rs b/v4-client-rs/client/tests/env.rs new file mode 100644 index 00000000..f6edc20d --- /dev/null +++ b/v4-client-rs/client/tests/env.rs @@ -0,0 +1,120 @@ +#[cfg(any(feature = "faucet", feature = "noble"))] +use anyhow::anyhow as err; +use anyhow::{Error, Result}; +use chrono::{TimeDelta, Utc}; +#[cfg(feature = "faucet")] +use dydx::faucet::FaucetClient; +#[cfg(feature = "noble")] +use dydx::noble::NobleClient; +use dydx::{ + config::ClientConfig, + indexer::{ClientId, Height, IndexerClient, PerpetualMarket, Ticker}, + node::{Account, Address, NodeClient, OrderBuilder, OrderId, OrderSide, Subaccount, Wallet}, +}; + +const TEST_MNEMONIC: &str = "mirror actor skill push coach wait confirm orchard lunch mobile athlete gossip awake miracle matter bus reopen team ladder lazy list timber render wait"; + +pub enum TestEnv {} + +#[allow(dead_code)] +impl TestEnv { + pub async fn testnet() -> Result { + TestnetEnv::bootstrap().await + } + + pub async fn mainnet() -> Result { + MainnetEnv::bootstrap().await + } +} + +#[allow(dead_code)] +pub struct MainnetEnv { + pub indexer: IndexerClient, + pub ticker: Ticker, +} + +impl MainnetEnv { + async fn bootstrap() -> Result { + let path = "tests/mainnet.toml"; + let config = ClientConfig::from_file(path).await?; + let indexer = IndexerClient::new(config.indexer); + let ticker = Ticker::from("ETH-USD"); + Ok(Self { indexer, ticker }) + } +} + +#[allow(dead_code)] +pub struct TestnetEnv { + pub node: NodeClient, + pub indexer: IndexerClient, + #[cfg(feature = "faucet")] + pub faucet: FaucetClient, + #[cfg(feature = "noble")] + pub noble: NobleClient, + pub wallet: Wallet, + pub account: Account, + pub address: Address, + pub subaccount: Subaccount, + pub ticker: Ticker, +} + +#[allow(dead_code)] +impl TestnetEnv { + async fn bootstrap() -> Result { + let path = "tests/testnet.toml"; + let config = ClientConfig::from_file(path).await?; + let mut node = NodeClient::connect(config.node).await?; + let indexer = IndexerClient::new(config.indexer); + #[cfg(feature = "faucet")] + let faucet = FaucetClient::new(config.faucet.ok_or_else(|| { + err!("Configuration file must contain a [faucet] configuration for testing") + })?); + #[cfg(feature = "noble")] + let noble = NobleClient::connect(config.noble.ok_or_else(|| { + err!("Configuration file must contain a [noble] configuration for testing") + })?) + .await?; + let wallet = Wallet::from_mnemonic(TEST_MNEMONIC)?; + let account = wallet.account(0, &mut node).await?; + let ticker = Ticker::from("ETH-USD"); + let address = account.address().clone(); + let subaccount = account.subaccount(0)?; + Ok(Self { + node, + indexer, + #[cfg(feature = "faucet")] + faucet, + #[cfg(feature = "noble")] + noble, + wallet, + account, + address, + subaccount, + ticker, + }) + } + + pub async fn get_market(&self) -> Result { + self.indexer + .markets() + .get_perpetual_market(&self.ticker) + .await + } + + pub async fn get_height(&self) -> Result { + Ok(self.indexer.utility().get_height().await?.height) + } + + pub async fn spawn_order(&mut self) -> Result { + let market = self.get_market().await?; + let subaccount = self.account.subaccount(0)?; + let (id, order) = OrderBuilder::new(market, subaccount) + .limit(OrderSide::Buy, 1, 1) + .until(Utc::now() + TimeDelta::seconds(60)) + .long_term() + .build(ClientId::random())?; + let tx_res = self.node.place_order(&mut self.account, order).await; + self.node.query_transaction_result(tx_res).await?; + Ok(id) + } +} diff --git a/v4-client-rs/client/tests/mainnet.toml b/v4-client-rs/client/tests/mainnet.toml new file mode 100644 index 00000000..542c462d --- /dev/null +++ b/v4-client-rs/client/tests/mainnet.toml @@ -0,0 +1,9 @@ +[node] +# You can select other gRPC endpoints from [the list](https://docs.dydx.exchange/infrastructure_providers-network/resources#full-node-endpoints). +endpoint = "https://dydx-ops-grpc.kingnodes.com:443" +chain_id = "dydx-mainnet-1" +fee_denom = "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5" + +[indexer] +http.endpoint = "https://indexer.dydx.trade/v4" +ws.endpoint = "wss://indexer.dydx.trade/v4/ws" diff --git a/v4-client-rs/client/tests/test_faucet.rs b/v4-client-rs/client/tests/test_faucet.rs new file mode 100644 index 00000000..81a2ad8a --- /dev/null +++ b/v4-client-rs/client/tests/test_faucet.rs @@ -0,0 +1,40 @@ +mod env; + +#[cfg(feature = "faucet")] +mod faucet_tests { + use super::env; + use env::TestEnv; + + use anyhow::Error; + use dydx::indexer::Usdc; + + const FILL_AMOUNT: u64 = 1_000_000; + + #[tokio::test] + #[ignore] + async fn test_faucet_fill() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let faucet = env.faucet; + let subaccount = env.account.subaccount(0)?; + + println!( + "before equity: {:?}", + env.indexer + .accounts() + .get_subaccount(&subaccount) + .await? + .equity + ); + faucet.fill(&subaccount, &Usdc(FILL_AMOUNT.into())).await?; + println!( + "after equity: {:?}", + env.indexer + .accounts() + .get_subaccount(&subaccount) + .await? + .equity + ); + + Ok(()) + } +} diff --git a/v4-client-rs/client/tests/test_indexer_rest.rs b/v4-client-rs/client/tests/test_indexer_rest.rs new file mode 100644 index 00000000..dc65a74e --- /dev/null +++ b/v4-client-rs/client/tests/test_indexer_rest.rs @@ -0,0 +1,333 @@ +mod env; +use env::TestEnv; + +use anyhow::{anyhow as err, Result}; +use bigdecimal::BigDecimal; +use dydx::indexer::*; +use std::str::FromStr; + +#[tokio::test] +async fn test_indexer_markets_list_perpetual_markets() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer.markets().list_perpetual_markets(None).await?; + + let opts = ListPerpetualMarketsOpts { + ticker: Some(env.ticker), + ..Default::default() + }; + env.indexer + .markets() + .list_perpetual_markets(Some(opts)) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_markets_get_perpetual_market() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .markets() + .get_perpetual_market(&env.ticker) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_markets_get_perpetual_market_orderbook() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .markets() + .get_perpetual_market_orderbook(&env.ticker) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_markets_get_trades() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer.markets().get_trades(&env.ticker, None).await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_markets_get_candles() -> Result<()> { + let env = TestEnv::testnet().await?; + let res = CandleResolution::M1; + env.indexer + .markets() + .get_candles(&env.ticker, res, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_markets_get_historical_funding() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .markets() + .get_historical_funding(&env.ticker, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_markets_get_sparklines() -> Result<()> { + let env = TestEnv::testnet().await?; + let period = SparklineTimePeriod::OneDay; + env.indexer.markets().get_sparklines(period).await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_utility_get_time() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer.utility().get_time().await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_utility_get_height() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer.utility().get_height().await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_utility_get_screen() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer.utility().get_screen(&env.address).await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_subaccounts() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer.accounts().get_subaccounts(&env.address).await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_subaccount() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_subaccount(&env.subaccount) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_parent_subaccount() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_parent_subaccount(&env.subaccount.parent()) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_list_positions() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .list_positions(&env.subaccount, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_list_parent_positions() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .list_parent_positions(&env.subaccount.parent(), None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_asset_positions() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_asset_positions(&env.subaccount) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_parent_asset_positions() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_parent_asset_positions(&env.subaccount.parent()) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_transfers() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_transfers(&env.subaccount, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_parent_transfers() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_parent_transfers(&env.subaccount.parent(), None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_list_orders() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .list_orders(&env.subaccount, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_list_parent_orders() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .list_parent_orders(&env.subaccount.parent(), None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_order() -> Result<()> { + let env = TestEnv::testnet().await?; + let orders = env + .indexer + .accounts() + .list_orders(&env.subaccount, None) + .await?; + let order = orders + .first() + .ok_or_else(|| err!("at least one order is required for testing"))?; + env.indexer.accounts().get_order(&order.id).await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_fills() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_fills(&env.subaccount, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_parent_fills() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_parent_fills(&env.subaccount.parent(), None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_historical_pnl() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_historical_pnl(&env.subaccount, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_parent_historical_pnl() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_parent_historical_pnl(&env.subaccount.parent(), None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_rewards() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer + .accounts() + .get_rewards(&env.address, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_account_get_rewards_aggregated() -> Result<()> { + let env = TestEnv::testnet().await?; + let period = TradingRewardAggregationPeriod::Daily; + env.indexer + .accounts() + .get_rewards_aggregated(&env.address, period, None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_vaults_get_megavault_historical_pnl() -> Result<()> { + let env = TestEnv::testnet().await?; + let resolution = PnlTickInterval::Hour; + env.indexer + .vaults() + .get_megavault_historical_pnl(resolution) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_vaults_get_vaults_historical_pnl() -> Result<()> { + let env = TestEnv::testnet().await?; + let resolution = PnlTickInterval::Hour; + env.indexer + .vaults() + .get_vaults_historical_pnl(resolution) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_indexer_vaults_get_megavault_positions() -> Result<()> { + let env = TestEnv::testnet().await?; + env.indexer.vaults().get_megavault_positions().await?; + Ok(()) +} + +#[tokio::test] +async fn test_perpetual_market_quantization() -> Result<()> { + let env = TestEnv::testnet().await?; + let markets = env.indexer.markets().list_perpetual_markets(None).await?; + let params = markets + .get(&env.ticker) + .ok_or_else(|| err!("The ticker {} has not found!", env.ticker))? + .order_params(); + + let price = BigDecimal::from_str("4321.1234")?; + let quantized = params.quantize_price(price); + let expected = BigDecimal::from_str("4321100000")?; + assert_eq!(quantized, expected); + + let size = BigDecimal::from_str("4321.1234")?; + let quantized = params.quantize_quantity(size); + let expected = BigDecimal::from_str("4321123000000")?; + assert_eq!(quantized, expected); + Ok(()) +} diff --git a/v4-client-rs/client/tests/test_indexer_sock.rs b/v4-client-rs/client/tests/test_indexer_sock.rs new file mode 100644 index 00000000..b4095935 --- /dev/null +++ b/v4-client-rs/client/tests/test_indexer_sock.rs @@ -0,0 +1,635 @@ +mod env; +use env::TestEnv; + +use anyhow::{anyhow as err, Error}; +use dydx::indexer::*; +use tokio::time::{sleep, Duration, Instant}; + +#[tokio::test] +async fn test_indexer_sock_trades() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().trades(&env.ticker, false).await?; + + match feed.recv().await { + Some(TradesMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Trades event is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_trades_with_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().trades(&env.ticker, false).await?; + + match feed.recv().await { + Some(TradesMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Trades event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(TradesMessage::Update(_)) => {} + other => { + return Err(err!("Not the Trades update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_trades_with_batched_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().trades(&env.ticker, true).await?; + + match feed.recv().await { + Some(TradesMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Trades event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(TradesMessage::Update(_)) => {} + other => { + return Err(err!("Not the Trades update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_orders() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().orders(&env.ticker, false).await?; + + match feed.recv().await { + Some(OrdersMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Orders event is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_orders_with_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().orders(&env.ticker, false).await?; + + match feed.recv().await { + Some(OrdersMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Orders event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(OrdersMessage::Update(_)) => {} + other => { + return Err(err!("Not the Orders update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_orders_with_batched_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().orders(&env.ticker, true).await?; + + match feed.recv().await { + Some(OrdersMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Orders event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(OrdersMessage::Update(_)) => {} + other => { + return Err(err!("Not the Orders update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_markets() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().markets(false).await?; + + match feed.recv().await { + Some(MarketsMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Markets event is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_markets_with_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().markets(false).await?; + + match feed.recv().await { + Some(MarketsMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Markets event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(MarketsMessage::Update(_)) => {} + other => { + return Err(err!("Not the Markets update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_markets_with_batched_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().markets(true).await?; + + match feed.recv().await { + Some(MarketsMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Markets event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(MarketsMessage::Update(_)) => {} + other => { + return Err(err!("Not the Markets update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_blockheight() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().block_height(false).await?; + + match feed.recv().await { + Some(BlockHeightMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the BlockHeight initial event is received: {other:?}" + )); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_blockheight_with_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().block_height(false).await?; + + match feed.recv().await { + Some(BlockHeightMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the BlockHeight initial event is received: {other:?}" + )); + } + } + + match feed.recv().await { + Some(BlockHeightMessage::Update(_)) => {} + other => { + return Err(err!("Not the BlockHeight update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_blockheight_with_batched_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env.indexer.feed().block_height(true).await?; + + match feed.recv().await { + Some(BlockHeightMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the BlockHeight initial event is received: {other:?}" + )); + } + } + + match feed.recv().await { + Some(BlockHeightMessage::Update(_)) => {} + other => { + return Err(err!("Not the BlockHeight update is received: {other:?}")); + } + } + + Ok(()) +} + +// Candles +#[tokio::test] +async fn test_indexer_sock_candles() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env + .indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, false) + .await?; + + match feed.recv().await { + Some(CandlesMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Candles event is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_candles_with_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env + .indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, false) + .await?; + + match feed.recv().await { + Some(CandlesMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Candles event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(CandlesMessage::Update(_)) => {} + other => { + return Err(err!("Not the Candles update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_candles_with_batched_updates() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed = env + .indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, true) + .await?; + + match feed.recv().await { + Some(CandlesMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Candles event is received: {other:?}")); + } + } + + match feed.recv().await { + Some(CandlesMessage::Update(m)) => { + println!("{:?}", m); + } + other => { + return Err(err!("Not the Candles update is received: {other:?}")); + } + } + + Ok(()) +} + +// Subaccounts +#[tokio::test] +async fn test_indexer_sock_subaccounts() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + let mut feed = env + .indexer + .feed() + .subaccounts(env.subaccount, false) + .await?; + + match feed.recv().await { + Some(SubaccountsMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the Subaccounts initial event is received: {other:?}" + )); + } + } + + Ok(()) +} + +#[tokio::test] +#[ignore] +async fn test_indexer_sock_subaccounts_with_updates() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + let mut feed = env + .indexer + .feed() + .subaccounts(env.subaccount, false) + .await?; + + match feed.recv().await { + Some(SubaccountsMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the Subaccounts initial event is received: {other:?}" + )); + } + } + + match feed.recv().await { + Some(SubaccountsMessage::Update(_)) => {} + other => { + return Err(err!("Not the Subaccounts update is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +#[ignore] +async fn test_indexer_sock_subaccounts_with_batched_updates() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + let mut feed = env.indexer.feed().subaccounts(env.subaccount, true).await?; + + match feed.recv().await { + Some(SubaccountsMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the Subaccounts initial event is received: {other:?}" + )); + } + } + + match feed.recv().await { + Some(SubaccountsMessage::Update(_)) => {} + other => { + return Err(err!("Not the Subaccounts update is received: {other:?}")); + } + } + + Ok(()) +} + +// Parent subaccounts +#[tokio::test] +async fn test_indexer_sock_parentsubaccounts() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + let mut feed = env + .indexer + .feed() + .parent_subaccounts(env.subaccount.parent(), false) + .await?; + + match feed.recv().await { + Some(ParentSubaccountsMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the ParentSubaccounts initial event is received: {other:?}" + )); + } + } + + Ok(()) +} + +#[tokio::test] +#[ignore] +async fn test_indexer_sock_parentsubaccounts_with_updates() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + let mut feed = env + .indexer + .feed() + .parent_subaccounts(env.subaccount.parent(), false) + .await?; + + match feed.recv().await { + Some(ParentSubaccountsMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the ParentSubaccounts initial event is received: {other:?}" + )); + } + } + + match feed.recv().await { + Some(ParentSubaccountsMessage::Update(_)) => {} + other => { + return Err(err!( + "Not the ParentSubaccounts update is received: {other:?}" + )); + } + } + + Ok(()) +} + +#[tokio::test] +#[ignore] +async fn test_indexer_sock_parentsubaccounts_with_batched_updates() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + let mut feed = env + .indexer + .feed() + .parent_subaccounts(env.subaccount.parent(), true) + .await?; + + match feed.recv().await { + Some(ParentSubaccountsMessage::Initial(_)) => {} + other => { + return Err(err!( + "Not the ParentSubaccounts initial event is received: {other:?}" + )); + } + } + + match feed.recv().await { + Some(ParentSubaccountsMessage::Update(_)) => {} + other => { + return Err(err!( + "Not the ParentSubaccounts update is received: {other:?}" + )); + } + } + + Ok(()) +} + +// Misc +struct Feeder> { + feed: Feed, + n_init: usize, + n_upd: usize, +} + +impl> Feeder { + fn new(feed: Feed) -> Self { + Self { + feed, + n_init: 0, + n_upd: 0, + } + } +} + +#[tokio::test] +async fn test_indexer_sock_handle_several_feeds() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + + let mut trades = Feeder::new(env.indexer.feed().trades(&env.ticker, false).await?); + let mut orders = Feeder::new(env.indexer.feed().orders(&env.ticker, false).await?); + let mut markets = Feeder::new(env.indexer.feed().markets(false).await?); + let mut candles = Feeder::new( + env.indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, false) + .await?, + ); + + let start = Instant::now(); + let duration = Duration::from_secs(20); + while start.elapsed() < duration { + tokio::select! { + Some(msg) = trades.feed.recv() => { + match msg { + TradesMessage::Initial(_) => { trades.n_init += 1; }, + TradesMessage::Update(_) => { trades.n_upd += 1; }, + } + } + Some(msg) = orders.feed.recv() => { + match msg { + OrdersMessage::Initial(_) => { orders.n_init += 1; }, + OrdersMessage::Update(_) => { orders.n_upd += 1; }, + } + } + Some(msg) = markets.feed.recv() => { + match msg { + MarketsMessage::Initial(_) => { markets.n_init += 1; }, + MarketsMessage::Update(_) => { markets.n_upd += 1; }, + } + } + Some(msg) = candles.feed.recv() => { + match msg { + CandlesMessage::Initial(_) => { candles.n_init += 1; }, + CandlesMessage::Update(_) => { candles.n_upd += 1; }, + } + } + _ = sleep(Duration::from_millis(200)) => { + continue; + } + } + } + + assert!(trades.n_init == 1); + assert!(orders.n_init == 1); + assert!(markets.n_init == 1); + assert!(candles.n_init == 1); + assert!(trades.n_upd + orders.n_upd + markets.n_upd + candles.n_upd > 0); + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_resub_protection() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + let mut feed0 = env + .indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, false) + .await?; + + let feed1 = env + .indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, false) + .await; + match feed1 { + Err(FeedError::Resubscription) => {} + _ => return Err(err!("Expected Resubscription error")), + } + + match feed0.recv().await { + Some(CandlesMessage::Initial(_)) => {} + other => { + return Err(err!("Not the Candles event is received: {other:?}")); + } + } + + Ok(()) +} + +#[tokio::test] +async fn test_indexer_sock_rapid_requests() -> Result<(), Error> { + let mut env = TestEnv::mainnet().await?; + + for _ in 0..5 { + env.indexer.feed().trades(&env.ticker, false).await?; + env.indexer.feed().orders(&env.ticker, false).await?; + env.indexer.feed().markets(false).await?; + env.indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, false) + .await?; + } + let mut trades = Feeder::new(env.indexer.feed().trades(&env.ticker, false).await?); + let mut orders = Feeder::new(env.indexer.feed().orders(&env.ticker, false).await?); + let mut markets = Feeder::new(env.indexer.feed().markets(false).await?); + let mut candles = Feeder::new( + env.indexer + .feed() + .candles(&env.ticker, CandleResolution::M1, false) + .await?, + ); + + let start = Instant::now(); + let duration = Duration::from_secs(10); + while start.elapsed() < duration { + tokio::select! { + Some(TradesMessage::Update(_)) = trades.feed.recv() => { + trades.n_upd += 1; + } + Some(OrdersMessage::Update(_)) = orders.feed.recv() => { + orders.n_upd += 1; + } + Some(MarketsMessage::Update(_)) = markets.feed.recv() => { + markets.n_upd += 1; + } + Some(CandlesMessage::Update(_)) = candles.feed.recv() => { + candles.n_upd += 1; + } + _ = sleep(Duration::from_millis(200)) => { + continue; + } + } + } + + assert!(trades.n_upd + orders.n_upd + markets.n_upd + candles.n_upd > 0); + + Ok(()) +} diff --git a/v4-client-rs/client/tests/test_noble.rs b/v4-client-rs/client/tests/test_noble.rs new file mode 100644 index 00000000..0a5f6012 --- /dev/null +++ b/v4-client-rs/client/tests/test_noble.rs @@ -0,0 +1,72 @@ +mod env; + +#[cfg(feature = "noble")] +mod noble_tests { + use super::env; + use env::TestEnv; + + use anyhow::Error; + use dydx::indexer::Denom; + use dydx::noble::NobleUsdc; + use serial_test::serial; + + #[tokio::test] + #[serial] + async fn test_noble_get_balance() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut noble = env.noble; + + let account = env.wallet.noble().account_offline(0)?; + let denom = Denom::NobleUsdc; + + let balance = noble + .get_account_balance(account.address().clone(), &denom) + .await?; + + assert_eq!(balance.denom, Denom::NobleUsdc.as_ref()); + + Ok(()) + } + + #[tokio::test] + #[serial] + async fn test_noble_get_balances() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut noble = env.noble; + + let account = env.wallet.noble().account_offline(0)?; + + noble + .get_account_balances(account.address().clone()) + .await?; + + Ok(()) + } + + #[tokio::test] + #[serial] + #[ignore] + async fn test_noble_send_token() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut noble = env.noble; + + let mut noble_account = env.wallet.noble().account(0, &mut noble).await?; + let dydx_account = env.wallet.account_offline(0)?; + + let sender = noble_account.address().clone(); + let recipient = dydx_account.address().clone(); + let source_channel = "channel-33".to_string(); + + noble + .send_token_ibc( + &mut noble_account, + sender, + recipient, + NobleUsdc::from(1000), + source_channel, + ) + .await?; + + Ok(()) + } +} diff --git a/v4-client-rs/client/tests/test_node.rs b/v4-client-rs/client/tests/test_node.rs new file mode 100644 index 00000000..f52ef7d5 --- /dev/null +++ b/v4-client-rs/client/tests/test_node.rs @@ -0,0 +1,377 @@ +mod env; +use env::TestEnv; + +use anyhow::{anyhow as err, Error}; +use bigdecimal::{num_traits::cast::ToPrimitive, BigDecimal, One}; +use chrono::{TimeDelta, Utc}; +use dydx::{ + indexer::{OrderExecution, Ticker, Token}, + node::*, +}; +use dydx_proto::dydxprotocol::{ + clob::{ + order::{self, ConditionType, Side, TimeInForce}, + Order, OrderBatch, OrderId, + }, + subaccounts::SubaccountId, +}; +use rand::{thread_rng, Rng}; +use serial_test::serial; +use std::str::FromStr; +use tokio::time::{sleep, Duration}; + +const ETH_USD_PAIR_ID: u32 = 1; // information on market id can be fetch from indexer API + +#[tokio::test] +async fn test_node_order_generator() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let market = env.get_market().await?; + let height = env.get_height().await?; + let account = env.account; + + // Test values + let price = BigDecimal::from_str("4000.0")?; + let subticks = 4_000_000_000_u64; + let quantity = BigDecimal::from_str("0.1")?; + let quantums = 100_000_000_u64; + let client_id = 123456; + + let until_height = height.ahead(SHORT_TERM_ORDER_MAXIMUM_LIFETIME); + let now = Utc::now(); + let until_time = now + TimeDelta::seconds(60); + + let oracle_price = market + .oracle_price + .clone() + .expect("Market oracle price required for testing"); + let allowed_slippage = BigDecimal::from_str("1.5")?; // % + let one = ::one(); + let slippaged_price = oracle_price * (one - allowed_slippage.clone() / BigDecimal::from(100)); + let slippaged_subticks = market + .order_params() + .quantize_price(slippaged_price) + .to_u64() + .ok_or_else(|| err!("Failed converting slippage subticks to u64"))?; + + let generator = OrderBuilder::new(market, account.subaccount(0)?); + + // Short-term market order + let order_ms = generator + .clone() + .market(OrderSide::Sell, quantity.clone()) + .allowed_slippage(allowed_slippage.clone()) + .until(until_height.clone()) + .build(client_id)?; + + let order_ms_r = Order { + order_id: Some(OrderId { + subaccount_id: Some(SubaccountId { + owner: account.address().to_string(), + number: 0, + }), + client_id, + order_flags: 0_u32, + clob_pair_id: 1_u32, + }), + side: Side::Sell.into(), + quantums, + subticks: slippaged_subticks, + time_in_force: TimeInForce::Ioc.into(), + reduce_only: false, + client_metadata: DEFAULT_RUST_CLIENT_METADATA, + condition_type: ConditionType::Unspecified.into(), + conditional_order_trigger_subticks: 0u64, + good_til_oneof: Some(order::GoodTilOneof::GoodTilBlock(until_height.0)), + }; + + // Conditional stop market order + let order_mc = generator + .clone() + .stop_market(OrderSide::Sell, price.clone(), quantity.clone()) + .until(until_time) + // Optional, defaults to 5% + .allowed_slippage(allowed_slippage) + .execution(OrderExecution::Ioc) + .build(client_id)?; + + let order_mc_r = Order { + order_id: Some(OrderId { + subaccount_id: Some(SubaccountId { + owner: account.address().to_string(), + number: 0, + }), + client_id, + order_flags: 32_u32, + clob_pair_id: 1_u32, + }), + side: Side::Sell.into(), + quantums, + subticks: slippaged_subticks, + time_in_force: TimeInForce::Ioc.into(), + reduce_only: false, + client_metadata: DEFAULT_RUST_CLIENT_METADATA, + condition_type: ConditionType::StopLoss.into(), + conditional_order_trigger_subticks: subticks, + good_til_oneof: Some(order::GoodTilOneof::GoodTilBlockTime( + until_time.timestamp().try_into().unwrap(), + )), + }; + + // Long-term limit order + let order_ll = generator + .clone() + .limit(OrderSide::Buy, price, quantity) + .long_term() + .until(until_time) + .build(client_id)?; + + let order_ll_r = Order { + order_id: Some(OrderId { + subaccount_id: Some(SubaccountId { + owner: account.address().to_string(), + number: 0, + }), + client_id, + order_flags: 64_u32, + clob_pair_id: 1_u32, + }), + side: Side::Buy.into(), + quantums, + subticks, + time_in_force: TimeInForce::Unspecified.into(), + reduce_only: false, + client_metadata: DEFAULT_RUST_CLIENT_METADATA, + condition_type: ConditionType::Unspecified.into(), + conditional_order_trigger_subticks: 0u64, + good_til_oneof: Some(order::GoodTilOneof::GoodTilBlockTime( + until_time.timestamp().try_into().unwrap(), + )), + }; + + assert_eq!(order_ms.1, order_ms_r); + assert_eq!(order_mc.1, order_mc_r); + assert_eq!(order_ll.1, order_ll_r); + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_place_order() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let market = env.get_market().await?; + let mut node = env.node; + let mut account = env.account; + let subaccount = account.subaccount(0)?; + + let (_id, order) = OrderBuilder::new(market, subaccount) + .limit(OrderSide::Buy, 1, 1) + .long_term() + .until(Utc::now() + TimeDelta::seconds(60)) + .build(thread_rng().gen_range(0..100_000_000))?; + + let tx_res = node.place_order(&mut account, order).await; + + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_place_order_market_short_term() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let market = env.get_market().await?; + let height = env.get_height().await?; + let mut node = env.node; + let mut account = env.account; + + let (_id, order) = OrderBuilder::new(market, account.subaccount(0)?) + .market(OrderSide::Buy, BigDecimal::from_str("0.001")?) + .price(10) // Low slippage price to not execute + .until(height.ahead(10)) + .build(thread_rng().gen_range(0..100_000_000))?; + + node.place_order(&mut account, order).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +#[ignore] +async fn test_node_cancel_order() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let market = env.get_market().await?; + let mut node = env.node; + let mut account = env.account; + let subaccount = account.subaccount(0)?; + + let (id, order) = OrderBuilder::new(market, subaccount) + .limit(OrderSide::Buy, 1, 1) + .until(Utc::now() + TimeDelta::seconds(60)) + .long_term() + .build(thread_rng().gen_range(0..100_000_000))?; + let order_tx_hash = node.place_order(&mut account, order).await?; + node.query_transaction(&order_tx_hash).await?; + + sleep(Duration::from_secs(2)).await; + + // Following requests will fail if account does not have funds + let until = OrderGoodUntil::Time(Utc::now() + TimeDelta::seconds(60)); + let tx_res = node.cancel_order(&mut account, id, until).await; + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_deposit() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let sender = account.address().clone(); + let recipient = account.subaccount(0)?; + + let tx_res = node.deposit(&mut account, sender, recipient, 1).await; + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_withdraw() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let sender = account.subaccount(0)?; + let recipient = account.address().clone(); + + let tx_res = node.withdraw(&mut account, sender, recipient, 1).await; + + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_transfer() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let sender = account.subaccount(0)?; + let recipient = account.subaccount(1)?; + + let tx_res = node.transfer(&mut account, sender, recipient, 1).await; + + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_send_token() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let sender = account.address().clone(); + let recipient = account.address().clone(); + + let tx_res = node + .send_token(&mut account, sender, recipient, Token::DydxTnt(1000.into())) + .await; + + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +#[ignore] +async fn test_node_batch_cancel_orders() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + + let order_id0 = env.spawn_order().await?; + sleep(Duration::from_secs(2)).await; + let order_id1 = env.spawn_order().await?; + sleep(Duration::from_secs(2)).await; + + let mut node = env.node; + let mut account = env.account; + + let subaccount = account.subaccount(0)?; + + let batch = OrderBatch { + clob_pair_id: ETH_USD_PAIR_ID, + client_ids: vec![order_id0.client_id, order_id1.client_id], + }; + let cancels = vec![batch]; + let good_til = node + .get_latest_block_height() + .await? + .ahead(SHORT_TERM_ORDER_MAXIMUM_LIFETIME); + + let tx_res = node + .batch_cancel_orders(&mut account, subaccount, cancels, good_til) + .await; + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_close_position() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let subaccount = account.subaccount(0)?; + let market = env + .indexer + .markets() + .get_perpetual_market(&env.ticker) + .await?; + + node.close_position( + &mut account, + subaccount, + market, + None, + thread_rng().gen_range(0..100_000_000), + ) + .await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_create_market_permissionless() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let subaccount = account.subaccount(0)?; + // Avoid creating a new market and just try to create one that already exists + let ticker = Ticker::from("ETH-USD"); + + let tx_res = node + .create_market_permissionless(&mut account, &ticker, &subaccount) + .await; + + match node.query_transaction_result(tx_res).await { + Err(e) if e.to_string().contains("Market params pair already exists") => Ok(()), + Err(e) => Err(e), + Ok(_) => Err(err!("Market creation (ETH-USD) should fail")), + } +} diff --git a/v4-client-rs/client/tests/test_node_megavault.rs b/v4-client-rs/client/tests/test_node_megavault.rs new file mode 100644 index 00000000..5ef8fd71 --- /dev/null +++ b/v4-client-rs/client/tests/test_node_megavault.rs @@ -0,0 +1,60 @@ +mod env; +use env::TestEnv; + +use anyhow::Error; +use serial_test::serial; + +#[tokio::test] +#[serial] +async fn test_node_megavault_deposit() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let subaccount = account.subaccount(0)?; + + let tx_res = node.megavault().deposit(&mut account, subaccount, 1).await; + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_megavault_withdraw() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let mut account = env.account; + + let subaccount = account.subaccount(0)?; + + let tx_res = node + .megavault() + .withdraw(&mut account, subaccount, 0, Some(&1.into())) + .await; + + node.query_transaction_result(tx_res).await?; + + Ok(()) +} + +#[tokio::test] +async fn test_node_megavault_get_owner_shares() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let account = env.account; + + node.megavault().get_owner_shares(account.address()).await?; + + Ok(()) +} + +#[tokio::test] +async fn test_node_megavault_get_withdrawal_info() -> Result<(), Error> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + + node.megavault().get_withdrawal_info(&1.into()).await?; + + Ok(()) +} diff --git a/v4-client-rs/client/tests/test_node_methods.rs b/v4-client-rs/client/tests/test_node_methods.rs new file mode 100644 index 00000000..fac7777f --- /dev/null +++ b/v4-client-rs/client/tests/test_node_methods.rs @@ -0,0 +1,228 @@ +mod env; +use env::TestEnv; + +use anyhow::Result; +use dydx::indexer::Denom; + +#[tokio::test] +async fn test_node_get_account_balances() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + + let balances = node.get_account_balances(address).await?; + assert!(!balances.is_empty()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_account_balance() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + let denom = Denom::Usdc; + + let balance = node.get_account_balance(address, &denom).await?; + assert_eq!(balance.denom, denom.as_ref()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_account() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + + let response = node.get_account(address).await?; + assert_eq!(response.address, env.account.address().as_ref()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_node_info() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let info = node.get_node_info().await?; + assert!(info.default_node_info.is_some() || info.application_version.is_some()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_latest_block() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let height = node.get_latest_block_height().await?.0; + assert!(height > 18_476_624); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_user_stats() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + + let _stats = node.get_user_stats(address).await?; + Ok(()) +} + +#[tokio::test] +async fn test_node_get_all_validators() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let validators = node.get_all_validators(None).await?; + assert!(validators.len() > 2); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_subaccounts() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let subaccounts = node.get_subaccounts().await?; + assert!(!subaccounts.is_empty()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_subaccount() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let subaccount = env.account.subaccount(0)?; + + let subaccount_info = node.get_subaccount(&subaccount).await?; + assert!(subaccount_info.asset_positions.len() + subaccount_info.perpetual_positions.len() > 0); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_clob_pair() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + let pair_id = 0; + + let pair = node.get_clob_pair(pair_id).await?; + assert!(pair.id == pair_id); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_clob_pairs() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let pairs = node.get_clob_pairs(None).await?; + assert!(!pairs.is_empty()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_price() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + let market_id = 0; + + let market_price = node.get_price(market_id).await?; + assert!(market_price.id == market_id); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_prices() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let prices = node.get_prices(None).await?; + assert!(!prices.is_empty()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_perpetual() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + let perpetual_id = 0; + + let perpetual = node.get_perpetual(perpetual_id).await?; + let params = perpetual.params.unwrap(); + assert!(params.id == perpetual_id); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_perpetuals() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let perpetuals = node.get_perpetuals(None).await?; + assert!(!perpetuals.is_empty()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_equity_tier_limit_config() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let config = node.get_equity_tier_limit_config().await?; + assert!( + config.stateful_order_equity_tiers.len() + config.short_term_order_equity_tiers.len() > 0 + ); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_delegator_delegations() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + + let _response = node + .get_delegator_delegations(address.clone(), None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_node_get_delegator_unbonding_delegations() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + + let _delegations = node + .get_delegator_unbonding_delegations(address.clone(), None) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_node_get_delayed_complete_bridge_messages() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + + let _messages = node + .get_delayed_complete_bridge_messages(address.clone()) + .await?; + Ok(()) +} + +#[tokio::test] +async fn test_node_get_fee_tiers() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let fee_tiers = node.get_fee_tiers().await?; + assert!(!fee_tiers.is_empty()); + Ok(()) +} + +#[tokio::test] +async fn test_node_get_user_fee_tier() -> Result<()> { + let env = TestEnv::testnet().await?; + let mut node = env.node; + let address = env.account.address(); + + let _tier = node.get_user_fee_tier(address.clone()).await?; + Ok(()) +} + +#[tokio::test] +async fn test_node_get_rewards_params() -> Result<()> { + let mut node = TestEnv::testnet().await?.node; + + let _params = node.get_rewards_params().await?; + Ok(()) +} diff --git a/v4-client-rs/client/tests/test_node_sequencer.rs b/v4-client-rs/client/tests/test_node_sequencer.rs new file mode 100644 index 00000000..cc7acb1c --- /dev/null +++ b/v4-client-rs/client/tests/test_node_sequencer.rs @@ -0,0 +1,66 @@ +mod env; +use env::TestEnv; + +use anyhow::Error; +use dydx::node::sequencer::*; +use serial_test::serial; + +#[tokio::test] +#[serial] +async fn test_node_sequencer_query() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + + let seqnum_before = env.account.sequence_number(); + + // account.sequence_number() holds the correct and next sequence number to be used. + // We spawn two orders because wallet.account() produces an account with an already + // correct and updated sequence number. + // In the first order this value should not change, changing only then in the second order. + env.spawn_order().await?; + env.spawn_order().await?; + + let seqnum_after = env.account.sequence_number(); + + assert_eq!(seqnum_after, seqnum_before + 1); + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_sequencer_incremental() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + let address = env.account.address().clone(); + let sequencer = IncrementalSequencer::new(&[(address, env.account.sequence_number())]); + env.node.with_sequencer(sequencer); + + let seqnum_before = env.account.sequence_number(); + + env.spawn_order().await?; + env.spawn_order().await?; + + let seqnum_after = env.account.sequence_number(); + + assert_eq!(seqnum_after, seqnum_before + 1); + + Ok(()) +} + +#[tokio::test] +#[serial] +async fn test_node_sequencer_timestamp() -> Result<(), Error> { + let mut env = TestEnv::testnet().await?; + env.node.with_sequencer(TimestamperSequencer); + + let seqnum_before = env.account.sequence_number(); + + env.spawn_order().await?; + env.spawn_order().await?; + env.spawn_order().await?; + + let seqnum_after = env.account.sequence_number(); + + assert!(seqnum_after == seqnum_before); + + Ok(()) +} diff --git a/v4-client-rs/client/tests/testnet.toml b/v4-client-rs/client/tests/testnet.toml new file mode 100644 index 00000000..f99783af --- /dev/null +++ b/v4-client-rs/client/tests/testnet.toml @@ -0,0 +1,17 @@ +[node] +# You can select other gRPC endpoints from [the list](https://docs.dydx.exchange/infrastructure_providers-network/resources#full-node-endpoints). +endpoint = "https://test-dydx-grpc.kingnodes.com" +chain_id = "dydx-testnet-4" +fee_denom = "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5" + +[indexer] +http.endpoint = "https://indexer.v4testnet.dydx.exchange" +ws.endpoint = "wss://indexer.v4testnet.dydx.exchange/v4/ws" + +[faucet] # optional +endpoint = "https://faucet.v4testnet.dydx.exchange" + +[noble] # optional +endpoint = "http://noble-testnet-grpc.polkachu.com:21590" +chain_id = "grand-1" +fee_denom = "uusdc" diff --git a/v4-client-rs/deny.toml b/v4-client-rs/deny.toml new file mode 100644 index 00000000..a078c802 --- /dev/null +++ b/v4-client-rs/deny.toml @@ -0,0 +1,64 @@ +[graph] +targets = [ + { triple = "x86_64-unknown-linux-gnu" }, + { triple = "aarch64-unknown-linux-gnu" }, + { triple = "x86_64-unknown-linux-musl" }, + { triple = "aarch64-apple-darwin" }, + { triple = "x86_64-apple-darwin" }, + { triple = "x86_64-pc-windows-msvc" }, +] +all-features = false +no-default-features = false + +[output] +feature-depth = 1 + +[advisories] +db-path = "~/.cargo/advisory-db" +db-urls = ["https://github.com/rustsec/advisory-db"] + +[licenses] +allow = [ + "MIT", + "Apache-2.0", + "BSD-3-Clause", + "ISC", + "Unicode-DFS-2016", + "Unicode-3.0", + "OpenSSL", + "LicenseRef-dYdX-Custom", +] +confidence-threshold = 0.8 + +[[licenses.clarify]] +crate = "dydx-proto" +expression = "LicenseRef-dYdX-Custom" +license-files = [ + { path = "LICENSE", hash = 0x30bcd1e3 }, +] + +[[licenses.clarify]] +name = "ring" +expression = "MIT AND ISC AND OpenSSL" +license-files = [ + { path = "LICENSE", hash = 0xbd0eed23 } +] + +[licenses.private] +ignore = false +registries = [] + +[bans] +multiple-versions = "warn" +wildcards = "allow" +highlight = "all" + +[sources] +unknown-registry = "warn" +unknown-git = "warn" +allow-registry = ["https://github.com/rust-lang/crates.io-index"] + +[sources.allow-org] +github = [] +gitlab = [] +bitbucket = []